From 4640763e263d2d699544d3c2d0eaecdb91d01883 Mon Sep 17 00:00:00 2001 From: Mark Toda Date: Mon, 18 Mar 2024 18:33:25 -0400 Subject: [PATCH] feat: add v2 deployment --- script/DeployDutchV2.s.sol | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 script/DeployDutchV2.s.sol diff --git a/script/DeployDutchV2.s.sol b/script/DeployDutchV2.s.sol new file mode 100644 index 00000000..78c78d8c --- /dev/null +++ b/script/DeployDutchV2.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.8.13; + +import "forge-std/console2.sol"; +import "forge-std/Script.sol"; +import {IPermit2} from "permit2/src/interfaces/IPermit2.sol"; +import {V2DutchOrderReactor} from "../src/reactors/V2DutchOrderReactor.sol"; + +struct V2DutchOrderDeployment { + IPermit2 permit2; + V2DutchOrderReactor reactor; +} + +contract DeployDutchV2 is Script { + address constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3; + + function setUp() public {} + + function run() public returns (V2DutchOrderDeployment memory deployment) { + address owner = vm.envAddress("FOUNDRY_REACTOR_OWNER"); + console2.log("Owner", owner); + vm.startBroadcast(); + + V2DutchOrderReactor reactor = new V2DutchOrderReactor{salt: 0x00}(IPermit2(PERMIT2), owner); + console2.log("Reactor", address(reactor)); + + vm.stopBroadcast(); + + return V2DutchOrderDeployment(IPermit2(PERMIT2), reactor); + } +}