From ba9e3cd95689aa4fce995ba7a47a45b84f2a259e Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:11:11 -0700 Subject: [PATCH 1/2] fix: configure correct script dir --- contracts/foundry.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 706e8903e..2e0fbdb0f 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -1,6 +1,7 @@ [profile.default] src = 'contracts' solc-version = '0.8.20' +script = 'scripts' out = 'out' libs = ['node_modules', 'lib'] test = 'test' From 79a4e93e04a94bb5a04c6589d7d843db17387bc1 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:11:58 -0700 Subject: [PATCH 2/2] fix: scripts such that they build --- contracts/scripts/DeployScripts.s.sol | 1 - contracts/scripts/DeployStandardBridge.s.sol | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/contracts/scripts/DeployScripts.s.sol b/contracts/scripts/DeployScripts.s.sol index 99f298dc7..47ea90fbb 100644 --- a/contracts/scripts/DeployScripts.s.sol +++ b/contracts/scripts/DeployScripts.s.sol @@ -6,7 +6,6 @@ import "../contracts/ProviderRegistry.sol"; import "../contracts/PreConfCommitmentStore.sol"; import "../contracts/Oracle.sol"; import "../contracts/Whitelist.sol"; -import "../contracts/validator-registry/ValidatorRegistryV1.sol"; import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import "../contracts/BlockTracker.sol"; diff --git a/contracts/scripts/DeployStandardBridge.s.sol b/contracts/scripts/DeployStandardBridge.s.sol index 03ee32b44..cc4719cec 100644 --- a/contracts/scripts/DeployStandardBridge.s.sol +++ b/contracts/scripts/DeployStandardBridge.s.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BSL 1.1 pragma solidity ^0.8.20; import "forge-std/Script.sol"; -import {Create2Deployer} from "../scripts/DeployScripts.s.sol"; import {SettlementGateway} from "../contracts/standard-bridge/SettlementGateway.sol"; import {L1Gateway} from "../contracts/standard-bridge/L1Gateway.sol"; import {Whitelist} from "../contracts/Whitelist.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; +import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; contract DeploySettlementGateway is Script { function run() external { @@ -13,23 +13,26 @@ contract DeploySettlementGateway is Script { vm.startBroadcast(); address relayerAddr = vm.envAddress("RELAYER_ADDR"); + require(relayerAddr != address(0), "RELAYER_ADDR is not set"); + address whitelistAddr = vm.envAddress("WHITELIST_ADDR"); + require(whitelistAddr != address(0), "WHITELIST_ADDR is not set"); address sgProxy = Upgrades.deployUUPSProxy( "SettlementGateway.sol", abi.encodeCall(SettlementGateway.initialize, - (msg.sender, // Owner + (whitelistAddr, + msg.sender, // Owner relayerAddr, 1, 1)) // Fees set to 1 wei for now ); SettlementGateway gateway = SettlementGateway(sgProxy); console.log("Standard bridge gateway for settlement chain deployed to:", address(gateway)); - address whitelistProxy = Upgrades.deployUUPSProxy( "Whitelist.sol", abi.encodeCall(Whitelist.initialize, (msg.sender)) ); - Whitelist whitelist = Whitelist(whitelistProxy); + Whitelist whitelist = Whitelist(payable(whitelistProxy)); console.log("Whitelist deployed to:", address(whitelist)); whitelist.addToWhitelist(address(gateway)); @@ -62,7 +65,7 @@ contract DeployL1Gateway is Script { relayerAddr, 1, 1)) // Fees set to 1 wei for now ); - L1Gateway gateway = L1Gateway(l1gProxy); + L1Gateway gateway = L1Gateway(payable(l1gProxy)); console.log("Standard bridge gateway for l1 deployed to:", address(gateway));