Assessment reports>OFTAdapter Burn>Threat Model>_credit

Function: _credit(address _to, uint256 _amountLD, uint32 /* _srcEid */)

This is an internal function that handles the token credit logic during cross-chain token receipt.

Inputs

  • _to

    • Control: Decoded from cross-chain--message data.

    • Constraints: N/A.

    • Impact: The address of the token receiver for tokens transferred across chain.

  • _amountLD

    • Control: Decoded from cross-chain--message data.

    • Constraints: N/A.

    • Impact: The amount of tokens to be minted to the receiver address.

Branches and code coverage

Intended branches

  • The expected amount of tokens are minted.

  • The innerToken balance of the contract is not changed.

  • The _to balance is increased by the _amountLD.

Function call analysis

  • IMintSelfBurnToken(address(innerToken)).mint(_to, _amountLD);

    • What is controllable? N/A.

    • If the return value is controllable, how is it used and how can it go wrong? There is no return value here.

    • What happens if it reverts, reenters or does other unusual control flow? Mints the specified amount of tokens to the _to account balance. The function reverts if _to is the zero address; however, in this implementation, _to is replaced with the 0xdead address in such cases, ensuring the zero address is never passed to the mint function.

Zellic © 2025Back to top ↑