diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml index 74d6a0d4f..fb2554411 100644 --- a/.github/workflows/rainix.yaml +++ b/.github/workflows/rainix.yaml @@ -61,4 +61,9 @@ jobs: DEPLOY_BROADCAST: "" DEPLOY_VERIFIER: "" DEPLOY_METABOARD_ADDRESS: ${{ vars.CI_DEPLOY_SEPOLIA_METABOARD_ADDRESS }} + CI_DEPLOY_ARBITRUM_RPC_URL: ${{ secrets.CI_DEPLOY_ARBITRUM_RPC_URL || vars.CI_DEPLOY_ARBITRUM_RPC_URL || '' }} + CI_DEPLOY_BASE_RPC_URL: ${{ secrets.CI_DEPLOY_BASE_RPC_URL || vars.CI_DEPLOY_BASE_RPC_URL || '' }} + CI_DEPLOY_BASE_SEPOLIA_RPC_URL: ${{ secrets.CI_DEPLOY_BASE_SEPOLIA_RPC_URL || vars.CI_DEPLOY_BASE_SEPOLIA_RPC_URL || '' }} + CI_DEPLOY_FLARE_RPC_URL: ${{ secrets.CI_DEPLOY_FLARE_RPC_URL || vars.CI_DEPLOY_FLARE_RPC_URL || '' }} + CI_DEPLOY_POLYGON_RPC_URL: ${{ secrets.CI_DEPLOY_POLYGON_RPC_URL || vars.CI_DEPLOY_POLYGON_RPC_URL || '' }} run: nix develop -c ${{ matrix.task }} diff --git a/foundry.lock b/foundry.lock index 004d595a2..139dc6894 100644 --- a/foundry.lock +++ b/foundry.lock @@ -12,7 +12,7 @@ "rev": "83e607990be8b3e06549338043c6b18f430f6bd2" }, "lib/rain.metadata": { - "rev": "a823381df1a118fe0e217150a416566e0c182210" + "rev": "cda61a682e6cbc954d3ad8b50913a9058c834283" }, "lib/rain.string": { "rev": "488f237cd59874e4eb91b5a4f747bd57578fec7f" diff --git a/lib/rain.metadata b/lib/rain.metadata index a823381df..cda61a682 160000 --- a/lib/rain.metadata +++ b/lib/rain.metadata @@ -1 +1 @@ -Subproject commit a823381df1a118fe0e217150a416566e0c182210 +Subproject commit cda61a682e6cbc954d3ad8b50913a9058c834283 diff --git a/test/src/lib/deploy/LibInterpreterDeployProd.t.sol b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol new file mode 100644 index 000000000..80e527149 --- /dev/null +++ b/test/src/lib/deploy/LibInterpreterDeployProd.t.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: LicenseRef-DCL-1.0 +// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd +pragma solidity =0.8.25; + +import {Test} from "forge-std/Test.sol"; +import {LibRainDeploy} from "rain.deploy/lib/LibRainDeploy.sol"; +import {LibInterpreterDeploy} from "../../../../src/lib/deploy/LibInterpreterDeploy.sol"; + +/// @title LibInterpreterDeployProdTest +/// @notice Forks each supported network and verifies that all five interpreter +/// contracts are deployed at the expected addresses with the expected codehash. +contract LibInterpreterDeployProdTest is Test { + function _checkAllContracts() internal view { + assertTrue(LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.code.length > 0, "Parser not deployed"); + assertEq(LibInterpreterDeploy.PARSER_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.PARSER_DEPLOYED_CODEHASH); + + assertTrue(LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.code.length > 0, "Store not deployed"); + assertEq(LibInterpreterDeploy.STORE_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.STORE_DEPLOYED_CODEHASH); + + assertTrue(LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.code.length > 0, "Interpreter not deployed"); + assertEq( + LibInterpreterDeploy.INTERPRETER_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.INTERPRETER_DEPLOYED_CODEHASH + ); + + assertTrue( + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_ADDRESS.code.length > 0, "ExpressionDeployer not deployed" + ); + assertEq( + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_ADDRESS.codehash, + LibInterpreterDeploy.EXPRESSION_DEPLOYER_DEPLOYED_CODEHASH + ); + + assertTrue(LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.code.length > 0, "Rainlang not deployed"); + assertEq( + LibInterpreterDeploy.RAINLANG_DEPLOYED_ADDRESS.codehash, LibInterpreterDeploy.RAINLANG_DEPLOYED_CODEHASH + ); + } + + /// All five contracts MUST be deployed on Arbitrum. + function testProdDeployArbitrum() external { + vm.createSelectFork(LibRainDeploy.ARBITRUM_ONE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Base. + function testProdDeployBase() external { + vm.createSelectFork(LibRainDeploy.BASE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Base Sepolia. + function testProdDeployBaseSepolia() external { + vm.createSelectFork(LibRainDeploy.BASE_SEPOLIA); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Flare. + function testProdDeployFlare() external { + vm.createSelectFork(LibRainDeploy.FLARE); + _checkAllContracts(); + } + + /// All five contracts MUST be deployed on Polygon. + function testProdDeployPolygon() external { + vm.createSelectFork(LibRainDeploy.POLYGON); + _checkAllContracts(); + } +}