@superfluid-finance/ethereum-contracts 1.3.2-dev.8696fa0.0 → 1.3.2-dev.9e41aae.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 (110) hide show
  1. package/build/contracts/AccessControl.json +1 -1
  2. package/build/contracts/AccessControlEnumerable.json +1 -1
  3. package/build/contracts/Address.json +1 -1
  4. package/build/contracts/AgreementBase.json +18 -18
  5. package/build/contracts/AgreementLibrary.json +165 -165
  6. package/build/contracts/BaseRelayRecipient.json +55 -55
  7. package/build/contracts/BatchLiquidator.json +208 -208
  8. package/build/contracts/BatchOperation.json +599 -599
  9. package/build/contracts/CFAv1Library.json +389 -389
  10. package/build/contracts/CallUtils.json +198 -198
  11. package/build/contracts/ClosingOnUpdateFlowTestApp.json +1525 -1525
  12. package/build/contracts/ConstantFlowAgreementV1.json +932 -932
  13. package/build/contracts/Context.json +1 -1
  14. package/build/contracts/ContextDefinitions.json +599 -599
  15. package/build/contracts/Create2.json +1 -1
  16. package/build/contracts/CustomSuperTokenBase.json +19 -19
  17. package/build/contracts/ERC165.json +1 -1
  18. package/build/contracts/ERC1820Implementer.json +1 -1
  19. package/build/contracts/ERC1820RegistryCompiled.json +22 -22
  20. package/build/contracts/ERC20.json +1 -1
  21. package/build/contracts/ERC20Burnable.json +1 -1
  22. package/build/contracts/ERC20Pausable.json +1 -1
  23. package/build/contracts/ERC20PresetMinterPauser.json +1 -1
  24. package/build/contracts/ERC20WithTokenInfo.json +23 -23
  25. package/build/contracts/ERC777Helper.json +380 -380
  26. package/build/contracts/ERC777RecipientDrainingGas.json +855 -855
  27. package/build/contracts/ERC777RecipientReverting.json +855 -855
  28. package/build/contracts/EnumerableSet.json +1 -1
  29. package/build/contracts/EventsEmitter.json +43 -43
  30. package/build/contracts/ExclusiveInflowTestApp.json +1525 -1525
  31. package/build/contracts/FixedSizeData.json +200 -200
  32. package/build/contracts/FlowExchangeTestApp.json +1526 -1526
  33. package/build/contracts/FlowOperatorDefinitions.json +599 -599
  34. package/build/contracts/FullUpgradableSuperTokenProxy.json +112 -112
  35. package/build/contracts/IAccessControl.json +1 -1
  36. package/build/contracts/IAccessControlEnumerable.json +1 -1
  37. package/build/contracts/IConstantFlowAgreementV1.json +567 -567
  38. package/build/contracts/IDAv1Library.json +430 -430
  39. package/build/contracts/IERC165.json +1 -1
  40. package/build/contracts/IERC1820Implementer.json +1 -1
  41. package/build/contracts/IERC1820Registry.json +1 -1
  42. package/build/contracts/IERC20.json +1 -1
  43. package/build/contracts/IERC20Metadata.json +1 -1
  44. package/build/contracts/IERC20Permit.json +1 -1
  45. package/build/contracts/IERC777.json +1 -1
  46. package/build/contracts/IERC777Recipient.json +1 -1
  47. package/build/contracts/IERC777Sender.json +1 -1
  48. package/build/contracts/IInstantDistributionAgreementV1.json +640 -640
  49. package/build/contracts/IMaticBridgedNativeSuperToken.json +62 -62
  50. package/build/contracts/IMaticBridgedNativeSuperTokenCustom.json +62 -62
  51. package/build/contracts/IMultiSigWallet.json +24 -24
  52. package/build/contracts/IPureSuperToken.json +42 -42
  53. package/build/contracts/IPureSuperTokenCustom.json +42 -42
  54. package/build/contracts/IRelayRecipient.json +27 -27
  55. package/build/contracts/IResolver.json +38 -38
  56. package/build/contracts/ISETH.json +47 -47
  57. package/build/contracts/ISETHCustom.json +47 -47
  58. package/build/contracts/ISuperAgreement.json +50 -50
  59. package/build/contracts/ISuperApp.json +191 -191
  60. package/build/contracts/ISuperToken.json +523 -523
  61. package/build/contracts/ISuperTokenFactory.json +160 -160
  62. package/build/contracts/ISuperfluid.json +826 -826
  63. package/build/contracts/ISuperfluidGovernance.json +242 -242
  64. package/build/contracts/ISuperfluidToken.json +389 -389
  65. package/build/contracts/ITOGAv1.json +1441 -1441
  66. package/build/contracts/ITOGAv2.json +1441 -1441
  67. package/build/contracts/Initializable.json +1 -1
  68. package/build/contracts/InstantDistributionAgreementV1.json +567 -567
  69. package/build/contracts/MaticBridgedNativeSuperTokenProxy.json +228 -228
  70. package/build/contracts/NonClosableOutflowTestApp.json +1526 -1526
  71. package/build/contracts/Ownable.json +1 -1
  72. package/build/contracts/Pausable.json +1 -1
  73. package/build/contracts/Proxy.json +1 -1
  74. package/build/contracts/PureSuperToken.json +106 -106
  75. package/build/contracts/Resolver.json +98 -98
  76. package/build/contracts/SETHProxy.json +224 -224
  77. package/build/contracts/SafeCast.json +1 -1
  78. package/build/contracts/SafeERC20.json +1 -1
  79. package/build/contracts/SafeMath.json +1 -1
  80. package/build/contracts/SelfDeletingFlowTestApp.json +1525 -1525
  81. package/build/contracts/SlotsBitmapLibrary.json +457 -457
  82. package/build/contracts/StreamRedirector.json +704 -704
  83. package/build/contracts/Strings.json +1 -1
  84. package/build/contracts/SuperAppBase.json +42 -42
  85. package/build/contracts/SuperAppDefinitions.json +599 -599
  86. package/build/contracts/SuperToken.json +2362 -2362
  87. package/build/contracts/SuperTokenFactory.json +747 -747
  88. package/build/contracts/SuperTokenFactoryBase.json +737 -737
  89. package/build/contracts/SuperTokenFactoryHelper.json +740 -740
  90. package/build/contracts/SuperUpgrader.json +437 -437
  91. package/build/contracts/Superfluid.json +4860 -4860
  92. package/build/contracts/SuperfluidFrameworkDeployer.json +690 -690
  93. package/build/contracts/SuperfluidGovernanceBase.json +3933 -2158
  94. package/build/contracts/SuperfluidGovernanceConfigs.json +599 -599
  95. package/build/contracts/SuperfluidGovernanceII.json +7488 -4364
  96. package/build/contracts/SuperfluidGovernanceIIProxy.json +131 -131
  97. package/build/contracts/SuperfluidLoader.json +207 -207
  98. package/build/contracts/SuperfluidToken.json +1404 -1404
  99. package/build/contracts/TOGA.json +1458 -1458
  100. package/build/contracts/TestGovernance.json +8293 -5439
  101. package/build/contracts/TestToken.json +93 -93
  102. package/build/contracts/TokenCustodian.json +214 -214
  103. package/build/contracts/TokenInfo.json +32 -32
  104. package/build/contracts/UUPSProxiable.json +139 -139
  105. package/build/contracts/UUPSProxy.json +81 -81
  106. package/build/contracts/UUPSUtils.json +37 -37
  107. package/build/contracts-sizes.txt +1 -1
  108. package/contracts/gov/SuperfluidGovernanceBase.sol +98 -35
  109. package/package.json +2 -2
  110. package/scripts/gov-create-new-app-registration-key.js +9 -19
