Open code423n4 opened 2 years ago
https://github.com/code-423n4/2022-06-nibbl-findings/issues/2, https://github.com/code-423n4/2022-06-nibbl-findings/issues/3, https://github.com/code-423n4/2022-06-nibbl-findings/issues/6, https://github.com/code-423n4/2022-06-nibbl-findings/issues/7, https://github.com/code-423n4/2022-06-nibbl-findings/issues/8, https://github.com/code-423n4/2022-06-nibbl-findings/issues/15
Good & relevant feedback. Low & NC suggestions.
1.Use a single modifier to check the same condition in mutliple functions
_isApprovedOrOwner()
can be checked using a single modifier inbasket.sol
NibblVault.sol
forrequire(msg.sender == bidder,"NibblVault: Only winner")
s2. Add descriptive revert string in "require()"
Some require statements dont have revert strings, using short descriptive message is good practice
3. Unbounded loops with external calls
Some external function take arrays from users and iterate thorugh them. If a user sends very large loop the transaction may be too big to fit in a single block. Checking for a resonable array size in such case is a best pracitce.
withdrawMultipleERC1155()
,withdrawMultipleERC20()
, etc..4. Address(0) checks while setting adderss in
initialize()
inNibblVault.sol
Check for zero address in the initialize function, so it doesn't gets set to 0 accidently.
5. Address(0) checks for withdraw methods for ERC20, ERC721 and ERC1155
The token withdraw methods for ERC20, ERC721 and ERC1155 take
_to
address to which these tokens are transferred, but this address may be accidently sent to zero address and the tokens may be lost forever.withdrawUnsettledBids
,redeem
,redeemCuratorFee
,updateCurator
,withdrawERC721
,withdrawMultipleERC721
,withdrawERC20
,withdrawMultipleERC20
,withdrawERC1155
,withdrawMultipleERC1155
This is very important for critical role changes such as
updateCurator()
6.
buy()
function is not making any external calls, so reentrancy guardlock
maynot be needed7. Unused
receive()
should revert8. floating pragma in
AccessControlMechanism.sol
pragma solidity ^0.8.0;