-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathOptimismSuperchainERC20Beacon.t.sol
More file actions
47 lines (40 loc) · 1.88 KB
/
OptimismSuperchainERC20Beacon.t.sol
File metadata and controls
47 lines (40 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
// Testing utilities
import {CommonTest} from "test/setup/CommonTest.sol";
// Libraries
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.
abstract contract OptimismSuperchainERC20Beacon_TestInit is CommonTest {
/// @notice Sets up the test suite.
function setUp() public override {
// Skip the test until OptimismSuperchainERC20Beacon is integrated again
vm.skip(true);
super.enableInterop();
super.setUp();
}
}
/// @title OptimismSuperchainERC20Beacon_Implementation_Test
/// @notice Contract for testing the `implementation` function of the
/// `OptimismSuperchainERC20Beacon` contract.
contract OptimismSuperchainERC20Beacon_Implementation_Test is OptimismSuperchainERC20Beacon_TestInit {
/// @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());
}
}