ODCinterfacesdataobject-interfacesomnichain

IOmnichainFungibleFractionsOperations

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

localMintBurnSupplyAll

function localMintBurnSupplyAll() external view returns (uint256)

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

Return Values

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

localMintBurnSupply

function localMintBurnSupply(uint256 id) external view returns (uint256)

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

Parameters

NameTypeDescription
iduint256Id of the token

Return Values

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

omnichainTransfer

function omnichainTransfer(address from, OmnichainAddress to, uint256 id, uint256 value, 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
iduint256The id of the token
valueuint256The amount of tokens to transfer
refundAddressaddress payableWhere to send refund, this address SHOULD be able to accept both native currency AND tokens which are being transferred on this call

omnichainBatchTransfer

function omnichainBatchTransfer(address from, OmnichainAddress to, uint256[] ids, uint256[] values, address payable refundAddress) external returns (bytes32)

Operation used to transfer a batch of 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
idsuint256[]The ids of the tokens
valuesuint256[]The amounts of tokens to transfer
refundAddressaddress payableWhere to send refund, this address SHOULD be able to accept both native currency AND tokens which are being transferred on this call

omnichainIncreaseBalance

function omnichainIncreaseBalance(bytes32 rid, address target, uint256 id, uint256 value) 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
iduint256The id of the token
valueuint256Amount of tokens to send

omnichainBatchIncreaseBalance

function omnichainBatchIncreaseBalance(bytes32 rid, address target, uint256[] ids, uint256[] values) external

Internal operation used to increase the balance of a target account with a batch of tokens

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
idsuint256[]The id of the token
valuesuint256[]Amount 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 NOTE: This function is capable of refund the tokens back to the sender if the transfer failed

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