@superfluid-finance/ethereum-contracts 1.4.1-dev.e675dbc.0 → 1.4.2-dev.e06ddfc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/contracts/AccessControl.json +1 -1
- package/build/contracts/AccessControlEnumerable.json +1 -1
- package/build/contracts/Address.json +1 -1
- package/build/contracts/AgreementBase.json +28 -28
- package/build/contracts/AgreementLibrary.json +165 -165
- package/build/contracts/BaseRelayRecipient.json +55 -55
- package/build/contracts/BatchLiquidator.json +208 -208
- package/build/contracts/BatchOperation.json +784 -784
- package/build/contracts/CFAv1Forwarder.json +2299 -2473
- package/build/contracts/CFAv1Library.json +2279 -2279
- package/build/contracts/CallUtils.json +198 -198
- package/build/contracts/ClosingOnUpdateFlowTestApp.json +1544 -1544
- package/build/contracts/ConstantFlowAgreementV1.json +8579 -8423
- package/build/contracts/Context.json +1 -1
- package/build/contracts/ContextDefinitions.json +784 -784
- package/build/contracts/Create2.json +1 -1
- package/build/contracts/CustomSuperTokenBase.json +19 -19
- package/build/contracts/ERC165.json +1 -1
- package/build/contracts/ERC1820Implementer.json +1 -1
- package/build/contracts/ERC1820RegistryCompiled.json +22 -22
- package/build/contracts/ERC20.json +1 -1
- package/build/contracts/ERC20Burnable.json +1 -1
- package/build/contracts/ERC20Pausable.json +1 -1
- package/build/contracts/ERC20PresetMinterPauser.json +1 -1
- package/build/contracts/ERC20WithTokenInfo.json +23 -23
- package/build/contracts/ERC777Helper.json +380 -380
- package/build/contracts/ERC777RecipientDrainingGas.json +855 -855
- package/build/contracts/ERC777RecipientReverting.json +855 -855
- package/build/contracts/EnumerableSet.json +1 -1
- package/build/contracts/EventsEmitter.json +43 -43
- package/build/contracts/ExclusiveInflowTestApp.json +1544 -1544
- package/build/contracts/FixedSizeData.json +200 -200
- package/build/contracts/FlowExchangeTestApp.json +1545 -1545
- package/build/contracts/FlowOperatorDefinitions.json +784 -784
- package/build/contracts/FullUpgradableSuperTokenProxy.json +116 -116
- package/build/contracts/IAccessControl.json +1 -1
- package/build/contracts/IAccessControlEnumerable.json +1 -1
- package/build/contracts/IConstantFlowAgreementV1.json +608 -608
- package/build/contracts/IDAv1Library.json +2611 -2611
- package/build/contracts/IERC165.json +1 -1
- package/build/contracts/IERC1820Implementer.json +1 -1
- package/build/contracts/IERC1820Registry.json +1 -1
- package/build/contracts/IERC20.json +1 -1
- package/build/contracts/IERC20Metadata.json +1 -1
- package/build/contracts/IERC20Permit.json +1 -1
- package/build/contracts/IERC777.json +1 -1
- package/build/contracts/IERC777Recipient.json +1 -1
- package/build/contracts/IERC777Sender.json +1 -1
- package/build/contracts/IInstantDistributionAgreementV1.json +652 -652
- package/build/contracts/IMultiSigWallet.json +24 -24
- package/build/contracts/IPureSuperToken.json +47 -47
- package/build/contracts/IPureSuperTokenCustom.json +47 -47
- package/build/contracts/IRelayRecipient.json +27 -27
- package/build/contracts/IResolver.json +38 -38
- package/build/contracts/ISETH.json +52 -52
- package/build/contracts/ISETHCustom.json +52 -52
- package/build/contracts/ISuperAgreement.json +50 -50
- package/build/contracts/ISuperApp.json +191 -191
- package/build/contracts/ISuperToken.json +544 -544
- package/build/contracts/ISuperTokenFactory.json +166 -166
- package/build/contracts/ISuperfluid.json +874 -874
- package/build/contracts/ISuperfluidGovernance.json +254 -254
- package/build/contracts/ISuperfluidToken.json +395 -395
- package/build/contracts/ITOGAv1.json +1441 -1441
- package/build/contracts/ITOGAv2.json +1441 -1441
- package/build/contracts/Initializable.json +1 -1
- package/build/contracts/InstantDistributionAgreementV1.json +5893 -5893
- package/build/contracts/NonClosableOutflowTestApp.json +1545 -1545
- package/build/contracts/Ownable.json +1 -1
- package/build/contracts/Pausable.json +1 -1
- package/build/contracts/Proxy.json +1 -1
- package/build/contracts/PureSuperToken.json +106 -106
- package/build/contracts/Resolver.json +98 -98
- package/build/contracts/SETHProxy.json +224 -224
- package/build/contracts/SafeCast.json +1 -1
- package/build/contracts/SafeERC20.json +1 -1
- package/build/contracts/SafeMath.json +1 -1
- package/build/contracts/SelfDeletingFlowTestApp.json +1544 -1544
- package/build/contracts/SlotsBitmapLibrary.json +457 -457
- package/build/contracts/StreamRedirector.json +745 -745
- package/build/contracts/Strings.json +1 -1
- package/build/contracts/SuperAppBase.json +239 -239
- package/build/contracts/SuperAppDefinitions.json +784 -784
- package/build/contracts/SuperToken.json +2475 -2475
- package/build/contracts/SuperTokenFactory.json +774 -774
- package/build/contracts/SuperTokenFactoryBase.json +764 -764
- package/build/contracts/SuperTokenFactoryHelper.json +767 -767
- package/build/contracts/SuperUpgrader.json +437 -437
- package/build/contracts/Superfluid.json +5082 -5082
- package/build/contracts/SuperfluidErrors.json +784 -784
- package/build/contracts/SuperfluidFrameworkDeployer.json +765 -765
- package/build/contracts/SuperfluidGovernanceBase.json +2459 -2459
- package/build/contracts/SuperfluidGovernanceConfigs.json +784 -784
- package/build/contracts/SuperfluidGovernanceII.json +155 -155
- package/build/contracts/SuperfluidGovernanceIIProxy.json +135 -135
- package/build/contracts/SuperfluidLoader.json +207 -207
- package/build/contracts/SuperfluidToken.json +1471 -1471
- package/build/contracts/TOGA.json +1457 -1457
- package/build/contracts/TestGovernance.json +250 -250
- package/build/contracts/TestToken.json +93 -93
- package/build/contracts/TokenCustodian.json +214 -214
- package/build/contracts/TokenInfo.json +32 -32
- package/build/contracts/UUPSProxiable.json +139 -139
- package/build/contracts/UUPSProxy.json +81 -81
- package/build/contracts/UUPSUtils.json +37 -37
- package/build/contracts-sizes.txt +1 -1
- package/contracts/agreements/ConstantFlowAgreementV1.sol +8 -3
- package/contracts/utils/CFAv1Forwarder.sol +2 -6
- package/package.json +10 -6
- package/scripts/deploy-deterministically.js +35 -24
- package/scripts/deploy-framework.js +65 -38
- package/scripts/gov-upgrade-governance.js +87 -0
- package/scripts/info-print-contract-addresses.js +1 -1
- package/scripts/libs/common.js +2 -1
- package/scripts/libs/getConfig.js +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const util = require("util");
|
|
1
3
|
const getConfig = require("./libs/getConfig");
|
|
2
4
|
const SuperfluidSDK = require("@superfluid-finance/js-sdk");
|
|
3
5
|
const {web3tx} = require("@decentral.ee/web3-helpers");
|
|
@@ -17,6 +19,8 @@ const {
|
|
|
17
19
|
let resetSuperfluidFramework;
|
|
18
20
|
let resolver;
|
|
19
21
|
|
|
22
|
+
/// @param deployFunc must return a contract object
|
|
23
|
+
/// @returns the newly deployed or existing loaded contract
|
|
20
24
|
async function deployAndRegisterContractIf(
|
|
21
25
|
Contract,
|
|
22
26
|
resolverKey,
|
|
@@ -42,6 +46,8 @@ async function deployAndRegisterContractIf(
|
|
|
42
46
|
return contractDeployed;
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
/// @param deployFunc must return a contract address
|
|
50
|
+
/// @returns the address of the newly deployed contract or ZERO_ADDRESS if not deployed
|
|
45
51
|
async function deployContractIf(web3, Contract, cond, deployFunc) {
|
|
46
52
|
let newCodeAddress = ZERO_ADDRESS;
|
|
47
53
|
const contractName = Contract.contractName;
|
|
@@ -57,6 +63,8 @@ async function deployContractIf(web3, Contract, cond, deployFunc) {
|
|
|
57
63
|
return newCodeAddress;
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
/// @param deployFunc must return a contract address
|
|
67
|
+
/// @returns the address of the newly deployed contract or ZERO_ADDRESS if not deployed
|
|
60
68
|
async function deployContractIfCodeChanged(
|
|
61
69
|
web3,
|
|
62
70
|
Contract,
|
|
@@ -88,6 +96,8 @@ async function deployContractIfCodeChanged(
|
|
|
88
96
|
* (overriding env: RESET_SUPERFLUID_FRAMEWORK)
|
|
89
97
|
* @param {boolean} options.protocolReleaseVersion Specify the protocol release version to be used
|
|
90
98
|
* (overriding env: RELEASE_VERSION)
|
|
99
|
+
* @param {boolean} options.outputFile Name of file where to log addresses of newly deployed contracts
|
|
100
|
+
* (overriding env: OUTPUT_FILE)
|
|
91
101
|
*
|
|
92
102
|
* Usage: npx truffle exec scripts/deploy-framework.js
|
|
93
103
|
*/
|
|
@@ -103,6 +113,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
103
113
|
nonUpgradable,
|
|
104
114
|
appWhiteListing,
|
|
105
115
|
protocolReleaseVersion,
|
|
116
|
+
outputFile,
|
|
106
117
|
} = options;
|
|
107
118
|
resetSuperfluidFramework = options.resetSuperfluidFramework;
|
|
108
119
|
|
|
@@ -110,6 +121,12 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
110
121
|
resetSuperfluidFramework || !!process.env.RESET_SUPERFLUID_FRAMEWORK;
|
|
111
122
|
console.log("reset superfluid framework: ", resetSuperfluidFramework);
|
|
112
123
|
|
|
124
|
+
outputFile = outputFile || process.env.OUTPUT_FILE;
|
|
125
|
+
console.log("output file: ", outputFile);
|
|
126
|
+
|
|
127
|
+
// string to build a list of newly deployed contracts, written to a file if "outputFile" option set
|
|
128
|
+
let output = "";
|
|
129
|
+
|
|
113
130
|
const networkType = await web3.eth.net.getNetworkType();
|
|
114
131
|
const networkId = await web3.eth.net.getId();
|
|
115
132
|
const chainId = await web3.eth.getChainId();
|
|
@@ -117,6 +134,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
117
134
|
console.log("network ID: ", networkId);
|
|
118
135
|
console.log("chain ID: ", chainId);
|
|
119
136
|
const config = getConfig(chainId);
|
|
137
|
+
output += `NETWORK_ID=${networkId}\n`;
|
|
120
138
|
|
|
121
139
|
const CFAv1_TYPE = web3.utils.sha3(
|
|
122
140
|
"org.superfluid-finance.agreements.ConstantFlowAgreement.v1"
|
|
@@ -221,7 +239,12 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
221
239
|
await codeChanged(web3, TestGovernance, contractAddress),
|
|
222
240
|
async () => {
|
|
223
241
|
governanceInitializationRequired = true;
|
|
224
|
-
|
|
242
|
+
const c = await web3tx(
|
|
243
|
+
TestGovernance.new,
|
|
244
|
+
"TestGovernance.new"
|
|
245
|
+
)();
|
|
246
|
+
output += `SUPERFLUID_GOVERNANCE=${c.address}\n`;
|
|
247
|
+
return c;
|
|
225
248
|
}
|
|
226
249
|
);
|
|
227
250
|
}
|
|
@@ -232,10 +255,12 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
232
255
|
"SuperfluidLoader-v1",
|
|
233
256
|
async (contractAddress) => contractAddress === ZERO_ADDRESS,
|
|
234
257
|
async () => {
|
|
235
|
-
|
|
258
|
+
const c = await web3tx(
|
|
236
259
|
SuperfluidLoader.new,
|
|
237
260
|
"SuperfluidLoader.new"
|
|
238
261
|
)(resolver.address);
|
|
262
|
+
output += `SUPERFLUID_LOADER=${c.address}\n`;
|
|
263
|
+
return c;
|
|
239
264
|
}
|
|
240
265
|
);
|
|
241
266
|
|
|
@@ -255,11 +280,13 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
255
280
|
console.log(
|
|
256
281
|
`Superfluid new code address ${superfluidLogic.address}`
|
|
257
282
|
);
|
|
283
|
+
output += `SUPERFLUID_HOST_LOGIC=${superfluidLogic.address}\n`;
|
|
258
284
|
if (!nonUpgradable) {
|
|
259
285
|
const proxy = await web3tx(
|
|
260
286
|
UUPSProxy.new,
|
|
261
287
|
"Create Superfluid proxy"
|
|
262
288
|
)();
|
|
289
|
+
output += `SUPERFLUID_HOST_PROXY=${proxy.address}\n`;
|
|
263
290
|
await web3tx(
|
|
264
291
|
proxy.initializeProxy,
|
|
265
292
|
"proxy.initializeProxy"
|
|
@@ -332,8 +359,10 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
332
359
|
"ConstantFlowAgreementV1.new"
|
|
333
360
|
)(superfluid.address);
|
|
334
361
|
console.log("New ConstantFlowAgreementV1 address", agreement.address);
|
|
362
|
+
output += `CFA_LOGIC=${agreement.address}\n`;
|
|
335
363
|
return agreement;
|
|
336
364
|
};
|
|
365
|
+
|
|
337
366
|
if (!(await superfluid.isAgreementTypeListed.call(CFAv1_TYPE))) {
|
|
338
367
|
const cfa = await deployCFAv1();
|
|
339
368
|
await web3tx(
|
|
@@ -341,32 +370,26 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
341
370
|
"Governance registers CFA"
|
|
342
371
|
)(superfluid.address, cfa.address);
|
|
343
372
|
}
|
|
344
|
-
|
|
345
|
-
let lib;
|
|
373
|
+
|
|
346
374
|
// list IDA v1
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (linked || lib != null) return;
|
|
351
|
-
lib = await web3tx(
|
|
352
|
-
SlotsBitmapLibrary.new,
|
|
353
|
-
"SlotsBitmapLibrary.new"
|
|
354
|
-
)();
|
|
355
|
-
InstantDistributionAgreementV1.link(lib);
|
|
356
|
-
linked = true;
|
|
357
|
-
return lib.address;
|
|
358
|
-
} else {
|
|
359
|
-
const lib = await web3tx(
|
|
375
|
+
const deployIDAv1 = async () => {
|
|
376
|
+
const deploySlotsBitmapLibrary = async () => {
|
|
377
|
+
const slotsBmpLib = await web3tx(
|
|
360
378
|
SlotsBitmapLibrary.new,
|
|
361
379
|
"SlotsBitmapLibrary.new"
|
|
362
380
|
)();
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
381
|
+
output += `SLOTS_BITMAP_LIBRARY_ADDRESS=${slotsBmpLib.address}\n`;
|
|
382
|
+
if (process.env.IS_HARDHAT) {
|
|
383
|
+
InstantDistributionAgreementV1.link(slotsBmpLib);
|
|
384
|
+
} else {
|
|
385
|
+
InstantDistributionAgreementV1.link(
|
|
386
|
+
"SlotsBitmapLibrary",
|
|
387
|
+
slotsBmpLib.address
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
return slotsBmpLib;
|
|
391
|
+
};
|
|
392
|
+
// small inefficiency: this may be re-deployed even if not changed
|
|
370
393
|
await deploySlotsBitmapLibrary();
|
|
371
394
|
const agreement = await web3tx(
|
|
372
395
|
InstantDistributionAgreementV1.new,
|
|
@@ -376,16 +399,18 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
376
399
|
"New InstantDistributionAgreementV1 address",
|
|
377
400
|
agreement.address
|
|
378
401
|
);
|
|
402
|
+
output += `IDA_LOGIC=${agreement.address}\n`;
|
|
379
403
|
return agreement;
|
|
380
404
|
};
|
|
405
|
+
|
|
381
406
|
if (!(await superfluid.isAgreementTypeListed.call(IDAv1_TYPE))) {
|
|
382
|
-
await deploySlotsBitmapLibrary();
|
|
383
407
|
const ida = await deployIDAv1();
|
|
384
408
|
await web3tx(
|
|
385
409
|
governance.registerAgreementClass,
|
|
386
410
|
"Governance registers IDA"
|
|
387
411
|
)(superfluid.address, ida.address);
|
|
388
412
|
} else {
|
|
413
|
+
// link library in order to avoid spurious code change detections
|
|
389
414
|
let slotsBitmapLibraryAddress = ZERO_ADDRESS;
|
|
390
415
|
try {
|
|
391
416
|
slotsBitmapLibraryAddress = await (
|
|
@@ -393,20 +418,11 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
393
418
|
await superfluid.getAgreementClass.call(IDAv1_TYPE)
|
|
394
419
|
)
|
|
395
420
|
).SLOTS_BITMAP_LIBRARY_ADDRESS.call();
|
|
396
|
-
} catch (e) {
|
|
397
|
-
console.warn("Cannot get slotsBitmapLibrary address", e.toString());
|
|
398
|
-
}
|
|
399
|
-
if (
|
|
400
|
-
(await deployContractIfCodeChanged(
|
|
401
|
-
web3,
|
|
402
|
-
SlotsBitmapLibrary,
|
|
403
|
-
slotsBitmapLibraryAddress,
|
|
404
|
-
deploySlotsBitmapLibrary
|
|
405
|
-
)) == ZERO_ADDRESS
|
|
406
|
-
) {
|
|
407
|
-
// code not changed, link with existing library
|
|
408
421
|
if (process.env.IS_HARDHAT) {
|
|
409
|
-
if (
|
|
422
|
+
if (slotsBitmapLibraryAddress !== ZERO_ADDRESS) {
|
|
423
|
+
const lib = await SlotsBitmapLibrary.at(
|
|
424
|
+
slotsBitmapLibraryAddress
|
|
425
|
+
);
|
|
410
426
|
InstantDistributionAgreementV1.link(lib);
|
|
411
427
|
}
|
|
412
428
|
} else {
|
|
@@ -415,6 +431,8 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
415
431
|
slotsBitmapLibraryAddress
|
|
416
432
|
);
|
|
417
433
|
}
|
|
434
|
+
} catch (e) {
|
|
435
|
+
console.warn("Cannot get slotsBitmapLibrary address", e.toString());
|
|
418
436
|
}
|
|
419
437
|
}
|
|
420
438
|
|
|
@@ -438,6 +456,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
438
456
|
SuperfluidLogic.new,
|
|
439
457
|
"SuperfluidLogic.new"
|
|
440
458
|
)(nonUpgradable, appWhiteListing);
|
|
459
|
+
output += `SUPERFLUID_HOST_LOGIC=${superfluidLogic.address}\n`;
|
|
441
460
|
return superfluidLogic.address;
|
|
442
461
|
}
|
|
443
462
|
);
|
|
@@ -533,6 +552,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
533
552
|
SuperTokenFactoryLogic.new,
|
|
534
553
|
"SuperTokenFactoryLogic.new"
|
|
535
554
|
)(superfluid.address, helper.address);
|
|
555
|
+
output += `SUPERFLUID_SUPER_TOKEN_FACTORY_LOGIC=${superTokenFactoryLogic.address}\n`;
|
|
536
556
|
return superTokenFactoryLogic.address;
|
|
537
557
|
}
|
|
538
558
|
);
|
|
@@ -569,4 +589,11 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
|
|
|
569
589
|
);
|
|
570
590
|
console.log(`export RESOLVER_ADDRESS=${process.env.RESOLVER_ADDRESS}`);
|
|
571
591
|
}
|
|
592
|
+
|
|
593
|
+
if (outputFile !== undefined) {
|
|
594
|
+
await util.promisify(fs.writeFile)(outputFile, output);
|
|
595
|
+
console.log(
|
|
596
|
+
`List of newly deployed contracts written to ${outputFile}`
|
|
597
|
+
);
|
|
598
|
+
}
|
|
572
599
|
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const SuperfluidSDK = require("@superfluid-finance/js-sdk");
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
getScriptRunnerFactory: S,
|
|
5
|
+
extractWeb3Options,
|
|
6
|
+
builtTruffleContractLoader,
|
|
7
|
+
} = require("./libs/common");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @dev Deploy the latest governance logic and initiate an upgrade to it.
|
|
11
|
+
* Needs the deployed governance contract to implement UUPSProxiable
|
|
12
|
+
* and owned by a Gnosis Multisig Wallet.
|
|
13
|
+
* @param {Array} argv Overriding command line arguments
|
|
14
|
+
* @param {boolean} options.isTruffle Whether the script is used within native truffle framework
|
|
15
|
+
* @param {Web3} options.web3 Injected web3 instance
|
|
16
|
+
* @param {Address} options.from Address to deploy contracts from
|
|
17
|
+
* @param {boolean} options.protocolReleaseVersion Specify the protocol release version to be used
|
|
18
|
+
*
|
|
19
|
+
* Usage: npx truffle exec scripts/gov-upgrade-governance.js
|
|
20
|
+
*/
|
|
21
|
+
module.exports = eval(`(${S.toString()})()`)(async function (
|
|
22
|
+
args,
|
|
23
|
+
options = {}
|
|
24
|
+
) {
|
|
25
|
+
console.log("======== Upgrade governance ========");
|
|
26
|
+
let {protocolReleaseVersion} = options;
|
|
27
|
+
|
|
28
|
+
console.log("protocol release version:", protocolReleaseVersion);
|
|
29
|
+
|
|
30
|
+
const sf = new SuperfluidSDK.Framework({
|
|
31
|
+
...extractWeb3Options(options),
|
|
32
|
+
version: protocolReleaseVersion,
|
|
33
|
+
additionalContracts: [
|
|
34
|
+
"Ownable",
|
|
35
|
+
"IMultiSigWallet",
|
|
36
|
+
"SuperfluidGovernanceBase",
|
|
37
|
+
"SuperfluidGovernanceII",
|
|
38
|
+
],
|
|
39
|
+
contractLoader: builtTruffleContractLoader,
|
|
40
|
+
});
|
|
41
|
+
await sf.initialize();
|
|
42
|
+
|
|
43
|
+
const gov = await sf.contracts.UUPSProxiable.at(
|
|
44
|
+
await sf.host.getGovernance.call()
|
|
45
|
+
);
|
|
46
|
+
console.log("Governance address:", gov.address);
|
|
47
|
+
|
|
48
|
+
// sanity check - do we have an upgradable proxy contract and the right one?
|
|
49
|
+
try {
|
|
50
|
+
const uuidIs = await gov.proxiableUUID();
|
|
51
|
+
const uuidWant = web3.utils.keccak256(
|
|
52
|
+
"org.superfluid-finance.contracts.SuperfluidGovernanceII.implementation"
|
|
53
|
+
);
|
|
54
|
+
if (uuidIs !== uuidWant) {
|
|
55
|
+
console.error("ERR: governance contract: proxiableUUID mismatch");
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.error(
|
|
60
|
+
"ERR: governance seems not to be an instance of UUPSProxiable"
|
|
61
|
+
);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// we have the right contract, proceeding with new contract deployment
|
|
66
|
+
console.log(
|
|
67
|
+
"Deploying new instance of SuperfluidGovernanceII (gov logic)..."
|
|
68
|
+
);
|
|
69
|
+
const govLogic = await sf.contracts.SuperfluidGovernanceII.new();
|
|
70
|
+
console.log("Deployed to", govLogic.address);
|
|
71
|
+
await govLogic.castrate();
|
|
72
|
+
console.log("Marked gov logic as initialized (castrate)");
|
|
73
|
+
|
|
74
|
+
// prepare multisig transaction for executing the upgrade
|
|
75
|
+
const multis = await sf.contracts.IMultiSigWallet.at(
|
|
76
|
+
await (await sf.contracts.Ownable.at(gov.address)).owner()
|
|
77
|
+
);
|
|
78
|
+
console.log("MultiSig address:", multis.address);
|
|
79
|
+
|
|
80
|
+
const data = gov.contract.methods.updateCode(govLogic.address).encodeABI();
|
|
81
|
+
console.log("MultiSig data", data);
|
|
82
|
+
console.log("Sending governance action to multisig...");
|
|
83
|
+
await multis.submitTransaction(gov.address, 0, data);
|
|
84
|
+
console.log(
|
|
85
|
+
"Governance action sent, but it may still need confirmation(s)."
|
|
86
|
+
);
|
|
87
|
+
});
|
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
* @param {Web3} options.web3 Injected web3 instance
|
|
16
16
|
* @param {Address} options.from Address to deploy contracts from
|
|
17
17
|
*
|
|
18
|
-
* Usage: npx truffle exec scripts/info-print-contract-addresses :
|
|
18
|
+
* Usage: npx truffle exec scripts/info-print-contract-addresses : {OUTPUT_FILE}
|
|
19
19
|
*/
|
|
20
20
|
module.exports = eval(`(${S.toString()})()`)(async function (
|
|
21
21
|
args,
|
package/scripts/libs/common.js
CHANGED
|
@@ -193,13 +193,14 @@ async function sendGovernanceAction(sf, actionFn) {
|
|
|
193
193
|
const gov = await sf.contracts.SuperfluidGovernanceBase.at(
|
|
194
194
|
await sf.host.getGovernance.call()
|
|
195
195
|
);
|
|
196
|
+
console.log("Governance address:", gov.address);
|
|
196
197
|
switch (process.env.GOVERNANCE_ADMIN_TYPE) {
|
|
197
198
|
case "MULTISIG": {
|
|
198
199
|
console.log("Governance Admin Type: MultiSig");
|
|
199
200
|
const multis = await sf.contracts.IMultiSigWallet.at(
|
|
200
201
|
await (await sf.contracts.Ownable.at(gov.address)).owner()
|
|
201
202
|
);
|
|
202
|
-
console.log("MultiSig address:
|
|
203
|
+
console.log("MultiSig address:", multis.address);
|
|
203
204
|
const data = actionFn(gov.contract.methods).encodeABI();
|
|
204
205
|
console.log("MultiSig data", data);
|
|
205
206
|
console.log("Sending governance action to multisig...");
|
|
@@ -198,7 +198,7 @@ module.exports = function getConfig(chainId) {
|
|
|
198
198
|
// governance default configs
|
|
199
199
|
gov_enableAppWhiteListing: true,
|
|
200
200
|
// misc
|
|
201
|
-
|
|
201
|
+
disableTestGovernance: true,
|
|
202
202
|
data: {
|
|
203
203
|
initialBlockNumber: 14700000,
|
|
204
204
|
getLogsRange: 50000,
|