ODCinterfacesdataobject-interfacesomnichain

IOmnichainNonFungibleTokenOperations

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

omnichainTransfer

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

Operation used to transfer a token to another chain

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

Parameters

NameTypeDescription
fromaddressaddress where to take token from (on current chain)
toOmnichainAddressaddress to send token to
tokenIduint256The id of the token
refundAddressaddress payableWhere to send refund

omnichainIncreaseBalance

function omnichainIncreaseBalance(bytes32 rid, OmnichainAddress from, OmnichainAddress to, uint256 tokenId) external

Operation used to increase the balance of a target account

Parameters

NameTypeDescription
ridbytes32Request ID (GUID)
fromOmnichainAddressOmnichain Address token transferred from (used to emit correct event)
toOmnichainAddressOmnichain Address to send token to
tokenIduint256Id of the token NOTE: 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

omnichainIncreaseBalanceCallback

function omnichainIncreaseBalanceCallback(bytes32 rid) external

Operation executed after the token was transferred to another chain

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

Parameters

NameTypeDescription
ridbytes32Request ID (GUID)

registerOmnichainIncreaseBalanceHandler

function registerOmnichainIncreaseBalanceHandler(address handler) external

Operation to register an omnichain increase balance handler

Parameters

NameTypeDescription
handleraddressAddress of the handler to register NOTE: The handler MUST implement the IOmnichainNonFungibleTokenIncreaseBalanceCallback interface

unregisterOmnichainIncreaseBalanceHandler

function unregisterOmnichainIncreaseBalanceHandler(address handler) external

Operation to unregister an omnichain increase balance handler

Parameters

NameTypeDescription
handleraddressAddress of the handler to unregister

On this page