Skip to content

Commit 5e8004a

Browse files
authored
Merge pull request #45 from sprintertech/deploy-stage
Deploy stage contracts
2 parents 7de2e76 + 29e3b2a commit 5e8004a

File tree

9 files changed

+308
-0
lines changed

9 files changed

+308
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Deployment ID: MVP
2+
Deploying to: ARBITRUM_ONE
3+
Deploying staging set of contracts on: ARBITRUM_ONE
4+
Deploying AAVE Liquidity Pool
5+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
6+
Deploying USDC Liquidity Pool
7+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
8+
Multicall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
9+
Admin: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
10+
LiquidityPool Withdraw Profit: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
11+
LiquidityPool Pauser: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
12+
MPC Address: 0x6adAF8c96151962198a9b73132c16E99F4682Eb5
13+
USDC: 0xaf88d065e77c8cC2239327C5EDb3A432268e5831
14+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
15+
RebalancerProxyAdmin: 0xcB33De00942f1004F59B2346d3891864DecEF14C
16+
Routes:
17+
┌─────────┬──────────────────────────────────────────────┬────────────────┬──────────┐
18+
│ (index) │ Pool │ Domain │ Provider │
19+
├─────────┼──────────────────────────────────────────────┼────────────────┼──────────┤
20+
│ 0 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'BASE' │ 'CCTP' │
21+
│ 1 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'OP_MAINNET' │ 'CCTP' │
22+
│ 2 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'BASE' │ 'CCTP' │
23+
│ 3 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'OP_MAINNET' │ 'CCTP' │
24+
│ 4 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'ARBITRUM_ONE' │ 'LOCAL' │
25+
│ 5 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'ARBITRUM_ONE' │ 'LOCAL' │
26+
└─────────┴──────────────────────────────────────────────┴────────────────┴──────────┘

