Assessment reports>warpdotgreen-cli>Threat Model>bridgeToChia

Function: bridgeToChia(address _assetContract, byte[32] _receiver, uint256 _mojoAmount)

This function is used to bridge ERC-20 tokens to Chia via the warp.green protocol. This function transfers tokens to this contract, redirects the portal tip, and sends a message for tokens to be minted on Chia.

Inputs

  • _assetContract

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Address of the ERC-20 token to bridge.

  • _receiver

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Receiver puzzle hash for the tokens.

  • _mojoAmount

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Amount to bridge to Chia, in Mojos.

Branches and code coverage

Intended branches

  • Invoke the _handleBridging function.

Negative behavior

  • Revert if msg.value is not equal to the value of the message toll.

Zellic © 2024Back to top ↑