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 the burnToken must not be zero. The burnToken contract must support the burnByBurnerOnly functionality.

    • Impact: The burnByBurnerOnly function of the burnToken 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 supported

  • The burnAmount exceeds the burnLimitsPerMessage

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.

Zellic © 2025Back to top ↑