DepositBoxERC1155
Runs on mainnet, accepts messages from schain, stores deposits of ERC1155.
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)
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.
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.
-
msg.sender should be an owner of schain
-
IMA transfers Mainnet <→ schain should be killed
gasPayer gasPayer(bytes32 schainHash, address sender, bytes data) → address
external
Returns receiver of message.
Requirements:
-
Sender contract should be defined and schain name cannot be
Mainnet
.
onERC1155Received onERC1155Received(address operator, address, uint256, uint256, bytes) → bytes4
external
Returns selector of onERC1155Received.
onERC1155BatchReceived onERC1155BatchReceived(address operator, address, uint256[], uint256[], bytes) → bytes4
external
Returns selector of onERC1155BatchReceived.
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.
getSchainToAllERC1155Length getSchainToAllERC1155Length(string schainName) → uint256
external
Should return length of a set of all mapped tokens which were added by Schain owner or added automatically after sending to schain if whitelist was turned off.
getSchainToAllERC1155 getSchainToAllERC1155(string schainName, uint256 from, uint256 to) → address[] tokensInRange
external
Should return an array of tokens were added by Schain owner or added automatically after sending to schain if whitelist was turned off.
initialize initialize(contract IContractManager contractManagerOfSkaleManagerValue, contract ILinker linkerValue, contract IMessageProxyForMainnet 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.