diff --git a/deploy/foundry/fundDisputerWhitelist.s.sol b/deploy/foundry/fundDisputerWhitelist.s.sol new file mode 100644 index 0000000..5dbf97d --- /dev/null +++ b/deploy/foundry/fundDisputerWhitelist.s.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.17; + +import { Script } from "forge-std/Script.sol"; +import { BaseScript } from "../utils/Base.s.sol"; +import { console } from "forge-std/console.sol"; + +// NOTE: This script is used to fund the whitelist of disputers for a given chain. +// Can be executed with (0.1 ether = 100000000000000000 wei): +// forge script deploy/foundry/fundDisputerWhitelist.s.sol:FundDisputerWhitelistScript \ +// -vvvv \ +// --rpc-url localhost \ +// --sig "run(uint256,address[])" \ +// 100000000000000000 "[0xeA05F9001FbDeA6d4280879f283Ff9D0b282060e,0x0dd2Ea40A3561C309C03B96108e78d06E8A1a99B,0xF4c94b2FdC2efA4ad4b831f312E7eF74890705DA]" +contract FundDisputerWhitelistScript is Script, BaseScript { + function run(uint256 fundAmount, address[] calldata whitelist) external { + uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); + console.log("Chain ID:", block.chainid); + + vm.startBroadcast(deployerPrivateKey); + + // Fund each whitelisted address + for (uint256 i = 0; i < whitelist.length; i++) { + address recipient = whitelist[i]; + console.log("Funding whitelist address:", recipient); + + // Transfer native token + (bool success, ) = recipient.call{ value: fundAmount }(""); + require(success, "Transfer failed"); + + console.log("Funded with amount:", fundAmount); + } + + vm.stopBroadcast(); + + // Print summary + console.log("\n=== Funding Summary ==="); + console.log("Amount per address:", fundAmount); + console.log("Number of addresses funded:", whitelist.length); + } +} diff --git a/deploy/foundry/merklDeploy.s.sol b/deploy/foundry/merklDeploy.s.sol index 3742f7d..7c19ee4 100644 --- a/deploy/foundry/merklDeploy.s.sol +++ b/deploy/foundry/merklDeploy.s.sol @@ -17,6 +17,7 @@ import { ICore } from "../../contracts/interfaces/ICore.sol"; import { BaseScript } from "../utils/Base.s.sol"; import { MockToken } from "../../contracts/mock/MockToken.sol"; +// NOTE: Before running this script on a new chain, make sure to create the AngleLabs multisig and update the sdk with the new address contract MainDeployScript is Script, BaseScript, JsonReader { uint256 private DEPLOYER_PRIVATE_KEY; uint256 private MERKL_DEPLOYER_PRIVATE_KEY;