TokenManagerERC721
Runs on SKALE Chains, accepts messages from mainnet, and creates ERC721 clones. TokenManagerERC721 mints tokens. When a user exits a SKALE chain, it burns them.
-
transferToSchainERC721(targetSchainName, contractOnMainnet, tokenId)
-
addERC721TokenByOwner(targetChainName, erc721OnMainChain, erc721OnSchain)
-
initialize(newChainName, newMessageProxy, newIMALinker, newCommunityLocker, newDepositBox)
-
_exit(chainHash, messageReceiver, contractOnMainChain, to, tokenId)
exitToMainERC721 exitToMainERC721(address contractOnMainnet, uint256 tokenId)
external
Move tokens from schain to mainnet.
{contractOnMainnet} tokens are burned on schain and unlocked on mainnet for {msg.sender} address.
transferToSchainERC721 transferToSchainERC721(string targetSchainName, address contractOnMainnet, uint256 tokenId)
external
Move tokens from schain to schain.
{contractOnMainnet} tokens are burned on origin schain and are minted on {targetSchainName} schain for {msg.sender} address.
postMessage postMessage(bytes32 fromChainHash, address sender, bytes data)
external
Allows MessageProxy to post operational message from mainnet or SKALE chains.
Requirements:
-
MessageProxy must be the sender.
-
fromChainHash
must exist in TokenManager addresses.
addERC721TokenByOwner addERC721TokenByOwner(string targetChainName, address erc721OnMainChain, address erc721OnSchain)
external
Allows Schain owner to register an ERC721 token clone in the token manager.
initialize initialize(string newChainName, contract IMessageProxyForSchain newMessageProxy, contract ITokenManagerLinker newIMALinker, contract ICommunityLocker newCommunityLocker, address newDepositBox)
external
Is called once during contract deployment.
_sendERC721 _sendERC721(bytes32 fromChainHash, bytes data) → address
internal
Allows TokenManager to send ERC721 tokens.
Emits a {ERC20TokenCreated} event if token did not exist and was automatically deployed. Emits a {ERC20TokenReceived} event on success.
_removeTransferredAmount _removeTransferredAmount(bytes32 chainHash, address erc721Token, uint256 tokenId)
internal
Removes the ids of tokens that was transferred from schain.
_receiveERC721 _receiveERC721(bytes32 chainHash, address erc721OnMainChain, address to, uint256 tokenId) → bytes data
internal
Allows DepositBoxERC721 to receive ERC721 tokens.
Emits an ERC721TokenReady
event.
Requirements:
-
Whitelist should be turned off for auto adding tokens to DepositBoxERC721.
_addERC721ForSchain _addERC721ForSchain(bytes32 chainHash, address erc721OnMainChain)
internal
Adds an ERC721 token to DepositBoxERC721.
Emits an ERC721TokenAdded
event.
Requirements:
-
Given address should be contract.
_exit _exit(bytes32 chainHash, address messageReceiver, address contractOnMainChain, address to, uint256 tokenId)
internal
Burn tokens on schain and send message to unlock them on target chain.
_saveTransferredAmount _saveTransferredAmount(bytes32 chainHash, address erc721Token, uint256 tokenId)
internal
Saves the ids of tokens that was transferred to schain.
_getTokenInfo _getTokenInfo(contract IERC721MetadataUpgradeable erc721) → struct Messages.Erc721TokenInfo
internal
Returns info about ERC721 token such as token name, symbol.
_isERC721AddedToSchain _isERC721AddedToSchain(bytes32 chainHash, address erc721OnMainChain) → bool
internal
ERC721TokenAdded ERC721TokenAdded(bytes32 chainHash, address erc721OnMainChain, address erc721OnSchain)
event
Emitted when schain owner register new ERC721 clone.
ERC721TokenCreated ERC721TokenCreated(bytes32 chainHash, address erc721OnMainChain, address erc721OnSchain)
event
Emitted when TokenManagerERC721 automatically deploys new ERC721 clone.
ERC721TokenReceived ERC721TokenReceived(bytes32 chainHash, address erc721OnMainChain, address erc721OnSchain, uint256 tokenId)
event
Emitted when someone sends tokens from mainnet to schain.
ERC721TokenReady ERC721TokenReady(bytes32 chainHash, address contractOnMainnet, uint256 tokenId)
event
Emitted when token is received by TokenManager and is ready to be cloned or transferred on SKALE chain.