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 #49

Closed
code423n4 opened this issue Feb 12, 2022 · 2 comments
Closed

QA Report #49

code423n4 opened this issue Feb 12, 2022 · 2 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Long revert string

https://github.com/code-423n4/2022-02-nested/blob/fe6f9ef7783c3c84798c8ab5fc58085a55cebcfc/contracts/NestedFactory.sol#L444

            require(amounts[1] <= _amountToSpend, "NestedFactory::_safeSubmitOrder: Overspent");

https://github.com/code-423n4/2022-02-nested/blob/fe6f9ef7783c3c84798c8ab5fc58085a55cebcfc/contracts/operators/ZeroEx/ZeroExOperator.sol#L36

        require(amountBought != 0, "ZeroExOperator::performSwap: amountBought cant be zero");
        require(amountSold != 0, "ZeroExOperator::performSwap: amountSold cant be zero");

Use uint256 instead of bool

Use uint(1) instead of bool(true) to save gas by avoiding masking ops
https://github.com/code-423n4/2022-02-nested/blob/fe6f9ef7783c3c84798c8ab5fc58085a55cebcfc/contracts/abstracts/OwnableFactoryHandler.sol#L17

    mapping(address => bool) public supportedFactories;

Use custom errors

Solidity ^0.8.4 allow the use of custom errors to optimize gas usage.
https://blog.soliditylang.org/2021/04/21/custom-errors/

@code423n4 code423n4 added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax bug Something isn't working labels Feb 12, 2022
code423n4 added a commit that referenced this issue Feb 12, 2022
@maximebrugel
Copy link
Collaborator

maximebrugel commented Feb 15, 2022

"Long revert string" (Confirmed)

Will be fixed by #70 for ZeroExOperator

"Use uint256 instead of bool" (Acknowledged)

Better for readability.

"Use custom errors" (Disputed)

Is that an issue?

@maximebrugel maximebrugel added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Feb 15, 2022
@maximebrugel maximebrugel self-assigned this Feb 16, 2022
@harleythedogC4
Copy link
Collaborator

This is a gas report, and #48 is identical. I will close this one.

@harleythedogC4 harleythedogC4 added invalid This doesn't seem right and removed sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") labels Mar 1, 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 invalid This doesn't seem right 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