From 2e3d44278a0796d640a72cb02d1556d63109880b Mon Sep 17 00:00:00 2001 From: radar bear Date: Thu, 5 Sep 2024 01:36:35 -0400 Subject: [PATCH] change some deploy script --- script/deployChainlinkDSPortal.s.sol | 1 + script/deployDistrobutor.s.sol | 25 -------------- script/deployFundingRateLimiterZK.s.sol | 45 +++++++++++++++++++++++++ script/deployMerkle.sol | 42 +++++++++++++++++++++++ 4 files changed, 88 insertions(+), 25 deletions(-) delete mode 100644 script/deployDistrobutor.s.sol create mode 100644 script/deployFundingRateLimiterZK.s.sol create mode 100644 script/deployMerkle.sol diff --git a/script/deployChainlinkDSPortal.s.sol b/script/deployChainlinkDSPortal.s.sol index e178e78..702117b 100644 --- a/script/deployChainlinkDSPortal.s.sol +++ b/script/deployChainlinkDSPortal.s.sol @@ -43,6 +43,7 @@ contract ChainlinkDSPortalScript is Script { inputs[7] = Utils.bytesToStringWithout0x(arguments); Utils.logInputs(inputs); } +} contract ChainlinkDSPortalScriptBaseTestnet is Script { // add this to be excluded from coverage report diff --git a/script/deployDistrobutor.s.sol b/script/deployDistrobutor.s.sol deleted file mode 100644 index f0be500..0000000 --- a/script/deployDistrobutor.s.sol +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -pragma solidity ^0.8.19; - -import "../lib/forge-std/src/Script.sol"; -import "../src/token/MerkleDistributorWithDeadline.sol"; - -contract MerkleDistributorWithDeadlineScript is Script { - // add this to be excluded from coverage report - function test() public { } - - function run() external { - uint256 deployerPrivateKey = vm.envUint("JOJO_BASE_TEST_DEPLOYER_PK"); - vm.startBroadcast(deployerPrivateKey); - new MerkleDistributorWithDeadline( - // token - 0xA42589C591f8AE08B0e2C2C18439d72628a66c3E, - // root - 0xdd456584bb08073476d98226fcacbce40633adbf1b7fe4e0ad4cef1f462e98b6, - // timestamp - 1724860800 - ); - vm.stopBroadcast(); - } -} diff --git a/script/deployFundingRateLimiterZK.s.sol b/script/deployFundingRateLimiterZK.s.sol new file mode 100644 index 0000000..06eac81 --- /dev/null +++ b/script/deployFundingRateLimiterZK.s.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.8.19; + +import "../lib/forge-std/src/Script.sol"; +import "../src/fundingRateLimiter/FundingRateUpdateLimiterZK.sol"; +import "./utils.s.sol"; + +contract FundingRateUpdateLimiterZKScript is Script { + // add this to be excluded from coverage report + function test() public { } + + function run() external { + uint256 deployerPrivateKey = vm.envUint("JOJO_DEPLOYER_PK"); + vm.startBroadcast(deployerPrivateKey); + // Testnet + address _dealer = 0x65bE09345311aCc72d9358Ea7d7B13A91DFF51B6; + uint8 _speedMultiplier = 3; + address _brevisProof = 0x9Bb46D5100d2Db4608112026951c9C965b233f4D; + address _owner = 0xF1D7Ac5Fd1b806d24bCd2764C7c29A9fAd51698B; + bytes32 _vkHash = 0x289682858ff8c014eb45e19b4275de16f705ca841dcaccc0583bd8dc7fd76745; + + FundingRateUpdateLimiterZK limiter = new FundingRateUpdateLimiterZK( + _dealer, + _speedMultiplier, + _brevisProof + ); + limiter.setVkHash(_vkHash); + limiter.transferOwnership(_owner); + vm.stopBroadcast(); + + string memory chainId = vm.envString("CHAIN_ID"); + bytes memory arguments = abi.encode(_dealer,_speedMultiplier,_brevisProof); + string[] memory inputs = new string[](8); + inputs[0] = "forge"; + inputs[1] = "verify-contract"; + inputs[2] = Utils.addressToString(address(limiter)); + inputs[3] = "src/fundingRateLimiter/FundingRateUpdateLimiterZK.sol:FundingRateUpdateLimiterZK"; + inputs[4] = "--chain-id"; + inputs[5] = chainId; + inputs[6] = "--constructor-args"; + inputs[7] = Utils.bytesToStringWithout0x(arguments); + Utils.logInputs(inputs); + } +} diff --git a/script/deployMerkle.sol b/script/deployMerkle.sol new file mode 100644 index 0000000..5f302ca --- /dev/null +++ b/script/deployMerkle.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.8.19; + +import "../lib/forge-std/src/Script.sol"; +import "../src/token/MerkleDistributorWithDeadline.sol"; +import "./utils.s.sol"; + +contract DeployMerkleDistributor is Script { + // add this to be excluded from coverage report + function test() public { } + + function run() external { + uint256 deployerPrivateKey = vm.envUint("JOJO_DEPLOYER_PK"); + vm.startBroadcast(deployerPrivateKey); + address token = 0x0645bC5cDff2376089323Ac20Df4119e48e4BCc4; + bytes32 root = 0x915135dccd7288b4da16541980aa0cb78e5166f48b22029dcf8104dd84c0419a; + uint256 endTime = 1727740800; + MerkleDistributorWithDeadline distributor = new MerkleDistributorWithDeadline( + // token + token, + // root + root, + // timestamp + endTime + ); + vm.stopBroadcast(); + + string memory chainId = vm.envString("CHAIN_ID"); + bytes memory arguments = abi.encode(token,root,endTime); + string[] memory inputs = new string[](8); + inputs[0] = "forge"; + inputs[1] = "verify-contract"; + inputs[2] = Utils.addressToString(address(distributor)); + inputs[3] = "src/token/MerkleDistributorWithDeadline.sol:MerkleDistributorWithDeadline"; + inputs[4] = "--chain-id"; + inputs[5] = chainId; + inputs[6] = "--constructor-args"; + inputs[7] = Utils.bytesToStringWithout0x(arguments); + Utils.logInputs(inputs); + } +}