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

Open
code423n4 opened this issue Sep 15, 2022 · 1 comment
Open

QA Report #584

code423n4 opened this issue Sep 15, 2022 · 1 comment
Labels
bug Something isn't working old-submission-method QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

code423n4 commented Sep 15, 2022

Summary

We list 1 low-critical finding:

  • (Low) It’s better to define uint8 founderPct

(Low) It’s better to define uint8 founderPct

Impact

founderPct is defined as uint256, but it’s used for both uint8 and uint256.

Proof of Concept

founderPct is uint256 but is used by uin8:
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L82
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L88

                uint256 founderPct = _founders[i].ownershipPct;
                if ((totalOwnership += uint8(founderPct)) > 100) revert INVALID_FOUNDER_OWNERSHIP();

But L102 uint256 again:
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L102

                uint256 schedule = 100 / founderPct;

Recommended Mitigation Steps

Define uint8 rather than uint256 in L82.

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

(Low) It’s better to define uint8 founderPct

R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working old-submission-method 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

2 participants