Important Information
- When a SKALE Chain is created, there are no ERC-1155 tokens mapped by default
- A token being bridged between two chains should have its supply issued (i.e minted) on one chain. The second SKALE Chain mints by design via IMA, however, the token should not be mintable any other way
- Tokens being bridged from SKALE Chain to SKALE Chain are locked in TokenManagerERC1155 on the origin chain
- Tokens being bridged from SKALE Chain to SKALE Chain are minted by IMA on the destination chain
Bridge Setup
If the SKALE Chains you are mapping the ERC-1155 token from/to are not connected, please connect the SKALE Chains.
1. Prepare the ERC-1155
ERC-1155 tokens that are being bridged between SKALE Chains should have the mint function that is locked down to TokenManagerERC1155.If the mint function is not locked down to just the IMA Bridge, specifically TokenManagerERC1155; there is a chance that the existing tokens on the SKALE Chain may not match what is secured in the bridge.
2. Deploy the ERC-1155 on SKALE
Utilize your preferred tooling i.e Foundry, Hardhat, Remix, etc. to deploy your IMA compatible ERC-1155 token to the SKALE Chain you want to be able to bridge assets too.InterchainERC1155.sol is inherited from the code above
3. Map the SKALE Token
If you are trying to setup a token on SKALE in a production environment please join us in Discord for support!
Add the token on SKALE Chain TokenManagerERC1155
- DST_SCHAIN_NAME is the name of the SKALE Chain that the transaction should execute on
- ORIGIN_SCHAIN_NAME is the name of the SKALE Chain that the token is being mapped from
- 0x_ORIGIN_TOKEN is the original token address on the ORIGIN_SCHAIN_NAME
- 0x_DST_TOKEN is the destination token address on the DST_SCHAIN_NAME
- Multisigwallet CLI
Multisigwallet CLI
Verify the Mapping
To verify the mapping, you should have an event emitted from TokenManagerERC1155 on SKALE Chain -event ERC1155TokenAdded(SchainHash indexed chainHash, address indexed erc1155OnMainChain, address indexed erc1155OnSchain);
Bridging ERC-1155
The following does not require you to setup your own token. This works with ANY ERC-1155 token that is mapped from a SKALE Chain to any other SKALE Chain as long as the actual ERC-1155 token on each side does not have additional restrictions around who can transfer. The flow for bridging an ERC-1155 from SKALE Chain to SKALE Chain follows a very similar flow to a standard ERC-1155 transfer:- Approve the bridge contract on the ERC-1155 token to allow it to move your NFTs
- Call the bridge directly to transfer the specific ERC-1155 from SKALE Chain -> SKALE Chain, if the mapping exists
- Wait for the message to be posted by the validator set on the SKALE Chain, which is the net-new minted NFT corresponding to the NFT (by id) locked on the origin SKALE Chain during the bridge
Bridge Tokens
The following will help you bridge an ERC-1155 NFT from one SKALE Chain to another.- bridge.js
- bridgeBatch.js
