Closed code423n4 closed 2 years ago
https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/manager/IManager.sol#L48-L52 https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/token/types/TokenTypesV1.sol#L28-L32
Unnecessary complexity during updating the founder parameters. Refer the below function function _addFounders(IManager.FounderParams[] calldata _founders) internal https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/token/Token.sol#L71
function _addFounders(IManager.FounderParams[] calldata _founders) internal
TokenTypesV1.sol#L28-L31
struct Founder { address wallet; uint8 ownershipPct; uint32 vestExpiry; }
IManager.sol#L48-L52
struct FounderParams { address wallet; uint256 ownershipPct; uint256 vestExpiry; }
Founder : uint8 ownershipPct; uint32 vestExpiry; FounderParams : uint256 ownershipPct; uint256 vestExpiry;
uint8 ownershipPct; uint32 vestExpiry;
uint256 ownershipPct; uint256 vestExpiry;
The function _addFounders can be updated/simplified.
_addFounders
Manual code review
Use the same data type used as in the struct Founder for FounderParams also.
Founder
FounderParams
Valid finding, Med Severity is beyond exaggerated, downgrading to QA Refactoring
R
Lines of code
https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/manager/IManager.sol#L48-L52 https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/token/types/TokenTypesV1.sol#L28-L32
Vulnerability details
Impact
Unnecessary complexity during updating the founder parameters. Refer the below function
function _addFounders(IManager.FounderParams[] calldata _founders) internal
https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/token/Token.sol#L71Proof of Concept
TokenTypesV1.sol#L28-L31
struct Founder { address wallet; uint8 ownershipPct; uint32 vestExpiry; }
IManager.sol#L48-L52
Founder :
uint8 ownershipPct; uint32 vestExpiry;
FounderParams :uint256 ownershipPct; uint256 vestExpiry;
The function
_addFounders
can be updated/simplified.Tools Used
Manual code review
Recommended Mitigation Steps
Use the same data type used as in the struct
Founder
forFounderParams
also.