QA Report #185
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
Define the magic numbers as constant.
a. (10**18)
b. require(minNonce < userMinOrderNonce[msg.sender] + 1000000, 'too many');
c. uint256 protocolFee = (protocolFeeBps * execPrice) / 10000;
d. uint256 protocolFee = (protocolFeeBps * execPrice) / 10000;
e. uint256 protocolFee = (protocolFeeBps * execPrice) / 10000;
f. uint256 protocolFee = (protocolFeeBps * execPrice) / 10000;
g. uint256 protocolFee = (PROTOCOL_FEE_BPS * amount) / 10000;
The constraints uint256 array inside the MakerOrder structure contains 6 parameters. I would use a struct here instead of a uint array for readability. Several places in the code, the access of important variables happen with an index instead of a human-friendly word.
uint256[] constraints;
Similarly address[] execParams;
could be spilt into two address type variables named in a reader-friendly way.
https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L375
The text was updated successfully, but these errors were encountered: