Platform: Code4rena
Start Date: 06/12/2022
Pot Size: $36,500 USDC
Total HM: 16
Participants: 119
Period: 3 days
Judge: berndartmueller
Total Solo HM: 2
Id: 189
League: ETH
Rank: 53/119
Findings: 1
Award: $57.63
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ladboy233
Also found by: 0x1f8b, Matin, UniversalCrypto, gzeon, karanctf, minhquanym, obront, rvierdiiev, seyni, slvDev, yixxas
57.6274 USDC - $57.63
https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L58-L59 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/FixedPrice.sol#L57-L74 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/OpenEdition.sol#L57-L72
The variable _amount
is uint256
but the variable amount
is uint24
so the variable amount
the full value may not be stored.
These calculations and operations may produce incorrect results if the amount
variable has a different value than what was intended.
This could still cause the contract to behave unexpectedly and potentially lead to financial losses for users of the contract or incorrect balances being stored.
This possibility exists because the amount variable is defined as an uint48
type, which has a narrower range of possible values than the _amount
parameter's uint256
type.
If the value assigned to the amount
variable is greater than the maximum value that can be stored in an uint48
type, the value will be truncated. This truncation may result in the amount variable having a different value than intended.
Manual Audit
if (_amount <= uint48.max()) { uint48 amount = uint48(_amount); ... } else { // Handle _amount being too large }
#0 - c4-judge
2022-12-10T17:07:39Z
berndartmueller marked the issue as duplicate of #369
#1 - c4-judge
2023-01-03T13:49:21Z
berndartmueller marked the issue as satisfactory