Skip to main content

Solidity API

ERC1155Handler

EMPTY_BYTES

bytes EMPTY_BYTES

constructor

constructor(address bridgeAddress) public
NameTypeDescription
bridgeAddressaddressContract address of previously deployed Bridge.

deposit

function deposit(bytes32 resourceID, address depositer, bytes data) external payable returns (bytes)

A deposit is initiatied by making a deposit in the Bridge contract.

Requirements:

  • It must be called by only bridge.
NameTypeDescription
resourceIDbytes32ResourceID used to find address of token to be used for deposit.
depositeraddressAddress of account making the deposit in the Bridge contract.
databytesConsists of ABI-encoded arrays of tokenIDs and amounts.

executeProposal

function executeProposal(bytes32 resourceID, bytes data) external

Proposal execution should be initiated when a proposal is finalized in the Bridge contract. by a relayer on the deposit's destination chain.

Requirements:

  • It must be called by only bridge.
NameTypeDescription
resourceIDbytes32
databytesConsists of ABI-encoded {tokenIDs}, {amounts}, {recipient}, and {transferData} of types uint[], uint[], bytes, bytes.

withdraw

function withdraw(bytes data) external

Used to manually release ERC1155 tokens from ERC1155Safe.

Requirements:

  • It must be called by only bridge.
NameTypeDescription
databytesConsists of ABI-encoded {tokenAddress}, {recipient}, {tokenIDs}, {amounts}, and {transferData} of types address, address, uint[], uint[], bytes.