Important Information
- When a SKALE Chain is created, there are NO ERC-721 tokens mapped by default
- In order to bridge an ERC-721 token to a SKALE Chain from Ethereum, it must be added by the SKALE Chain owner or operator via the standard mapping process
- All ERC-721 tokens bridged into SKALE have a set of basic requirements to make them compatible with SKALE’s bridging layer
SKALE utilizes a popular architectural design within bridging which is a liquidity based bridge.
This means that tokens bridged into SKALE are locked on Ethereum and a copy is minted on the target SKALE Chain.
Bridge Setup
1. Prepare the ERC-721 on SKALE
ERC-721 tokens that are being bridged to SKALE should follow two basic requirements in order to be compatible with the SKALE IMA bridging layer:- Have a mint function that is locked down to the IMA Bridge
- Have a burn function that is locked down to the IMA Bridge
If the mint function is not locked down to just the IMA Bridge, specifically TokenManagerERC721; there is a chance that
the existing tokens on the SKALE Chain may not match what is secured in the bridge.
If the burn function is not locked down to just the IMA Bridge, specifically TokenManagerERC721; there is a chance that
the supply on the SKALE Chain side could be “burned”, while the tokens still exist on Ethereum which could later be withdrawn under certain circumstances. It is recommended that explicit burns on a SKALE Chain should be avoided for bridged tokens.
2. Deploy the ERC-721 on SKALE
Utilize your preferred tooling i.e Foundry, Hardhat, Remix, etc. to deploy your IMA compatible ERC-721 token to the SKALE Chain you want to be able to bridge assets too.InterchainERC721.sol is inherited from the code above
3. Map the SKALE and Ethereum tokens together
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 Ethereum via SAFE
Start by visiting your SAFE via the official SAFE website or your preferred tool. If you are unsure, you can follow the steps here. Once on your SAFE, start by preparing a transaction via the Transaction Builder. Follow these steps:- Input the DepositBoxERC721 address into the address field.
- Select Use Implementation ABI
- Select
addERC721TokenByOwnerfor the method - Input your SKALE Chain Name and your ERC-721 contract address on Ethereum in the fields
- Send by itslef or via batch
Add the token on SKALE Chain TokenManagerERC721
- Multisigwallet CLI
Verify the Mapping
To verify the mapping, you should have an event emitted from the following:-
DepositBoxERC721 on Ethereum -
event ERC721TokenAdded(string schainName, address indexed contractOnMainnet); -
TokenManagerERC721 on SKALE Chain -
event ERC721TokenAdded(SchainHash indexed chainHash, address indexed erc721OnMainChain, address indexed erc721OnSchain);
Bridging ERC-721
The following does not require you to setup your own token. This works with ANY ERC-721 token that is mapped from Ethereum to any SKALE Chain as long as the actual ERC-721 token on each side does not have additional restrictions around who can transfer. The flow for bridging an ERC-721 from Ethereum to SKALE follows a very similar flow to a standard ERC-721 transfer:- Approve the bridge contract on the ERC-721 token to allow it to move your NFTs
- Call the bridge directly to transfer the specific ERC-721 from Ethereum -> 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 Ethereum during the bridge
Bridge to SKALE (from Ethereum)
The following will help you bridge an NFT from Ethereum to SKALE.- bridge.js
- bridgeDirect.js
Bridge to Ethereum (from SKALE)
SKALE’s decentralized bridge offers a simple two-step process to bridge from any SKALE Chain to Ethereum Mainnet.- The first step, which only has to be done if you don’t have a sufficient balance to exit, is to fill up your gas wallet on Ethereum
- The second step is to initiate the bridge (technically known as an exit) on the SKALE Chain
Gas Wallet, officially referred to as the community pool, is a smart contract on Ethereum that is used to handle exits from SKALE. Users pre-pay ETH into this contract which is then used to reimburse validators for the gas costs of the bridge cost back to Ethereum. Make sure users top up their gas wallet to ensure the bridge can succeed.
Pre-pay for your Exit
This step is optional IF the user has already filled up their gas wallet and has sufficient balance left. You can check if the wallet is anactiveUser on the CommunityLocker 0xD2aaa00300000000000000000000000000000000 smart contract on the SKALE Chain. If active, no need to fill the pool again.
Bridge to Ethereum
Once the above prepayment steps are completed, you can proceed with the bridging. Bridging from SKALE simply requires theexitToMainERC721 function to be called with the corresponding token and amount to initiate the transfer back to Ethereum.
If your bridge is not working, it is most likely for one of three reasons:
- You forgot to prepay for gas
- You forgot to approve the bridge on the ERC-721 token id you want to bridge
- You don’t actually own the ERC-721 Token
