Skip to content

Commit

Permalink
change some deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
radar bear committed Sep 5, 2024
1 parent 8809cd5 commit 2e3d442
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 25 deletions.
1 change: 1 addition & 0 deletions script/deployChainlinkDSPortal.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions script/deployDistrobutor.s.sol

This file was deleted.

45 changes: 45 additions & 0 deletions script/deployFundingRateLimiterZK.s.sol
Original file line number Diff line number Diff line change
@@ -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);
}
}
42 changes: 42 additions & 0 deletions script/deployMerkle.sol
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 2e3d442

Please sign in to comment.