@superfluid-finance/ethereum-contracts 1.7.2-dev.09f3be3.0 → 1.7.2-dev.1ef77a5.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.
Files changed (188) hide show
  1. package/README.md +2 -2
  2. package/artifacts/contracts/apps/SuperAppBaseFlow.sol/SuperAppBaseFlow.json +13 -13
  3. package/artifacts/contracts/apps/SuperfluidLoaderLibrary.sol/SuperfluidLoaderLibrary.json +2 -2
  4. package/artifacts/contracts/mocks/SuperAppBaseFlowTester.sol/SuperAppBaseFlowTester.json +15 -15
  5. package/build/contracts/AccessControl.json +1 -1
  6. package/build/contracts/AccessControlEnumerable.json +1 -1
  7. package/build/contracts/Address.json +1 -1
  8. package/build/contracts/AgreementBase.json +18 -18
  9. package/build/contracts/AgreementLibrary.json +165 -165
  10. package/build/contracts/BaseRelayRecipient.json +57 -57
  11. package/build/contracts/BatchLiquidator.json +382 -382
  12. package/build/contracts/BatchOperation.json +614 -614
  13. package/build/contracts/CFAv1Forwarder.json +1250 -1250
  14. package/build/contracts/CFAv1ForwarderDeployerLibrary.json +2384 -2384
  15. package/build/contracts/CFAv1Library.json +389 -389
  16. package/build/contracts/CallUtils.json +198 -198
  17. package/build/contracts/ClosingOnUpdateFlowTestApp.json +1525 -1525
  18. package/build/contracts/ConstantFlowAgreementV1.json +1087 -1087
  19. package/build/contracts/ConstantInflowNFT.json +402 -402
  20. package/build/contracts/ConstantOutflowNFT.json +661 -661
  21. package/build/contracts/Context.json +1 -1
  22. package/build/contracts/ContextDefinitions.json +614 -614
  23. package/build/contracts/CustomSuperTokenBase.json +19 -19
  24. package/build/contracts/ERC165.json +1 -1
  25. package/build/contracts/ERC1820Implementer.json +1 -1
  26. package/build/contracts/ERC1820RegistryCompiled.json +22 -22
  27. package/build/contracts/ERC20.json +1 -1
  28. package/build/contracts/ERC20WithTokenInfo.json +23 -23
  29. package/build/contracts/ERC777Helper.json +384 -384
  30. package/build/contracts/ERC777RecipientDrainingGas.json +863 -863
  31. package/build/contracts/ERC777RecipientReverting.json +863 -863
  32. package/build/contracts/EnumerableSet.json +1 -1
  33. package/build/contracts/EventsEmitter.json +43 -43
  34. package/build/contracts/ExclusiveInflowTestApp.json +1525 -1525
  35. package/build/contracts/FixedSizeData.json +200 -200
  36. package/build/contracts/FlowExchangeTestApp.json +1526 -1526
  37. package/build/contracts/FlowNFTBase.json +1280 -1280
  38. package/build/contracts/FlowOperatorDefinitions.json +614 -614
  39. package/build/contracts/ForwarderBase.json +190 -190
  40. package/build/contracts/FullUpgradableSuperTokenProxy.json +116 -116
  41. package/build/contracts/IAccessControl.json +1 -1
  42. package/build/contracts/IAccessControlEnumerable.json +1 -1
  43. package/build/contracts/IConstantFlowAgreementV1.json +677 -677
  44. package/build/contracts/IConstantInflowNFT.json +54 -54
  45. package/build/contracts/IConstantOutflowNFT.json +107 -107
  46. package/build/contracts/IDAv1Forwarder.json +912 -912
  47. package/build/contracts/IDAv1ForwarderDeployerLibrary.json +2384 -2384
  48. package/build/contracts/IDAv1Library.json +430 -430
  49. package/build/contracts/IERC165.json +1 -1
  50. package/build/contracts/IERC1820Implementer.json +1 -1
  51. package/build/contracts/IERC1820Registry.json +1 -1
  52. package/build/contracts/IERC20.json +1 -1
  53. package/build/contracts/IERC20Metadata.json +1 -1
  54. package/build/contracts/IERC20Permit.json +1 -1
  55. package/build/contracts/IERC721.json +1 -1
  56. package/build/contracts/IERC721Metadata.json +1 -1
  57. package/build/contracts/IERC777.json +1 -1
  58. package/build/contracts/IERC777Recipient.json +1 -1
  59. package/build/contracts/IERC777Sender.json +1 -1
  60. package/build/contracts/IFlowNFTBase.json +115 -115
  61. package/build/contracts/IInstantDistributionAgreementV1.json +667 -667
  62. package/build/contracts/IMultiSigWallet.json +31 -31
  63. package/build/contracts/IPoolAdminNFT.json +7 -7
  64. package/build/contracts/IPoolMemberNFT.json +7 -7
  65. package/build/contracts/IPureSuperToken.json +62 -62
  66. package/build/contracts/IPureSuperTokenCustom.json +62 -62
  67. package/build/contracts/IRelayRecipient.json +27 -27
  68. package/build/contracts/IResolver.json +38 -38
  69. package/build/contracts/ISETH.json +67 -67
  70. package/build/contracts/ISETHCustom.json +67 -67
  71. package/build/contracts/ISuperAgreement.json +50 -50
  72. package/build/contracts/ISuperApp.json +191 -191
  73. package/build/contracts/ISuperToken.json +695 -695
  74. package/build/contracts/ISuperTokenFactory.json +225 -225
  75. package/build/contracts/ISuperfluid.json +904 -904
  76. package/build/contracts/ISuperfluidGovernance.json +251 -251
  77. package/build/contracts/ISuperfluidToken.json +407 -407
  78. package/build/contracts/ITOGAv1.json +1346 -1346
  79. package/build/contracts/ITOGAv2.json +1346 -1346
  80. package/build/contracts/ITOGAv3.json +1346 -1346
  81. package/build/contracts/Initializable.json +1 -1
  82. package/build/contracts/InstantDistributionAgreementV1.json +594 -594
  83. package/build/contracts/Math.json +1 -1
  84. package/build/contracts/NonClosableOutflowTestApp.json +1526 -1526
  85. package/build/contracts/Ownable.json +1 -1
  86. package/build/contracts/Proxy.json +1 -1
  87. package/build/contracts/ProxyDeployerLibrary.json +2382 -2382
  88. package/build/contracts/PureSuperToken.json +106 -106
  89. package/build/contracts/Resolver.json +98 -98
  90. package/build/contracts/SETHProxy.json +224 -224
  91. package/build/contracts/SafeCast.json +1 -1
  92. package/build/contracts/SafeERC20.json +1 -1
  93. package/build/contracts/SafeGasLibrary.json +51 -51
  94. package/build/contracts/SafeMath.json +1 -1
  95. package/build/contracts/SelfDeletingFlowTestApp.json +1525 -1525
  96. package/build/contracts/SlotsBitmapLibrary.json +457 -457
  97. package/build/contracts/StreamRedirector.json +704 -704
  98. package/build/contracts/Strings.json +1 -1
  99. package/build/contracts/SuperAppBase.json +42 -42
  100. package/build/contracts/SuperAppBaseFlow.json +800 -800
  101. package/build/contracts/SuperAppDefinitions.json +614 -614
  102. package/build/contracts/SuperToken.json +2714 -2714
  103. package/build/contracts/SuperTokenDeployerLibrary.json +2383 -2383
  104. package/build/contracts/SuperTokenFactory.json +1347 -1347
  105. package/build/contracts/SuperTokenFactoryBase.json +1329 -1329
  106. package/build/contracts/SuperTokenV1Library.json +1483 -1483
  107. package/build/contracts/SuperUpgrader.json +439 -439
  108. package/build/contracts/Superfluid.json +5196 -5196
  109. package/build/contracts/SuperfluidCFAv1DeployerLibrary.json +2383 -2383
  110. package/build/contracts/SuperfluidFrameworkDeployer.json +1260 -1260
  111. package/build/contracts/SuperfluidFrameworkDeploymentSteps.json +2382 -2382
  112. package/build/contracts/SuperfluidGovDeployerLibrary.json +2383 -2383
  113. package/build/contracts/SuperfluidGovernanceBase.json +2449 -2449
  114. package/build/contracts/SuperfluidGovernanceConfigs.json +614 -614
  115. package/build/contracts/SuperfluidGovernanceII.json +155 -155
  116. package/build/contracts/SuperfluidGovernanceIIProxy.json +135 -135
  117. package/build/contracts/SuperfluidHostDeployerLibrary.json +2382 -2382
  118. package/build/contracts/SuperfluidIDAv1DeployerLibrary.json +2383 -2383
  119. package/build/contracts/SuperfluidLoader.json +207 -207
  120. package/build/contracts/SuperfluidLoaderDeployerLibrary.json +2384 -2384
  121. package/build/contracts/SuperfluidLoaderLibrary.json +552 -417
  122. package/build/contracts/SuperfluidNFTLogicDeployerLibrary.json +2387 -2387
  123. package/build/contracts/SuperfluidPeripheryDeployerLibrary.json +2385 -2385
  124. package/build/contracts/SuperfluidToken.json +1423 -1423
  125. package/build/contracts/TOGA.json +1360 -1360
  126. package/build/contracts/TestGovernance.json +250 -250
  127. package/build/contracts/TestResolver.json +47 -47
  128. package/build/contracts/TestToken.json +102 -102
  129. package/build/contracts/TokenDeployerLibrary.json +2384 -2384
  130. package/build/contracts/TokenInfo.json +32 -32
  131. package/build/contracts/UUPSProxiable.json +139 -139
  132. package/build/contracts/UUPSProxy.json +81 -81
  133. package/build/contracts/UUPSUtils.json +37 -37
  134. package/build/contracts-sizes.txt +15 -15
  135. package/build/typechain/contracts/apps/SuperAppBaseFlow.d.ts +9 -9
  136. package/build/typechain/contracts/apps/SuperAppBaseFlow.d.ts.map +1 -1
  137. package/build/typechain/contracts/mocks/SuperAppBaseFlowTester.d.ts +9 -9
  138. package/build/typechain/contracts/mocks/SuperAppBaseFlowTester.d.ts.map +1 -1
  139. package/build/typechain/factories/contracts/apps/SuperAppBaseFlow__factory.d.ts +10 -10
  140. package/build/typechain/factories/contracts/apps/SuperAppBaseFlow__factory.js +13 -13
  141. package/build/typechain/factories/contracts/apps/SuperAppBaseFlow__factory.js.map +1 -1
  142. package/build/typechain/factories/contracts/apps/SuperfluidLoaderLibrary__factory.d.ts +1 -1
  143. package/build/typechain/factories/contracts/apps/SuperfluidLoaderLibrary__factory.d.ts.map +1 -1
  144. package/build/typechain/factories/contracts/apps/SuperfluidLoaderLibrary__factory.js +1 -1
  145. package/build/typechain/factories/contracts/apps/SuperfluidLoaderLibrary__factory.js.map +1 -1
  146. package/build/typechain/factories/contracts/mocks/SuperAppBaseFlowTester__factory.d.ts +11 -11
  147. package/build/typechain/factories/contracts/mocks/SuperAppBaseFlowTester__factory.d.ts.map +1 -1
  148. package/build/typechain/factories/contracts/mocks/SuperAppBaseFlowTester__factory.js +14 -14
  149. package/build/typechain/factories/contracts/mocks/SuperAppBaseFlowTester__factory.js.map +1 -1
  150. package/contracts/apps/SuperAppBaseFlow.sol +8 -8
  151. package/contracts/apps/SuperfluidLoaderLibrary.sol +5 -2
  152. package/package.json +5 -5
  153. package/ops-scripts/.eslintrc.js +0 -15
  154. package/ops-scripts/artifacts/ERC1820Registry.json +0 -5
  155. package/ops-scripts/deploy-aux-contracts.js +0 -99
  156. package/ops-scripts/deploy-deterministically.js +0 -169
  157. package/ops-scripts/deploy-erc1820.js +0 -83
  158. package/ops-scripts/deploy-framework.js +0 -895
  159. package/ops-scripts/deploy-mfa.ts +0 -27
  160. package/ops-scripts/deploy-super-token.js +0 -206
  161. package/ops-scripts/deploy-test-environment.js +0 -98
  162. package/ops-scripts/deploy-test-token.js +0 -86
  163. package/ops-scripts/deploy-unlisted-pure-super-token.js +0 -69
  164. package/ops-scripts/deploy-unlisted-super-token.js +0 -68
  165. package/ops-scripts/gov-create-new-app-registration-key.js +0 -75
  166. package/ops-scripts/gov-create-new-factory-registration.js +0 -49
  167. package/ops-scripts/gov-set-3Ps-config.js +0 -67
  168. package/ops-scripts/gov-set-reward-address.js +0 -60
  169. package/ops-scripts/gov-set-token-min-deposit.js +0 -53
  170. package/ops-scripts/gov-set-trusted-forwarder.js +0 -80
  171. package/ops-scripts/gov-transfer-framework-ownership.js +0 -90
  172. package/ops-scripts/gov-upgrade-governance.js +0 -87
  173. package/ops-scripts/gov-upgrade-super-token-logic.js +0 -193
  174. package/ops-scripts/info-inspect-account.js +0 -118
  175. package/ops-scripts/info-list-apps.js +0 -55
  176. package/ops-scripts/info-print-contract-addresses.js +0 -136
  177. package/ops-scripts/info-scan-deployments.js +0 -63
  178. package/ops-scripts/info-show-protocol.js +0 -400
  179. package/ops-scripts/libs/common.js +0 -436
  180. package/ops-scripts/libs/getConfig.js +0 -289
  181. package/ops-scripts/libs/truffleScriptRunnerFactory.js +0 -97
  182. package/ops-scripts/resolver-list-super-token.js +0 -73
  183. package/ops-scripts/resolver-register-token.js +0 -72
  184. package/ops-scripts/resolver-reset-deployment.js +0 -54
  185. package/ops-scripts/resolver-set-key-value.js +0 -69
  186. package/ops-scripts/resolver-unlist-super-token.js +0 -61
  187. package/ops-scripts/tmp-trigger-token-transfer.js +0 -33
  188. package/ops-scripts/validate-nft-addresses.ts +0 -49
