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
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
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
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
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.
