QA Report #670
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
[L-01] TOKEN CAN BE LOCKED IF SENDING TO A CONTRACT
Currently, as shown below,
token.transferFrom
is called to transfer the token to a receiver address. If the receiver is a contract that does not support the ERC721 protocol, the token can be locked and cannot be retrieved. To prevent this from happening, the ERC721safeTransferFrom
function could be used instead of thetransferFrom
function.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/auction/Auction.sol#L192
[L-02] TOKEN CAN BE LOCKED WHEN MINTING IT TO A CONTRACT
Currently, as shown below,
super._mint
is called to mint the token to a receiver address. If the receiver is a contract that does not support the ERC721 protocol, the token can be locked and cannot be retrieved. To mitigate this risk, the ERC721_safeMint
function could be used instead of the_mint
function. It looks like that the_safeMint
function is currently not found in the relevant contracts in the codebase; please consider adding one in theToken
contract for using it.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L167-L173
[L-03] CANCEL OR VETO FUNCTION CAN BE CALLED TO CANCEL OR VETO CANCELED, VETOED, AND EXPIRED PROPOSALS
The following
cancel
orveto
function can be called to cancel a proposal that is already canceled, vetoed, or expired, which can be meaningless. Emitting theProposalCanceled
andProposalVetoed
events for these proposals that are already canceled, vetoed, and expired can spam the frontend with meaningless information. When calling these functions, please consider requiring the proposal to be not canceled, vetoed, or expired.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L353-L377
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L385-L405
[L-04] CONTRACT CONSTRUCTORS ARE PAYABLE
The following
constructor
are payable. For someone who is not familar with the protocol, it is possible to send ETH to these contracts during constructions. The sent ETH will be locked in these contracts. To prevent this, please consider removingpayable
from theseconstructor
.[L-05]
_proposalThresholdBps
AND_quorumThresholdBps
CAN BE FURTHER CHECKEDThe sensible range of values for the following
settings.proposalThresholdBps
andsettings.quorumThresholdBps
would be> 0
and<= 10_000
. Please consider checking the values of_proposalThresholdBps
and_quorumThresholdBps
before using them to setsettings.proposalThresholdBps
andsettings.quorumThresholdBps
to prevent unintended behaviors.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L79-L80
[L-06] MISSING ZERO-ADDRESS CHECK FOR CRITICAL ADDRESSES
To prevent unintended behaviors, the critical address inputs should be checked against
address(0)
. Please consider checking theaddress
variables in the followingconstructor
.[N-01] CONSTANTS CAN BE USED INSTEAD OF MAGIC NUMBERS
To improve readability and maintainability, constants can be used instead of the magic numbers. Please consider replacing the magic numbers used in the following code with constants.
[N-02] INCOMPLETE NATSPEC COMMENTS
NatSpec comments provide rich code documentation. @param or @return comments are missing for the following functions. Please consider completing NatSpec comments for them.
The text was updated successfully, but these errors were encountered: