Function: swapToken(uint256 amount)

This function receives SWAPPABLE_TOKEN and mints this contract token to the caller.

Inputs

  • amount

    • Control: Fully controlled by the caller.

    • Impact: Amount of swap.

Branches and code coverage

Intended branches

  • Check if SWAPPABLE_TOKEN is not zero address.

  • Receive an amount of SWAPPABLE_TOKEN.

  • Mint an amount of the contract token to the caller.

Negative behavior

  • If SWAPPABLE_TOKEN is zero address, revert transaction with SwapToken__TokenDoesNotExist.

Zellic © 2025Back to top ↑