@@ -1,118 +0,0 @@
1
- const getConfig = require("./libs/getConfig");
2
- const SuperfluidSDK = require("@superfluid-finance/js-sdk");
3
- const {
4
- getScriptRunnerFactory: S,
5
- extractWeb3Options,
6
- } = require("./libs/common");
7
-
8
- function normalizeFlowRate(fr) {
9
- return ((fr.toString() / 1e18) * 3600 * 24 * 30).toFixed(4) + " / mo";
10
- }
11
-
12
- /**
13
- * @dev Inspect accounts and their agreements
14
- * @param {Array} argv Overriding command line arguments
15
- *
16
- * Usage: npx truffle exec ops-scripts/info-inspect-account.js : 0xACC1 0xACC2 ...
17
- */
18
- module.exports = eval(`(${S.toString()})()`)(async function (
19
- args,
20
- options = {}
21
- ) {
22
- let {protocolReleaseVersion} = options;
23
-
24
- if (args.length < 1) {
25
- throw new Error("Not enough arguments");
26
- }
27
-
28
- const sf = new SuperfluidSDK.Framework({
29
- ...extractWeb3Options(options),
30
- version: protocolReleaseVersion,
31
- loadSuperNativeToken: true,
32
- });
33
- await sf.initialize();
34
- const config = getConfig(sf.chainId);
35
- for (let i = 0; i < config.tokenList.length; ++i) {
36
- await sf.loadToken(config.tokenList[i]);
37
- }
38
- const superTokens = Object.keys(sf.superTokens);
39
-
40
- while (args.length) {
41
- const account = args.shift();
42
- console.log("=".repeat(80));
43
- const isApp = await sf.host.isApp(account);
44
- console.log("Account", account, isApp ? "(app)" : "");
45
- if (isApp) {
46
- console.log("Jailed", await sf.host.isAppJailed(account));
47
- }
48
- for (let i = 0; i < superTokens.length; ++i) {
49
- console.log("-".repeat(80));
50
- const superTokenSymbol = superTokens[i];
51
- const superToken = sf.superTokens[superTokenSymbol];
52
- const underlyingToken = superToken.underlyingToken;
53
- if (underlyingToken) {
54
- const underlyingTokenSymbol = await underlyingToken.symbol();
55
- console.log(
56
- `${underlyingTokenSymbol} balance`,
57
- (await underlyingToken.balanceOf.call(account)).toString() /
58
- 1e18
59
- );
60
- }
61
- const realtimeBalance = await superToken.realtimeBalanceOf.call(
62
- account,
63
- parseInt(Date.now() / 1000)
64
- );
65
- console.log(
66
- `${superTokenSymbol} balance`,
67
- realtimeBalance.availableBalance.toString() / 1e18,
68
- realtimeBalance.deposit.toString() / 1e18,
69
- realtimeBalance.owedDeposit.toString() / 1e18
70
- );
71
- {
72
- console.log("# CFA");
73
- const netFlowRate = await sf.cfa.getNetFlow({
74
- superToken: superToken.address,
75
- account,
76
- });
77
- console.log(`Net flow rate ${normalizeFlowRate(netFlowRate)}`);
78
- const flows = await sf.cfa.listFlows({
79
- superToken: superToken.address,
80
- account,
81
- });
82
- console.log("In Flows:");
83
- console.log(
84
- flows.inFlows.map(
85
- (f) => `${f.sender} -> ${normalizeFlowRate(f.flowRate)}`
86
- )
87
- );
88
- console.log("Out Flows:");
89
- console.log(
90
- flows.outFlows.map(
91
- (f) =>
92
- `${f.receiver} -> ${normalizeFlowRate(f.flowRate)}`
93
- )
94
- );
95
- }
96
- {
97
- console.log("# IDA");
98
- console.log("Indicies:");
99
- const indices = await sf.ida.listIndices({
100
- superToken: superToken.address,
101
- publisher: account,
102
- });
103
- console.log(indices);
104
- console.log("Subscriptions:");
105
- const subscriptions = await sf.ida.listSubscriptions({
106
- superToken: superToken.address,
107
- subscriber: account,
108
- });
109
- console.log(
110
- subscriptions.map(
111
- (s) => `${s.publisher}@${s.indexId} ${s.units} units`
112
- )
113
- );
114
- }
115
- }
116
- console.log("=".repeat(80));
117
- }
118
- });
@@ -1,55 +0,0 @@
1
- const SuperfluidSDK = require("@superfluid-finance/js-sdk");
2
- const {
3
- getScriptRunnerFactory: S,
4
- extractWeb3Options,
5
- } = require("./libs/common");
6
-
7
- module.exports = eval(`(${S.toString()})()`)(async function (
8
- args,
9
- options = {}
10
- ) {
11
- let {protocolReleaseVersion} = options;
12
-
13
- const sf = new SuperfluidSDK.Framework({
14
- ...extractWeb3Options(options),
15
- version: protocolReleaseVersion,
16
- });
17
- await sf.initialize();
18
-
19
- const events = await sf.getPastEvents(sf.host, "AppRegistered");
20
- const apps = [];
21
- const froms = {};
22
- console.log("## Registered apps");
23
- console.log("DateTime | App | Address | From | Jailed");
24
- //for (let i = 0; i < events.length; ++i) {
25
- await Promise.all(
26
- events.map(async (e) => {
27
- //const e = events[i];
28
- const block = await web3.eth.getBlock(e.blockNumber);
29
- const receipt = await web3.eth.getTransactionReceipt(
30
- e.transactionHash
31
- );
32
- receipt !== null && froms[receipt.from]++;
33
- const isJailed = await sf.host.isAppJailed(e.app);
34
- apps.push({
35
- address: e.app,
36
- block,
37
- receipt,
38
- isJailed,
39
- });
40
- })
41
- );
42
- apps.sort((a, b) => a.block.timestamp - b.block.timestamp).forEach(
43
- (app) => {
44
- const date = new Date(app.block.timestamp * 1000);
45
- console.log(
46
- `${date.toISOString().slice(0, 19)} | ${app.address} | ${
47
- (app.receipt || {}).from
48
- } | ${app.isJailed ? "*" : ""}`
49
- );
50
- }
51
- );
52
- console.log("---");
53
- console.log("Total apps registered", apps.length);
54
- console.log("Unique from addresses", Object.keys(froms).length);
55
- });
@@ -1,136 +0,0 @@
1
- const fs = require("fs");
2
- const util = require("util");
3
- const getConfig = require("./libs/getConfig");
4
- const SuperfluidSDK = require("@superfluid-finance/js-sdk");
5
- const {
6
- getScriptRunnerFactory: S,
7
- getCodeAddress,
8
- extractWeb3Options,
9
- } = require("./libs/common");
10
-
11
- /**
12
- * @dev Inspect accounts and their agreements
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.skipTokens Don't iterate through tokens
18
- * (overriding env: SKIP_TOKENS)
19
- *
20
- * Usage: npx truffle exec ops-scripts/info-print-contract-addresses : {OUTPUT_FILE}
21
- */
22
- module.exports = eval(`(${S.toString()})()`)(async function (
23
- args,
24
- options = {}
25
- ) {
26
- let output = "";
27
-
28
- let {
29
- protocolReleaseVersion,
30
- skipTokens
31
- } = options;
32
- skipTokens = skipTokens || process.env.SKIP_TOKENS;
33
-
34
- if (args.length !== 1) {
35
- throw new Error("Wrong number of arguments");
36
- }
37
- const outputFilename = args.shift();
38
-
39
- const networkType = await web3.eth.net.getNetworkType();
40
- const networkId = await web3.eth.net.getId();
41
- const chainId = await web3.eth.getChainId();
42
- console.log("network Type: ", networkType);
43
- console.log("network ID: ", networkId);
44
- console.log("chain ID: ", chainId);
45
- const config = getConfig(chainId);
46
-
47
- const sf = new SuperfluidSDK.Framework({
48
- ...extractWeb3Options(options),
49
- version: protocolReleaseVersion,
50
- tokens: skipTokens ? [] : config.tokenList,
51
- loadSuperNativeToken: !skipTokens, // defaults to true
52
- additionalContracts: ["UUPSProxiable"],
53
- });
54
- await sf.initialize();
55
-
56
- const SuperToken = artifacts.require("SuperToken");
57
- const UUPSProxiable = artifacts.require("UUPSProxiable");
58
- const ISuperTokenFactory = artifacts.require("ISuperTokenFactory");
59
-
60
- output += `NETWORK_ID=${networkId}\n`;
61
- output += `SUPERFLUID_LOADER=${sf.loader.address}\n`;
62
- output += `SUPERFLUID_HOST_PROXY=${sf.host.address}\n`;
63
- output += `SUPERFLUID_HOST_LOGIC=${await getCodeAddress(
64
- UUPSProxiable,
65
- sf.host.address
66
- )}\n`;
67
- output += `SUPERFLUID_GOVERNANCE=${await sf.host.getGovernance()}\n`;
68
- output += `SUPERFLUID_SUPER_TOKEN_FACTORY_PROXY=${await sf.host.getSuperTokenFactory()}\n`;
69
- output += `SUPERFLUID_SUPER_TOKEN_FACTORY_LOGIC=${await sf.host.getSuperTokenFactoryLogic()}\n`;
70
- output += `CFA_PROXY=${sf.agreements.cfa.address}\n`;
71
- output += `CFA_LOGIC=${await getCodeAddress(
72
- UUPSProxiable,
73
- sf.agreements.cfa.address
74
- )}\n`;
75
- output += `IDA_PROXY=${sf.agreements.ida.address}\n`;
76
- output += `SLOTS_BITMAP_LIBRARY_ADDRESS=${
77
- "0x" +
78
- (
79
- await web3.eth.call({
80
- to: sf.agreements.ida.address,
81
- data: "0x3fd4176a", //SLOTS_BITMAP_LIBRARY_ADDRESS()
82
- })
83
- ).slice(-40)
84
- }\n`;
85
- output += `IDA_LOGIC=${await getCodeAddress(
86
- UUPSProxiable,
87
- sf.agreements.ida.address
88
- )}\n`;
89
- const superTokenLogicAddress = await (
90
- await ISuperTokenFactory.at(await sf.host.getSuperTokenFactory())
91
- ).getSuperTokenLogic();
92
- output += `SUPERFLUID_SUPER_TOKEN_LOGIC=${superTokenLogicAddress}\n`;
93
-
94
- const superTokenLogicContract = await SuperToken.at(superTokenLogicAddress);
95
-
96
- const constantOutflowNFTProxyAddress =
97
- await superTokenLogicContract.CONSTANT_OUTFLOW_NFT();
98
- output += `CONSTANT_OUTFLOW_NFT_PROXY=${constantOutflowNFTProxyAddress}\n`;
99
-
100
- const constantOutflowNFTLogicAddress = await (
101
- await UUPSProxiable.at(constantOutflowNFTProxyAddress)
102
- ).getCodeAddress();
103
- output += `CONSTANT_OUTFLOW_NFT_LOGIC=${constantOutflowNFTLogicAddress}\n`;
104
-
105
- const constantInflowNFTProxyAddress =
106
- await superTokenLogicContract.CONSTANT_INFLOW_NFT();
107
- output += `CONSTANT_INFLOW_NFT_PROXY=${constantInflowNFTProxyAddress}\n`;
108
-
109
- const constantInflowNFTLogicAddress = await (
110
- await UUPSProxiable.at(constantInflowNFTProxyAddress)
111
- ).getCodeAddress();
112
- output += `CONSTANT_INFLOW_NFT_LOGIC=${constantInflowNFTLogicAddress}\n`;
113
-
114
- if (! skipTokens) {
115
- await Promise.all(
116
- config.tokenList.map(async (tokenName) => {
117
- output += `SUPER_TOKEN_${tokenName.toUpperCase()}=${
118
- sf.tokens[tokenName].address
119
- }\n`;
120
- const underlyingTokenSymbol = await sf.tokens[
121
- tokenName
122
- ].underlyingToken.symbol.call();
123
- output += `NON_SUPER_TOKEN_${underlyingTokenSymbol.toUpperCase()}=${
124
- sf.tokens[tokenName].underlyingToken.address
125
- }\n`;
126
- })
127
- );
128
- if (sf.config.nativeTokenSymbol) {
129
- output += `SUPER_TOKEN_NATIVE_COIN=${
130
- sf.tokens[sf.config.nativeTokenSymbol + "x"].address
131
- }\n`;
132
- }
133
- }
134
-
135
- await util.promisify(fs.writeFile)(outputFilename, output);
136
- });
@@ -1,63 +0,0 @@
1
- const _ = require("lodash");
2
- const getConfig = require("./libs/getConfig");
3
- const {getScriptRunnerFactory: S, getPastEvents} = require("./libs/common");
4
-
5
- /**
6
- * @dev Scans the network for a protocol deployment by looking for AgreementClassRegistered events
7
- *
8
- * Usage: npx truffle exec ops-scripts/info-scan-deployments.js
9
- */
10
-
11
- module.exports = eval(`(${S.toString()})()`)(async function () {
12
- const networkType = await web3.eth.net.getNetworkType();
13
- const networkId = await web3.eth.net.getId();
14
- const chainId = await web3.eth.getChainId();
15
- console.log("network Type: ", networkType);
16
- console.log("network ID: ", networkId);
17
- console.log("chain ID: ", chainId);
18
- const config = getConfig(chainId);
19
-
20
- // infer deployment from AgreementClassRegistered events
21
- const AgreementClassRegistered = web3.utils.sha3(
22
- "AgreementClassRegistered(bytes32,address)"
23
- );
24
- const events = await getPastEvents({
25
- config,
26
- topics: [AgreementClassRegistered],
27
- });
28
-
29
- const deployments = events.reduce((acc, cur) => {
30
- acc[cur.address] = _.defaults(acc[cur.address], {
31
- host: cur.address,
32
- transactions: new Set(),
33
- deployers: new Set(),
34
- });
35
- acc[cur.address].transactions.add(cur.transactionHash);
36
- return acc;
37
- }, {});
38
-
39
- if (deployments.length == 0)
40
- throw new Error("No Superfluid is ever deployed!?");
41
-
42
- const deployers = new Set();
43
- await Promise.all(
44
- Object.values(deployments).map(async (deployment) => {
45
- const transactions = Array.from(deployment.transactions);
46
- for (let i = 0; i < transactions.length; ++i) {
47
- const tx = await web3.eth.getTransaction(transactions[i]);
48
- deployers.add(tx.from);
49
- deployment.deployers.add(tx.from);
50
- }
51
- })
52
- );
53
-
54
- console.log("Host contracts:");
55
- console.log(
56
- Object.values(deployments).map((i) => {
57
- return `${i.host} deployed by ${Array.from(i.deployers)}`;
58
- })
59
- );
60
-
61
- console.log("All Deployers:");
62
- console.log(Array.from(deployers));
63
- });