Skip to content

Commit 772871e

Browse files
authored
Merge pull request #22 from SetProtocol/pranav/update-polygon-staging-delegated-manager-system-deployment
Update polygon staging delegated manager system deployment [SIM-182]
2 parents ef9d4c9 + 47d1cf8 commit 772871e

File tree

3 files changed

+69
-43
lines changed

3 files changed

+69
-43
lines changed

polygon/deploy/002_delegated_manager_system.ts

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
saveContractDeployment,
1212
stageAlreadyFinished,
1313
trackFinishedStage,
14-
saveDeferredTransactionData,
1514
writeTransactionToOutputs,
1615
getAccounts,
1716
} from "@utils/index";
@@ -23,6 +22,7 @@ import { DEPENDENCY } from "../deployments/utils/dependencies";
2322
import { CONTRACT_NAMES } from "../deployments/constants/002_delegated_manager_system";
2423

2524
const {
25+
MULTI_SIG_OWNER,
2626
CONTROLLER,
2727
SET_TOKEN_CREATOR,
2828
ISSUANCE_MODULE,
@@ -68,6 +68,8 @@ const func: DeployFunction = trackFinishedStage(CURRENT_STAGE, async function (b
6868

6969
await initializeManagerCore();
7070

71+
await transferManagerCoreOwnershipToMultisig();
72+
7173
//
7274
// Helper Functions
7375
//
@@ -163,26 +165,45 @@ const func: DeployFunction = trackFinishedStage(CURRENT_STAGE, async function (b
163165
async function initializeManagerCore(): Promise<void> {
164166
const managerCoreInstance = await instanceGetter.getManagerCore(managerCoreAddress);
165167
if (!await managerCoreInstance.isInitialized()) {
166-
const data = managerCoreInstance.interface.encodeFunctionData(
168+
const initializeData = managerCoreInstance.interface.encodeFunctionData(
167169
"initialize",
168170
[[issuanceExtensionAddress, streamingFeeSplitExtensionAddress, tradeExtensionAddress], [delegatedManagerFactoryAddress]]
169171
);
170172
const description = "Initialized ManagerCore with DelegatedManagerFactory, IssuanceExtension, StreamingFeeSplitExtension, and TradeExtension";
171173

172-
if ((networkConstant === "production" || process.env.TESTING_PRODUCTION)) {
173-
await saveDeferredTransactionData({
174-
data,
175-
description,
176-
contractName: "ManagerCore",
177-
});
178-
} else {
179-
const initializeTransaction: any = await rawTx({
174+
const initializeTransaction: any = await rawTx({
175+
from: deployer,
176+
to: managerCoreAddress,
177+
data: initializeData,
178+
log: true,
179+
});
180+
await writeTransactionToOutputs(initializeTransaction.transactionHash, description);
181+
}
182+
}
183+
184+
async function transferManagerCoreOwnershipToMultisig(): Promise<void> {
185+
if (networkConstant === "production") {
186+
const multisig = await findDependency(MULTI_SIG_OWNER);
187+
const managerCoreInstance = await instanceGetter.getManagerCore(managerCoreAddress);
188+
189+
const managerCoreOwner = await managerCoreInstance.owner();
190+
if (multisig !== "" && managerCoreOwner === deployer) {
191+
const transferOwnershipData = managerCoreInstance.interface.encodeFunctionData(
192+
"transferOwnership",
193+
[multisig]
194+
);
195+
196+
const transferOwnershipTransaction: any = await rawTx({
180197
from: deployer,
181198
to: managerCoreAddress,
182-
data,
199+
data: transferOwnershipData,
183200
log: true,
184201
});
185-
await writeTransactionToOutputs(initializeTransaction.transactionHash, description);
202+
203+
await writeTransactionToOutputs(
204+
transferOwnershipTransaction.transactionHash,
205+
"Transfer ManagerCore ownership to Multisig"
206+
);
186207
}
187208
}
188209
}

polygon/deployments/outputs/137-staging.json

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
},
88
"addresses": {
99
"ExchangeIssuanceZeroEx": "0xF22075FFEB9bCFa7e54d68Cd2f0FbFA17D1bCE35",
10-
"ManagerCore": "0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
11-
"DelegatedManagerFactory": "0x6C9A0eAE685a454Edf1f74B027e8910a5A72A6A0",
12-
"IssuanceExtension": "0xA16F2F47f26f6d70311A30b35E2332FC417888E1",
13-
"StreamingFeeSplitExtension": "0x10ED5F873e8b1a510e5bad029DBbFF235bFef758",
14-
"TradeExtension": "0x03641c1E4A7a3daF4cf6aE378153A28B5ca5F787"
10+
"ManagerCore": "0x90a591DD3365d5d7afbC2967338AB159257107c4",
11+
"DelegatedManagerFactory": "0x32D1324661F9785C2B79c366098e8e5a4c8C4e38",
12+
"IssuanceExtension": "0xc40dc02124849258eD937988625eb272516f3660",
13+
"StreamingFeeSplitExtension": "0x82A0Cff528A58c768a99fE3C20C46826F0D573c9",
14+
"TradeExtension": "0x5A3E244Ea272A957AFA3963C6bb7Ee2ac9C0ab94"
1515
},
1616
"transactions": {
1717
"0": {
@@ -29,71 +29,72 @@
2929
"libraries": {}
3030
},
3131
"1": {
32-
"id": "0xa6e71215fa2d6bc17bfefe6c56c1a27640f7196e6305787fa0e21d129880e912",
32+
"id": "0xcd4aac5760f85e3e6e8387291406dae91f864ca40df99aa03951a7f13270609b",
3333
"name": "ManagerCore",
34-
"timestamp": 1647282833272,
34+
"timestamp": 1648241404384,
3535
"verified": true,
3636
"description": "Deployed ManagerCore",
37-
"contractAddress": "0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
37+
"contractAddress": "0x90a591DD3365d5d7afbC2967338AB159257107c4",
3838
"constructorArgs": [],
3939
"libraries": {}
4040
},
4141
"2": {
42-
"id": "0xabdcfa7e417cad727f23c51224bcdd0f8c3cb9de48feb8215c081f6e3c99bdbe",
42+
"id": "0x999041bb50ee03cd8f8360ff598ec7ea4326f2c9a7ec615c1a60fa901f55c69b",
4343
"name": "DelegatedManagerFactory",
44-
"timestamp": 1647282833629,
44+
"timestamp": 1648241410537,
4545
"verified": true,
4646
"description": "Deployed DelegatedManagerFactory",
47-
"contractAddress": "0x6C9A0eAE685a454Edf1f74B027e8910a5A72A6A0",
47+
"contractAddress": "0x32D1324661F9785C2B79c366098e8e5a4c8C4e38",
4848
"constructorArgs": [
49-
"0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
49+
"0x90a591DD3365d5d7afbC2967338AB159257107c4",
50+
"0x719E5B865dE407bf38647C1625D193E0CE42111D",
5051
"0x2907206B253665EEF4776b8e684D61AFD957B974"
5152
],
5253
"libraries": {}
5354
},
5455
"3": {
55-
"id": "0xa342ef8c505395f318c2b1fa1ffcbecfcedfeace58e824078695f021e5247f56",
56-
"timestamp": 1647282808078,
57-
"description": "Initialized ManagerCore with DelegatedManagerFactory"
58-
},
59-
"4": {
60-
"id": "0xa4002f932412165167389838bb93a693100a842f05c86752fea2f95917df4f8f",
56+
"id": "0x38f03510ea393409eeebda43e80e64c2e5a873aa0e45c15a85c278e5ad40851e",
6157
"name": "IssuanceExtension",
62-
"timestamp": 1647282840886,
58+
"timestamp": 1648241416923,
6359
"verified": true,
6460
"description": "Deployed IssuanceExtension",
65-
"contractAddress": "0xA16F2F47f26f6d70311A30b35E2332FC417888E1",
61+
"contractAddress": "0xc40dc02124849258eD937988625eb272516f3660",
6662
"constructorArgs": [
67-
"0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
63+
"0x90a591DD3365d5d7afbC2967338AB159257107c4",
6864
"0x9e4ACB5737884719B8407F58F0c8cd3F97d2e130"
6965
],
7066
"libraries": {}
7167
},
72-
"5": {
73-
"id": "0x68d31740d61ddc0afe12387400ca3817d70e446e208c6429b98f57cdf9c427e1",
68+
"4": {
69+
"id": "0x126e1a0bef5055eaedf63391dc42952506c29ccc8ad275d923aed4bef7acaf92",
7470
"name": "StreamingFeeSplitExtension",
75-
"timestamp": 1647282847225,
71+
"timestamp": 1648241432419,
7672
"verified": true,
7773
"description": "Deployed StreamingFeeSplitExtension",
78-
"contractAddress": "0x10ED5F873e8b1a510e5bad029DBbFF235bFef758",
74+
"contractAddress": "0x82A0Cff528A58c768a99fE3C20C46826F0D573c9",
7975
"constructorArgs": [
80-
"0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
76+
"0x90a591DD3365d5d7afbC2967338AB159257107c4",
8177
"0x2f8FF0546a478DF380f975cA035B95DF82377721"
8278
],
8379
"libraries": {}
8480
},
85-
"6": {
86-
"id": "0xcd3b77b2f24568e183c9eabb2a70f7254b9f918233f0295960231ba82a812724",
81+
"5": {
82+
"id": "0x3882f27afaebb416d40e59a66fae338ef0ce08231eb219b87bb99f52e10f1798",
8783
"name": "TradeExtension",
88-
"timestamp": 1647282854483,
84+
"timestamp": 1648241441371,
8985
"verified": true,
9086
"description": "Deployed TradeExtension",
91-
"contractAddress": "0x03641c1E4A7a3daF4cf6aE378153A28B5ca5F787",
87+
"contractAddress": "0x5A3E244Ea272A957AFA3963C6bb7Ee2ac9C0ab94",
9288
"constructorArgs": [
93-
"0x13C5A1444CC7cF0bCae366ed5BDe13d46dba3311",
89+
"0x90a591DD3365d5d7afbC2967338AB159257107c4",
9490
"0x4F70287526ea9Ba7e799D616ea86635CdAf0de4F"
9591
],
9692
"libraries": {}
93+
},
94+
"6": {
95+
"id": "0x811ddf0769434ae247cd94e27984188baca9d3f24812498eb4b6676ee5399dd0",
96+
"timestamp": 1648241447515,
97+
"description": "Initialized ManagerCore with DelegatedManagerFactory, IssuanceExtension, StreamingFeeSplitExtension, and TradeExtension"
9798
}
9899
}
99100
}

polygon/deployments/utils/dependencies.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,25 @@ export default {
151151
SET_TOKEN_CREATOR: {
152152
137: {
153153
staging: "0x2907206B253665EEF4776b8e684D61AFD957B974",
154+
production: "0x14f0321be5e581abF9d5BC76260bf015Dc04C53d"
154155
},
155156
},
156157
ISSUANCE_MODULE: {
157158
137: {
158159
staging: "0x9e4ACB5737884719B8407F58F0c8cd3F97d2e130",
160+
production: "0x3E7f7F520e4e52a0c139d77a5487586012C90F07"
159161
},
160162
},
161163
STREAMING_FEE_MODULE: {
162164
137: {
163165
staging: "0x2f8FF0546a478DF380f975cA035B95DF82377721",
166+
production: "0x8440f6a2c42118bed0D6E6A89Bf170ffd13e21c0"
164167
},
165168
},
166169
TRADE_MODULE: {
167170
137: {
168171
staging: "0x4F70287526ea9Ba7e799D616ea86635CdAf0de4F",
172+
production: "0xd04AabadEd11e92Fefcd92eEdbBC81b184CdAc82"
169173
},
170174
},
171175

0 commit comments

Comments
 (0)