Creating a Custom ERC-20 Token
Overview
This section provides a guide on creating a custom ERC-20 token using the Initia platform's precompiled contracts. We will use two specific precompiled interfaces from Initia's library: IERC20
for the ERC-20 token standard and ERC20Registry
for registering the token within the ecosystem.
A developer interested in creating a standard ERC-20 token can utilize the factory contract deployed at 0x101FA200c0b44FAAC6944d30C04a97cDe6E6B19c
. Refer to @initia/evm-precompiles/erc20_factory/ERC20Factory.sol
for more details.
If the minitia deployer doesn't support custom erc20 tokens, you won't be able to deploy cosmos bank supported custom erc20 tokens. Therefore, you should check /minievm/evm/v1/params before proceeding.
Sample Contract Implementation
Here is an example of how to implement a custom ERC-20 token by extending both the IERC20
and ERC20Registry
. The contract includes necessary functions and modifiers to ensure compliance and functionality.
Conclusion
By integrating these components into your ERC-20 contract, you can leverage the advanced features of the Initia platform, ensuring that your token operates smoothly within both the Initia and broader Ethereum ecosystems. This setup not only aligns with standard ERC-20 operations but also enhances functionality with specific adaptations for the Cosmos environment.
Last updated