-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove immutables from superchain erc20 beacon (#12207)
* fix: remove immutables from superchain erc20 beacon (#67) * fix: remove immutables from superchain erc20 beacon * test: add superchain erc20 beacon tests * fix: superchain erc20 beacon interface (#99)
- Loading branch information
Showing
7 changed files
with
41 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
packages/contracts-bedrock/src/L2/interfaces/IOptimismSuperchainERC20Beacon.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; | ||
import { ISemver } from "src/universal/interfaces/ISemver.sol"; | ||
|
||
/// @title IOptimismSuperchainERC20Beacon | ||
/// @notice Interface for the OptimismSuperchainERC20Beacon contract | ||
interface IOptimismSuperchainERC20Beacon is IBeacon, ISemver { | ||
function version() external view returns (string memory); | ||
function implementation() external view override returns (address); | ||
interface IOptimismSuperchainERC20Beacon is ISemver { | ||
function implementation() external pure returns (address); | ||
|
||
function __constructor__(address _implementation) external; | ||
function __constructor__() external; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/contracts-bedrock/test/L2/OptimismSuperchainERC20Beacon.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
// Testing utilities | ||
import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; | ||
|
||
// Libraries | ||
import { Predeploys } from "src/libraries/Predeploys.sol"; | ||
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; | ||
|
||
/// @title OptimismSuperchainERC20BeaconTest | ||
/// @notice Contract for testing the OptimismSuperchainERC20Beacon contract. | ||
contract OptimismSuperchainERC20BeaconTest is Bridge_Initializer { | ||
/// @notice Sets up the test suite. | ||
function setUp() public override { | ||
super.enableInterop(); | ||
super.setUp(); | ||
} | ||
|
||
/// @notice Test that calling the implementation function returns the correct implementation address. | ||
function test_implementation_is_correct() public view { | ||
IBeacon beacon = IBeacon(Predeploys.OPTIMISM_SUPERCHAIN_ERC20_BEACON); | ||
assertEq(beacon.implementation(), Predeploys.OPTIMISM_SUPERCHAIN_ERC20); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters