Skip to content
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

QA Report #185

Open
code423n4 opened this issue Jun 19, 2022 · 0 comments
Open

QA Report #185

code423n4 opened this issue Jun 19, 2022 · 0 comments
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

Comments

@code423n4
Copy link
Contributor

  1. 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;

  2. 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.

  1. The new INFINITY_TREASURY is not zero-checked.
    https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/staking/InfinityStaker.sol#L375
@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Jun 19, 2022
code423n4 added a commit that referenced this issue Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants