Function: burn(address burnToken, uint256 burnAmount)
This function allows burning the provided burnAmount
of tokens. The amount to be burned per message is limited by the burnLimitsPerMessage
, which is controlled by the _tokenController
address.
Inputs
burnToken
Control: Full control.
Constraints: The
burnLimitsPerMessage
for theburnToken
must not be zero. TheburnToken
contract must support theburnByBurnerOnly
functionality.Impact: The
burnByBurnerOnly
function of theburnToken
contract is executed to burn the provided amount of tokens.
burnAmount
Control: Full control.
Constraints: The amount to be burned must not exceed the
burnLimitsPerMessage
for the burnToken.Impact: The amount of tokens to be burned.
Branches and code coverage
Intended branches
Tokens were burned successfully.
Negative behavior
The caller is not
localTokenMessenger
The
burnToken
is not supportedThe
burnAmount
exceeds theburnLimitsPerMessage
Function call analysis
_token.burnByBurnerOnly(burnAmount)
What is controllable?
burnAmount
If the return value is controllable, how is it used and how can it go wrong? n/a
What happens if it reverts, reenters or does other unusual control flow? This function burns the specified amount of tokens and will revert if the contract does not own enough tokens to burn.