Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .soldeerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.gitignore
.gitmodules
.pre-commit-config.yaml
.prettierignore
.soldeerignore
.vscode
CLAUDE.md
Expand Down
56 changes: 10 additions & 46 deletions test/lib/deploy/LibMetaBoardDeploy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {LibMetaBoardDeploy} from "src/lib/deploy/LibMetaBoardDeploy.sol";
import {MetaBoard} from "src/concrete/MetaBoard.sol";

contract LibMetaBoardDeployTest is Test {
/// Arbitrum Nitro genesis block. Archive RPCs can't serve blocks before this.
uint256 constant ARBITRUM_NITRO_GENESIS_BLOCK = 22207817;

function testDeployAddress() external {
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
// Ethereum mainnet has the zoltu factory deployed but no MetaBoard,
// so the deterministic deploy cannot collide with a live deployment.
// ETHEREUM_RPC_URL is exported by the rainix rpc-preflight in CI.
vm.createSelectFork(vm.envString("ETHEREUM_RPC_URL"));

address deployedAddress = LibRainDeploy.deployZoltu(type(MetaBoard).creationCode);

Expand Down Expand Up @@ -59,48 +59,12 @@ contract LibMetaBoardDeployTest is Test {
checkProdDeployment("POLYGON_RPC_URL");
}

function findStartBlock(string memory rpcEnvVar, uint256 searchFrom) internal returns (uint256) {
vm.createSelectFork(vm.envString(rpcEnvVar));
return LibRainDeploy.findDeployBlock(
vm,
LibMetaBoardDeploy.METABOARD_DEPLOYED_ADDRESS,
LibMetaBoardDeploy.METABOARD_DEPLOYED_CODEHASH,
searchFrom
);
}

/// findDeployBlock binary searches via rollFork which hits RPC rate limits
/// in CI. Skipped there; the isStartBlock tests verify correctness cheaply.
/// Arbitrum is always skipped because Foundry's rollFork maps to L1 block
/// numbers, not L2. The Arbitrum start block was found via manual binary
/// search using eth_getCode RPC calls against L2 block numbers.
// function testStartBlockArbitrum() external {
// assertEq(
// findStartBlock("ARBITRUM_RPC_URL", ARBITRUM_NITRO_GENESIS_BLOCK),
// LibMetaBoardDeploy.METABOARD_START_BLOCK_ARBITRUM
// );
// }

function testStartBlockBase() external {
vm.skip(vm.envOr("CI", false));
assertEq(findStartBlock("BASE_RPC_URL", 0), LibMetaBoardDeploy.METABOARD_START_BLOCK_BASE);
}

function testStartBlockBaseSepolia() external {
vm.skip(vm.envOr("CI", false));
assertEq(findStartBlock("BASE_SEPOLIA_RPC_URL", 0), LibMetaBoardDeploy.METABOARD_START_BLOCK_BASE_SEPOLIA);
}

function testStartBlockFlare() external {
vm.skip(vm.envOr("CI", false));
assertEq(findStartBlock("FLARE_RPC_URL", 0), LibMetaBoardDeploy.METABOARD_START_BLOCK_FLARE);
}

function testStartBlockPolygon() external {
vm.skip(vm.envOr("CI", false));
assertEq(findStartBlock("POLYGON_RPC_URL", 0), LibMetaBoardDeploy.METABOARD_START_BLOCK_POLYGON);
}

/// Start block DISCOVERY (`LibRainDeploy.findDeployBlock`) is deliberately
/// not tested here: its rollFork binary search hits RPC rate limits, and on
/// Arbitrum rollFork maps to L1 block numbers, not L2 (the Arbitrum start
/// block was found via manual binary search using eth_getCode RPC calls
/// against L2 block numbers). The `testIsStartBlock*` tests below verify
/// the pinned constants directly and cheaply instead.
function checkIsStartBlock(string memory rpcEnvVar, uint256 startBlock) internal {
vm.createSelectFork(vm.envString(rpcEnvVar));
assertTrue(
Expand Down
Loading