Skip to content

Instantly share code, notes, and snippets.

@JayWelsh
Created March 21, 2024 00:42
Show Gist options
  • Save JayWelsh/cb34415b1b8f4ce269fa580a2e404c18 to your computer and use it in GitHub Desktop.
Save JayWelsh/cb34415b1b8f4ce269fa580a2e404c18 to your computer and use it in GitHub Desktop.
How to deploy a custom decimal place ERC-20 token contract to Base Network

Context:

  1. I was initially pointed towards https://github.com/ethereum-optimism/optimism/blob/c04cefe0258a3a13266fe7f3df830f392f4a14dc/packages/contracts-bedrock/src/universal/OptimismMintableERC20Factory.sol#L89C14-L89C53

  2. However, this version of the OptimismMintableERC20Factory wasn't (and I think still isn't) officially deployed to a production environment for Base, and so it was suggested by the Optimism team to make the deployment of the latest code independently, there is more context on this here: ethereum-optimism/developers#143

  3. This lead to me trying to make a deployment of the factory myself, however this was shortsighted of me in hindsight and lead to the suggestion to not deploy the whole factory but rather to just deploy the reference contract itself, without involving the factory side of things, more context: ethereum-optimism/developers#147

Conclusion

you can make a deployment of OptimismMintableERC20 yourself, this is the contract one would deploy, with an adjusted decimals value: https://github.com/ethereum-optimism/optimism/blob/c04cefe0258a3a13266fe7f3df830f392f4a14dc/packages/contracts-bedrock/src/universal/OptimismMintableERC20.sol

You can then use the address that results from deploying the above to Base within the existing L2StandardBridge on Ethereum Mainnet (0x3154Cf16ccdb4C6d922629664174b904d80F2C35 as per https://docs.base.org/base-contracts/#l2-contract-addresses)

P.S. For anyone reading this in the future, it would be worth checking what the latest situation is, but this method should hopefully last as an option.

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