Skip to content

Commit

Permalink
fix: forge build now specifies correct script directory (#174)
Browse files Browse the repository at this point in the history
* fix: configure correct script dir

* fix: scripts such that they build
  • Loading branch information
shaspitz authored Jun 26, 2024
1 parent 8760588 commit 32da5a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[profile.default]
src = 'contracts'
solc-version = '0.8.20'
script = 'scripts'
out = 'out'
libs = ['node_modules', 'lib']
test = 'test'
Expand Down
1 change: 0 additions & 1 deletion contracts/scripts/DeployScripts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
13 changes: 8 additions & 5 deletions contracts/scripts/DeployStandardBridge.s.sol
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
// 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 {

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));
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 32da5a3

Please sign in to comment.