Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
pragma solidity 0.8.15;

// Testing utilities
import { CommonTest } from "test/setup/CommonTest.sol";
import {CommonTest} from "test/setup/CommonTest.sol";

// Libraries
import { Predeploys } from "src/libraries/Predeploys.sol";
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
import {Predeploys} from "src/libraries/Predeploys.sol";
import {SemverComp} from "src/libraries/SemverComp.sol";
import {IBeacon} from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";

// Interfaces
import {ISemver} from "interfaces/universal/ISemver.sol";

/// @title OptimismSuperchainERC20Beacon_TestInit
/// @notice Reusable test initialization for `OptimismSuperchainERC20Beacon` tests.
Expand All @@ -25,9 +29,19 @@ abstract contract OptimismSuperchainERC20Beacon_TestInit is CommonTest {
/// @notice Contract for testing the `implementation` function of the
/// `OptimismSuperchainERC20Beacon` contract.
contract OptimismSuperchainERC20Beacon_Implementation_Test is OptimismSuperchainERC20Beacon_TestInit {
/// @notice Test that calling the implementation function returns the correct implementation address.
function test_implementation_isCorrect_works() public view {
/// @notice Test that the implementation returns the correct address.
function test_implementation_succeeds() public view {
IBeacon beacon = IBeacon(Predeploys.OPTIMISM_SUPERCHAIN_ERC20_BEACON);
assertEq(beacon.implementation(), Predeploys.OPTIMISM_SUPERCHAIN_ERC20);
}
}

/// @title OptimismSuperchainERC20Beacon_Version_Test
/// @notice Tests the `version` function of the
/// `OptimismSuperchainERC20Beacon` contract.
contract OptimismSuperchainERC20Beacon_Version_Test is OptimismSuperchainERC20Beacon_TestInit {
/// @notice Tests that version returns a valid semver string.
function test_version_succeeds() external view {
SemverComp.parse(ISemver(Predeploys.OPTIMISM_SUPERCHAIN_ERC20_BEACON).version());
}
}
Loading