From 5904d583c7b2b966d756dff83eaa13bc5061f382 Mon Sep 17 00:00:00 2001 From: Ezequiel Date: Wed, 8 May 2024 15:56:31 -0300 Subject: [PATCH] feat: add foundry deployment script --- scripts/state/Deploy.s.sol | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/state/Deploy.s.sol diff --git a/scripts/state/Deploy.s.sol b/scripts/state/Deploy.s.sol new file mode 100644 index 0000000..07b6581 --- /dev/null +++ b/scripts/state/Deploy.s.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {Script, console2} from "forge-std/Script.sol"; +import {IOverlayV1Factory} from "@overlay-protocol/v1-core/contracts/interfaces/IOverlayV1Factory.sol"; +import {OverlayV1State} from "contracts/OverlayV1State.sol"; + +// 1. Set required environment variables: ETHERSCAN_API_KEY, DEPLOYER_PK, RPC. +// 2. Run with: +// $ source .env +// $ forge script scripts/state/Deploy.s.sol:DeployScript --rpc-url $RPC --verify -vvvv --broadcast + +contract DeployScript is Script { + // TODO: update values as needed + address constant FACTORY = 0x8cCD181113c7Ae40f31D5e8178a98A1A60B55c4C; + + function run() external { + uint256 DEPLOYER_PK = vm.envUint("DEPLOYER_PK"); + + vm.startBroadcast(DEPLOYER_PK); + + // + + OverlayV1State state = new OverlayV1State(IOverlayV1Factory(FACTORY)); + + // + + vm.stopBroadcast(); + + console2.log("OverlayV1State deployed at:", address(state)); + } +}