DepositBoxERC1155

onERC1155Received onERC1155Received(address operator, address, uint256, uint256, bytes) → bytes4 external

onERC1155BatchReceived onERC1155BatchReceived(address operator, address, uint256[], uint256[], bytes) → bytes4 external

depositERC1155 depositERC1155(string schainName, address erc1155OnMainnet, uint256 id, uint256 amount) external

Allows msg.sender to send ERC1155 token from mainnet to schain.

Requirements:

  • Receiver contract should be defined.

  • msg.sender should approve their tokens for DepositBoxERC1155 address.

depositERC1155Batch depositERC1155Batch(string schainName, address erc1155OnMainnet, uint256[] ids, uint256[] amounts) external

Allows msg.sender to send batch of ERC1155 tokens from mainnet to schain.

Requirements:

  • Receiver contract should be defined.

  • msg.sender should approve their tokens for DepositBoxERC1155 address.

postMessage postMessage(bytes32 schainHash, address sender, bytes data) → address receiver external

Allows MessageProxyForMainnet contract to execute transferring ERC1155 token from schain to mainnet.

Requirements:

  • Schain from which the tokens came should not be killed.

  • Sender contract should be added to DepositBoxERC1155 and schain name cannot be Mainnet.

  • Amount of tokens on DepositBoxERC1155 should be equal or more than transferred amount.

gasPayer gasPayer(bytes32 schainHash, address sender, bytes data) → address external

addERC1155TokenByOwner addERC1155TokenByOwner(string schainName, address erc1155OnMainnet) external

Allows Schain owner to add an ERC1155 token to DepositBoxERC1155.

Emits an ERC1155TokenAdded event.

Requirements:

  • Schain should not be killed.

  • Only owner of the schain able to run function.

getFunds getFunds(string schainName, address erc1155OnMainnet, address receiver, uint256[] ids, uint256[] amounts) external

Allows Schain owner to return each user their tokens. The Schain owner decides which tokens to send to which address, since the contract on mainnet does not store information about which tokens belong to whom.

Requirements:

  • Amount of tokens on schain should be equal or more than transferred amount.

getSchainToERC1155 getSchainToERC1155(string schainName, address erc1155OnMainnet) → bool external

Should return true if token was added by Schain owner or added automatically after sending to schain if whitelist was turned off.

initialize initialize(contract IContractManager contractManagerOfSkaleManagerValue, contract Linker linkerValue, contract MessageProxyForMainnet messageProxyValue) public

Creates a new DepositBoxERC1155 contract.

supportsInterface supportsInterface(bytes4 interfaceId) → bool public

Checks whether contract supports such interface (first 4 bytes of method name and its params).

ERC1155TokenAdded ERC1155TokenAdded(string schainName, address contractOnMainnet) event

Emitted when token is mapped in DepositBoxERC20.

ERC1155TokenReady ERC1155TokenReady(address contractOnMainnet, uint256[] ids, uint256[] amounts) event

Emitted when token is received by DepositBox and is ready to be cloned or transferred on SKALE chain.