From 2c55c5d15c0180c71be85282b387c2eb4437e407 Mon Sep 17 00:00:00 2001 From: Alex Roan Date: Fri, 15 Sep 2023 12:37:22 +0100 Subject: [PATCH] Helper script to set the forwarder --- script/SetForwarderAddress.s.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 script/SetForwarderAddress.s.sol diff --git a/script/SetForwarderAddress.s.sol b/script/SetForwarderAddress.s.sol new file mode 100644 index 0000000..d642c18 --- /dev/null +++ b/script/SetForwarderAddress.s.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {GMXAutomationBase} from "../src/GMXAutomationBase.sol"; +import {TestData} from "../test/TestData.sol"; +// forge-std +import {Script} from "forge-std/Script.sol"; + +contract SetForwarderAddress is Script, TestData { + // TODO: FILL THESE IN BEFORE RUNNING + address public constant AUTOMATION_CONTRACT = address(0); + address public constant FORWARDER_ADDRESS = address(0); + + function run() external { + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + GMXAutomationBase(AUTOMATION_CONTRACT).setForwarderAddress(FORWARDER_ADDRESS); + vm.stopBroadcast(); + } +}