ODCdataManagersomnichainERC1155extensions

OmnichainERC1155Transfers

Abstract contract that provides Omnichain ERC1155 transfer functions of the Omnichain ERC1155 Data Manager

Based on OpenZeppelin ERC1155 implementation

safeTransferFrom

function safeTransferFrom(address from, OmnichainAddress to, uint256 id, uint256 value, bytes data) public payable virtual

Transfers value amount of an id from from to to in another chain

The caller must have allowance for from's tokens of at least value or be from Caller may receive native coin refund, so if it's a contract it MUST have receive() or payable fallback()

Parameters

NameTypeDescription
fromaddressSource address
toOmnichainAddressDestination omnichain address
iduint256Token ID
valueuint256Amount of tokens to transfer
databytesAdditional data with no specified format

safeTransferFrom

function safeTransferFrom(address from, OmnichainAddress to, uint256 id, uint256 value, bytes data, address payable refundAddress) public payable virtual

Transfers value amount of an id from from to to in another chain

The caller must have allowance for from's tokens of at least value or be from

Parameters

NameTypeDescription
fromaddressSource address
toOmnichainAddressDestination omnichain address
iduint256Token ID
valueuint256Amount of tokens to transfer
databytesAdditional data with no specified format
refundAddressaddress payableAddress to send native coin refund to

safeBatchTransferFrom

function safeBatchTransferFrom(address from, OmnichainAddress to, uint256[] ids, uint256[] values, bytes data) public payable virtual

Transfers values amount of multiple ids from from to to in another chain

The caller must have allowance for from's tokens of at least value for each id or be from Caller may receive native coin refund, so if it's a contract it MUST have receive() or payable fallback()

Parameters

NameTypeDescription
fromaddressSource address
toOmnichainAddressDestination omnichain address
idsuint256[]Array of token IDs
valuesuint256[]Array of amounts of tokens to transfer
databytesAdditional data with no specified format

safeBatchTransferFrom

function safeBatchTransferFrom(address from, OmnichainAddress to, uint256[] ids, uint256[] values, bytes data, address payable refundAddress) public payable virtual

Transfers values amount of multiple ids from from to to in another chain

The caller must have allowance for from's tokens of at least value for each id or be from

Parameters

NameTypeDescription
fromaddressSource address
toOmnichainAddressDestination omnichain address
idsuint256[]Array of token IDs
valuesuint256[]Array of amounts of tokens to transfer
databytesAdditional data with no specified format
refundAddressaddress payableAddress to send native coin refund to

_writeTransfer

function _writeTransfer(address from, OmnichainAddress to, uint256 id, uint256 value, address payable refundAddress) internal virtual

_writeTransferBatch

function _writeTransferBatch(address from, OmnichainAddress to, uint256[] ids, uint256[] values, address payable refundAddress) internal virtual

_safeBatchTransferFrom

function _safeBatchTransferFrom(address from, OmnichainAddress to, uint256[] ids, uint256[] values, bytes, address payable refundAddress) internal

_safeTransferFrom

function _safeTransferFrom(address from, OmnichainAddress to, uint256 id, uint256 value, bytes, address payable refundAddress) internal

_update

function _update(address from, OmnichainAddress to, uint256 id, uint256 value, address payable refundAddress) internal virtual

_update

function _update(address from, OmnichainAddress to, uint256[] ids, uint256[] values, address payable refundAddress) internal virtual

On this page