Skip to content

Conversation

@AdriaCarrera
Copy link
Contributor

[DRAFT] Add ERC20 Token Factory Precompile

Motivation 💡

This PR introduces the ERC20 token factory precompile, enabling the creation of x/erc20 STRv2 tokens directly from the EVM.

The precompile exposes two primary methods:

  • Create Token:
function create(uint8 tokenType, bytes32 salt, string memory name, string memory symbol, uint8 decimals) external returns (address)
  • Calculate Token Address:
function calculateAddress(uint8 tokenPairType, bytes32 salt) external view returns (address)

These methods allow for seamless integration and deterministic address calculation when deploying new ERC20 tokens.

Changes 🛠

  • Added the precompile declaration in /app/precompiles.go
  • Added the precompile implementation.

Considerations 🤔

  • This PR depends on a change on evmos for including tokenType field in TokenPair type.

Dependencies 📦

  • Main Yet to be published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants