CW20 vs. ERC20 For Interchain Transactions

165 Views Asked by At

When sending cosmos tokens to evm chains. How are Cosmos specific tokens for example CW20s (not the same as an ERC20, but similar) handled? It can't exist on the EVM chain, so if the CW20 is on your DEX (evm and Cosmos), how is the EVM chain going to update when the Cosmos chain makes a transfer, swap, etc?

I do not understand how this works these are two different token standards that are supposedly now interconnected how can two different standards be compatible.

2

There are 2 best solutions below

0
On BEST ANSWER

Axelar provides a secure interchain communication platform that allows for token transfers across different chains, regardless of their consensus mechanism or message payload. This includes the ability to transfer tokens between Cosmos and EVM chains.

When transferring tokens from a Cosmos-based chain to an EVM chain, the asset will arrive as an ERC-20 asset. This is facilitated by the AxelarJS SDK, which provides a method for generating a deposit address for the transfer. Here's an example of how this can be done:

const sdk = new AxelarAssetTransfer({ environment: "testnet" });

const fromChain = CHAINS.TESTNET.OSMOSIS,
toChain = CHAINS.TESTNET.AVALANCHE,
destinationAddress = "0xF16DfB26e1FEc993E085092563ECFAEaDa7eD7fD",
asset = "uausdc"; // denom of asset. See note (2) below

const depositAddress = await sdk.getDepositAddress({
fromChain,
toChain,
destinationAddress,
asset
});

More info here:

0
On

There must exist a mapping between ERC-20 tokens on EVM and any token presentation that exist on the same chain, but not using EVM (WebAssembly smart contract, or native assets). Most tokens use native Cosmos asset presentation from bank module, not from CW-20, and the former is preferred because of its benefits.

Because there is no single Cosmos chain, every Cosmos app chain may handle this differently. Here is a blog post from the EVMOS team that describes how Cosmos native tokens are mapped to ERC-20 and vice versa.

The most popular DEX in the Cosmos system is Osmosis, which is an app chain, and it can trade any Inter-Blockchain Communication Protocol (IBC) assets.