optimism icon indicating copy to clipboard operation
optimism copied to clipboard

feat: introduce OptimismSuperchainERC20Factory

Open agusduha opened this issue 1 year ago • 1 comments

Description

Implement the factory for deploying OptimismSuperchainERC20 Beacon proxies.

Spec: https://github.com/ethereum-optimism/specs/pull/332

Tests

Added OptimismSuperchainERC20Factory tests Test the OptimismSuperchainERC20 Beacon in its tests

Additional context

Q: Should the OptimismSuperchainERC20Beacon predeploy be proxied?

TODO: Set the correct address of the OptimismSuperchainERC20 implementation in the OptimismSuperchainERC20Beacon contract.

Metadata

  • Closes https://github.com/ethereum-optimism/optimism/issues/10872

agusduha avatar Aug 27 '24 19:08 agusduha

@tynes Do you have an usual way to generate an address in the L2Genesis script? It is the thing missing for the OptimismSuperchainERC20 implementation

agusduha avatar Aug 28 '24 18:08 agusduha

@tynes Do you have an usual way to generate an address in the L2Genesis script? It is the thing missing for the OptimismSuperchainERC20 implementation

An example of how addresses are generated can be found here: https://github.com/ethereum-optimism/specs/blob/9342867e3fd6dcd47038200b21629d25cb7fe566/specs/protocol/fjord/derivation.md#network-upgrade-automation-transactions

The idea is that the hardfork includes special deposit transactions at the hardfork block and these deposit transactions can deploy contracts, initialize state, modify implementations in proxies. We will need to compute the address at which the implementation will be deployed at. There isn't really any special reason as to why a particular from is picked, usually a fresh one is used with nonce 0. There needs to be enough gas to do the execution.

I recommend just creating an entry in the predeploys library for an arbitrary address for now, and we can think about the hardfork later. For now we just care about new networks

tynes avatar Aug 29 '24 15:08 tynes

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.78%. Comparing base (d887cfa) to head (3e23981). Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #11617   +/-   ##
========================================
  Coverage    78.78%   78.78%           
========================================
  Files           41       41           
  Lines         3262     3262           
========================================
  Hits          2570     2570           
  Misses         529      529           
  Partials       163      163           
Flag Coverage Δ
cannon-go-tests 78.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Sep 09 '24 18:09 codecov[bot]

It looks like this may need to be rebased one more time to get the latest CI to run with it, some new required CI was added since this was last committed to. The code looks good to me, great work!

tynes avatar Sep 12 '24 03:09 tynes