Memetroplis ProductionGuideReference

2.3 Meme Token (ERC-20) Contract

EVM Contract

2.3 Meme Token (ERC-20) Contract

Each token launched by the TokenFactory is an ERC-20 smart contract (often a simple implementation with a name, symbol, and 18 decimals). The TokenFactory deploys this contract (e.g. via

new ERC20Token(...)

) when a user creates a new token. Important aspects of the token contract:

  • Mint/Burn Control: The token’s minting and burning is controlled by the TokenFactory. Typically, the token contract might use an Ownable or MINTER role pattern where the TokenFactory contract is the only address allowed to mint or burn tokens. This ensures that all supply changes happen through the bonding curve logic in the TokenFactory.

  • Cross-Chain Deployment: In a cross-chain scenario, the same token may exist on multiple chains. The system can deploy identical ERC-20 contracts for the token on each chain, or use a single canonical contract and represent ownership on other chains via messaging. A common pattern (used here) is to deploy a token contract on each chain and have the TokenFactories coordinate minting so that the total supply across all chains is consistent. For example, if a token is created on Ethereum, an ERC-20 is deployed on Ethereum (with initial supply 0). If users on BSC also buy the token, an ERC-20 for that token will be deployed on BSC as well (by the BSC TokenFactory when needed), and some of the total supply will be minted on BSC. The TokenFactories ensure the sum of supplies on all chains follows the bonding curve’s supply count.

  • Standard ERC-20 Behavior: Aside from controlled minting, these Meme Token contracts behave like standard ERC-20 tokens. Users can transfer them, add them to liquidity pools, etc. Once the bonding curve phase is over, the token contract doesn’t restrict transfers (it’s fully liquid). During the bonding curve phase, transfers might be allowed as well (users could technically trade OTC by sending tokens, though that’s outside the intended flow).

  • No Special Governance or Taxes: Typically, these meme token contracts are kept simple (no fee on transfer, no complex governance logic). They exist solely to track balances. All pricing and purchase logic is kept in the TokenFactory instead of the token contract.

Because the token contracts are minimal, developers forking this system can easily reuse the same ERC-20 implementation or swap in a custom one if needed (as long as it allows the TokenFactory to mint/burn).

2.4 LogExpMath & TokenFactoryHelper Libraries

Bonding Curve and Contract Helpers