Skip to content

Commit

Permalink
feat: dry run and prod files
Browse files Browse the repository at this point in the history
  • Loading branch information
deluca-mike committed Mar 27, 2024
1 parent 73747a9 commit 4f0295b
Show file tree
Hide file tree
Showing 19 changed files with 360 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage-summary:

# Deployment helpers
deploy-dry-run:
./set-epochs.sh -p dry-run && forge script script/Deploy.s.sol --skip src --skip test --rpc-url sepolia --broadcast --slow -vvv
./set-epochs.sh -p dry-run && forge script script/DeployDryRun.s.sol --skip src --skip test --rpc-url sepolia --broadcast --slow -vvv

deploy-staging:
./set-epochs.sh -p staging && forge script script/Deploy.s.sol --skip src --skip test --rpc-url sepolia --broadcast --slow -vvv
Expand All @@ -22,7 +22,7 @@ deploy-dev:
./set-epochs.sh -p dev && forge script script/Deploy.s.sol --skip src --skip test --rpc-url sepolia --broadcast --slow -vvv

deploy-production:
./set-epochs.sh -p production && forge script script/Deploy.s.sol --skip src --skip test --rpc-url mainnet --broadcast --slow -vvv
./set-epochs.sh -p production && forge script script/DeployProduction.s.sol --skip src --skip test --rpc-url mainnet --broadcast --slow -vvv

deploy-local:
./set-epochs.sh -p dev && forge script script/Deploy.s.sol --skip src --skip test --rpc-url localhost --broadcast --slow -vvv
Expand Down
52 changes: 52 additions & 0 deletions abi/Registrar.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "CLOCK_MODE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "addToList",
Expand All @@ -28,6 +41,45 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "clock",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint48",
"internalType": "uint48"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "clockPeriod",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "clockStartingTimestamp",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "emergencyGovernor",
Expand Down
2 changes: 1 addition & 1 deletion bytecode/DistributionVault.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/EmergencyGovernor.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/EmergencyGovernorDeployer.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/PowerToken.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/PowerTokenDeployer.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/Registrar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/StandardGovernor.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/StandardGovernorDeployer.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/ZeroGovernor.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bytecode/ZeroToken.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/protocol
2 changes: 1 addition & 1 deletion lib/ttg
Submodule ttg updated from 1f2343 to 01097b
24 changes: 6 additions & 18 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ pragma solidity 0.8.23;

import { Script, console2 } from "../lib/forge-std/src/Script.sol";

import { IRegistrar } from "../lib/ttg/src/interfaces/IRegistrar.sol";
import { IMinterGateway } from "../lib/protocol/src/interfaces/IMinterGateway.sol";
import { Logger } from "./Logger.sol";

import { DeployBase } from "./DeployBase.sol";

contract Deploy is Script, DeployBase {
uint256 internal constant _STANDARD_PROPOSAL_FEE = 0.5 ether;
contract DeployDryRun is Script, DeployBase {
uint256 internal constant _STANDARD_PROPOSAL_FEE = 0.01 ether;

address internal constant _WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // Mainnet WETH
address internal constant _WETH = 0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9; // NOTE: Populate with WETH.

// NOTE: Populate these arrays with Power ad Zero starting accounts respectively.
address[][2] _initialAccounts = [
Expand All @@ -21,7 +20,7 @@ contract Deploy is Script, DeployBase {
];

// NOTE: Populate these arrays with Power ad Zero starting balances respectively.
uint256[][2] _initialBalances = [[uint256(10_000)], [uint256(1_000_000_000e6)]];
uint256[][2] _initialBalances = [[uint256(1)], [uint256(1_000_000e6)]];

function run() external {
(address deployer_, ) = deriveRememberKey(vm.envString("MNEMONIC"), 0);
Expand All @@ -46,17 +45,6 @@ contract Deploy is Script, DeployBase {

vm.stopBroadcast();

console2.log("Minter Gateway address:", minterGateway_);
console2.log("M Token address:", IMinterGateway(minterGateway_).mToken());
console2.log("Earner Rate Model address:", earnerRateModel_);
console2.log("Minter Rate Model address:", minterRateModel_);

console2.log("Registrar Address:", ttgRegistrar_);
console2.log("Power Token Address:", IRegistrar(ttgRegistrar_).powerToken());
console2.log("Zero Token Address:", IRegistrar(ttgRegistrar_).zeroToken());
console2.log("Standard Governor Address:", IRegistrar(ttgRegistrar_).standardGovernor());
console2.log("Emergency Governor Address:", IRegistrar(ttgRegistrar_).emergencyGovernor());
console2.log("Zero Governor Address:", IRegistrar(ttgRegistrar_).zeroGovernor());
console2.log("Distribution Vault Address:", IRegistrar(ttgRegistrar_).vault());
Logger.logContracts(ttgRegistrar_, minterGateway_, minterRateModel_, earnerRateModel_);
}
}
205 changes: 205 additions & 0 deletions script/DeployDryRun.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.23;

import { Script, console2 } from "../lib/forge-std/src/Script.sol";

import { Logger } from "./Logger.sol";

import { DeployBase } from "./DeployBase.sol";

contract DeployDryRun is Script, DeployBase {
uint256 internal constant _STANDARD_PROPOSAL_FEE = 0.01 ether;

address internal constant _WETH = 0xE67ABDA0D43f7AC8f37876bBF00D1DFadbB93aaa; // Sepolia WETH

// NOTE: Populate these arrays with Power ad Zero starting accounts respectively.
address[][2] _initialAccounts = [
[
address(0xfa65B58D50a1904D22a9b5dcE1f6F08a4E12aB9e),
address(0x21EC143CB7cAfA4A16Eb1AAdAd9095E1d1D570bE),
address(0x8fc4a0908574f02a3000e37616827A26894a9E2e),
address(0xD4ab5deb6874893D7A386cCA9367cDCa8e52a58B),
address(0x76C052F12258Ed5BD7144bB8Cc4Cee6700c6b671),
address(0x55A79a2B559e85438Ea3025D6226b7d8a757db8d),
address(0x4A64eB0F986b86F7Ff92E5218dF7141690eBbb05),
address(0xA41134003daDBc44872aBB08a0FB7f3E0261836E),
address(0xF77EFB221D52285f627e0d563410413aFe63bf03),
address(0x8F6155300ae3010e9F9e4C87E0304457C11df840),
address(0x4AD2b7dC6E32C7712295fa39633CfF5c8c96D527),
address(0x4B7537B99B8fcd7828Af2429Dbd5a7D1590524fD),
address(0xF3Cfe30e96D018F9BF1DbE11BF61a46285771521),
address(0x55f6bb5Dc25d34c9d0A5e87736B7ecefC01312d0),
address(0xa0263acF572888e4b67BF453a93186b6Aea8D05e),
address(0x935409981a62e28b51e5405286eb44E787afd852),
address(0x1622F8C365B75fa047f2D4a45198aA540C12eD5A),
address(0x7D6105D75C5E6A40791a50a52a92365545e9B112),
address(0x0e72b902EcB7AB5a5737257fff3e680aDA2C6c49),
address(0xaDd9E9Fb7777a95D65fc0b8dB0660094B200E583),
address(0x910555405Ddf2a8f066F88137EF088033AA53d35),
address(0x83e16B16BAABBa5Af1e0B06a7e1bF26F427C2Dfc),
address(0x1F511D3647DDB3dA0b94f969650165baF28e72Ea),
address(0x986d22508044Cc16C85E7602a7818e789C8B75A9),
address(0x079d13B2E33260c9F22B8Bd8cd8f69Dd5697e865),
address(0xfd5ce934530dCCf240C72287A59Fe2e9Dda6FeEc),
address(0x881B885f20c4A0236bF1175f0498005C649A505C),
address(0xa5e1E933373eaBC3be71b267Da1524177151D596),
address(0x21e4Ba500a05D37416dbdB403edC3E2b6f287d41),
address(0xEA33C571a093F54D6817Cb33703707082E86c607),
address(0x0552FF21688705848118374A2486A074eAc317cF),
address(0x8D400c5448EF07ef9196794f57E0DeAa631bAD5b),
address(0x7A104038E679d742e068bef2f802B68D4865ecb5),
address(0x7428D7CAEe5fFcae87ADF9B8D66BD77e77e52E92),
address(0xDeD054Fcb48388447f4B14016A3E9B418507EFfe),
address(0xe9B7351A4f4D307BCa99bB8Cfd698443E0BA4BC2),
address(0x7A2c177fdDB05B59ab3795943a227cb1fb0694F5)
],
[
address(0xfa65B58D50a1904D22a9b5dcE1f6F08a4E12aB9e),
address(0x21EC143CB7cAfA4A16Eb1AAdAd9095E1d1D570bE),
address(0x8fc4a0908574f02a3000e37616827A26894a9E2e),
address(0xD4ab5deb6874893D7A386cCA9367cDCa8e52a58B),
address(0x76C052F12258Ed5BD7144bB8Cc4Cee6700c6b671),
address(0x55A79a2B559e85438Ea3025D6226b7d8a757db8d),
address(0x4A64eB0F986b86F7Ff92E5218dF7141690eBbb05),
address(0xA41134003daDBc44872aBB08a0FB7f3E0261836E),
address(0xF77EFB221D52285f627e0d563410413aFe63bf03),
address(0x8F6155300ae3010e9F9e4C87E0304457C11df840),
address(0x4AD2b7dC6E32C7712295fa39633CfF5c8c96D527),
address(0x4B7537B99B8fcd7828Af2429Dbd5a7D1590524fD),
address(0xF3Cfe30e96D018F9BF1DbE11BF61a46285771521),
address(0x55f6bb5Dc25d34c9d0A5e87736B7ecefC01312d0),
address(0xa0263acF572888e4b67BF453a93186b6Aea8D05e),
address(0x935409981a62e28b51e5405286eb44E787afd852),
address(0x1622F8C365B75fa047f2D4a45198aA540C12eD5A),
address(0x7D6105D75C5E6A40791a50a52a92365545e9B112),
address(0x0e72b902EcB7AB5a5737257fff3e680aDA2C6c49),
address(0xaDd9E9Fb7777a95D65fc0b8dB0660094B200E583),
address(0x910555405Ddf2a8f066F88137EF088033AA53d35),
address(0x83e16B16BAABBa5Af1e0B06a7e1bF26F427C2Dfc),
address(0x1F511D3647DDB3dA0b94f969650165baF28e72Ea),
address(0x986d22508044Cc16C85E7602a7818e789C8B75A9),
address(0x079d13B2E33260c9F22B8Bd8cd8f69Dd5697e865),
address(0xfd5ce934530dCCf240C72287A59Fe2e9Dda6FeEc),
address(0x881B885f20c4A0236bF1175f0498005C649A505C),
address(0xa5e1E933373eaBC3be71b267Da1524177151D596),
address(0x21e4Ba500a05D37416dbdB403edC3E2b6f287d41),
address(0xEA33C571a093F54D6817Cb33703707082E86c607),
address(0x0552FF21688705848118374A2486A074eAc317cF),
address(0x8D400c5448EF07ef9196794f57E0DeAa631bAD5b),
address(0x7A104038E679d742e068bef2f802B68D4865ecb5),
address(0x7428D7CAEe5fFcae87ADF9B8D66BD77e77e52E92),
address(0xDeD054Fcb48388447f4B14016A3E9B418507EFfe),
address(0xe9B7351A4f4D307BCa99bB8Cfd698443E0BA4BC2),
address(0x7A2c177fdDB05B59ab3795943a227cb1fb0694F5)
]
];

// NOTE: Populate these arrays with Power ad Zero starting balances respectively.
uint256[][2] _initialBalances = [
[
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1),
uint256(1)
],
[
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027),
uint256(27_027_027_027027)
]
];

function run() external {
(address deployer_, ) = deriveRememberKey(vm.envString("MNEMONIC"), 0);

console2.log("Deployer:", deployer_);

vm.startBroadcast(deployer_);

(
address ttgRegistrar_,
address minterGateway_,
address minterRateModel_,
address earnerRateModel_
) = deployCore(
deployer_,
vm.getNonce(deployer_),
_initialAccounts,
_initialBalances,
_STANDARD_PROPOSAL_FEE,
_WETH
);

vm.stopBroadcast();

Logger.logContracts(ttgRegistrar_, minterGateway_, minterRateModel_, earnerRateModel_);
}
}
50 changes: 50 additions & 0 deletions script/DeployProduction.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.23;

import { Script, console2 } from "../lib/forge-std/src/Script.sol";

import { Logger } from "./Logger.sol";

import { DeployBase } from "./DeployBase.sol";

contract DeployProduction is Script, DeployBase {
uint256 internal constant _STANDARD_PROPOSAL_FEE = 0.5 ether;

address internal constant _WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // Mainnet WETH

// NOTE: Populate these arrays with Power ad Zero starting accounts respectively.
address[][2] _initialAccounts = [
[address(0xdeaDDeADDEaDdeaDdEAddEADDEAdDeadDEADDEaD)],
[address(0xdeaDDeADDEaDdeaDdEAddEADDEAdDeadDEADDEaD)]
];

// NOTE: Populate these arrays with Power ad Zero starting balances respectively.
uint256[][2] _initialBalances = [[uint256(10_000)], [uint256(1_000_000_000e6)]];

function run() external {
(address deployer_, ) = deriveRememberKey(vm.envString("MNEMONIC"), 0);

console2.log("Deployer:", deployer_);

vm.startBroadcast(deployer_);

(
address ttgRegistrar_,
address minterGateway_,
address minterRateModel_,
address earnerRateModel_
) = deployCore(
deployer_,
vm.getNonce(deployer_),
_initialAccounts,
_initialBalances,
_STANDARD_PROPOSAL_FEE,
_WETH
);

vm.stopBroadcast();

Logger.logContracts(ttgRegistrar_, minterGateway_, minterRateModel_, earnerRateModel_);
}
}
Loading

0 comments on commit 4f0295b

Please sign in to comment.