Skip to content

Commit 8f6e1c1

Browse files
author
Sachin
authored
feat(MNYe): Deploy MNYe system to prod (#39)
* Limit scope of 004 script to development and staging * Remove update operator Have to perform some transactions using EOA before transferring to IC * Add dependencies * Deploy to prod * Fix failing test * Fix failing test once again :)
1 parent fb8871b commit 8f6e1c1

File tree

5 files changed

+172
-11
lines changed

5 files changed

+172
-11
lines changed

optimism/deploy/004_perp_basis_trading_system.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ const CURRENT_STAGE = getCurrentStage(__filename);
5959

6060

6161
const func: DeployFunction = trackFinishedStage(CURRENT_STAGE, async function (hre: HRE) {
62+
const contexts = ["development", "staging"];
63+
6264
const {
6365
deploy,
6466
deployer,
6567
networkConstant
6668
} = await prepareDeployment(hre);
6769

70+
// Configure: Script is skipped by default except for testing
71+
const SHOULD_SKIP = true;
72+
if (SHOULD_SKIP && !contexts.includes(networkConstant)) return;
73+
6874
// Deploy BaseManager
6975
await deployBaseManager(
7076
hre,
@@ -78,8 +84,8 @@ const func: DeployFunction = trackFinishedStage(CURRENT_STAGE, async function (h
7884
// Perpetual Protocol has a fully deployed system on Optimistic Kovan. You can get the
7985
// kovan test USDC it uses from faucet at: https://kovan.optifaucet.com/
8086
const usdcTokenAddress = (networkId === KOVAN_TESTNET_ID)
81-
? await findDependency(PERP_TEST_USDC)
82-
: await findDependency(USDC);
87+
? await findDependency(PERP_TEST_USDC)
88+
: await findDependency(USDC);
8389

8490
// Deploy strategy extension
8591
await deployBasisTradingStrategyExtension();

optimism/deploy/005_mny_eth_system.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
trackFinishedStage,
2727
updateSetManager,
2828
deployFeeExtension,
29-
setOperator,
3029
addApprovedCaller
3130
} from "@utils/deploys/deployUtils";
3231

@@ -117,9 +116,6 @@ const func: DeployFunction = trackFinishedStage(CURRENT_STAGE, async function (h
117116
await updateSetManager(hre, MNY_ETH_TOKEN, CONTRACT_NAMES.BASE_MANAGER);
118117
}
119118

120-
// Finally set operator to IC Operator multisig
121-
await setOperator(hre, CONTRACT_NAMES.BASE_MANAGER, IC_OPERATOR_MULTISIG);
122-
123119
async function deployBasisTradingStrategyExtension(): Promise<void> {
124120
const checkStrategyExtensionAddress = await getContractAddress(CONTRACT_NAMES.STRATEGY_EXTENSION);
125121
if (checkStrategyExtensionAddress == "") {

optimism/deployments/outputs/10-production.json

Lines changed: 161 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
"network_key": "10-production",
44
"human_friendly_name": "optimism-mainnet-production",
55
"network_id": 10,
6-
"last_deployment_stage": 4
6+
"last_deployment_stage": 6
77
},
88
"addresses": {
99
"ExchangeIssuanceZeroEx": "0x01ecc782531ADCfB8C5a58A2C7FD544Ada946b81",
1010
"ManagerCore": "0x71ceB3F645dCBD7549CaaF85A224Db987Ae92630",
1111
"DelegatedManagerFactory": "0x6A2B2fCC2bF5c1C1c0c96036bd11337ec5fFA16a",
1212
"IssuanceExtension": "0x32C993A42a654C63d296EeF15c5AcD3FFd272165",
1313
"StreamingFeeSplitExtension": "0x8F14b50d5e56422b2759C4fdD8D148Bb28a6599D",
14-
"TradeExtension": "0x5fdbEb52Adfc6FbA26ef0E4b5e9464C63A15467b"
14+
"TradeExtension": "0x5fdbEb52Adfc6FbA26ef0E4b5e9464C63A15467b",
15+
"MNYeBaseManager": "0xB0051e20A2eD91AF525A2eDc54AEd6735e7fe892",
16+
"MNYeBasisTradingStrategyExtension": "0x3138293423c06D81Cc9Ae78FbCD3F7DB6323B83a",
17+
"MNYeFeeSplitExtension": "0x61A307cbfa9b88f2bE019915bD597C99D9690D96"
1518
},
1619
"transactions": {
1720
"0": {
@@ -100,6 +103,162 @@
100103
"id": "0x10cdd964906e50492e746f6902da124a9a68050b5d3cfc26f4fd37c363cad0b9",
101104
"timestamp": 1648700574747,
102105
"description": "Transfer ManagerCore ownership to Multisig"
106+
},
107+
"8": {
108+
"id": "0xac715ea6bb5bf6373e37d1965dc1e7ce8a95c6db28e5e92378e30249d6064e62",
109+
"name": "MNYeBaseManager",
110+
"timestamp": 1650563242452,
111+
"verified": true,
112+
"description": "Deployed MNYeBaseManager",
113+
"contractAddress": "0xB0051e20A2eD91AF525A2eDc54AEd6735e7fe892",
114+
"constructorArgs": [
115+
"0x0Be27c140f9Bdad3474bEaFf0A413EC7e19e9B93",
116+
"0x69Bdb276A17Dd90F9D3A545944CCB20E593ae8E3",
117+
"0xA047F6900FeE0b6195088a49009eA65365f7DD68"
118+
],
119+
"libraries": {}
120+
},
121+
"9": {
122+
"id": "0xa11c92052c1720ee70fec723454791721a3e71faeb0cd1b8c8c89c544f5b55aa",
123+
"name": "MNYeBasisTradingStrategyExtension",
124+
"timestamp": 1650563248288,
125+
"verified": true,
126+
"description": "Deployed MNYeBasisTradingStrategyExtension",
127+
"contractAddress": "0x3138293423c06D81Cc9Ae78FbCD3F7DB6323B83a",
128+
"constructorArgs": [
129+
"0xB0051e20A2eD91AF525A2eDc54AEd6735e7fe892",
130+
{
131+
"setToken": "0x0Be27c140f9Bdad3474bEaFf0A413EC7e19e9B93",
132+
"basisTradingModule": "0x2C229EE3aD3fdC0e581d51BaA6b6f45CC9A6Ca39",
133+
"tradeModule": "0x7215f38011C3e4058Ca3cF7d2b99033016EeFBD8",
134+
"quoter": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6",
135+
"perpV2AccountBalance": "0xA7f3FC32043757039d5e13d790EE43edBcBa8b7c",
136+
"baseUSDPriceOracle": "0xA36fAF16f31c12285467b1973ee8Fa144ED4d846",
137+
"twapInterval": {
138+
"type": "BigNumber",
139+
"hex": "0x00"
140+
},
141+
"basePriceDecimalAdjustment": {
142+
"type": "BigNumber",
143+
"hex": "0x0a"
144+
},
145+
"virtualBaseAddress": "0x8C835DFaA34e2AE61775e80EE29E2c724c6AE2BB",
146+
"virtualQuoteAddress": "0xC84Da6c8ec7A57cD10B939E79eaF9d2D17834E04",
147+
"spotAssetAddress": "0x4200000000000000000000000000000000000006"
148+
},
149+
{
150+
"targetLeverageRatio": {
151+
"type": "BigNumber",
152+
"hex": "-0x0de0b6b3a7640000"
153+
},
154+
"minLeverageRatio": {
155+
"type": "BigNumber",
156+
"hex": "-0x0d2f13f7789f0000"
157+
},
158+
"maxLeverageRatio": {
159+
"type": "BigNumber",
160+
"hex": "-0x1bc16d674ec80000"
161+
},
162+
"recenteringSpeed": {
163+
"type": "BigNumber",
164+
"hex": "0x0de0b6b3a7640000"
165+
},
166+
"rebalanceInterval": {
167+
"type": "BigNumber",
168+
"hex": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
169+
},
170+
"reinvestInterval": {
171+
"type": "BigNumber",
172+
"hex": "0x093a80"
173+
},
174+
"minReinvestUnits": {
175+
"type": "BigNumber",
176+
"hex": "0x2710"
177+
}
178+
},
179+
{
180+
"twapCooldownPeriod": {
181+
"type": "BigNumber",
182+
"hex": "0x1e"
183+
},
184+
"slippageTolerance": {
185+
"type": "BigNumber",
186+
"hex": "0x470de4df820000"
187+
}
188+
},
189+
{
190+
"incentivizedTwapCooldownPeriod": {
191+
"type": "BigNumber",
192+
"hex": "0x01"
193+
},
194+
"incentivizedSlippageTolerance": {
195+
"type": "BigNumber",
196+
"hex": "0xb1a2bc2ec50000"
197+
},
198+
"etherReward": {
199+
"type": "BigNumber",
200+
"hex": "0x0de0b6b3a7640000"
201+
},
202+
"incentivizedLeverageRatio": {
203+
"type": "BigNumber",
204+
"hex": "-0x29a2241af62c0000"
205+
}
206+
},
207+
{
208+
"exchangeName": "UniswapV3ExchangeAdapterV2",
209+
"buyExactSpotTradeData": "0x4200000000000000000000000000000000000006000bb87f5c764cbc14f9669b88837ca1490cca17c3160700",
210+
"sellExactSpotTradeData": "0x4200000000000000000000000000000000000006000bb87f5c764cbc14f9669b88837ca1490cca17c3160701",
211+
"buySpotQuoteExactInputPath": "0x7f5c764cbc14f9669b88837ca1490cca17c31607000bb84200000000000000000000000000000000000006",
212+
"twapMaxTradeSize": {
213+
"type": "BigNumber",
214+
"hex": "0x01a055690d9db80000"
215+
},
216+
"incentivizedTwapMaxTradeSize": {
217+
"type": "BigNumber",
218+
"hex": "0x0340aad21b3b700000"
219+
}
220+
}
221+
],
222+
"libraries": {}
223+
},
224+
"10": {
225+
"id": "0x22c2e6f4bce498b92c0b4869b036dab697669291d803f895669180bfde14ff3a",
226+
"name": "MNYeFeeSplitExtension",
227+
"timestamp": 1650563254847,
228+
"verified": true,
229+
"description": "Deployed MNYeFeeSplitExtension",
230+
"contractAddress": "0x61A307cbfa9b88f2bE019915bD597C99D9690D96",
231+
"constructorArgs": [
232+
"0xB0051e20A2eD91AF525A2eDc54AEd6735e7fe892",
233+
"0x6a7aE5124677314dc32C5ba3004CbFC9c7Febff0",
234+
"0x1db929398958082d2080AA1B501e460503f60467",
235+
{
236+
"type": "BigNumber",
237+
"hex": "0x0de0b6b3a7640000"
238+
},
239+
"0xA047F6900FeE0b6195088a49009eA65365f7DD68"
240+
],
241+
"libraries": {}
242+
},
243+
"11": {
244+
"id": "0x5a234dae2c22f221372006398c197e0d3f3b62a22c15aedfe70b9114a0c610fc",
245+
"timestamp": 1650563260731,
246+
"description": "Add MNYeBasisTradingStrategyExtension on MNYeBaseManager"
247+
},
248+
"12": {
249+
"id": "0x1bf0f3ee2491b156897dcd4c27b64f1bf3381b7205e4f1ad6e7fb1beda04709b",
250+
"timestamp": 1650563267629,
251+
"description": "Add MNYeFeeSplitExtension on MNYeBaseManager"
252+
},
253+
"13": {
254+
"id": "0xab31c3c758a995aa300841cec47e6ddcd75c64b61904b3a9765d5bec2e534a29",
255+
"timestamp": 1650563275307,
256+
"description": "MNYeBasisTradingStrategyExtension caller statuses updated."
257+
},
258+
"14": {
259+
"id": "0xab4934e5f313f4072861113c6ff36c972da7a08530797285991d2769b3a04e31",
260+
"timestamp": 1650563282977,
261+
"description": "Set MNYeBaseManager contract as MNY_ETH_TOKEN Manager"
103262
}
104263
}
105264
}

optimism/deployments/utils/dependencies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
MNY_ETH_TOKEN: {
3939
10: {
4040
staging: "0x93910D1D112AEA86E20c998948897b0cd37B3Ed9", // dummy address
41-
production: ""
41+
production: "0x0Be27c140f9Bdad3474bEaFf0A413EC7e19e9B93"
4242
},
4343
69: ""
4444
},
@@ -251,7 +251,7 @@ export default {
251251
PERPV2_BASIS_TRADING_MODULE: {
252252
10: {
253253
staging: "0x02318dd7821a8B9395D616071c1d3573C5886c02",
254-
production: ""
254+
production: "0x2C229EE3aD3fdC0e581d51BaA6b6f45CC9A6Ca39"
255255
},
256256
69: "0x5aAd2270a04976e66aA6C4F4d3d9E95e06f45542"
257257
},

optimism/test/deploys/005_mny_eth_system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("MNYe Basis Trading System", () => {
6969

7070
it("should have the correct operator address", async () => {
7171
const operator = await baseManagerInstance.operator();
72-
expect(operator).to.eq(IC_OPERATOR_MULTISIG);
72+
expect(operator).to.eq(deployer.wallet.address);
7373
});
7474

7575
it("should have the correct methodologist address", async () => {

0 commit comments

Comments
 (0)