@@ -15,15 +15,15 @@
15
15
  "absolutePath": "project:/contracts/upgradability/UUPSUtils.sol",
16
16
  "exportedSymbols": {
17
17
  "UUPSUtils": [
18
- 37098
18
+ 37220
19
19
  ]
20
20
  },
21
- "id": 37099,
21
+ "id": 37221,
22
22
  "license": "AGPLv3",
23
23
  "nodeType": "SourceUnit",
24
24
  "nodes": [
25
25
  {
26
- "id": 37076,
26
+ "id": 37198,
27
27
  "literals": [
28
28
  "solidity",
29
29
  "0.8",
@@ -39,15 +39,15 @@
39
39
  "contractDependencies": [],
40
40
  "contractKind": "library",
41
41
  "documentation": {
42
- "id": 37077,
42
+ "id": 37199,
43
43
  "nodeType": "StructuredDocumentation",
44
44
  "src": "60:76:97",
45
45
  "text": " @title UUPS (Universal Upgradeable Proxy Standard) Shared Library"
46
46
  },
47
47
  "fullyImplemented": true,
48
- "id": 37098,
48
+ "id": 37220,
49
49
  "linearizedBaseContracts": [
50
- 37098
50
+ 37220
51
51
  ],
52
52
  "name": "UUPSUtils",
53
53
  "nameLocation": "145:9:97",
@@ -56,17 +56,17 @@
56
56
  {
57
57
  "constant": true,
58
58
  "documentation": {
59
- "id": 37078,
59
+ "id": 37200,
60
60
  "nodeType": "StructuredDocumentation",
61
61
  "src": "162:288:97",
62
62
  "text": " @dev Implementation slot constant.\n Using https://eips.ethereum.org/EIPS/eip-1967 standard\n Storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\n (obtained as bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1))."
63
63
  },
64
- "id": 37081,
64
+ "id": 37203,
65
65
  "mutability": "constant",
66
66
  "name": "_IMPLEMENTATION_SLOT",
67
67
  "nameLocation": "481:20:97",
68
68
  "nodeType": "VariableDeclaration",
69
- "scope": 37098,
69
+ "scope": 37220,
70
70
  "src": "455:115:97",
71
71
  "stateVariable": true,
72
72
  "storageLocation": "default",
@@ -75,7 +75,7 @@
75
75
  "typeString": "bytes32"
76
76
  },
77
77
  "typeName": {
78
- "id": 37079,
78
+ "id": 37201,
79
79
  "name": "bytes32",
80
80
  "nodeType": "ElementaryTypeName",
81
81
  "src": "455:7:97",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "value": {
88
88
  "hexValue": "307833363038393461313362613161333231303636376338323834393264623938646361336532303736636333373335613932306133636135303564333832626263",
89
- "id": 37080,
89
+ "id": 37202,
90
90
  "isConstant": false,
91
91
  "isLValue": false,
92
92
  "isPure": true,
@@ -104,7 +104,7 @@
104
104
  },
105
105
  {
106
106
  "body": {
107
- "id": 37088,
107
+ "id": 37210,
108
108
  "nodeType": "Block",
109
109
  "src": "681:107:97",
110
110
  "statements": [
@@ -145,33 +145,33 @@
145
145
  "evmVersion": "london",
146
146
  "externalReferences": [
147
147
  {
148
- "declaration": 37081,
148
+ "declaration": 37203,
149
149
  "isOffset": false,
150
150
  "isSlot": false,
151
151
  "src": "751:20:97",
152
152
  "valueSize": 1
153
153
  },
154
154
  {
155
- "declaration": 37085,
155
+ "declaration": 37207,
156
156
  "isOffset": false,
157
157
  "isSlot": false,
158
158
  "src": "737:4:97",
159
159
  "valueSize": 1
160
160
  }
161
161
  ],
162
- "id": 37087,
162
+ "id": 37209,
163
163
  "nodeType": "InlineAssembly",
164
164
  "src": "691:91:97"
165
165
  }
166
166
  ]
167
167
  },
168
168
  "documentation": {
169
- "id": 37082,
169
+ "id": 37204,
170
170
  "nodeType": "StructuredDocumentation",
171
171
  "src": "577:36:97",
172
172
  "text": "@dev Get implementation address."
173
173
  },
174
- "id": 37089,
174
+ "id": 37211,
175
175
  "implemented": true,
176
176
  "kind": "function",
177
177
  "modifiers": [],
@@ -179,23 +179,23 @@
179
179
  "nameLocation": "627:14:97",
180
180
  "nodeType": "FunctionDefinition",
181
181
  "parameters": {
182
- "id": 37083,
182
+ "id": 37205,
183
183
  "nodeType": "ParameterList",
184
184
  "parameters": [],
185
185
  "src": "641:2:97"
186
186
  },
187
187
  "returnParameters": {
188
- "id": 37086,
188
+ "id": 37208,
189
189
  "nodeType": "ParameterList",
190
190
  "parameters": [
191
191
  {
192
192
  "constant": false,
193
- "id": 37085,
193
+ "id": 37207,
194
194
  "mutability": "mutable",
195
195
  "name": "impl",
196
196
  "nameLocation": "675:4:97",
197
197
  "nodeType": "VariableDeclaration",
198
- "scope": 37089,
198
+ "scope": 37211,
199
199
  "src": "667:12:97",
200
200
  "stateVariable": false,
201
201
  "storageLocation": "default",
@@ -204,7 +204,7 @@
204
204
  "typeString": "address"
205
205
  },
206
206
  "typeName": {
207
- "id": 37084,
207
+ "id": 37206,
208
208
  "name": "address",
209
209
  "nodeType": "ElementaryTypeName",
210
210
  "src": "667:7:97",
@@ -219,7 +219,7 @@
219
219
  ],
220
220
  "src": "666:14:97"
221
221
  },
222
- "scope": 37098,
222
+ "scope": 37220,
223
223
  "src": "618:170:97",
224
224
  "stateMutability": "view",
225
225
  "virtual": false,
@@ -227,7 +227,7 @@
227
227
  },
228
228
  {
229
229
  "body": {
230
- "id": 37096,
230
+ "id": 37218,
231
231
  "nodeType": "Block",
232
232
  "src": "896:171:97",
233
233
  "statements": [
@@ -266,33 +266,33 @@
266
266
  "evmVersion": "london",
267
267
  "externalReferences": [
268
268
  {
269
- "declaration": 37081,
269
+ "declaration": 37203,
270
270
  "isOffset": false,
271
271
  "isSlot": false,
272
272
  "src": "988:20:97",
273
273
  "valueSize": 1
274
274
  },
275
275
  {
276
- "declaration": 37092,
276
+ "declaration": 37214,
277
277
  "isOffset": false,
278
278
  "isSlot": false,
279
279
  "src": "1026:11:97",
280
280
  "valueSize": 1
281
281
  }
282
282
  ],
283
- "id": 37095,
283
+ "id": 37217,
284
284
  "nodeType": "InlineAssembly",
285
285
  "src": "906:155:97"
286
286
  }
287
287
  ]
288
288
  },
289
289
  "documentation": {
290
- "id": 37090,
290
+ "id": 37212,
291
291
  "nodeType": "StructuredDocumentation",
292
292
  "src": "794:40:97",
293
293
  "text": "@dev Set new implementation address."
294
294
  },
295
- "id": 37097,
295
+ "id": 37219,
296
296
  "implemented": true,
297
297
  "kind": "function",
298
298
  "modifiers": [],
@@ -300,17 +300,17 @@
300
300
  "nameLocation": "848:17:97",
301
301
  "nodeType": "FunctionDefinition",
302
302
  "parameters": {
303
- "id": 37093,
303
+ "id": 37215,
304
304
  "nodeType": "ParameterList",
305
305
  "parameters": [
306
306
  {
307
307
  "constant": false,
308
- "id": 37092,
308
+ "id": 37214,
309
309
  "mutability": "mutable",
310
310
  "name": "codeAddress",
311
311
  "nameLocation": "874:11:97",
312
312
  "nodeType": "VariableDeclaration",
313
- "scope": 37097,
313
+ "scope": 37219,
314
314
  "src": "866:19:97",
315
315
  "stateVariable": false,
316
316
  "storageLocation": "default",
@@ -319,7 +319,7 @@
319
319
  "typeString": "address"
320
320
  },
321
321
  "typeName": {
322
- "id": 37091,
322
+ "id": 37213,
323
323
  "name": "address",
324
324
  "nodeType": "ElementaryTypeName",
325
325
  "src": "866:7:97",
@@ -335,19 +335,19 @@
335
335
  "src": "865:21:97"
336
336
  },
337
337
  "returnParameters": {
338
- "id": 37094,
338
+ "id": 37216,
339
339
  "nodeType": "ParameterList",
340
340
  "parameters": [],
341
341
  "src": "896:0:97"
342
342
  },
343
- "scope": 37098,
343
+ "scope": 37220,
344
344
  "src": "839:228:97",
345
345
  "stateMutability": "nonpayable",
346
346
  "virtual": false,
347
347
  "visibility": "internal"
348
348
  }
349
349
  ],
350
- "scope": 37099,
350
+ "scope": 37221,
351
351
  "src": "137:933:97",
352
352
  "usedErrors": []
353
353
  }
@@ -360,7 +360,7 @@
360
360
  },
361
361
  "networks": {},
362
362
  "schemaVersion": "3.4.8",
363
- "updatedAt": "2022-08-29T16:08:02.781Z",
363
+ "updatedAt": "2022-08-30T13:03:13.792Z",
364
364
  "devdoc": {
365
365
  "kind": "dev",
366
366
  "methods": {},
@@ -7,5 +7,5 @@ InstantDistributionAgreementV1.sol : 21835 (2741)
7
7
  AgreementLibrary.sol : 143 (24433)
8
8
  ConstantFlowAgreementV1.sol : 21805 (2771)
9
9
  AgreementBase.sol : 2 (24574)
10
- SuperfluidGovernanceII.sol : 7347 (17229)
10
+ SuperfluidGovernanceII.sol : 8402 (16174)
11
11
  SuperfluidGovernanceBase.sol : 2 (24574)
@@ -218,7 +218,7 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
218
218
  }
219
219
 
220
220
  /**************************************************************************
221
- /* Known Configurations
221
+ /* Convenience methods for known Configurations
222
222
  /*************************************************************************/
223
223
 
224
224
  // Superfluid rewardAddress
@@ -232,7 +232,8 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
232
232
  ISuperfluid host,
233
233
  ISuperfluidToken superToken
234
234
  )
235
- public view returns (address)
235
+ public view
236
+ returns (address)
236
237
  {
237
238
  return getConfigAsAddress(
238
239
  host, superToken,
@@ -246,11 +247,11 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
246
247
  )
247
248
  public
248
249
  {
249
- emit RewardAddressChanged(host, superToken, true, rewardAddress);
250
- return _setConfig(
250
+ _setConfig(
251
251
  host, superToken,
252
252
  SuperfluidGovernanceConfigs.SUPERFLUID_REWARD_ADDRESS_CONFIG_KEY,
253
253
  rewardAddress);
254
+ emit RewardAddressChanged(host, superToken, true, rewardAddress);
254
255
  }
255
256
 
256
257
  function clearRewardAddress(
@@ -259,10 +260,10 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
259
260
  )
260
261
  public
261
262
  {
262
- emit RewardAddressChanged(host, superToken, false, address(0));
263
263
  _clearConfig(
264
264
  host, superToken,
265
265
  SuperfluidGovernanceConfigs.SUPERFLUID_REWARD_ADDRESS_CONFIG_KEY);
266
+ emit RewardAddressChanged(host, superToken, false, address(0));
266
267
  }
267
268
 
268
269
  // CFAv1 liquidationPeriod (DEPRECATED BY PPPConfigurationChanged)
@@ -283,16 +284,17 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
283
284
  function getPPPConfig(
284
285
  ISuperfluid host,
285
286
  ISuperfluidToken superToken
286
- ) public view
287
+ )
288
+ public view
287
289
  returns (uint256 liquidationPeriod, uint256 patricianPeriod)
288
- {
289
- uint256 pppConfig = getConfigAsUint256(
290
- host,
291
- superToken,
292
- SuperfluidGovernanceConfigs.CFAV1_PPP_CONFIG_KEY
293
- );
294
- (liquidationPeriod, patricianPeriod) = SuperfluidGovernanceConfigs.decodePPPConfig(pppConfig);
295
- }
290
+ {
291
+ uint256 pppConfig = getConfigAsUint256(
292
+ host,
293
+ superToken,
294
+ SuperfluidGovernanceConfigs.CFAV1_PPP_CONFIG_KEY
295
+ );
296
+ (liquidationPeriod, patricianPeriod) = SuperfluidGovernanceConfigs.decodePPPConfig(pppConfig);
297
+ }
296
298
 
297
299
  function setPPPConfig(
298
300
  ISuperfluid host,
@@ -307,23 +309,27 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
307
309
  && patricianPeriod < type(uint32).max,
308
310
  "SFGov: Invalid liquidationPeriod or patricianPeriod"
309
311
  );
310
- emit PPPConfigurationChanged(host, superToken, true, liquidationPeriod, patricianPeriod);
311
312
  uint256 value = (uint256(liquidationPeriod) << 32) | uint256(patricianPeriod);
312
- return _setConfig(
313
+ _setConfig(
313
314
  host,
314
315
  superToken,
315
316
  SuperfluidGovernanceConfigs.CFAV1_PPP_CONFIG_KEY,
316
317
  value
317
318
  );
319
+ emit PPPConfigurationChanged(host, superToken, true, liquidationPeriod, patricianPeriod);
318
320
  }
319
321
 
320
322
  function clearPPPConfig(
321
323
  ISuperfluid host,
322
324
  ISuperfluidToken superToken
323
- ) public {
325
+ )
326
+ public
327
+ {
328
+ _clearConfig(host, superToken, SuperfluidGovernanceConfigs.CFAV1_PPP_CONFIG_KEY);
324
329
  emit PPPConfigurationChanged(host, superToken, false, 0, 0);
325
- return _clearConfig(host, superToken, SuperfluidGovernanceConfigs.CFAV1_PPP_CONFIG_KEY);
326
330
  }
331
+
332
+ // CFAv1 minimum deposit
327
333
  event SuperTokenMinimumDepositChanged(
328
334
  ISuperfluid indexed host,
329
335
  ISuperfluidToken indexed superToken,
@@ -334,8 +340,9 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
334
340
  function getSuperTokenMinimumDeposit(
335
341
  ISuperfluid host,
336
342
  ISuperfluidToken superToken
337
- ) public view
338
- returns (uint256 value)
343
+ )
344
+ public view
345
+ returns (uint256 value)
339
346
  {
340
347
  return getConfigAsUint256(host, superToken,
341
348
  SuperfluidGovernanceConfigs.SUPERTOKEN_MINIMUM_DEPOSIT_KEY);
@@ -345,18 +352,21 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
345
352
  ISuperfluid host,
346
353
  ISuperfluidToken superToken,
347
354
  uint256 value
348
- ) public {
355
+ )
356
+ public
357
+ {
358
+ _setConfig(host, superToken, SuperfluidGovernanceConfigs.SUPERTOKEN_MINIMUM_DEPOSIT_KEY, value);
349
359
  emit SuperTokenMinimumDepositChanged(host, superToken, true, value);
350
- return _setConfig(host, superToken, SuperfluidGovernanceConfigs.SUPERTOKEN_MINIMUM_DEPOSIT_KEY, value);
351
360
  }
352
361
 
353
362
  function clearSuperTokenMinimumDeposit(
354
363
  ISuperfluid host,
355
364
  ISuperToken superToken
356
- ) public
365
+ )
366
+ public
357
367
  {
368
+ _clearConfig(host, superToken, SuperfluidGovernanceConfigs.SUPERTOKEN_MINIMUM_DEPOSIT_KEY);
358
369
  emit SuperTokenMinimumDepositChanged(host, superToken, false, 0);
359
- return _clearConfig(host, superToken, SuperfluidGovernanceConfigs.SUPERTOKEN_MINIMUM_DEPOSIT_KEY);
360
370
  }
361
371
 
362
372
  // trustedForwarder
@@ -401,26 +411,78 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
401
411
  )
402
412
  public
403
413
  {
404
- _setConfig(
414
+ _clearConfig(
405
415
  host, superToken,
406
- SuperfluidGovernanceConfigs.getTrustedForwarderConfigKey(forwarder),
407
- 0);
416
+ SuperfluidGovernanceConfigs.getTrustedForwarderConfigKey(forwarder));
408
417
  emit TrustedForwarderChanged(host, superToken, true, forwarder, false);
409
418
  }
410
419
 
411
- function clearTrustedForwarder(
420
+ // Superfluid registrationKey
421
+ event AppRegistrationKeyChanged(
422
+ ISuperfluid indexed host,
423
+ address indexed deployer,
424
+ string appRegistrationKey,
425
+ uint256 expirationTs
426
+ );
427
+
428
+ function verifyAppRegistrationKey(
412
429
  ISuperfluid host,
413
- ISuperfluidToken superToken,
414
- address forwarder
430
+ address deployer,
431
+ string memory registrationKey
432
+ )
433
+ public view
434
+ returns(bool validNow, uint256 expirationTs)
435
+ {
436
+ bytes32 configKey = SuperfluidGovernanceConfigs.getAppRegistrationConfigKey(
437
+ deployer,
438
+ registrationKey
439
+ );
440
+ uint256 expirationTs = getConfigAsUint256(host, ISuperfluidToken(address(0)), configKey);
441
+ return (
442
+ // solhint-disable-next-line not-rely-on-time
443
+ expirationTs >= block.timestamp,
444
+ expirationTs
445
+ );
446
+ }
447
+
448
+ function setAppRegistrationKey(
449
+ ISuperfluid host,
450
+ address deployer,
451
+ string memory registrationKey,
452
+ uint256 expirationTs
415
453
  )
416
454
  public
417
455
  {
418
- emit TrustedForwarderChanged(host, superToken, false, forwarder, false);
419
- return _clearConfig(
420
- host, superToken,
421
- SuperfluidGovernanceConfigs.getTrustedForwarderConfigKey(forwarder));
456
+ bytes32 configKey = SuperfluidGovernanceConfigs.getAppRegistrationConfigKey(
457
+ deployer,
458
+ registrationKey
459
+ );
460
+ _setConfig(host, ISuperfluidToken(address(0)), configKey, expirationTs);
461
+ emit AppRegistrationKeyChanged(host, deployer, registrationKey, expirationTs);
422
462
  }
423
463
 
464
+ function clearAppRegistrationKey(
465
+ ISuperfluid host,
466
+ address deployer,
467
+ string memory registrationKey
468
+ )
469
+ public
470
+ {
471
+ bytes32 configKey = SuperfluidGovernanceConfigs.getAppRegistrationConfigKey(
472
+ deployer,
473
+ registrationKey
474
+ );
475
+ _clearConfig(host, ISuperfluidToken(address(0)), configKey);
476
+ emit AppRegistrationKeyChanged(host, deployer, registrationKey, 0);
477
+ }
478
+
479
+ // Superfluid App factory
480
+ event AppFactoryAuthorizationChanged(
481
+ ISuperfluid indexed host,
482
+ address indexed factory,
483
+ bool authorized
484
+ );
485
+
424
486
  /**
425
487
  * @dev tells if the given factory is authorized to register apps
426
488
  */
@@ -453,11 +515,11 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
453
515
  assembly { cs := extcodesize(factory) }
454
516
  require(cs > 0, "SFGov: factory must be a contract");
455
517
  }
456
-
457
518
  _setConfig(
458
519
  host, ISuperfluidToken(address(0)),
459
520
  SuperfluidGovernanceConfigs.getAppFactoryConfigKey(factory),
460
521
  1);
522
+ emit AppFactoryAuthorizationChanged(host, factory, true);
461
523
  }
462
524
 
463
525
  /**
@@ -473,6 +535,7 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
473
535
  _clearConfig(
474
536
  host, ISuperfluidToken(address(0)),
475
537
  SuperfluidGovernanceConfigs.getAppFactoryConfigKey(factory));
538
+ emit AppFactoryAuthorizationChanged(host, factory, false);
476
539
  }
477
540
 
478
541
  // TODO: would like to use virtual modifier, but solhint doesn't like it atm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superfluid-finance/ethereum-contracts",
3
- "version": "1.3.2-dev.8696fa0.0",
3
+ "version": "1.3.2-dev.9e41aae.0",
4
4
  "description": " Ethereum contracts implementation for the Superfluid Protocol",
5
5
  "homepage": "https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/ethereum-contracts#readme",
6
6
  "repository": {
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "@decentral.ee/web3-helpers": "0.5.3",
59
59
  "@openzeppelin/contracts": "4.7.0",
60
- "@superfluid-finance/js-sdk": "^0.6.4-dev.8696fa0.0",
60
+ "@superfluid-finance/js-sdk": "^0.6.4-dev.9e41aae.0",
61
61
  "@truffle/contract": "4.5.15",
62
62
  "ethereumjs-tx": "2.1.2",
63
63
  "ethereumjs-util": "7.1.5",
@@ -6,8 +6,6 @@ const {
6
6
  sendGovernanceAction,
7
7
  } = require("./libs/common");
8
8
 
9
- const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
10
-
11
9
  /**
12
10
  * @dev Create a new super app registration key.
13
11
  * @param {Array} argv Overriding command line arguments
@@ -43,11 +41,12 @@ module.exports = eval(`(${S.toString()})({
43
41
  throw new Error("EXPIRATON_TS not an integer");
44
42
  }
45
43
  expirationTs = parsedExpTs;
46
- console.log("Expiration timestamp", expirationTs);
47
44
  }
48
- const registrationkey = args.pop();
45
+ const registrationKey = args.pop();
49
46
  const deployer = args.pop();
50
47
  console.log("Deployer", deployer);
48
+ console.log("Registration key", registrationKey);
49
+ console.log("Expiration timestamp", expirationTs);
51
50
 
52
51
  console.log("protocol release version:", protocolReleaseVersion);
53
52
 
@@ -63,23 +62,14 @@ module.exports = eval(`(${S.toString()})({
63
62
  });
64
63
  await sf.initialize();
65
64
 
66
- const appKey = web3.utils.sha3(
67
- web3.eth.abi.encodeParameters(
68
- ["string", "address", "string"],
69
- [
70
- "org.superfluid-finance.superfluid.appWhiteListing.registrationKey",
71
- deployer,
72
- registrationkey,
73
- ]
74
- )
75
- );
76
- console.log("App key", appKey);
77
65
  console.log("Expiration date", new Date(expirationTs * 1000)); // print human readable
78
66
 
79
- // Note that we are NOT using gov.whiteListNewApp here, because it doesn't support setting
80
- // an expiration date and will eventually be deprecated.
81
- // Instead we use the lower level setConfig directly.
82
67
  await sendGovernanceAction(sf, (gov) =>
83
- gov.setConfig(sf.host.address, ZERO_ADDRESS, appKey, expirationTs)
68
+ gov.setAppRegistrationKey(
69
+ sf.host.address,
70
+ deployer,
71
+ registrationKey,
72
+ expirationTs
73
+ )
84
74
  );
85
75
  });