Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function ProtocolLib.updateDAO will never revert with MaxValueExceeded as intended #304

Open
barakman opened this issue Dec 30, 2024 · 0 comments

Comments

@barakman
Copy link

barakman commented Dec 30, 2024

This is mostly FYI, since the intended revert reason is effectively replaced with a non-intended revert reason.
In function ProtocolLib.updateDAO:

if ((sp.daoValidatorCount += deltaValidatorCount) > type(uint32).max) {
    revert ISSVNetworkCore.MaxValueExceeded();
}

Since both operands of the += operation are of type uint32, their sum being larger than type(uint32).max will lead this operation to revert on overflow.
Hence the condition in context will never be met, and the intended revert reason will never be emitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant