Skip to content

Commit

Permalink
feat: config script for the votes aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosgj94 committed Mar 24, 2024
1 parent 63aa742 commit 079882c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions script/3.SetL2BridgeSettings.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console2} from "forge-std/Script.sol";
import {L2VetoAggregation} from "../src/L2VetoAggregation.sol";
import {IVotesUpgradeable} from "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol";

contract Deploy is Script {
address l2VetoAggregation;
address l2LzEndpoint;
address l1Plugin;
uint16 l1ChainId;

function setUp() public {
l2VetoAggregation = vm.envAddress("L2_VETO_AGGREGATION");
l2LzEndpoint = vm.envAddress("LZ_L2_ENDPOINT");
l1Plugin = vm.envAddress("L1_PLUGIN");
l1ChainId = uint16(vm.envUint("L1_CHAIN_ID"));
}

function run() public {
// 0. Setting up Foundry
vm.startBroadcast(vm.envUint("PRIVATE_KEY"));

// 1. Create the seetings for the L2 Bridge
L2VetoAggregation.BridgeSettings
memory l2BridgeSettings = L2VetoAggregation.BridgeSettings(
l1ChainId,
l2LzEndpoint,
l1Plugin
);

// 2. Initialize the L2 Veto Aggregation
L2VetoAggregation(l2VetoAggregation).initialize(l2BridgeSettings);

vm.stopBroadcast();
}
}

0 comments on commit 079882c

Please sign in to comment.