-
Notifications
You must be signed in to change notification settings - Fork 5
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
[CodeArena] - [L-19/L-11] : Add missing reserve checks and inputs length check #49
Conversation
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.
This particular check will be present 6 times in this file.
Should we consider using a modifier with an internal function to extract the check?
I don't feel strongly about it, I'm fine with repeating it
contracts/NestedFactory.sol
Outdated
|
||
require( | ||
nestedRecords.getAssetReserve(_nftId) == address(reserve), | ||
"NestedFactory::addTokens: Assets in different reserve" |
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.
Rebase and name the reason NF: RESERVE_MISMATCH
contracts/NestedFactory.sol
Outdated
@@ -249,6 +252,10 @@ contract NestedFactory is INestedFactory, ReentrancyGuard, Ownable, MixinOperato | |||
require(assetTokensLength > _tokenIndex, "NestedFactory::withdraw: Invalid token index"); | |||
// Use destroy instead if NFT has a single holding | |||
require(assetTokensLength > 1, "NestedFactory::withdraw: Can't withdraw the last asset"); | |||
require( | |||
nestedRecords.getAssetReserve(_nftId) == address(reserve), | |||
"NestedFactory::withdraw: Assets in different reserve" |
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.
Rebase and name the reason NF: RESERVE_MISMATCH
d760aec
to
03a00e0
Compare
@adrien-supizet Fixed the require message + prettier |
Issues :