The fungible token precompile allows conversions between native coins and ERC20 tokens. Read up on EVM assets vs native coinsto understand what a native coin is.
If a native coin doesn't have an ERC20 representation, then a "fungible token mapping" must be created for it. That can be done via the Cosmos msg MsgCreateFunToken.
You can verify if a fungible token mapping exists for a native coin by querying for fungible token mappings for a specific denom.
nibidqevmfuntokenunibi|jq
Convert from native coin to ERC20
There are two mechanisms for converting from a native coin to ERC20:
Cosmos msg MsgConvertCoinToEvm
IFunToken.sendToEvm precompile call
The MsgConvertCoinToEvm msg can be called via command line:
The IFunToken.sendToEvm precompile call can be called via another EVM smart contract or directly via ethers.js:
Convert from ERC20 to native coin
Likewise, an ERC20 token can be converted back to a native coin if it has a fungible token mapping. The only mechanism to do this is via the IFunToken.sendToBank precompile call.