deployments/deploy-base-stage.log

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Deployment ID: MVP
2+
Deploying to: BASE
3+
Deploying staging set of contracts on: BASE
4+
Deploying AAVE Liquidity Pool
5+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
6+
SprinterUSDCLPShare: 0xCb85b9fEFcA1316EFe0B7E1965A8922701fF502f
7+
LiquidityHub: 0x6FD4142Be84134C5a6D45d454529A6C3c9573B61
8+
LiquidityHubProxyAdmin: 0x806BA52Fad6BED2EE431e4a3CC436B3F3Da54aED
9+
LiquidityHub Adjuster: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
10+
LiquidityHub DepositProfit: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
11+
LiquidityHub Assets Limit: 10000000
12+
SprinterLiquidityMining: 0xa85Aa9ac9EaC15BA8636cE4C8014135bC34B0525
13+
Tiers:
14+
┌─────────┬──────────┬────────────────┐
15+
│ (index) │ seconds │ multiplier │
16+
├─────────┼──────────┼────────────────┤
17+
│ 0 │ 7776000 │ '0.400000000x' │
18+
│ 1 │ 15552000 │ '1.0x' │
19+
│ 2 │ 31104000 │ '2.200000000x' │
20+
└─────────┴──────────┴────────────────┘
21+
Multicall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
22+
Admin: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
23+
LiquidityPool Withdraw Profit: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
24+
LiquidityPool Pauser: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
25+
MPC Address: 0x6adAF8c96151962198a9b73132c16E99F4682Eb5
26+
USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
27+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
28+
RebalancerProxyAdmin: 0xcB33De00942f1004F59B2346d3891864DecEF14C
29+
Routes:
30+
┌─────────┬──────────────────────────────────────────────┬────────────────┬──────────┐
31+
│ (index) │ Pool │ Domain │ Provider │
32+
├─────────┼──────────────────────────────────────────────┼────────────────┼──────────┤
33+
│ 0 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'OP_MAINNET' │ 'CCTP' │
34+
│ 1 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'ARBITRUM_ONE' │ 'CCTP' │
35+
│ 2 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'OP_MAINNET' │ 'CCTP' │
36+
│ 3 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'ARBITRUM_ONE' │ 'CCTP' │
37+
│ 4 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'BASE' │ 'LOCAL' │
38+
└─────────┴──────────────────────────────────────────────┴────────────────┴──────────┘
39+
40+
Deployment ID: MVP
41+
Redeploying to: BASE
42+
Deploying staging USDC pool on fork: BASE
43+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
44+
Deploying USDC Liquidity Pool
45+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Deployment ID: MVP
2+
Deploying to: OP_MAINNET
3+
Deploying staging set of contracts on: OP_MAINNET
4+
Deploying AAVE Liquidity Pool
5+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
6+
Deploying USDC Liquidity Pool
7+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
8+
Multicall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
9+
Admin: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
10+
LiquidityPool Withdraw Profit: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
11+
LiquidityPool Pauser: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f
12+
MPC Address: 0x6adAF8c96151962198a9b73132c16E99F4682Eb5
13+
USDC: 0x0b2c639c533813f4aa9d7837caf62653d097ff85
14+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
15+
RebalancerProxyAdmin: 0xcB33De00942f1004F59B2346d3891864DecEF14C
16+
Routes:
17+
┌─────────┬──────────────────────────────────────────────┬────────────────┬──────────┐
18+
│ (index) │ Pool │ Domain │ Provider │
19+
├─────────┼──────────────────────────────────────────────┼────────────────┼──────────┤
20+
│ 0 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'BASE' │ 'CCTP' │
21+
│ 1 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'ARBITRUM_ONE' │ 'CCTP' │
22+
│ 2 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'BASE' │ 'CCTP' │
23+
│ 3 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'ARBITRUM_ONE' │ 'CCTP' │
24+
│ 4 │ '0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D' │ 'OP_MAINNET' │ 'LOCAL' │
25+
│ 5 │ '0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0' │ 'OP_MAINNET' │ 'LOCAL' │
26+
└─────────┴──────────────────────────────────────────────┴────────────────┴──────────┘
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
eip155:8453:
2+
deployment id: MVP
3+
env: stage
4+
name: BASE
5+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
6+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
7+
SprinterUSDCLPShare: 0xCb85b9fEFcA1316EFe0B7E1965A8922701fF502f
8+
LiquidityHub: 0x6FD4142Be84134C5a6D45d454529A6C3c9573B61
9+
SprinterLiquidityMining: 0xa85Aa9ac9EaC15BA8636cE4C8014135bC34B0525
10+
CensoredTransferFromMulticall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
11+
USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
12+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
13+
14+
eip155:10:
15+
deployment id: MVP
16+
env: stage
17+
name: OP_MAINNET
18+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
19+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
20+
CensoredTransferFromMulticall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
21+
USDC: 0x0b2c639c533813f4aa9d7837caf62653d097ff85
22+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
23+
24+
eip155:42161:
25+
deployment id: MVP
26+
env: stage
27+
name: ARBITRUM_ONE
28+
LiquidityPoolAaveUSDC: 0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D
29+
LiquidityPoolUSDC: 0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0
30+
CensoredTransferFromMulticall: 0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3
31+
USDC: 0xaf88d065e77c8cC2239327C5EDb3A432268e5831
32+
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9

network.config.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface NetworkConfig {
7676
Hub?: HubConfig;
7777
AavePool?: AavePoolConfig;
7878
USDCPool?: boolean;
79+
Stage?: NetworkConfig;
7980
};
8081

8182
type NetworksConfig = {
@@ -145,6 +146,31 @@ export const networkConfig: NetworksConfig = {
145146
defaultLTV: 0,
146147
},
147148
USDCPool: true,
149+
Stage: {
150+
chainId: 10,
151+
CCTP: {
152+
TokenMessenger: "0x2B4069517957735bE00ceE0fadAE88a26365528f",
153+
MessageTransmitter: "0x4d41f22c5a0e5c74090899e5a8fb597a8842b3e8",
154+
},
155+
USDC: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
156+
IsTest: false,
157+
Admin: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
158+
WithdrawProfit: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
159+
Pauser: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
160+
RebalanceCaller: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
161+
MpcAddress: "0x6adAF8c96151962198a9b73132c16E99F4682Eb5",
162+
Routes: {
163+
Pools: [LiquidityPoolAaveUSDC, LiquidityPoolAaveUSDC, LiquidityPoolUSDC, LiquidityPoolUSDC],
164+
Domains: [Network.BASE, Network.ARBITRUM_ONE, Network.BASE, Network.ARBITRUM_ONE],
165+
Providers: [Provider.CCTP, Provider.CCTP, Provider.CCTP, Provider.CCTP],
166+
},
167+
AavePool: {
168+
AaveAddressesProvider: AAVEPools.AaveV3Optimism.POOL_ADDRESSES_PROVIDER,
169+
minHealthFactor: 300,
170+
defaultLTV: 0,
171+
},
172+
USDCPool: true,
173+
},
148174
},
149175
ARBITRUM_ONE: {
150176
chainId: 42161,
@@ -170,6 +196,31 @@ export const networkConfig: NetworksConfig = {
170196
defaultLTV: 0,
171197
},
172198
USDCPool: true,
199+
Stage: {
200+
chainId: 42161,
201+
CCTP: {
202+
TokenMessenger: "0x19330d10D9Cc8751218eaf51E8885D058642E08A",
203+
MessageTransmitter: "0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca",
204+
},
205+
USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
206+
IsTest: false,
207+
Admin: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
208+
WithdrawProfit: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
209+
Pauser: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
210+
RebalanceCaller: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
211+
MpcAddress: "0x6adAF8c96151962198a9b73132c16E99F4682Eb5",
212+
Routes: {
213+
Pools: [LiquidityPoolAaveUSDC, LiquidityPoolAaveUSDC, LiquidityPoolUSDC, LiquidityPoolUSDC],
214+
Domains: [Network.BASE, Network.OP_MAINNET, Network.BASE, Network.OP_MAINNET],
215+
Providers: [Provider.CCTP, Provider.CCTP, Provider.CCTP, Provider.CCTP],
216+
},
217+
AavePool: {
218+
AaveAddressesProvider: AAVEPools.AaveV3Arbitrum.POOL_ADDRESSES_PROVIDER,
219+
minHealthFactor: 300,
220+
defaultLTV: 0,
221+
},
222+
USDCPool: true,
223+
},
173224
},
174225
BASE: {
175226
chainId: 8453,
@@ -205,6 +256,41 @@ export const networkConfig: NetworksConfig = {
205256
defaultLTV: 0,
206257
},
207258
USDCPool: true,
259+
Stage: {
260+
chainId: 8453,
261+
CCTP: {
262+
TokenMessenger: "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",
263+
MessageTransmitter: "0xAD09780d193884d503182aD4588450C416D6F9D4",
264+
},
265+
USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
266+
IsTest: false,
267+
Admin: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
268+
WithdrawProfit: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
269+
Pauser: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
270+
RebalanceCaller: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
271+
MpcAddress: "0x6adAF8c96151962198a9b73132c16E99F4682Eb5",
272+
Hub: {
273+
AssetsAdjuster: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
274+
DepositProfit: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
275+
AssetsLimit: 10_000_000,
276+
Tiers: [
277+
{period: 7776000n, multiplier: 400000000n},
278+
{period: 15552000n, multiplier: 1000000000n},
279+
{period: 31104000n, multiplier: 2200000000n},
280+
]
281+
},
282+
Routes: {
283+
Pools: [LiquidityPoolAaveUSDC, LiquidityPoolAaveUSDC, LiquidityPoolUSDC, LiquidityPoolUSDC],
284+
Domains: [Network.OP_MAINNET, Network.ARBITRUM_ONE, Network.OP_MAINNET, Network.ARBITRUM_ONE],
285+
Providers: [Provider.CCTP, Provider.CCTP, Provider.CCTP, Provider.CCTP],
286+
},
287+
AavePool: {
288+
AaveAddressesProvider: AAVEPools.AaveV3Base.POOL_ADDRESSES_PROVIDER,
289+
minHealthFactor: 300,
290+
defaultLTV: 0,
291+
},
292+
USDCPool: true,
293+
},
208294
},
209295
POLYGON_MAINNET: {
210296
chainId: 137,

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
"deploy-ethereum": "hardhat run ./scripts/deploy.ts --network ETHEREUM",
1616
"deploy-arbitrumone": "hardhat run ./scripts/deploy.ts --network ARBITRUM_ONE",
1717
"deploy-opmainnet": "hardhat run ./scripts/deploy.ts --network OP_MAINNET",
18+
"deploy-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deploy.ts --network BASE",
19+
"deploy-arbitrumone-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deploy.ts --network ARBITRUM_ONE",
20+
"deploy-opmainnet-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deploy.ts --network OP_MAINNET",
1821
"redeploy-stash-basesepolia": "hardhat run ./scripts/redeployStash.ts --network BASE_SEPOLIA",
1922
"redeploy-stash-base": "hardhat run ./scripts/redeployStash.ts --network BASE",
23+
"deploy-usdcpool-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPool.ts --network BASE",
2024
"upgrade-liquiditypool": "hardhat run ./scripts/upgradeLiquidityPool.ts",
2125
"upgrade-liquiditypool-basesepolia": "hardhat run ./scripts/upgradeLiquidityPool.ts --network BASE_SEPOLIA",
2226
"upgrade-liquiditypool-ethereumsepolia": "hardhat run ./scripts/upgradeLiquidityPool.ts --network ETHEREUM_SEPOLIA",
@@ -30,8 +34,12 @@
3034
"dry:deploy-ethereum": "DRY_RUN=ETHEREUM VERIFY=false ts-node --files ./scripts/deploy.ts",
3135
"dry:deploy-arbitrumone": "DRY_RUN=ARBITRUM_ONE VERIFY=false ts-node --files ./scripts/deploy.ts",
3236
"dry:deploy-opmainnet": "DRY_RUN=OP_MAINNET VERIFY=false ts-node --files ./scripts/deploy.ts",
37+
"dry:deploy-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deploy.ts",
38+
"dry:deploy-arbitrumone-stage": "DRY_RUN=ARBITRUM_ONE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deploy.ts",
39+
"dry:deploy-opmainnet-stage": "DRY_RUN=OP_MAINNET DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deploy.ts",
3340
"dry:redeploy-stash-basesepolia": "DRY_RUN=BASE_SEPOLIA VERIFY=false ts-node --files ./scripts/redeployStash.ts",
3441
"dry:redeploy-stash-base": "DRY_RUN=BASE VERIFY=false ts-node --files ./scripts/redeployStash.ts",
42+
"dry:deploy-usdcpool-base-stage": "DRY_RUN=BASE VERIFY=false ts-node --files ./scripts/deployUSDCPool.ts",
3543
"lint": "npm run lint:solidity && npm run lint:ts",
3644
"lint:solidity": "solhint 'contracts/**/*.sol'",
3745
"lint:ts": "eslint",

scripts/deploy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ export async function main() {
3636
if (hre.network.name === "hardhat" && Object.values(Network).includes(process.env.DRY_RUN as Network)) {
3737
network = process.env.DRY_RUN as Network;
3838
config = networkConfig[network];
39+
if (process.env.DEPLOY_TYPE == "STAGE") {
40+
assert(config.Stage != undefined, "Stage config must be defined");
41+
console.log(`Deploying staging set of contracts on fork: ${network}`);
42+
config = config.Stage!;
43+
}
3944
console.log(`Dry run on fork: ${network}`);
4045
} else if (Object.values(Network).includes(hre.network.name as Network)) {
4146
network = hre.network.name as Network;
4247
config = networkConfig[network];
48+
if (process.env.DEPLOY_TYPE == "STAGE") {
49+
assert(config.Stage != undefined, "Stage config must be defined");
50+
console.log(`Deploying staging set of contracts on: ${network}`);
51+
config = config.Stage!;
52+
}
4353
} else {
4454
network = Network.BASE;
4555
console.log("TEST: Using TEST USDC and CCTP");

scripts/deployUSDCPool.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import dotenv from "dotenv";
2+
dotenv.config();
3+
import hre from "hardhat";
4+
import {getVerifier} from "./helpers";
5+
import {resolveProxyXAddress, toBytes32} from "../test/helpers";
6+
import {isSet, assert, DEFAULT_ADMIN_ROLE} from "./common";
7+
import {LiquidityPool} from "../typechain-types";
8+
import {networkConfig, Network, NetworkConfig, LiquidityPoolUSDC} from "../network.config";
9+
10+
export async function main() {
11+
const [deployer] = await hre.ethers.getSigners();
12+
13+
const LIQUIDITY_ADMIN_ROLE = toBytes32("LIQUIDITY_ADMIN_ROLE");
14+
const WITHDRAW_PROFIT_ROLE = toBytes32("WITHDRAW_PROFIT_ROLE");
15+
const PAUSER_ROLE = toBytes32("PAUSER_ROLE");
16+
17+
assert(isSet(process.env.DEPLOY_ID), "DEPLOY_ID must be set");
18+
const verifier = getVerifier(process.env.DEPLOY_ID);
19+
console.log(`Deployment ID: ${process.env.DEPLOY_ID}`);
20+
21+
let network: Network;
22+
let config: NetworkConfig;
23+
console.log(`Deploying to: ${hre.network.name}`);
24+
if (hre.network.name === "hardhat" && Object.values(Network).includes(process.env.DRY_RUN as Network)) {
25+
network = process.env.DRY_RUN as Network;
26+
config = networkConfig[network];
27+
if (process.env.DEPLOY_TYPE == "STAGE") {
28+
assert(config.Stage != undefined, "Stage config must be defined");
29+
console.log(`Dry run for deploying staging USDC pool on fork: ${network}`);
30+
config = config.Stage!;
31+
} else {
32+
console.log(`Dry run for deploying USDC pool on fork: ${network}`);
33+
}
34+
} else if (Object.values(Network).includes(hre.network.name as Network)) {
35+
network = hre.network.name as Network;
36+
config = networkConfig[network];
37+
if (process.env.DEPLOY_TYPE == "STAGE") {
38+
assert(config.Stage != undefined, "Stage config must be defined");
39+
console.log(`Deploying staging USDC pool on: ${network}`);
40+
config = config.Stage!;
41+
} else {
42+
console.log(`Deploying USDC pool on: ${network}`);
43+
}
44+
} else {
45+
console.log(`Nothing to deploy on ${hre.network.name} network`);
46+
return;
47+
}
48+
49+
assert(config.USDCPool, "USDC pool is not configured");
50+
51+
const rebalancer = await resolveProxyXAddress("Rebalancer");
52+
console.log(`Rebalancer: ${rebalancer}`);
53+
54+
console.log("Deploying USDC Liquidity Pool");
55+
const usdcPool: LiquidityPool = (await verifier.deployX(
56+
"LiquidityPool", deployer, {}, [config.USDC, deployer, config.MpcAddress], LiquidityPoolUSDC
57+
)) as LiquidityPool;
58+
console.log(`LiquidityPoolUSDC: ${usdcPool.target}`);
59+
60+
await usdcPool!.grantRole(LIQUIDITY_ADMIN_ROLE, rebalancer);
61+
await usdcPool!.grantRole(WITHDRAW_PROFIT_ROLE, config.WithdrawProfit);
62+
await usdcPool!.grantRole(PAUSER_ROLE, config.Pauser);
63+
64+
await usdcPool!.grantRole(DEFAULT_ADMIN_ROLE, config.Admin);
65+
await usdcPool!.renounceRole(DEFAULT_ADMIN_ROLE, deployer);
66+
67+
await verifier.verify(process.env.VERIFY === "true");
68+
}
69+
70+
if (process.env.SCRIPT_ENV !== "CI") {
71+
main();
72+
}

scripts/test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {assert} from "./common";
44
import {main as deploy} from "./deploy";
55
import {main as upgradeRebalancer} from "./upgradeRebalancer";
66
import {main as redeployStash} from "./redeployStash";
7+
import {main as deployUSDCPool} from "./deployUSDCPool";
78

89
async function main() {
910
console.log("Test deploy.")
@@ -12,6 +13,8 @@ async function main() {
1213
await upgradeRebalancer();
1314
console.log("Test redeployStash.")
1415
await redeployStash();
16+
console.log("Test deployUSDCPool.")
17+
await deployUSDCPool();
1518
console.log("Success.");
1619
}
1720

0 commit comments

Comments
 (0)