You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
sherlock-admin opened this issue
Dec 1, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
The first founder's share will be lost by 1% when reservedUntilTokenId>=100
Summary
The first founder's share will be lost by 1% when reservedUntilTokenId>=100.
Vulnerability Detail
When calculating the baseTokenId corresponding to the founder's share, since initially baseTokenId = reservedUntilTokenId and tokenRecipient[reservedUntilTokenId].wallet != address(0), the baseTokenId corresponding to the first 1% share of the first founder will be reservedUntilTokenId . Hence, when reservedUntilTokenId>=100, this 1% share will be lost. Subsequent shares will not be affected because the range of baseTokenId will correctly fall between 0-99.
uint256 baseTokenId = reservedUntilTokenId;
// For each token to vest:for (uint256 j; j < founderPct; ++j) {
// Get the available token id
baseTokenId =_getNextTokenId(baseTokenId);
// Store the founder as the recipient
tokenRecipient[baseTokenId] = newFounder;
emitMintScheduled(baseTokenId, founderId, newFounder);
// Update the base token id
baseTokenId = (baseTokenId + schedule) %100;
}
uint256 baseTokenId = reservedUntilTokenId %100; // <------ modify// For each token to vest:for (uint256 j; j < founderPct; ++j) {
// Get the available token id
baseTokenId =_getNextTokenId(baseTokenId);
// Store the founder as the recipient
tokenRecipient[baseTokenId] = newFounder;
emitMintScheduled(baseTokenId, founderId, newFounder);
// Update the base token id
baseTokenId = (baseTokenId + schedule) %100;
}
sherlock-admin2
changed the title
Narrow Magenta Kestrel - The first founder's share will be lost by 1% when reservedUntilTokenId>=100
zraxx - The first founder's share will be lost by 1% when reservedUntilTokenId>=100
Dec 13, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
zraxx
medium
The first founder's share will be lost by 1% when reservedUntilTokenId>=100
Summary
The first founder's share will be lost by 1% when reservedUntilTokenId>=100.
Vulnerability Detail
When calculating the baseTokenId corresponding to the founder's share, since initially
baseTokenId = reservedUntilTokenId
andtokenRecipient[reservedUntilTokenId].wallet != address(0)
, the baseTokenId corresponding to the first 1% share of the first founder will bereservedUntilTokenId
. Hence, when reservedUntilTokenId>=100, this 1% share will be lost. Subsequent shares will not be affected because the range of baseTokenId will correctly fall between 0-99.Impact
Founder loses 1% share
Code Snippet
https://github.com/sherlock-audit/2023-09-nounsbuilder/blob/main/nouns-protocol/src/token/Token.sol#L161
https://github.com/sherlock-audit/2023-09-nounsbuilder/blob/main/nouns-protocol/src/token/Token.sol#L186
Tool used
Manual Review
Recommendation
Patch method 1:
modify function _addFounders
Patch method 2:
modify function _getNextTokenId
Duplicate of #42
The text was updated successfully, but these errors were encountered: