Two Ways to Create ERC-20 Tokens
MANTRA Chain supports two methods for creating ERC-20 tokens, each with different use cases and benefits.Method 1: Deploy ERC-20 Contract in EVM
Deploy a standard ERC-20 contract inside the EVM (same experience as any EVM chain).Steps
-
Write or use a standard ERC-20 contract
- Use OpenZeppelin’s ERC20 contract
- Or write your own ERC-20 implementation
-
Deploy using standard EVM tooling
- Hardhat
- Foundry
- Remix
- Or any EVM deployment tool
-
Optionally, create a mapping to the Bank module
- This enables Cosmos SDK integration
- Allows use in Cosmos-native applications
Use Cases
- Standard ERC-20 tokens: Simple token requirements
- External (non-MANTRA) developers: Recommended approach
- Quick deployment: Fastest way to deploy tokens
- Standard tooling: Use familiar EVM development tools
Example
Method 2: TokenFactory with ERC-20 Precompile
Create a denom in TokenFactory, which automatically creates a custom ERC-20 precompile address so the token can be used in the EVM.Steps
-
Create token using TokenFactory module
- Use Cosmos SDK’s TokenFactory
- Configure token parameters
-
Token automatically gets ERC-20 precompile address
- No additional setup required
- Precompile address is deterministic
-
Use token in EVM contracts seamlessly
- Call precompile from Solidity
- Transfer, approve, and query balances
Use Cases
- MANTRA internal tokens: Tokens created by MANTRA
- Tokens requiring compliance features: Access to Bank module compliance
- Tokens that need Bank module integration: Native Cosmos SDK support
- Regulatory compliance: Protocol-level compliance features
Benefits
- Compliance features: Bank module has access to the token for compliance features
- Seamless integration: Works in both EVM and Cosmos SDK
- Native protocol support: Built-in MANTRA Chain features
- No wrapping required: Direct EVM access via precompile
Recommendation
For External Developers
Use Method 1 (deploy standard ERC-20 contract):- Familiar development experience
- Standard tooling and libraries
- No special setup required
- Works identically to other EVM chains
For MANTRA
Use Method 2 (TokenFactory) because:- Compliance features built inside the protocol (specifically in the Bank module) have access to the token
- Seamless integration with Cosmos ecosystem
- Native protocol support
- Protocol-level compliance features
TokenFactory ERC-20 Precompiles
Each TokenFactory token automatically gets:- ERC-20 precompile address: Deterministic address based on token denom
- Balance control: Manage token balances from EVM
- Transfer functionality: Standard ERC-20 transfer operations
- EVM contract compatibility: Use in any EVM contract
Using TokenFactory Tokens in EVM
Comparison
| Feature | Method 1: EVM Contract | Method 2: TokenFactory |
|---|---|---|
| Development Experience | Standard EVM | Cosmos SDK + EVM |
| Compliance Features | Limited | Full protocol support |
| Cosmos Integration | Optional mapping | Native integration |
| Recommended For | External developers | MANTRA internal tokens |
| Setup Complexity | Low | Medium |
| Tooling | Standard EVM tools | Cosmos SDK + EVM |
Next Steps
- Learn about address derivation
- Understand transaction sequencing
- Get started with EVM development