Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce OptimismSuperchainERC20Factory #30

Closed
wants to merge 18 commits into from

Conversation

agusduha
Copy link
Member

Closes OPT-197

TODO: Set the correct address of the OptimismSuperchainERC20 implementation.

agusduha and others added 12 commits August 5, 2024 11:32
* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: unit tests fixes

* fix: super to legacy tests failing

* fix: mock and expect mint and burn
* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface
* test: add L2 standard bridge interop unit tests

* fix: add tests natspec

* fix: add generic factory interface

* feat: modify OptimismMintableERC20Factory for convert

* fix: use only a public function for create3

* feat: rollback interop factory, modify legacy one

* fix: delete local token return variable
* feat: add superchain erc20 factory implementation

* fix: remove createX comments
* test: add superchain erc20 factory tests

* test: add erc20 asserts
@agusduha agusduha self-assigned this Aug 22, 2024
Copy link

linear bot commented Aug 22, 2024

@agusduha agusduha added the hold Do not merge for now label Aug 22, 2024
import { IBeacon } from "@openzeppelin/contracts-v5/proxy/beacon/IBeacon.sol";
import { ISemver } from "src/universal/ISemver.sol";

/// @custom:proxied
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contract isn't really proxied, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All predeploys are proxied by default, maybe we should add it to the not proxied list

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this the case, then leaving it like this is okay. I had the idea that this one was just going to have different code installed on hardforks, but I really don't remember where I got that from.

/// This is used to keep track of the token deployments.
mapping(address superchainToken => address remoteToken) public deployments;

/// @notice Emitted when a OptimismSuperchainERC20 is deployed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @notice Emitted when a OptimismSuperchainERC20 is deployed.
/// @notice Emitted when an OptimismSuperchainERC20 is deployed.

external
returns (address _superchainERC20)
{
// Encode the `initialize` call data for the OptimismSuperchainERC20.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it common for them to have these inline comments? I perhaps would remove them otherwise

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm not very common in practice, we can delete them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for that, yes

bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals));
address deployment = _calculateTokenAddress(salt, address(superchainERC20Factory));

vm.expectEmit(address(superchainERC20Factory));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have a true, true statement for the indexed arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i started changing them all after this comment ethereum-optimism#11479 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, was not aware of this

@agusduha
Copy link
Member Author

External review at ethereum-optimism#11617

@gotzenx
Copy link
Collaborator

gotzenx commented Sep 2, 2024

This branch will be closed since its not needed. Dev is the base branch that we sync since this repo is the fork. We already have the PR for this branch pointing to OPs repo. Once merged, our dev will be synced.

@gotzenx gotzenx closed this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold Do not merge for now
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants