The requirement allows for different tokens with varying initial supplies, but the fixed initial supply vulnerability in L1Token.sol
deploys tokens with a constant INITIAL_SUPPLY
of 1,000,000, regardless of specified values in for new token. The fixed initial supply vulnerability may lead to discrepancies between the specified initial supply in the contract bytecode and the actual minted supply, potentially affecting token functionality and intended use cases
The fixed initial supply vulnerability results in token contracts being deployed with a constant INITIAL_SUPPLY
, potentially deviating from the specified initial supply in contract bytecode
The fixed initial supply vulnerability includes discrepancies between specified and actual token supplies, potentially affecting asset tokenization, governance, and other use cases requiring precise supply control
Foundry and manual review
Add dynamic configuration for INITIAL_SUPPLY
In this modified contract:
The INITIAL_SUPPLY constant is removed, and a private _initialSupply
variable is introduced to store the initial supply.
The constructor
now accepts parameters for the token name, symbol, and initial supply.
The require statement ensures that the initial supply is greater than 0.
The _initialSupply
value is used to mint the initial tokens in the constructor.
A getInitialSupply
function is included to retrieve the initial supply if needed.
This modification allows for dynamic supply configuration when deploying the L1Token
contract, and the initial supply can be specified during contract deployment.
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.