Commit 05ab396e authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: forge-std v1.8.1 (#10161)

* contracts-bedrock: forge-std v1.8.1

Updates to latest `forge-std` release to get access to the latest
cheatcodes with a nice API.

https://github.com/foundry-rs/forge-std/releases/tag/v1.8.1

* contracts-bedrock: fix warnings

* lint: fix

* contracts-bedrock: fix compiler

* lint: fix

* snapshots: update

* contracts-bedrock: make deploy config safe + expect safe mem

* gas-snapshot
parent dcc4fb35
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356410)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954595)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549189)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4061165)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450338)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496087)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 59803)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92930)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68390)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 69043)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155559)
\ No newline at end of file
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356411)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954596)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549198)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4061174)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450326)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496075)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 59809)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92951)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68398)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 69062)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155567)
\ No newline at end of file
Subproject commit 1fd874f0efdb711cb6807c4f4a000ed2805dc809
Subproject commit bb4ceea94d6f10eeb5b41dc2391c6c8bf8e734ef
......@@ -7,10 +7,6 @@ import { stdJson } from "forge-std/StdJson.sol";
import { Executables } from "scripts/Executables.sol";
import { Chains } from "scripts/Chains.sol";
// Global constant for the `useFaultProofs` slot in the DeployConfig contract, which can be overridden in the testing
// environment.
bytes32 constant USE_FAULT_PROOFS_SLOT = bytes32(uint256(63));
/// @title DeployConfig
/// @notice Represents the configuration required to deploy the system. It is expected
/// to read the file from JSON. A future improvement would be to have fallback
......@@ -180,6 +176,11 @@ contract DeployConfig is Script {
usePlasma = _usePlasma;
}
/// @notice Allow the `useFaultProofs` config to be overridden in testing environments
function setUseFaultProofs(bool _useFaultProofs) public {
useFaultProofs = _useFaultProofs;
}
function _getBlockByTag(string memory _tag) internal returns (bytes32) {
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
......
......@@ -5,7 +5,6 @@ import { Script } from "forge-std/Script.sol";
import { Artifacts } from "scripts/Artifacts.s.sol";
import { Config } from "scripts/Config.sol";
import { DeployConfig } from "scripts/DeployConfig.s.sol";
import { USE_FAULT_PROOFS_SLOT } from "scripts/DeployConfig.s.sol";
/// @title Deployer
/// @author tynes
......@@ -18,18 +17,10 @@ abstract contract Deployer is Script, Artifacts {
function setUp() public virtual override {
Artifacts.setUp();
// Load the `useFaultProofs` slot value prior to etching the DeployConfig's bytecode and reading the deploy
// config file. If this slot has already been set, it will override the preference in the deploy config.
bytes32 useFaultProofsOverride = vm.load(address(cfg), USE_FAULT_PROOFS_SLOT);
vm.etch(address(cfg), vm.getDeployedCode("DeployConfig.s.sol:DeployConfig"));
vm.label(address(cfg), "DeployConfig");
vm.allowCheatcodes(address(cfg));
cfg.read(Config.deployConfigPath());
if (useFaultProofsOverride != 0) {
vm.store(address(cfg), USE_FAULT_PROOFS_SLOT, useFaultProofsOverride);
}
}
/// @notice Returns the name of the deployment script. Children contracts
......
......@@ -151,7 +151,7 @@ contract FPACOPS is Deploy, StdAssertions {
}
/// @notice Checks that the deployed system is configured correctly.
function postDeployAssertions(address _proxyAdmin, address _systemOwnerSafe) internal {
function postDeployAssertions(address _proxyAdmin, address _systemOwnerSafe) internal view {
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismPortal2 = mustGetAddress("OptimismPortal2");
......
......@@ -1137,7 +1137,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000f"
}
],
"value": 0
......@@ -1413,7 +1413,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000f"
}
],
"value": 0
......@@ -1962,7 +1962,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000d"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
}
],
"value": 0
......@@ -1988,7 +1988,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
}
],
"value": 0
......@@ -2014,7 +2014,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
}
],
"value": 0
......@@ -2397,7 +2397,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000d"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
}
],
"value": 0
......@@ -2475,7 +2475,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
}
],
"value": 0
......@@ -2553,7 +2553,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000003b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003c"
}
],
"value": 0
......@@ -3540,7 +3540,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000f"
}
],
"value": 0
......@@ -6043,7 +6043,7 @@
"newValue": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
"previousValue": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000017"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000018"
}
],
"value": 0
......@@ -6069,7 +6069,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000d"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
}
],
"value": 0
......@@ -6095,7 +6095,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
}
],
"value": 0
......@@ -6121,7 +6121,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002d"
}
],
"value": 0
......@@ -6147,7 +6147,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a"
}
],
"value": 0
......@@ -6173,7 +6173,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000015"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000016"
}
],
"value": 0
......@@ -6199,7 +6199,7 @@
"newValue": "0x000000000000000000000000ff00000000000000000000000000000000000000",
"previousValue": "0x000000000000000000000000ff00000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000016"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000017"
}
],
"value": 0
......@@ -6778,7 +6778,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000d"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
}
],
"value": 0
......@@ -6856,7 +6856,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000834",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002b"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
}
],
"value": 0
......@@ -6934,7 +6934,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000000f4240",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000002c"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002d"
}
],
"value": 0
......@@ -7012,7 +7012,7 @@
"newValue": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
"previousValue": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000017"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000018"
}
],
"value": 0
......@@ -7090,7 +7090,7 @@
"newValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"previousValue": "0x00000000000000000000000000000000000000000000000000000000017d7840",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000029"
"slot": "0x000000000000000000000000000000000000000000000000000000000000002a"
}
],
"value": 0
......@@ -7168,7 +7168,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000015"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000016"
}
],
"value": 0
......@@ -7246,7 +7246,7 @@
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000039"
"slot": "0x000000000000000000000000000000000000000000000000000000000000003a"
}
],
"value": 0
......@@ -7324,7 +7324,7 @@
"newValue": "0x000000000000000000000000ff00000000000000000000000000000000000000",
"previousValue": "0x000000000000000000000000ff00000000000000000000000000000000000000",
"reverted": false,
"slot": "0x0000000000000000000000000000000000000000000000000000000000000016"
"slot": "0x0000000000000000000000000000000000000000000000000000000000000017"
}
],
"value": 0
......@@ -11400,7 +11400,7 @@
"newValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"previousValue": "0x0000000000000000000000009965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"reverted": false,
"slot": "0x000000000000000000000000000000000000000000000000000000000000000e"
"slot": "0x000000000000000000000000000000000000000000000000000000000000000f"
}
],
"value": 0
......@@ -37,7 +37,7 @@ contract L1CrossDomainMessenger_Test is Bridge_Initializer {
}
/// @dev Tests that the proxy is initialized correctly.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(address(l1CrossDomainMessenger.superchainConfig()), address(superchainConfig));
assertEq(address(l1CrossDomainMessenger.PORTAL()), address(optimismPortal));
assertEq(address(l1CrossDomainMessenger.portal()), address(optimismPortal));
......@@ -46,7 +46,7 @@ contract L1CrossDomainMessenger_Test is Bridge_Initializer {
}
/// @dev Tests that the version can be decoded from the message nonce.
function test_messageVersion_succeeds() external {
function test_messageVersion_succeeds() external view {
(, uint16 version) = Encoding.decodeVersionedNonce(l1CrossDomainMessenger.messageNonce());
assertEq(version, l1CrossDomainMessenger.MESSAGE_VERSION());
}
......
......@@ -76,7 +76,7 @@ contract L1ERC721Bridge_Test is Bridge_Initializer {
}
/// @dev Tests that the proxy is initialized with the correct values.
function test_initialize_succeeds() public {
function test_initialize_succeeds() public view {
assertEq(address(l1ERC721Bridge.MESSENGER()), address(l1CrossDomainMessenger));
assertEq(address(l1ERC721Bridge.messenger()), address(l1CrossDomainMessenger));
assertEq(address(l1ERC721Bridge.OTHER_BRIDGE()), Predeploys.L2_ERC721_BRIDGE);
......@@ -316,7 +316,7 @@ contract L1ERC721Bridge_Test is Bridge_Initializer {
contract L1ERC721Bridge_Pause_Test is Bridge_Initializer {
/// @dev Verifies that the `paused` accessor returns the same value as the `paused` function of the
/// `superchainConfig`.
function test_paused_succeeds() external {
function test_paused_succeeds() external view {
assertEq(l1ERC721Bridge.paused(), superchainConfig.paused());
}
......
......@@ -45,7 +45,7 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
}
/// @dev Test that the initialize function sets the correct values.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(address(l1StandardBridge.superchainConfig()), address(superchainConfig));
assertEq(address(l1StandardBridge.MESSENGER()), address(l1CrossDomainMessenger));
assertEq(address(l1StandardBridge.messenger()), address(l1CrossDomainMessenger));
......@@ -58,7 +58,7 @@ contract L1StandardBridge_Initialize_Test is Bridge_Initializer {
contract L1StandardBridge_Pause_Test is Bridge_Initializer {
/// @dev Verifies that the `paused` accessor returns the same value as the `paused` function of the
/// `superchainConfig`.
function test_paused_succeeds() external {
function test_paused_succeeds() external view {
assertEq(l1StandardBridge.paused(), superchainConfig.paused());
}
......
......@@ -168,7 +168,7 @@ contract L2OutputOracle_getter_Test is CommonTest {
}
/// @dev Tests that `nextBlockNumber` returns the correct value.
function test_nextBlockNumber_succeeds() external {
function test_nextBlockNumber_succeeds() external view {
assertEq(
l2OutputOracle.nextBlockNumber(),
// The return value should match this arithmetic
......
......@@ -198,7 +198,7 @@ contract OptimismPortal_Test is CommonTest {
/// @dev Tests that `minimumGasLimit` succeeds for small calldata sizes.
/// The gas limit should be 21k for 0 calldata and increase linearly
/// for larger calldata sizes.
function test_minimumGasLimit_succeeds() external {
function test_minimumGasLimit_succeeds() external view {
assertEq(optimismPortal.minimumGasLimit(0), 21_000);
assertTrue(optimismPortal.minimumGasLimit(2) > optimismPortal.minimumGasLimit(1));
assertTrue(optimismPortal.minimumGasLimit(3) > optimismPortal.minimumGasLimit(2));
......@@ -914,7 +914,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is CommonTest {
contract OptimismPortalUpgradeable_Test is CommonTest {
/// @dev Tests that the proxy is initialized correctly.
function test_params_initValuesOnProxy_succeeds() external {
function test_params_initValuesOnProxy_succeeds() external view {
(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = optimismPortal.params();
ResourceMetering.ResourceConfig memory rcfg = systemConfig.resourceConfig();
......
......@@ -194,7 +194,7 @@ contract OptimismPortal2_Test is CommonTest {
/// @dev Tests that `minimumGasLimit` succeeds for small calldata sizes.
/// The gas limit should be 21k for 0 calldata and increase linearly
/// for larger calldata sizes.
function test_minimumGasLimit_succeeds() external {
function test_minimumGasLimit_succeeds() external view {
assertEq(optimismPortal2.minimumGasLimit(0), 21_000);
assertTrue(optimismPortal2.minimumGasLimit(2) > optimismPortal2.minimumGasLimit(1));
assertTrue(optimismPortal2.minimumGasLimit(3) > optimismPortal2.minimumGasLimit(2));
......@@ -1245,7 +1245,7 @@ contract OptimismPortal2_Upgradeable_Test is CommonTest {
}
/// @dev Tests that the proxy is initialized correctly.
function test_params_initValuesOnProxy_succeeds() external {
function test_params_initValuesOnProxy_succeeds() external view {
(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = optimismPortal2.params();
ResourceMetering.ResourceConfig memory rcfg = systemConfig.resourceConfig();
......
......@@ -29,7 +29,7 @@ contract ProtocolVersions_Init is CommonTest {
contract ProtocolVersions_Initialize_Test is ProtocolVersions_Init {
/// @dev Tests that initialization sets the correct values.
function test_initialize_values_succeeds() external {
function test_initialize_values_succeeds() external view {
ProtocolVersions protocolVersionsImpl = ProtocolVersions(deploy.mustGetAddress("ProtocolVersions"));
address owner = deploy.cfg().finalSystemOwner();
......
......@@ -62,7 +62,7 @@ contract ResourceMetering_Test is Test {
}
/// @dev Tests that the initial resource params are set correctly.
function test_meter_initialResourceParams_succeeds() external {
function test_meter_initialResourceParams_succeeds() external view {
(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = meter.params();
ResourceMetering.ResourceConfig memory rcfg = meter.resourceConfig();
......
......@@ -15,7 +15,7 @@ import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
contract SuperchainConfig_Init_Test is CommonTest {
/// @dev Tests that initialization sets the correct values. These are defined in CommonTest.sol.
function test_initialize_unpaused_succeeds() external {
function test_initialize_unpaused_succeeds() external view {
assertFalse(superchainConfig.paused());
assertEq(superchainConfig.guardian(), deploy.cfg().superchainConfigGuardian());
}
......
......@@ -44,7 +44,7 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init {
}
/// @dev Tests that constructor sets the correct values.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
SystemConfig impl = SystemConfig(systemConfigImpl);
assertEq(impl.owner(), address(0xdEaD));
assertEq(impl.overhead(), 0);
......@@ -71,7 +71,7 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init {
}
/// @dev Tests that initailization sets the correct values.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(systemConfig.owner(), owner);
assertEq(systemConfig.overhead(), overhead);
assertEq(systemConfig.scalar(), scalar);
......
......@@ -37,7 +37,7 @@ contract CrossDomainOwnable3_Test is Bridge_Initializer {
}
/// @dev Tests that the constructor sets the correct variables.
function test_constructor_succeeds() public {
function test_constructor_succeeds() public view {
assertEq(setter.owner(), alice);
assertEq(setter.isLocal(), true);
}
......
......@@ -53,7 +53,7 @@ contract GasPriceOracleBedrock_Test is GasPriceOracle_Test {
}
/// @dev Tests that `l1BaseFee` is set correctly.
function test_l1BaseFee_succeeds() external {
function test_l1BaseFee_succeeds() external view {
assertEq(gasPriceOracle.l1BaseFee(), baseFee);
}
......@@ -72,17 +72,17 @@ contract GasPriceOracleBedrock_Test is GasPriceOracle_Test {
}
/// @dev Tests that `scalar` is set correctly.
function test_scalar_succeeds() external {
function test_scalar_succeeds() external view {
assertEq(gasPriceOracle.scalar(), l1FeeScalar);
}
/// @dev Tests that `overhead` is set correctly.
function test_overhead_succeeds() external {
function test_overhead_succeeds() external view {
assertEq(gasPriceOracle.overhead(), l1FeeOverhead);
}
/// @dev Tests that `decimals` is set correctly.
function test_decimals_succeeds() external {
function test_decimals_succeeds() external view {
assertEq(gasPriceOracle.decimals(), 6);
assertEq(gasPriceOracle.DECIMALS(), 6);
}
......@@ -157,33 +157,33 @@ contract GasPriceOracleEcotone_Test is GasPriceOracle_Test {
}
/// @dev Tests that `l1BaseFee` is set correctly.
function test_l1BaseFee_succeeds() external {
function test_l1BaseFee_succeeds() external view {
assertEq(gasPriceOracle.l1BaseFee(), baseFee);
}
/// @dev Tests that `blobBaseFee` is set correctly.
function test_blobBaseFee_succeeds() external {
function test_blobBaseFee_succeeds() external view {
assertEq(gasPriceOracle.blobBaseFee(), blobBaseFee);
}
/// @dev Tests that `baseFeeScalar` is set correctly.
function test_baseFeeScalar_succeeds() external {
function test_baseFeeScalar_succeeds() external view {
assertEq(gasPriceOracle.baseFeeScalar(), baseFeeScalar);
}
/// @dev Tests that `blobBaseFeeScalar` is set correctly.
function test_blobBaseFeeScalar_succeeds() external {
function test_blobBaseFeeScalar_succeeds() external view {
assertEq(gasPriceOracle.blobBaseFeeScalar(), blobBaseFeeScalar);
}
/// @dev Tests that `decimals` is set correctly.
function test_decimals_succeeds() external {
function test_decimals_succeeds() external view {
assertEq(gasPriceOracle.decimals(), 6);
assertEq(gasPriceOracle.DECIMALS(), 6);
}
/// @dev Tests that `getL1GasUsed` and `getL1Fee` return expected values
function test_getL1Fee_succeeds() external {
function test_getL1Fee_succeeds() external view {
bytes memory data = hex"0000010203"; // 2 zero bytes, 3 non-zero bytes
// (2*4) + (3*16) + (68*16) == 1144
uint256 gas = gasPriceOracle.getL1GasUsed(data);
......
......@@ -21,7 +21,7 @@ contract L2CrossDomainMessenger_Test is Bridge_Initializer {
address recipient = address(0xabbaacdc);
/// @dev Tests that the implementation is initialized correctly.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
L2CrossDomainMessenger impl =
L2CrossDomainMessenger(EIP1967Helper.getImplementation(deploy.mustGetAddress("L2CrossDomainMessenger")));
assertEq(address(impl.OTHER_MESSENGER()), address(0));
......@@ -30,14 +30,14 @@ contract L2CrossDomainMessenger_Test is Bridge_Initializer {
}
/// @dev Tests that the proxy is initialized correctly.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(address(l2CrossDomainMessenger.OTHER_MESSENGER()), address(l1CrossDomainMessenger));
assertEq(address(l2CrossDomainMessenger.otherMessenger()), address(l1CrossDomainMessenger));
assertEq(address(l2CrossDomainMessenger.l1CrossDomainMessenger()), address(l1CrossDomainMessenger));
}
/// @dev Tests that `messageNonce` can be decoded correctly.
function test_messageVersion_succeeds() external {
function test_messageVersion_succeeds() external view {
(, uint16 version) = Encoding.decodeVersionedNonce(l2CrossDomainMessenger.messageNonce());
assertEq(version, l2CrossDomainMessenger.MESSAGE_VERSION());
}
......
......@@ -74,7 +74,7 @@ contract L2ERC721Bridge_Test is Bridge_Initializer {
}
/// @dev Tests that the constructor sets the correct variables.
function test_constructor_succeeds() public {
function test_constructor_succeeds() public view {
assertEq(address(l2ERC721Bridge.MESSENGER()), address(l2CrossDomainMessenger));
assertEq(address(l2ERC721Bridge.OTHER_BRIDGE()), address(l1ERC721Bridge));
assertEq(address(l2ERC721Bridge.messenger()), address(l2CrossDomainMessenger));
......@@ -83,7 +83,7 @@ contract L2ERC721Bridge_Test is Bridge_Initializer {
/// @dev Ensures that the L2ERC721Bridge is always not paused. The pausability
/// happens on L1 and not L2.
function test_paused_succeeds() external {
function test_paused_succeeds() external view {
assertFalse(l2ERC721Bridge.paused());
}
......
......@@ -25,7 +25,7 @@ contract L2StandardBridge_Test is Bridge_Initializer {
using stdStorage for StdStorage;
/// @dev Test that the bridge's constructor sets the correct values.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
L2StandardBridge impl =
L2StandardBridge(payable(EIP1967Helper.getImplementation(deploy.mustGetAddress("L2StandardBridge"))));
assertEq(address(impl.MESSENGER()), address(0));
......@@ -35,7 +35,7 @@ contract L2StandardBridge_Test is Bridge_Initializer {
}
/// @dev Tests that the bridge is initialized correctly.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(address(l2StandardBridge.MESSENGER()), address(l2CrossDomainMessenger));
assertEq(address(l2StandardBridge.messenger()), address(l2CrossDomainMessenger));
assertEq(l1StandardBridge.l2TokenBridge(), address(l2StandardBridge));
......@@ -45,7 +45,7 @@ contract L2StandardBridge_Test is Bridge_Initializer {
/// @dev Ensures that the L2StandardBridge is always not paused. The pausability
/// happens on L1 and not L2.
function test_paused_succeeds() external {
function test_paused_succeeds() external view {
assertFalse(l2StandardBridge.paused());
}
......
......@@ -26,12 +26,12 @@ contract SequencerFeeVault_Test is CommonTest {
}
/// @dev Tests that the minimum withdrawal amount is correct.
function test_minWithdrawalAmount_succeeds() external {
function test_minWithdrawalAmount_succeeds() external view {
assertEq(sequencerFeeVault.MIN_WITHDRAWAL_AMOUNT(), deploy.cfg().sequencerFeeVaultMinimumWithdrawalAmount());
}
/// @dev Tests that the l1 fee wallet is correct.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(sequencerFeeVault.l1FeeWallet(), recipient);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -55,7 +55,7 @@ contract LivenessGuard_Constructor_Test is LivenessGuard_TestInit {
contract LivenessGuard_Getters_Test is LivenessGuard_TestInit {
/// @dev Tests that the getters return the correct values
function test_getters_works() external {
function test_getters_works() external view {
assertEq(address(livenessGuard.safe()), address(safeInstance.safe));
assertEq(livenessGuard.lastLive(address(0)), 0);
}
......
......@@ -99,7 +99,7 @@ contract LivenessModule_Constructor_TestFail is LivenessModule_TestInit {
contract LivenessModule_Getters_Test is LivenessModule_TestInit {
/// @dev Tests if the getters work correctly
function test_getters_works() external {
function test_getters_works() external view {
assertEq(address(livenessModule.safe()), address(safeInstance.safe));
assertEq(address(livenessModule.livenessGuard()), address(livenessGuard));
assertEq(livenessModule.livenessInterval(), 30 days);
......@@ -129,7 +129,7 @@ contract LivenessModule_CanRemove_Test is LivenessModule_TestInit {
contract LivenessModule_Get75PercentThreshold_Test is LivenessModule_TestInit {
/// @dev check the return values of the get75PercentThreshold function against manually
/// calculated values.
function test_get75PercentThreshold_Works() external {
function test_get75PercentThreshold_Works() external view {
assertEq(livenessModule.get75PercentThreshold(20), 15);
assertEq(livenessModule.get75PercentThreshold(19), 15);
assertEq(livenessModule.get75PercentThreshold(18), 14);
......
......@@ -20,7 +20,7 @@ contract PreimageOracle_Test is Test {
}
/// @notice Test the pre-image key computation with a known pre-image.
function test_keccak256PreimageKey_succeeds() public {
function test_keccak256PreimageKey_succeeds() public pure {
bytes memory preimage = hex"deadbeef";
bytes32 key = PreimageKeyLib.keccak256PreimageKey(preimage);
bytes32 known = 0x02fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1;
......
......@@ -22,7 +22,7 @@ contract AnchorStateRegistry_Init is FaultDisputeGame_Init {
contract AnchorStateRegistry_Initialize_Test is AnchorStateRegistry_Init {
/// @dev Tests that initialization is successful.
function test_initialize_succeeds() public {
function test_initialize_succeeds() public view {
(Hash cannonRoot, uint256 cannonL2BlockNumber) = anchorStateRegistry.anchors(GameTypes.CANNON);
(Hash permissionedCannonRoot, uint256 permissionedCannonL2BlockNumber) =
anchorStateRegistry.anchors(GameTypes.PERMISSIONED_CANNON);
......
......@@ -30,7 +30,7 @@ contract DelayedWETH_Init is CommonTest {
contract DelayedWETH_Initialize_Test is DelayedWETH_Init {
/// @dev Tests that initialization is successful.
function test_initialize_succeeds() public {
function test_initialize_succeeds() public view {
assertEq(delayedWeth.owner(), address(this));
assertEq(address(delayedWeth.config()), address(superchainConfig));
}
......
......@@ -195,7 +195,7 @@ contract DisputeGameFactory_SetInitBond_Test is DisputeGameFactory_Init {
contract DisputeGameFactory_GetGameUUID_Test is DisputeGameFactory_Init {
/// @dev Tests that the `getGameUUID` function returns the correct hash when comparing
/// against the keccak256 hash of the abi-encoded parameters.
function testDiff_getGameUUID_succeeds(uint32 gameType, Claim rootClaim, bytes calldata extraData) public {
function testDiff_getGameUUID_succeeds(uint32 gameType, Claim rootClaim, bytes calldata extraData) public view {
// Ensure that the `gameType` is within the bounds of the `GameType` enum's possible values.
GameType gt = GameType.wrap(uint8(bound(gameType, 0, 2)));
......@@ -208,7 +208,7 @@ contract DisputeGameFactory_GetGameUUID_Test is DisputeGameFactory_Init {
contract DisputeGameFactory_Owner_Test is DisputeGameFactory_Init {
/// @dev Tests that the `owner` function returns the correct address after deployment.
function test_owner_succeeds() public {
function test_owner_succeeds() public view {
assertEq(disputeGameFactory.owner(), address(this));
}
}
......
......@@ -123,27 +123,27 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
}
/// @dev Tests that the game's root claim is set correctly.
function test_rootClaim_succeeds() public {
function test_rootClaim_succeeds() public view {
assertEq(gameProxy.rootClaim().raw(), ROOT_CLAIM.raw());
}
/// @dev Tests that the game's extra data is set correctly.
function test_extraData_succeeds() public {
function test_extraData_succeeds() public view {
assertEq(gameProxy.extraData(), extraData);
}
/// @dev Tests that the game's starting timestamp is set correctly.
function test_createdAt_succeeds() public {
function test_createdAt_succeeds() public view {
assertEq(gameProxy.createdAt().raw(), block.timestamp);
}
/// @dev Tests that the game's type is set correctly.
function test_gameType_succeeds() public {
function test_gameType_succeeds() public view {
assertEq(gameProxy.gameType().raw(), GAME_TYPE.raw());
}
/// @dev Tests that the game's data is set correctly.
function test_gameData_succeeds() public {
function test_gameData_succeeds() public view {
(GameType gameType, Claim rootClaim, bytes memory _extraData) = gameProxy.gameData();
assertEq(gameType.raw(), GAME_TYPE.raw());
......@@ -205,7 +205,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
}
/// @dev Tests that the game is initialized with the correct data.
function test_initialize_correctData_succeeds() public {
function test_initialize_correctData_succeeds() public view {
// Assert that the root claim is initialized correctly.
(
uint32 parentIndex,
......@@ -264,7 +264,7 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
}
/// @dev Tests that the bond during the bisection game depths is correct.
function test_getRequiredBond_succeeds() public {
function test_getRequiredBond_succeeds() public view {
for (uint8 i = 0; i < uint8(gameProxy.splitDepth()); i++) {
Position pos = LibPosition.wrap(i, 0);
uint256 bond = gameProxy.getRequiredBond(pos);
......
......@@ -27,7 +27,7 @@ contract WETH98_Test is Test {
assertEq(weth.balanceOf(alice), 1 ether);
}
function test_getName_succeeds() public {
function test_getName_succeeds() public view {
assertEq(weth.name(), "Wrapped Ether");
assertEq(weth.symbol(), "WETH");
assertEq(weth.decimals(), 18);
......
......@@ -8,13 +8,13 @@ import "src/libraries/DisputeTypes.sol";
/// @notice Tests for `LibClock`
contract LibClock_Test is Test {
/// @notice Tests that the `duration` function correctly shifts out the `Duration` from a packed `Clock` type.
function testFuzz_duration_succeeds(Duration _duration, Timestamp _timestamp) public {
function testFuzz_duration_succeeds(Duration _duration, Timestamp _timestamp) public pure {
Clock clock = LibClock.wrap(_duration, _timestamp);
assertEq(Duration.unwrap(clock.duration()), Duration.unwrap(_duration));
}
/// @notice Tests that the `timestamp` function correctly shifts out the `Timestamp` from a packed `Clock` type.
function testFuzz_timestamp_succeeds(Duration _duration, Timestamp _timestamp) public {
function testFuzz_timestamp_succeeds(Duration _duration, Timestamp _timestamp) public pure {
Clock clock = LibClock.wrap(_duration, _timestamp);
assertEq(Timestamp.unwrap(clock.timestamp()), Timestamp.unwrap(_timestamp));
}
......
......@@ -15,6 +15,7 @@ contract LibGameId_Test is Test {
IDisputeGame _gameProxy
)
public
pure
{
GameId gameId = LibGameId.pack(_gameType, _timestamp, _gameProxy);
(GameType gameType_, Timestamp timestamp_, IDisputeGame gameProxy_) = LibGameId.unpack(gameId);
......
......@@ -24,7 +24,7 @@ contract LibPosition_Test is Test {
}
/// @notice Tests that the `depth` function correctly shifts out the `depth` from a packed `Position` type.
function testFuzz_depth_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_depth_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, 0, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
Position position = LibPosition.wrap(_depth, _indexAtDepth);
......@@ -33,7 +33,7 @@ contract LibPosition_Test is Test {
/// @notice Tests that the `indexAtDepth` function correctly shifts out the `indexAtDepth` from a packed `Position`
/// type.
function testFuzz_indexAtDepth_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_indexAtDepth_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, 0, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
Position position = LibPosition.wrap(_depth, _indexAtDepth);
......@@ -41,7 +41,7 @@ contract LibPosition_Test is Test {
}
/// @notice Tests that the `left` function correctly computes the position of the left child.
function testFuzz_left_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_left_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, 0, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -53,7 +53,7 @@ contract LibPosition_Test is Test {
}
/// @notice Tests that the `right` function correctly computes the position of the right child.
function testFuzz_right_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_right_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
// Depth bound: [0, 63]
_depth = uint8(bound(_depth, 0, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -66,7 +66,7 @@ contract LibPosition_Test is Test {
}
/// @notice Tests that the `parent` function correctly computes the position of the parent.
function testFuzz_parent_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_parent_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, 1, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -79,7 +79,7 @@ contract LibPosition_Test is Test {
/// @notice Tests that the `traceAncestor` function correctly computes the position of the
/// highest ancestor that commits to the same trace index.
function testFuzz_traceAncestor_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_traceAncestor_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, 1, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -95,7 +95,7 @@ contract LibPosition_Test is Test {
/// @notice Tests that the `traceAncestorBounded` function correctly computes the position of the
/// highest ancestor (below `SPLIT_DEPTH`) that commits to the same trace index.
function testFuzz_traceAncestorBounded_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_traceAncestorBounded_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
_depth = uint8(bound(_depth, SPLIT_DEPTH + 1, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -116,7 +116,14 @@ contract LibPosition_Test is Test {
/// @notice Tests that the `rightIndex` function correctly computes the deepest, right most index relative
/// to a given position.
function testFuzz_rightIndex_correctness_succeeds(uint8 _maxDepth, uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_rightIndex_correctness_succeeds(
uint8 _maxDepth,
uint8 _depth,
uint128 _indexAtDepth
)
public
pure
{
// Max depth bound: [1, 63]
// The max game depth MUST be at least 1.
_maxDepth = uint8(bound(_maxDepth, 1, MAX_DEPTH));
......@@ -138,7 +145,7 @@ contract LibPosition_Test is Test {
/// @notice Tests that the `attack` function correctly computes the position of the attack relative to
/// a given position.
/// @dev `attack` is an alias for `left`, but we test it separately for completeness.
function testFuzz_attack_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_attack_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
// Depth bound: [0, 63]
_depth = uint8(bound(_depth, 0, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -154,7 +161,7 @@ contract LibPosition_Test is Test {
/// a given position.
/// @dev A defense can only be given if the position does not belong to the root claim, hence the bound of [1, 127]
/// on the depth.
function testFuzz_defend_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public {
function testFuzz_defend_correctness_succeeds(uint8 _depth, uint128 _indexAtDepth) public pure {
// Depth bound: [1, 63]
_depth = uint8(bound(_depth, 1, MAX_DEPTH));
_indexAtDepth = boundIndexAtDepth(_depth, _indexAtDepth);
......@@ -168,7 +175,7 @@ contract LibPosition_Test is Test {
/// @notice A static unit test for the correctness of all gindicies, (depth, index) combos,
/// and the trace index in a tree of max depth = 4.
function test_pos_correctness_succeeds() public {
function test_pos_correctness_succeeds() public pure {
uint256 maxDepth = 4;
Position p = LibPosition.wrap(0, 0);
......
......@@ -16,7 +16,7 @@ contract GovernanceToken_Test is CommonTest {
}
/// @dev Tests that the constructor sets the correct initial state.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(governanceToken.owner(), owner);
assertEq(governanceToken.name(), "Optimism");
assertEq(governanceToken.symbol(), "OP");
......
......@@ -33,7 +33,7 @@ contract MintManager_Initializer is CommonTest {
contract MintManager_constructor_Test is MintManager_Initializer {
/// @dev Tests that the constructor properly configures the contract.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(manager.owner(), owner);
assertEq(address(manager.governanceToken()), address(gov));
}
......
......@@ -45,7 +45,7 @@ contract AddressAliasHelper_AddressAliasing_Invariant is StdInvariant, Invariant
/// Asserts that an address that has been aliased with
/// `applyL1ToL2Alias` can always be unaliased with
/// `undoL1ToL2Alias`.
function invariant_round_trip_aliasing() external {
function invariant_round_trip_aliasing() external view {
// ASSERTION: The round trip aliasing done in testRoundTrip(...) should never fail.
assertEq(actor.failedRoundtrip(), false);
}
......
......@@ -63,7 +63,7 @@ contract Burn_BurnEth_Invariant is StdInvariant, InvariantTest {
///
/// Asserts that when `Burn.eth(uint256)` is called, it always
/// burns the exact amount of ETH passed to the function.
function invariant_burn_eth() external {
function invariant_burn_eth() external view {
// ASSERTION: The amount burned should always match the amount passed exactly
assertEq(actor.failedEthBurn(), false);
}
......
......@@ -63,7 +63,7 @@ contract Burn_BurnGas_Invariant is StdInvariant, InvariantTest {
///
/// Asserts that when `Burn.gas(uint256)` is called, it always burns
/// at least the amount of gas passed to the function.
function invariant_burn_gas() external {
function invariant_burn_gas() external view {
// ASSERTION: The amount burned should always match the amount passed exactly
assertEq(actor.failedGasBurn(), false);
}
......
......@@ -140,7 +140,7 @@ contract XDM_MinGasLimits_Succeeds is XDM_MinGasLimits {
///
/// - The inner min gas limit is for the call from the
/// `L1CrossDomainMessenger` to the target contract.
function invariant_minGasLimits() external {
function invariant_minGasLimits() external view {
uint256 length = actor.numHashes();
for (uint256 i = 0; i < length; ++i) {
bytes32 hash = actor.hashes(i);
......@@ -173,7 +173,7 @@ contract XDM_MinGasLimits_Reverts is XDM_MinGasLimits {
///
/// - The inner min gas limit is for the call from the
/// `L1CrossDomainMessenger` to the target contract.
function invariant_minGasLimits() external {
function invariant_minGasLimits() external view {
uint256 length = actor.numHashes();
for (uint256 i = 0; i < length; ++i) {
bytes32 hash = actor.hashes(i);
......
......@@ -70,7 +70,7 @@ contract Encoding_Invariant is StdInvariant, InvariantTest {
///
/// Asserts that a raw versioned nonce can be encoded / decoded
/// to reach the same raw value.
function invariant_round_trip_encoding_AToB() external {
function invariant_round_trip_encoding_AToB() external view {
// ASSERTION: The round trip encoding done in testRoundTripAToB(...)
assertEq(actor.failedRoundtripAToB(), false);
}
......@@ -79,7 +79,7 @@ contract Encoding_Invariant is StdInvariant, InvariantTest {
///
/// Asserts that an encoded versioned nonce can always be decoded /
/// re-encoded to reach the same encoded value.
function invariant_round_trip_encoding_BToA() external {
function invariant_round_trip_encoding_BToA() external view {
// ASSERTION: The round trip encoding done in testRoundTripBToA should never
// fail.
assertEq(actor.failedRoundtripBToA(), false);
......
......@@ -116,7 +116,7 @@ contract Hashing_Invariant is StdInvariant, InvariantTest {
///
/// The `hashCrossDomainMessage` function should always revert if
/// the `version` passed is > `1`.
function invariant_hash_xdomain_msg_high_version() external {
function invariant_hash_xdomain_msg_high_version() external view {
// ASSERTION: The round trip aliasing done in testRoundTrip(...) should never fail.
assertFalse(actor.failedCrossDomainHashHighVersion());
}
......@@ -126,7 +126,7 @@ contract Hashing_Invariant is StdInvariant, InvariantTest {
///
/// If the version passed is 0, `hashCrossDomainMessage` and
/// `hashCrossDomainMessageV0` should be equivalent.
function invariant_hash_xdomain_msg_0() external {
function invariant_hash_xdomain_msg_0() external view {
// ASSERTION: A call to hashCrossDomainMessage and hashCrossDomainMessageV0
// should always match when the version passed is 0
assertFalse(actor.failedCrossDomainHashV0());
......@@ -137,7 +137,7 @@ contract Hashing_Invariant is StdInvariant, InvariantTest {
///
/// If the version passed is 1, `hashCrossDomainMessage` and
/// `hashCrossDomainMessageV1` should be equivalent.
function invariant_hash_xdomain_msg_1() external {
function invariant_hash_xdomain_msg_1() external view {
// ASSERTION: A call to hashCrossDomainMessage and hashCrossDomainMessageV1
// should always match when the version passed is 1
assertFalse(actor.failedCrossDomainHashV1());
......
......@@ -55,7 +55,7 @@ contract L2OutputOracle_MonotonicBlockNumIncrease_Invariant is CommonTest {
///
/// When a new output is submitted, it should never be allowed to
/// correspond to a block number that is less than the current output.
function invariant_monotonicBlockNumIncrease() external {
function invariant_monotonicBlockNumIncrease() external view {
// Assert that the block number of proposals must monotonically increase.
assertTrue(l2OutputOracle.nextBlockNumber() >= l2OutputOracle.latestBlockNumber());
}
......
......@@ -146,7 +146,7 @@ contract OptimismPortal_Deposit_Invariant is CommonTest {
///
/// All deposits, barring creation transactions and transactions
/// sent to `address(0)`, should always succeed.
function invariant_deposit_completes() external {
function invariant_deposit_completes() external view {
assertEq(actor.failedToComplete(), false);
}
}
......
......@@ -157,7 +157,7 @@ contract OptimismPortal2_Deposit_Invariant is CommonTest {
///
/// All deposits, barring creation transactions and transactions
/// sent to `address(0)`, should always succeed.
function invariant_deposit_completes() external {
function invariant_deposit_completes() external view {
assertEq(actor.failedToComplete(), false);
}
}
......
......@@ -160,7 +160,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
/// (and there were no empty blocks in between), ensure this
/// block's baseFee increased, but not by more than the max amount
/// per block.
function invariant_high_usage_raise_baseFee() external {
function invariant_high_usage_raise_baseFee() external view {
assertFalse(actor.failedRaiseBaseFee());
}
......@@ -169,7 +169,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
///
/// If the previous block used less than the target amount of gas,
/// the base fee should decrease, but not more than the max amount.
function invariant_low_usage_lower_baseFee() external {
function invariant_low_usage_lower_baseFee() external view {
assertFalse(actor.failedLowerBaseFee());
}
......@@ -177,7 +177,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
///
/// This test asserts that a block's base fee can never drop
/// below the `MINIMUM_BASE_FEE` threshold.
function invariant_never_below_min_baseFee() external {
function invariant_never_below_min_baseFee() external view {
assertFalse(actor.failedNeverBelowMinBaseFee());
}
......@@ -185,7 +185,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
///
/// This test asserts that a block can never consume more than
/// the `MAX_RESOURCE_LIMIT` gas threshold.
function invariant_never_above_max_gas_limit() external {
function invariant_never_above_max_gas_limit() external view {
assertFalse(actor.failedMaxGasPerBlock());
}
......@@ -195,7 +195,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
/// cannot be raised more than the maximum amount allowed. The max base
/// fee change (per-block) is derived as follows:
/// `prevBaseFee / BASE_FEE_MAX_CHANGE_DENOMINATOR`
function invariant_never_exceed_max_increase() external {
function invariant_never_exceed_max_increase() external view {
assertFalse(actor.failedMaxRaiseBaseFeePerBlock());
}
......@@ -205,7 +205,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
/// be lowered more than the maximum amount allowed. The max base fee
/// change (per-block) is derived as follows:
/// `prevBaseFee / BASE_FEE_MAX_CHANGE_DENOMINATOR`
function invariant_never_exceed_max_decrease() external {
function invariant_never_exceed_max_decrease() external view {
assertFalse(actor.failedMaxLowerBaseFeePerBlock());
}
......@@ -214,7 +214,7 @@ contract ResourceMetering_Invariant is StdInvariant, InvariantTest {
///
/// When calculating the `maxBaseFeeChange` after multiple empty blocks,
/// the calculation should never be allowed to underflow.
function invariant_never_underflow() external {
function invariant_never_underflow() external view {
assertFalse(actor.underflow());
}
}
......@@ -30,7 +30,7 @@ contract SafeCall_Succeeds_Invariants is InvariantTest {
///
/// If the check for remaining gas in `SafeCall.callWithMinGas` passes, the
/// subcontext of the call below it must be provided at least `minGas` gas.
function invariant_callWithMinGas_alwaysForwardsMinGas_succeeds() public {
function invariant_callWithMinGas_alwaysForwardsMinGas_succeeds() public view {
assertEq(actor.numCalls(), 0, "no failed calls allowed");
}
......@@ -63,7 +63,7 @@ contract SafeCall_Fails_Invariants is InvariantTest {
/// If there is not enough gas in the callframe to ensure that
/// `callWithMinGas` can provide the specified minimum gas limit
/// to the subcontext of the call, then `callWithMinGas` must revert.
function invariant_callWithMinGas_neverForwardsMinGas_reverts() public {
function invariant_callWithMinGas_neverForwardsMinGas_reverts() public view {
assertEq(actor.numCalls(), 0, "no successful calls allowed");
}
......
......@@ -64,7 +64,7 @@ contract SystemConfig_GasLimitLowerBound_Invariant is Test {
/// @custom:invariant The gas limit of the `SystemConfig` contract can never be lower
/// than the hard-coded lower bound.
function invariant_gasLimitLowerBound() external {
function invariant_gasLimitLowerBound() external view {
assertTrue(config.gasLimit() >= config.minimumGasLimit());
}
}
......@@ -52,7 +52,7 @@ contract DeploymentSummary_TestOptimismPortal is DeploymentSummary, OptimismPort
/// @dev Skips the first line of `super.test_constructor_succeeds` because
/// we're not exercising the `Deploy` logic in these tests. However,
/// the remaining assertions of the test are important to check
function test_constructor_succeeds() external override {
function test_constructor_succeeds() external view override {
// OptimismPortal opImpl = OptimismPortal(payable(deploy.mustGetAddress("OptimismPortal")));
OptimismPortal opImpl = OptimismPortal(payable(optimismPortalAddress));
assertEq(address(opImpl.l2Oracle()), address(0));
......@@ -64,7 +64,7 @@ contract DeploymentSummary_TestOptimismPortal is DeploymentSummary, OptimismPort
/// @dev Skips the first line of `super.test_initialize_succeeds` because
/// we're not exercising the `Deploy` logic in these tests. However,
/// the remaining assertions of the test are important to check
function test_initialize_succeeds() external override {
function test_initialize_succeeds() external view override {
// address guardian = deploy.cfg().superchainConfigGuardian();
address guardian = superchainConfig.guardian();
assertEq(address(optimismPortal.l2Oracle()), address(l2OutputOracle));
......@@ -108,7 +108,7 @@ contract DeploymentSummary_TestL1CrossDomainMessenger is DeploymentSummary, L1Cr
/// @dev Skips the first line of `super.test_constructor_succeeds` because
/// we're not exercising the `Deploy` logic in these tests. However,
/// the remaining assertions of the test are important to check
function test_constructor_succeeds() external override {
function test_constructor_succeeds() external view override {
// L1CrossDomainMessenger impl = L1CrossDomainMessenger(deploy.mustGetAddress("L1CrossDomainMessenger"));
L1CrossDomainMessenger impl = L1CrossDomainMessenger(l1CrossDomainMessengerAddress);
assertEq(address(impl.superchainConfig()), address(0));
......@@ -205,7 +205,7 @@ contract DeploymentSummary_TestL1ERC721Bridge is DeploymentSummary, L1ERC721Brid
/// @dev Skips the first line of `super.test_constructor_succeeds` because
/// we're not exercising the `Deploy` logic in these tests. However,
/// the remaining assertions of the test are important to check
function test_constructor_succeeds() public override {
function test_constructor_succeeds() public view override {
// L1ERC721Bridge impl = L1ERC721Bridge(deploy.mustGetAddress("L1ERC721Bridge"));
L1ERC721Bridge impl = L1ERC721Bridge(l1ERC721BridgeAddress);
assertEq(address(impl.MESSENGER()), address(0));
......@@ -241,7 +241,7 @@ contract DeploymentSummary_TestL1StandardBridge is
/// @dev Skips the first line of `super.test_constructor_succeeds` because
/// we're not exercising the `Deploy` logic in these tests. However,
/// the remaining assertions of the test are important to check
function test_constructor_succeeds() external override {
function test_constructor_succeeds() external view override {
// L1StandardBridge impl = L1StandardBridge(deploy.mustGetAddress("L1StandardBridge"));
L1StandardBridge impl = L1StandardBridge(payable(l1StandardBridgeAddress));
assertEq(address(impl.superchainConfig()), address(0));
......
......@@ -16,7 +16,7 @@ contract DeployerWhitelist_Test is Test {
}
/// @dev Tests that `owner` is initialized to the zero address.
function test_owner_succeeds() external {
function test_owner_succeeds() external view {
assertEq(list.owner(), address(0));
}
......
......@@ -37,7 +37,7 @@ contract L1BlockNumberTest is Test {
}
/// @dev Tests that `getL1BlockNumber` returns the set block number.
function test_getL1BlockNumber_succeeds() external {
function test_getL1BlockNumber_succeeds() external view {
assertEq(bn.getL1BlockNumber(), number);
}
......
......@@ -9,7 +9,7 @@ import { Bytes } from "src/libraries/Bytes.sol";
contract Bytes_slice_Test is Test {
/// @notice Tests that the `slice` function works as expected when starting from index 0.
function test_slice_fromZeroIdx_works() public {
function test_slice_fromZeroIdx_works() public pure {
bytes memory input = hex"11223344556677889900";
// Exhaustively check if all possible slices starting from index 0 are correct.
......@@ -28,7 +28,7 @@ contract Bytes_slice_Test is Test {
/// @notice Tests that the `slice` function works as expected when starting from indices [1, 9]
/// with lengths [1, 9], in reverse order.
function test_slice_fromNonZeroIdx_works() public {
function test_slice_fromNonZeroIdx_works() public pure {
bytes memory input = hex"11223344556677889900";
// Exhaustively check correctness of slices starting from indexes [1, 9]
......@@ -47,7 +47,7 @@ contract Bytes_slice_Test is Test {
/// @notice Tests that the `slice` function works as expected when slicing between multiple words
/// in memory. In this case, we test that a 2 byte slice between the 32nd byte of the
/// first word and the 1st byte of the second word is correct.
function test_slice_acrossWords_works() public {
function test_slice_acrossWords_works() public pure {
bytes memory input =
hex"00000000000000000000000000000000000000000000000000000000000000112200000000000000000000000000000000000000000000000000000000000000";
......@@ -57,7 +57,7 @@ contract Bytes_slice_Test is Test {
/// @notice Tests that the `slice` function works as expected when slicing between multiple
/// words in memory. In this case, we test that a 34 byte slice between 3 separate words
/// returns the correct result.
function test_slice_acrossMultipleWords_works() public {
function test_slice_acrossMultipleWords_works() public pure {
bytes memory input =
hex"000000000000000000000000000000000000000000000000000000000000001122FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1100000000000000000000000000000000000000000000000000000000000000";
bytes memory expected = hex"1122FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11";
......@@ -87,6 +87,8 @@ contract Bytes_slice_Test is Test {
// Slice the input bytes array from `_start` to `_start + _length`
bytes memory slice = Bytes.slice(_input, _start, _length);
vm.stopExpectSafeMemory();
// Grab the free memory pointer after the slice operation
uint64 finalPtr;
assembly {
......@@ -157,7 +159,7 @@ contract Bytes_slice_TestFail is Test {
contract Bytes_toNibbles_Test is Test {
/// @notice Tests that, given an input of 5 bytes, the `toNibbles` function returns an array of
/// 10 nibbles corresponding to the input data.
function test_toNibbles_expectedResult5Bytes_works() public {
function test_toNibbles_expectedResult5Bytes_works() public pure {
bytes memory input = hex"1234567890";
bytes memory expected = hex"01020304050607080900";
bytes memory actual = Bytes.toNibbles(input);
......@@ -170,7 +172,7 @@ contract Bytes_toNibbles_Test is Test {
/// @notice Tests that, given an input of 128 bytes, the `toNibbles` function returns an array
/// of 256 nibbles corresponding to the input data. This test exists to ensure that,
/// given a large input, the `toNibbles` function works as expected.
function test_toNibbles_expectedResult128Bytes_works() public {
function test_toNibbles_expectedResult128Bytes_works() public pure {
bytes memory input =
hex"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f";
bytes memory expected =
......@@ -184,7 +186,7 @@ contract Bytes_toNibbles_Test is Test {
/// @notice Tests that, given an input of 0 bytes, the `toNibbles` function returns a zero
/// length array.
function test_toNibbles_zeroLengthInput_works() public {
function test_toNibbles_zeroLengthInput_works() public pure {
bytes memory input = hex"";
bytes memory expected = hex"";
bytes memory actual = Bytes.toNibbles(input);
......@@ -211,6 +213,8 @@ contract Bytes_toNibbles_Test is Test {
// Pull out each individual nibble from the input bytes array
bytes memory nibbles = Bytes.toNibbles(_input);
vm.stopExpectSafeMemory();
// Grab the free memory pointer after the `toNibbles` operation
uint64 finalPtr;
assembly {
......@@ -262,14 +266,14 @@ contract Bytes_equal_Test is Test {
/// @notice Tests that the `equal` function in the `Bytes` library returns `false` if given two
/// non-equal byte arrays.
function testFuzz_equal_notEqual_works(bytes memory _a, bytes memory _b) public {
function testFuzz_equal_notEqual_works(bytes memory _a, bytes memory _b) public pure {
vm.assume(!manualEq(_a, _b));
assertFalse(Bytes.equal(_a, _b));
}
/// @notice Test whether or not the `equal` function in the `Bytes` library is equivalent to
/// manually checking equality of the two dynamic `bytes` arrays in memory.
function testDiff_equal_works(bytes memory _a, bytes memory _b) public {
function testDiff_equal_works(bytes memory _a, bytes memory _b) public pure {
assertEq(Bytes.equal(_a, _b), manualEq(_a, _b));
}
}
......@@ -6,7 +6,7 @@ import { Constants } from "src/libraries/Constants.sol";
contract Constants_Test is Test {
/// @notice Check EIP1967 related constants.
function test_eip1967Constants_succeeds() external {
function test_eip1967Constants_succeeds() external pure {
assertEq(
bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1), Constants.PROXY_IMPLEMENTATION_ADDRESS
);
......
......@@ -13,7 +13,7 @@ import { Encoding } from "src/libraries/Encoding.sol";
contract Encoding_Test is CommonTest {
/// @dev Tests encoding and decoding a nonce and version.
function testFuzz_nonceVersioning_succeeds(uint240 _nonce, uint16 _version) external {
function testFuzz_nonceVersioning_succeeds(uint240 _nonce, uint16 _version) external pure {
(uint240 nonce, uint16 version) = Encoding.decodeVersionedNonce(Encoding.encodeVersionedNonce(_nonce, _version));
assertEq(version, _version);
assertEq(nonce, _nonce);
......@@ -59,6 +59,7 @@ contract Encoding_Test is CommonTest {
bytes memory _data
)
external
pure
{
uint8 version = 0;
uint256 nonce = Encoding.encodeVersionedNonce(_nonce, version);
......
......@@ -14,7 +14,7 @@ import { Hashing } from "src/libraries/Hashing.sol";
contract Hashing_hashDepositSource_Test is CommonTest {
/// @notice Tests that hashDepositSource returns the correct hash in a simple case.
function test_hashDepositSource_succeeds() external {
function test_hashDepositSource_succeeds() external pure {
assertEq(
Hashing.hashDepositSource(0xd25df7858efc1778118fb133ac561b138845361626dfb976699c5287ed0f4959, 0x1),
0xf923fb07134d7d287cb52c770cc619e17e82606c21a875c92f4c63b65280a5cc
......@@ -53,6 +53,7 @@ contract Hashing_hashCrossDomainMessage_Test is CommonTest {
uint256 _messageNonce
)
external
pure
{
assertEq(
keccak256(LegacyCrossDomainUtils.encodeXDomainCalldata(_target, _sender, _message, _messageNonce)),
......
......@@ -6,15 +6,15 @@ import { Test } from "forge-std/Test.sol";
import { RLPReader } from "src/libraries/rlp/RLPReader.sol";
contract RLPReader_readBytes_Test is Test {
function test_readBytes_bytestring00_succeeds() external {
function test_readBytes_bytestring00_succeeds() external pure {
assertEq(RLPReader.readBytes(hex"00"), hex"00");
}
function test_readBytes_bytestring01_succeeds() external {
function test_readBytes_bytestring01_succeeds() external pure {
assertEq(RLPReader.readBytes(hex"01"), hex"01");
}
function test_readBytes_bytestring7f_succeeds() external {
function test_readBytes_bytestring7f_succeeds() external pure {
assertEq(RLPReader.readBytes(hex"7f"), hex"7f");
}
......@@ -45,12 +45,12 @@ contract RLPReader_readBytes_Test is Test {
}
contract RLPReader_readList_Test is Test {
function test_readList_empty_succeeds() external {
function test_readList_empty_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(hex"c0");
assertEq(list.length, 0);
}
function test_readList_multiList_succeeds() external {
function test_readList_multiList_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(hex"c6827a77c10401");
assertEq(list.length, 3);
......@@ -59,7 +59,7 @@ contract RLPReader_readList_Test is Test {
assertEq(RLPReader.readRawBytes(list[2]), hex"01");
}
function test_readList_shortListMax1_succeeds() external {
function test_readList_shortListMax1_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(
hex"f784617364668471776572847a78637684617364668471776572847a78637684617364668471776572847a78637684617364668471776572"
);
......@@ -78,7 +78,7 @@ contract RLPReader_readList_Test is Test {
assertEq(RLPReader.readRawBytes(list[10]), hex"8471776572");
}
function test_readList_longList1_succeeds() external {
function test_readList_longList1_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(
hex"f840cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376"
);
......@@ -90,7 +90,7 @@ contract RLPReader_readList_Test is Test {
assertEq(RLPReader.readRawBytes(list[3]), hex"cf84617364668471776572847a786376");
}
function test_readList_longList2_succeeds() external {
function test_readList_longList2_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(
hex"f90200cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376cf84617364668471776572847a786376"
);
......@@ -106,14 +106,14 @@ contract RLPReader_readList_Test is Test {
RLPReader.readList(hex"e1454545454545454545454545454545454545454545454545454545454545454545");
}
function test_readList_listOfLists_succeeds() external {
function test_readList_listOfLists_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(hex"c4c2c0c0c0");
assertEq(list.length, 2);
assertEq(RLPReader.readRawBytes(list[0]), hex"c2c0c0");
assertEq(RLPReader.readRawBytes(list[1]), hex"c0");
}
function test_readList_listOfLists2_succeeds() external {
function test_readList_listOfLists2_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(hex"c7c0c1c0c3c0c1c0");
assertEq(list.length, 3);
......@@ -122,7 +122,7 @@ contract RLPReader_readList_Test is Test {
assertEq(RLPReader.readRawBytes(list[2]), hex"c3c0c1c0");
}
function test_readList_dictTest1_succeeds() external {
function test_readList_dictTest1_succeeds() external pure {
RLPReader.RLPItem[] memory list = RLPReader.readList(
hex"ecca846b6579318476616c31ca846b6579328476616c32ca846b6579338476616c33ca846b6579348476616c34"
);
......
......@@ -5,41 +5,41 @@ import { RLPWriter } from "src/libraries/rlp/RLPWriter.sol";
import { Test } from "forge-std/Test.sol";
contract RLPWriter_writeString_Test is Test {
function test_writeString_empty_succeeds() external {
function test_writeString_empty_succeeds() external pure {
assertEq(RLPWriter.writeString(""), hex"80");
}
function test_writeString_bytestring00_succeeds() external {
function test_writeString_bytestring00_succeeds() external pure {
assertEq(RLPWriter.writeString("\u0000"), hex"00");
}
function test_writeString_bytestring01_succeeds() external {
function test_writeString_bytestring01_succeeds() external pure {
assertEq(RLPWriter.writeString("\u0001"), hex"01");
}
function test_writeString_bytestring7f_succeeds() external {
function test_writeString_bytestring7f_succeeds() external pure {
assertEq(RLPWriter.writeString("\u007F"), hex"7f");
}
function test_writeString_shortstring_succeeds() external {
function test_writeString_shortstring_succeeds() external pure {
assertEq(RLPWriter.writeString("dog"), hex"83646f67");
}
function test_writeString_shortstring2_succeeds() external {
function test_writeString_shortstring2_succeeds() external pure {
assertEq(
RLPWriter.writeString("Lorem ipsum dolor sit amet, consectetur adipisicing eli"),
hex"b74c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c69"
);
}
function test_writeString_longstring_succeeds() external {
function test_writeString_longstring_succeeds() external pure {
assertEq(
RLPWriter.writeString("Lorem ipsum dolor sit amet, consectetur adipisicing elit"),
hex"b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974"
);
}
function test_writeString_longstring2_succeeds() external {
function test_writeString_longstring2_succeeds() external pure {
assertEq(
RLPWriter.writeString(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mauris magna, suscipit sed vehicula non, iaculis faucibus tortor. Proin suscipit ultricies malesuada. Duis tortor elit, dictum quis tristique eu, ultrices at risus. Morbi a est imperdiet mi ullamcorper aliquet suscipit nec lorem. Aenean quis leo mollis, vulputate elit varius, consequat enim. Nulla ultrices turpis justo, et posuere urna consectetur nec. Proin non convallis metus. Donec tempor ipsum in mauris congue sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse convallis sem vel massa faucibus, eget lacinia lacus tempor. Nulla quis ultricies purus. Proin auctor rhoncus nibh condimentum mollis. Aliquam consequat enim at metus luctus, a eleifend purus egestas. Curabitur at nibh metus. Nam bibendum, neque at auctor tristique, lorem libero aliquet arcu, non interdum tellus lectus sit amet eros. Cras rhoncus, metus ac ornare cursus, dolor justo ultrices metus, at ullamcorper volutpat"
......@@ -50,45 +50,45 @@ contract RLPWriter_writeString_Test is Test {
}
contract RLPWriter_writeUint_Test is Test {
function test_writeUint_zero_succeeds() external {
function test_writeUint_zero_succeeds() external pure {
assertEq(RLPWriter.writeUint(0x0), hex"80");
}
function test_writeUint_smallint_succeeds() external {
function test_writeUint_smallint_succeeds() external pure {
assertEq(RLPWriter.writeUint(1), hex"01");
}
function test_writeUint_smallint2_succeeds() external {
function test_writeUint_smallint2_succeeds() external pure {
assertEq(RLPWriter.writeUint(16), hex"10");
}
function test_writeUint_smallint3_succeeds() external {
function test_writeUint_smallint3_succeeds() external pure {
assertEq(RLPWriter.writeUint(79), hex"4f");
}
function test_writeUint_smallint4_succeeds() external {
function test_writeUint_smallint4_succeeds() external pure {
assertEq(RLPWriter.writeUint(127), hex"7f");
}
function test_writeUint_mediumint_succeeds() external {
function test_writeUint_mediumint_succeeds() external pure {
assertEq(RLPWriter.writeUint(128), hex"8180");
}
function test_writeUint_mediumint2_succeeds() external {
function test_writeUint_mediumint2_succeeds() external pure {
assertEq(RLPWriter.writeUint(1000), hex"8203e8");
}
function test_writeUint_mediumint3_succeeds() external {
function test_writeUint_mediumint3_succeeds() external pure {
assertEq(RLPWriter.writeUint(100000), hex"830186a0");
}
}
contract RLPWriter_writeList_Test is Test {
function test_writeList_empty_succeeds() external {
function test_writeList_empty_succeeds() external pure {
assertEq(RLPWriter.writeList(new bytes[](0)), hex"c0");
}
function test_writeList_stringList_succeeds() external {
function test_writeList_stringList_succeeds() external pure {
bytes[] memory list = new bytes[](3);
list[0] = RLPWriter.writeString("dog");
list[1] = RLPWriter.writeString("god");
......@@ -97,7 +97,7 @@ contract RLPWriter_writeList_Test is Test {
assertEq(RLPWriter.writeList(list), hex"cc83646f6783676f6483636174");
}
function test_writeList_multiList_succeeds() external {
function test_writeList_multiList_succeeds() external pure {
bytes[] memory list = new bytes[](3);
bytes[] memory list2 = new bytes[](1);
list2[0] = RLPWriter.writeUint(4);
......@@ -109,7 +109,7 @@ contract RLPWriter_writeList_Test is Test {
assertEq(RLPWriter.writeList(list), hex"c6827a77c10401");
}
function test_writeList_shortListMax1_succeeds() external {
function test_writeList_shortListMax1_succeeds() external pure {
bytes[] memory list = new bytes[](11);
list[0] = RLPWriter.writeString("asdf");
list[1] = RLPWriter.writeString("qwer");
......@@ -129,7 +129,7 @@ contract RLPWriter_writeList_Test is Test {
);
}
function test_writeList_longlist1_succeeds() external {
function test_writeList_longlist1_succeeds() external pure {
bytes[] memory list = new bytes[](4);
bytes[] memory list2 = new bytes[](3);
......@@ -148,7 +148,7 @@ contract RLPWriter_writeList_Test is Test {
);
}
function test_writeList_longlist2_succeeds() external {
function test_writeList_longlist2_succeeds() external pure {
bytes[] memory list = new bytes[](32);
bytes[] memory list2 = new bytes[](3);
......@@ -166,7 +166,7 @@ contract RLPWriter_writeList_Test is Test {
);
}
function test_writeList_listoflists_succeeds() external {
function test_writeList_listoflists_succeeds() external pure {
// [ [ [], [] ], [] ]
bytes[] memory list = new bytes[](2);
bytes[] memory list2 = new bytes[](2);
......@@ -180,7 +180,7 @@ contract RLPWriter_writeList_Test is Test {
assertEq(RLPWriter.writeList(list), hex"c4c2c0c0c0");
}
function test_writeList_listoflists2_succeeds() external {
function test_writeList_listoflists2_succeeds() external pure {
// [ [], [[]], [ [], [[]] ] ]
bytes[] memory list = new bytes[](3);
list[0] = RLPWriter.writeList(new bytes[](0));
......@@ -199,7 +199,7 @@ contract RLPWriter_writeList_Test is Test {
assertEq(RLPWriter.writeList(list), hex"c7c0c1c0c3c0c1c0");
}
function test_writeList_dictTest1_succeeds() external {
function test_writeList_dictTest1_succeeds() external pure {
bytes[] memory list = new bytes[](4);
bytes[] memory list1 = new bytes[](2);
......
......@@ -13,7 +13,7 @@ contract MerkleTrie_get_Test is Test {
vm.label(address(ffi), "FFIInterface");
}
function test_get_validProof1_succeeds() external {
function test_get_validProof1_succeeds() external pure {
bytes32 root = 0xd582f99275e227a1cf4284899e5ff06ee56da8859be71b553397c69151bc942f;
bytes memory key = hex"6b6579326262";
bytes memory val = hex"6176616c32";
......@@ -26,7 +26,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof2_succeeds() external {
function test_get_validProof2_succeeds() external pure {
bytes32 root = 0xd582f99275e227a1cf4284899e5ff06ee56da8859be71b553397c69151bc942f;
bytes memory key = hex"6b6579316161";
bytes memory val = hex"303132333435363738393031323334353637383930313233343536373839303132333435363738397878";
......@@ -39,7 +39,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof3_succeeds() external {
function test_get_validProof3_succeeds() external pure {
bytes32 root = 0xf838216fa749aefa91e0b672a9c06d3e6e983f913d7107b5dab4af60b5f5abed;
bytes memory key = hex"6b6579316161";
bytes memory val = hex"303132333435363738393031323334353637383930313233343536373839303132333435363738397878";
......@@ -50,7 +50,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof4_succeeds() external {
function test_get_validProof4_succeeds() external pure {
bytes32 root = 0x37956bab6bba472308146808d5311ac19cb4a7daae5df7efcc0f32badc97f55e;
bytes memory key = hex"6b6579316161";
bytes memory val = hex"3031323334";
......@@ -60,7 +60,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof5_succeeds() external {
function test_get_validProof5_succeeds() external pure {
bytes32 root = 0xcb65032e2f76c48b82b5c24b3db8f670ce73982869d38cd39a624f23d62a9e89;
bytes memory key = hex"6b657931";
bytes memory val =
......@@ -75,7 +75,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof6_succeeds() external {
function test_get_validProof6_succeeds() external pure {
bytes32 root = 0xcb65032e2f76c48b82b5c24b3db8f670ce73982869d38cd39a624f23d62a9e89;
bytes memory key = hex"6b657932";
bytes memory val = hex"73686f7274";
......@@ -88,7 +88,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof7_succeeds() external {
function test_get_validProof7_succeeds() external pure {
bytes32 root = 0xcb65032e2f76c48b82b5c24b3db8f670ce73982869d38cd39a624f23d62a9e89;
bytes memory key = hex"6b657933";
bytes memory val = hex"31323334353637383930313233343536373839303132333435363738393031";
......@@ -102,7 +102,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof8_succeeds() external {
function test_get_validProof8_succeeds() external pure {
bytes32 root = 0x72e6c01ad0c9a7b517d4bc68a5b323287fe80f0e68f5415b4b95ecbc8ad83978;
bytes memory key = hex"61";
bytes memory val = hex"61";
......@@ -114,7 +114,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof9_succeeds() external {
function test_get_validProof9_succeeds() external pure {
bytes32 root = 0x72e6c01ad0c9a7b517d4bc68a5b323287fe80f0e68f5415b4b95ecbc8ad83978;
bytes memory key = hex"62";
bytes memory val = hex"62";
......@@ -126,7 +126,7 @@ contract MerkleTrie_get_Test is Test {
assertEq(val, MerkleTrie.get(key, proof, root));
}
function test_get_validProof10_succeeds() external {
function test_get_validProof10_succeeds() external pure {
bytes32 root = 0x72e6c01ad0c9a7b517d4bc68a5b323287fe80f0e68f5415b4b95ecbc8ad83978;
bytes memory key = hex"63";
bytes memory val = hex"63";
......
......@@ -44,7 +44,7 @@ contract AssetReceiver_Initializer is Test {
contract AssetReceiverTest is AssetReceiver_Initializer {
/// @notice Tests if the owner was set correctly during deploy.
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(address(alice), assetReceiver.owner());
}
......
......@@ -34,7 +34,7 @@ contract Transactor_Initializer is Test {
contract TransactorTest is Transactor_Initializer {
/// @notice Tests if the owner was set correctly during deploy
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(address(alice), transactor.owner());
}
......
......@@ -18,7 +18,7 @@ contract CheckBalanceLowTest is Test {
/// @notice Fuzz the `check` function and assert that it always returns true
/// when the target's balance is smaller than the threshold.
function testFuzz_check_succeeds(address _target, uint256 _threshold) external {
function testFuzz_check_succeeds(address _target, uint256 _threshold) external view {
CheckBalanceLow.Params memory p = CheckBalanceLow.Params({ target: _target, threshold: _threshold });
vm.assume(_target.balance < _threshold);
......
......@@ -40,7 +40,7 @@ contract CheckGelatoLowTest is Test {
/// @notice Fuzz the `check` function and assert that it always returns true
/// when the user's balance in the treasury is less than the threshold.
function testFuzz_check_succeeds(uint256 _threshold, address _recipient) external {
function testFuzz_check_succeeds(uint256 _threshold, address _recipient) external view {
CheckGelatoLow.Params memory p =
CheckGelatoLow.Params({ treasury: address(gelato), threshold: _threshold, recipient: _recipient });
......
......@@ -16,7 +16,7 @@ contract CheckTrueTest is Test {
}
/// @notice Fuzz the `check` function and assert that it always returns true.
function testFuzz_always_true_succeeds(bytes memory input) external {
function testFuzz_always_true_succeeds(bytes memory input) external view {
assertEq(c.check(input), true);
}
}
......@@ -99,7 +99,7 @@ contract Faucet_Initializer is Test {
}
contract FaucetTest is Faucet_Initializer {
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(faucet.ADMIN(), faucetContractAdmin);
}
......
......@@ -203,7 +203,7 @@ contract Optimist_Initializer is Test {
contract OptimistTest is Optimist_Initializer {
/// @notice Check that constructor and initializer parameters are correctly set.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
// expect name to be set
assertEq(optimist.name(), name);
// expect symbol to be set
......@@ -498,7 +498,7 @@ contract OptimistTest is Optimist_Initializer {
}
/// @notice Should support ERC-721 interface.
function test_supportsInterface_returnsCorrectInterfaceForERC721_succeeds() external {
function test_supportsInterface_returnsCorrectInterfaceForERC721_succeeds() external view {
bytes4 iface721 = type(IERC721).interfaceId;
// check that it supports ERC-721 interface
assertEq(optimist.supportsInterface(iface721), true);
......
......@@ -120,7 +120,7 @@ contract OptimistAllowlist_Initializer is Test {
}
contract OptimistAllowlistTest is OptimistAllowlist_Initializer {
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
// expect attestationStation to be set
assertEq(address(optimistAllowlist.ATTESTATION_STATION()), address(attestationStation));
assertEq(optimistAllowlist.ALLOWLIST_ATTESTOR(), alice_allowlistAttestor);
......@@ -129,7 +129,7 @@ contract OptimistAllowlistTest is OptimistAllowlist_Initializer {
}
/// @notice Base case, a account without any relevant attestations should not be able to mint.
function test_isAllowedToMint_withoutAnyAttestations_fails() external {
function test_isAllowedToMint_withoutAnyAttestations_fails() external view {
assertFalse(optimistAllowlist.isAllowedToMint(bob));
}
......
......@@ -222,7 +222,7 @@ contract OptimistInviter_Initializer is Test {
}
contract OptimistInviterTest is OptimistInviter_Initializer {
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
// expect attestationStation to be set
assertEq(address(optimistInviter.ATTESTATION_STATION()), address(attestationStation));
assertEq(optimistInviter.INVITE_GRANTER(), alice_inviteGranter);
......
......@@ -18,6 +18,7 @@ contract CommonTest is Test, Setup, Events {
FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi"))))));
bool usePlasmaOverride;
bool useFaultProofs;
function setUp() public virtual override {
alice = makeAddr("alice");
......@@ -31,6 +32,9 @@ contract CommonTest is Test, Setup, Events {
if (usePlasmaOverride) {
deploy.cfg().setUsePlasma(true);
}
if (useFaultProofs) {
deploy.cfg().setUseFaultProofs(true);
}
vm.etch(address(ffi), vm.getDeployedCode("FFIInterface.sol:FFIInterface"));
vm.label(address(ffi), "FFIInterface");
......@@ -103,13 +107,7 @@ contract CommonTest is Test, Setup, Events {
revert("CommonTest: Cannot enable fault proofs after deployment. Consider overriding `setUp`.");
}
// Set `useFaultProofs` to `true` in the deploy config so that the deploy script deploys the Fault Proof system.
// This directly overrides the deploy config's `useFaultProofs` value, if the test requires it.
vm.store(
address(uint160(uint256(keccak256(abi.encode("optimism.deployconfig"))))),
USE_FAULT_PROOFS_SLOT,
bytes32(uint256(1))
);
useFaultProofs = true;
}
function enablePlasma() public {
......
......@@ -31,7 +31,7 @@ contract CrossDomainMessenger_BaseGas_Test is Bridge_Initializer {
/// or equal to the minimum gas limit value on the OptimismPortal.
/// This guarantees that the messengers will always pass sufficient
/// gas to the OptimismPortal.
function testFuzz_baseGas_portalMinGasLimit_succeeds(bytes memory _data, uint32 _minGasLimit) external {
function testFuzz_baseGas_portalMinGasLimit_succeeds(bytes memory _data, uint32 _minGasLimit) external view {
vm.assume(_data.length <= type(uint64).max);
uint64 baseGas = l1CrossDomainMessenger.baseGas(_data, _minGasLimit);
uint64 minGasLimit = optimismPortal.minimumGasLimit(uint64(_data.length));
......
......@@ -10,14 +10,14 @@ import { FeeVault } from "src/universal/FeeVault.sol";
// Test the implementations of the FeeVault
contract FeeVault_Test is Bridge_Initializer {
/// @dev Tests that the constructor sets the correct values.
function test_constructor_l1FeeVault_succeeds() external {
function test_constructor_l1FeeVault_succeeds() external view {
assertEq(l1FeeVault.RECIPIENT(), deploy.cfg().l1FeeVaultRecipient());
assertEq(l1FeeVault.MIN_WITHDRAWAL_AMOUNT(), deploy.cfg().l1FeeVaultMinimumWithdrawalAmount());
assertEq(uint8(l1FeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L1));
}
/// @dev Tests that the constructor sets the correct values.
function test_constructor_baseFeeVault_succeeds() external {
function test_constructor_baseFeeVault_succeeds() external view {
assertEq(baseFeeVault.RECIPIENT(), deploy.cfg().baseFeeVaultRecipient());
assertEq(baseFeeVault.MIN_WITHDRAWAL_AMOUNT(), deploy.cfg().baseFeeVaultMinimumWithdrawalAmount());
assertEq(uint8(baseFeeVault.WITHDRAWAL_NETWORK()), uint8(FeeVault.WithdrawalNetwork.L1));
......
......@@ -9,23 +9,23 @@ contract OptimismMintableERC20_Test is Bridge_Initializer {
event Mint(address indexed account, uint256 amount);
event Burn(address indexed account, uint256 amount);
function test_remoteToken_succeeds() external {
function test_remoteToken_succeeds() external view {
assertEq(L2Token.remoteToken(), address(L1Token));
}
function test_bridge_succeeds() external {
function test_bridge_succeeds() external view {
assertEq(L2Token.bridge(), address(l2StandardBridge));
}
function test_l1Token_succeeds() external {
function test_l1Token_succeeds() external view {
assertEq(L2Token.l1Token(), address(L1Token));
}
function test_l2Bridge_succeeds() external {
function test_l2Bridge_succeeds() external view {
assertEq(L2Token.l2Bridge(), address(l2StandardBridge));
}
function test_legacy_succeeds() external {
function test_legacy_succeeds() external view {
// Getters for the remote token
assertEq(L2Token.REMOTE_TOKEN(), address(L1Token));
assertEq(L2Token.remoteToken(), address(L1Token));
......@@ -73,7 +73,7 @@ contract OptimismMintableERC20_Test is Bridge_Initializer {
L2Token.burn(alice, 100);
}
function test_erc165_supportsInterface_succeeds() external {
function test_erc165_supportsInterface_succeeds() external view {
// The assertEq calls in this test are comparing the manual calculation of the iface,
// with what is returned by the solidity's type().interfaceId, just to be safe.
bytes4 iface1 = bytes4(keccak256("supportsInterface(bytes4)"));
......
......@@ -25,7 +25,7 @@ contract OptimismMintableTokenFactory_Test is Bridge_Initializer {
}
/// @dev Tests that the proxy is initialized correctly.
function test_initialize_succeeds() external {
function test_initialize_succeeds() external view {
assertEq(address(l1OptimismMintableERC20Factory.BRIDGE()), address(l1StandardBridge));
assertEq(address(l1OptimismMintableERC20Factory.bridge()), address(l1StandardBridge));
}
......
......@@ -30,7 +30,7 @@ contract OptimismMintableERC721_Test is Bridge_Initializer {
vm.label(address(L2NFT), "L2ERC721Token");
}
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(L2NFT.name(), "L2NFT");
assertEq(L2NFT.symbol(), "L2T");
assertEq(L2NFT.remoteToken(), address(L1NFT));
......@@ -42,7 +42,7 @@ contract OptimismMintableERC721_Test is Bridge_Initializer {
}
/// @notice Ensure that the contract supports the expected interfaces.
function test_supportsInterfaces_succeeds() external {
function test_supportsInterfaces_succeeds() external view {
// Checks if the contract supports the IOptimismMintableERC721 interface.
assertTrue(L2NFT.supportsInterface(type(IOptimismMintableERC721).interfaceId));
// Checks if the contract supports the IERC721Enumerable interface.
......
......@@ -21,7 +21,7 @@ contract OptimismMintableERC721Factory_Test is Bridge_Initializer {
vm.label(address(factory), "OptimismMintableERC721Factory");
}
function test_constructor_succeeds() external {
function test_constructor_succeeds() external view {
assertEq(factory.BRIDGE(), address(l2ERC721Bridge));
assertEq(factory.REMOTE_CHAIN_ID(), 1);
}
......
......@@ -80,11 +80,11 @@ contract ProxyAdmin_Test is Test {
admin.setProxyType(address(0), ProxyAdmin.ProxyType.CHUGSPLASH);
}
function test_owner_succeeds() external {
function test_owner_succeeds() external view {
assertEq(admin.owner(), alice);
}
function test_proxyType_succeeds() external {
function test_proxyType_succeeds() external view {
assertEq(uint256(admin.proxyType(address(proxy))), uint256(ProxyAdmin.ProxyType.ERC1967));
assertEq(uint256(admin.proxyType(address(chugsplash))), uint256(ProxyAdmin.ProxyType.CHUGSPLASH));
assertEq(uint256(admin.proxyType(address(resolved))), uint256(ProxyAdmin.ProxyType.RESOLVED));
......@@ -117,19 +117,19 @@ contract ProxyAdmin_Test is Test {
}
}
function test_erc1967GetProxyAdmin_succeeds() external {
function test_erc1967GetProxyAdmin_succeeds() external view {
getProxyAdmin(payable(proxy));
}
function test_chugsplashGetProxyAdmin_succeeds() external {
function test_chugsplashGetProxyAdmin_succeeds() external view {
getProxyAdmin(payable(chugsplash));
}
function test_delegateResolvedGetProxyAdmin_succeeds() external {
function test_delegateResolvedGetProxyAdmin_succeeds() external view {
getProxyAdmin(payable(resolved));
}
function getProxyAdmin(address payable _proxy) internal {
function getProxyAdmin(address payable _proxy) internal view {
address owner = admin.getProxyAdmin(_proxy);
assertEq(owner, address(admin));
}
......
......@@ -78,7 +78,7 @@ contract StandardBridge_Stateless_Test is CommonTest {
/// This function should return true for both modern and legacy
/// OptimismMintableERC20 tokens and false for any accounts that
/// do not implement the interface.
function test_isOptimismMintableERC20_succeeds() external {
function test_isOptimismMintableERC20_succeeds() external view {
// Both the modern and legacy mintable tokens should return true
assertTrue(bridge.isOptimismMintableERC20(address(mintable)));
assertTrue(bridge.isOptimismMintableERC20(address(legacy)));
......@@ -111,7 +111,7 @@ contract StandardBridge_Stateless_Test is CommonTest {
}
/// @notice The bridge by default should be unpaused.
function test_paused_succeeds() external {
function test_paused_succeeds() external view {
assertFalse(bridge.paused());
}
}
......@@ -6,7 +6,7 @@ import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
contract AddressAliasHelper_applyAndUndo_Test is Test {
/// @notice Tests that applying and then undoing an alias results in the original address.
function testFuzz_applyAndUndo_succeeds(address _address) external {
function testFuzz_applyAndUndo_succeeds(address _address) external pure {
address aliased = AddressAliasHelper.applyL1ToL2Alias(_address);
address unaliased = AddressAliasHelper.undoL1ToL2Alias(aliased);
assertEq(_address, unaliased);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment