🎨DuelToken Functions
This section details every public and external function, including parameters, requirements, logic, and effects. Internal functions are mentioned where relevant for clarity.
constructor()
Visibility: Public (called on deployment).
Parameters: None.
Description: Initializes the ERC20 token with name "DuelToken" and symbol "DUEL". Sets ownership to
msg.sender
.Requirements: None.
Effects: Standard ERC20 setup.
mint(address to, uint256 amount)
Visibility: External.
Modifiers: onlyOwner.
Parameters:
to
: Address to receive tokens.amount
: uint256 amount to mint.
Description: Mints new $DUEL tokens to the specified address. Used for supply management by the owner.
Requirements: Caller must be owner.
Effects: Increases total supply and balance of
to
. Calls internal_mint
.
burn(uint256 amount)
Visibility: External.
Parameters:
amount
: uint256 amount to burn.
Description: Burns $DUEL tokens from the caller's balance. Reduces supply and can be called by any holder.
Requirements: Caller must have sufficient balance.
Effects: Decreases total supply and caller's balance. Calls internal
_burn
.
Last updated