Native Transfers

You can send spot assets between the L1 and the EVM. Spot assets on the L1 are called “native spot” while ones on the EVM are called “EVM spot”. The spot deployer can link their native spot asset to any ERC20 contract deployed to the EVM. However, in order for transfers between the two to work the system address (0x2222222222222222222222222222222222222222) must have the total non-system balance on the other side. For example, if you want to deploy an ERC20 contract for an existing native spot asset, the system contract should have the entirety of the EVM spot supply equal to the max native spot supply. Once this is done the spot deployer needs to send a spot deploy action to link the token to the EVM:

/**
 * @param token - The token index to link
 * @param address - The address of the ERC20 contract on the evm.
 * @param evmExtraWeiDecimals - The difference in Wei decimals between native and EVM spot. E.g. native PURR has 5 weiDecimals but EVM PURR has 18, so this would be 13. EVM wei decimals should be at least native wei decimals.
 */
interface SetEvmContract {
  type:setEvmContract”;
  token: number;
  Address: address;
  evmExtraWeiDecimals: number;
}

Once a token is linked you can convert between native and EVM spot by sending the token to the system address (0x2222222222222222222222222222222222222222). This can be done on the L1 using a spotSend action (or via the frontend) and on the EVM by using an ERC transfer. There are currently no checks that the system address has sufficient supply or that the contract is a valid ERC20, so be careful when sending funds.

EVM PURR has been deployed as 0x8cDE56336E289c028C8f7CF5c20283fF02272182

Attached is a sample script for deploying an ERC20 token to the EVM and linking it to a native spot token.

Last updated