There is an inconsistency in the purchased present cost between the variable, documentation, and the burn
and mint
functions. This inconsistency can lead to confusion and potential errors when calculating the cost of purchasing presents or performing token operations.
The inconsistency in the purchased present cost can be observed in the following code snippet:
The PURCHASED_PRESENT_COST
constant is defined as 2e18
, indicating the cost of purchasing presents. However, both the mint
and burn
functions use 1e18
as the amount for minting and burning tokens. This inconsistency can lead to confusion and potential errors when calculating the cost of purchasing presents or performing token operations.
The inconsistency in the purchased present cost can have the following impacts:
Confusion in cost calculation: Developers or users relying on the documentation or variable definition may expect the cost of purchasing presents to be 2e18
. However, the actual token operations use 1e18
as the amount, leading to confusion and potential miscalculations.
The impact is Low because the same amount is present in mint()
and burn()
, so the number of present which can be booked by one user won’t change.
Manual review
To address the inconsistency in the purchased present cost, it is recommended to ensure consistency across all relevant components. This can be achieved by updating the mint
and burn
functions to use the PURCHASED_PRESENT_COST
constant as the amount for minting and burning tokens. Additionally, the documentation and variable definition should be updated to reflect the correct value of 2e18
as the cost of purchasing presents.
By ensuring consistency in the purchased present cost, it will help avoid confusion and potential errors when calculating the cost of purchasing presents or performing token operations.
This line indicates that the intended cost of presents for naughty people should be 2e18: https://github.com/Cyfrin/2023-11-Santas-List/blob/6627a6387adab89ae2ba2e82b38296723261c08a/src/SantasList.sol#L87 PURCHASE_PRESENT_COST should be implemented to enforce the cost of presents.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.