-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: Locked down the sweep
function
#473
Conversation
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
Codesize issues are becoming very annoying, can't wait to fix it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issue with the changes themselves, good work, but could you add negative and positive scenario tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good just some comments/questions
* Locked down the `sweep` function * Added a check on `isSweepable` in `test_erc4626_sweep` * Appeased the linter * Turned optimizer down to avoid code size issues * Addressed review feedback from @jrhea
Fixes: #507.
Along with fixing the Spearbit issue, this PR addresses a medium Certora issue by locking down the targets of
sweep
inERC4626Hyperdrive
. Previously, thesweep
function could be called on any target that is not equal tobaseToken
orpool
. Some tokens are accessible through more than one address, which means that it was theoretically possible for all of the Hyperdrive funds to be swept into governance if such a token was used as the base or pool token. To solve this problem, this PR adds a mapping calledisSweepable
that keeps track of which addresses can be swept. This list can't be updated after initialization, so users can verify that the pool is safe from being swept.