ODCinterfacesdataobject-interfacesomnichain

IOmnichainFungibleTokenOperations

Provides the operations of the FungibleTokenDO to interact with fungible tokens and their associated data across multiple chains

localTotalSupply

function localTotalSupply() external view returns (uint256)

Operation used to get the total supply of the token on the current chain

Transfer tokens between chains will not change the local total supply

Return Values

NameTypeDescription
[0]uint256The total supply of the token on the current chain

localMintBurnSupply

function localMintBurnSupply() external view returns (uint256)

Operation used to get count of all minted and not burned tokens on current chain

Return Values

NameTypeDescription
[0]uint256Difference between tokens minted and burned on current chain

omnichainTransfer

function omnichainTransfer(address from, OmnichainAddress to, uint256 amount, address payable refundAddress) external returns (bytes32)

Operation used to transfer tokens to another chain

Native Coin payment for sending omnichain tx should be sent with the call

Parameters

NameTypeDescription
fromaddressAddress where to take tokens from (on current chain)
toOmnichainAddressAddress to send tokens to
amountuint256How much to send
refundAddressaddress payableWhere to send refund

omnichainIncreaseBalance

function omnichainIncreaseBalance(bytes32 rid, address target, uint256 amount) external

Internal operation used to increase the balance of a target account

This function SHOULD be called only by the other-chain DataObject to transfer tokens to someone on this chain which MUST decrease the balance of the user in the origin chain and increase the balance of the target account in the current chain

Parameters

NameTypeDescription
ridbytes32Request ID (GUID)
targetaddressAddress to send tokens to
amountuint256Amount of tokens to send

omnichainIncreaseBalanceCallback

function omnichainIncreaseBalanceCallback(bytes32 rid) external

Internal operation executed after the tokens were transferred to another chain

This function SHOULD be called only by the other-chain DataObject to confirm that the tokens were transferred

Parameters

NameTypeDescription
ridbytes32Request ID (GUID)

registerOmnichainIncreaseBalanceHandler

function registerOmnichainIncreaseBalanceHandler(address handler) external

Operation used to register a handler to be called after a token transfer on the target chain

Parameters

NameTypeDescription
handleraddressAddress of the handler to register

unregisterOmnichainIncreaseBalanceHandler

function unregisterOmnichainIncreaseBalanceHandler(address handler) external

Operation used to unregister a handler to be called after a token transfer on the target chain

Parameters

NameTypeDescription
handleraddressAddress of the handler to unregister

On this page