-
Notifications
You must be signed in to change notification settings - Fork 59
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: Revert if trying to initialize new pool with forbidden or non-existing products #805
Fix: Revert if trying to initialize new pool with forbidden or non-existing products #805
Conversation
b1712b5
to
14fe339
Compare
@kyledewy converted back to draft until you add context, proposed changes, etc. |
878117d
to
cac6070
Compare
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.
Happy to argue over the obervations made but to me some changes are necessary
f1d2593
to
06b1c4d
Compare
06b1c4d
to
4026567
Compare
I made the changes suggested by @shark0der , along with the optimization I suggested above. The only thing that should be missing is the deprecated check in setProducts yet. Want to write some tests for it as well. |
f69fcdd
to
3ad8a67
Compare
…anize logic to be more clear
…r. Add requirePoolIsAllowed function.
6b3bf3e
to
82c66b7
Compare
Context
Fixes #803 - When adding initial staking products to a newly created staking pool, we should check for each product that it exists & is allowed for the pool
Changes proposed in this pull request
This PR checks that each product is allowed to be initialized for newly created staking pools in
Cover.sol
. The check is made for migrations and for new pool creations.Changes:
PoolNotAllowedForThisProduct(uint productId)
ifisPoolAllowed()
returns falseTest plan
I added a unit and integration test in
createStakingPool.js
and a fork test attest/fork/staked-product-authorization.js
Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: