@superfluid-finance/ethereum-contracts 1.2.3-dev.f94fdbb.0 → 1.3.1-dev.7df8a6a.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 (171) hide show
  1. package/build/contracts/AccessControl.json +3 -3
  2. package/build/contracts/AccessControlEnumerable.json +3 -3
  3. package/build/contracts/Address.json +5 -5
  4. package/build/contracts/AgreementBase.json +13 -13
  5. package/build/contracts/AgreementLibrary.json +7 -7
  6. package/build/contracts/BaseRelayRecipient.json +5 -5
  7. package/build/contracts/BatchLiquidator.json +179 -179
  8. package/build/contracts/BatchOperation.json +5 -5
  9. package/build/contracts/CFAv1Library.json +5 -5
  10. package/build/contracts/CallUtils.json +7 -7
  11. package/build/contracts/ClosingOnUpdateFlowTestApp.json +2107 -1917
  12. package/build/contracts/ConstantFlowAgreementV1.json +8 -8
  13. package/build/contracts/Context.json +3 -3
  14. package/build/contracts/ContextDefinitions.json +5 -5
  15. package/build/contracts/Create2.json +5 -5
  16. package/build/contracts/CustomSuperTokenBase.json +3 -3
  17. package/build/contracts/ERC165.json +3 -3
  18. package/build/contracts/ERC1820Implementer.json +5 -5
  19. package/build/contracts/ERC1820RegistryCompiled.json +7 -7
  20. package/build/contracts/ERC20.json +5 -5
  21. package/build/contracts/ERC20Burnable.json +3 -3
  22. package/build/contracts/ERC20Pausable.json +3 -3
  23. package/build/contracts/ERC20PresetMinterPauser.json +5 -5
  24. package/build/contracts/ERC20WithTokenInfo.json +3 -3
  25. package/build/contracts/ERC777Helper.json +7 -7
  26. package/build/contracts/ERC777RecipientDrainingGas.json +839 -839
  27. package/build/contracts/ERC777RecipientReverting.json +839 -839
  28. package/build/contracts/EnumerableSet.json +5 -5
  29. package/build/contracts/EventsEmitter.json +47 -47
  30. package/build/contracts/ExclusiveInflowTestApp.json +2107 -1917
  31. package/build/contracts/FixedSizeData.json +213 -213
  32. package/build/contracts/FlowExchangeTestApp.json +2107 -1917
  33. package/build/contracts/FlowOperatorDefinitions.json +5 -5
  34. package/build/contracts/FullUpgradableSuperTokenProxy.json +226 -312
  35. package/build/contracts/IAccessControl.json +3 -3
  36. package/build/contracts/IAccessControlEnumerable.json +3 -3
  37. package/build/contracts/IConstantFlowAgreementV1.json +451 -444
  38. package/build/contracts/IDAv1Library.json +5 -5
  39. package/build/contracts/IERC165.json +3 -3
  40. package/build/contracts/IERC1820Implementer.json +3 -3
  41. package/build/contracts/IERC1820Registry.json +3 -3
  42. package/build/contracts/IERC20.json +3 -3
  43. package/build/contracts/IERC20Metadata.json +3 -3
  44. package/build/contracts/IERC777.json +3 -3
  45. package/build/contracts/IERC777Recipient.json +3 -3
  46. package/build/contracts/IERC777Sender.json +3 -3
  47. package/build/contracts/IInstantDistributionAgreementV1.json +570 -559
  48. package/build/contracts/IMaticBridgedNativeSuperToken.json +71 -32
  49. package/build/contracts/IMaticBridgedNativeSuperTokenCustom.json +3 -3
  50. package/build/contracts/IMultiSigWallet.json +3 -3
  51. package/build/contracts/IPureSuperToken.json +71 -32
  52. package/build/contracts/IPureSuperTokenCustom.json +3 -3
  53. package/build/contracts/IRelayRecipient.json +3 -3
  54. package/build/contracts/IResolver.json +3 -3
  55. package/build/contracts/ISETH.json +71 -32
  56. package/build/contracts/ISETHCustom.json +3 -3
  57. package/build/contracts/ISuperAgreement.json +3 -3
  58. package/build/contracts/ISuperApp.json +179 -173
  59. package/build/contracts/ISuperToken.json +522 -483
  60. package/build/contracts/ISuperTokenFactory.json +3 -3
  61. package/build/contracts/ISuperfluid.json +633 -628
  62. package/build/contracts/ISuperfluidGovernance.json +134 -133
  63. package/build/contracts/ISuperfluidToken.json +403 -394
  64. package/build/contracts/ITOGAv1.json +1211 -1211
  65. package/build/contracts/ITOGAv2.json +1211 -1211
  66. package/build/contracts/Initializable.json +3 -3
  67. package/build/contracts/InstantDistributionAgreementV1.json +10 -10
  68. package/build/contracts/MaticBridgedNativeSuperTokenProxy.json +194 -194
  69. package/build/contracts/NonClosableOutflowTestApp.json +2107 -1917
  70. package/build/contracts/Ownable.json +3 -3
  71. package/build/contracts/Pausable.json +3 -3
  72. package/build/contracts/Proxy.json +3 -3
  73. package/build/contracts/PureSuperToken.json +91 -91
  74. package/build/contracts/Resolver.json +96 -96
  75. package/build/contracts/SETHProxy.json +199 -199
  76. package/build/contracts/SafeCast.json +5 -5
  77. package/build/contracts/SafeERC20.json +5 -5
  78. package/build/contracts/SafeMath.json +5 -5
  79. package/build/contracts/SelfDeletingFlowTestApp.json +2107 -1917
  80. package/build/contracts/SlotsBitmapLibrary.json +7 -7
  81. package/build/contracts/Strings.json +5 -5
  82. package/build/contracts/SuperAppBase.json +3 -3
  83. package/build/contracts/SuperAppDefinitions.json +5 -5
  84. package/build/contracts/SuperToken.json +2262 -2262
  85. package/build/contracts/SuperTokenFactory.json +582 -582
  86. package/build/contracts/SuperTokenFactoryBase.json +576 -576
  87. package/build/contracts/SuperTokenFactoryHelper.json +578 -578
  88. package/build/contracts/SuperUpgrader.json +687 -687
  89. package/build/contracts/Superfluid.json +6648 -6678
  90. package/build/contracts/SuperfluidFrameworkDeployer.json +526 -526
  91. package/build/contracts/SuperfluidGovernanceBase.json +13 -13
  92. package/build/contracts/SuperfluidGovernanceConfigs.json +5 -5
  93. package/build/contracts/SuperfluidGovernanceII.json +21 -21
  94. package/build/contracts/SuperfluidGovernanceIIProxy.json +20 -20
  95. package/build/contracts/SuperfluidLoader.json +147 -147
  96. package/build/contracts/SuperfluidToken.json +1269 -1269
  97. package/build/contracts/TOGA.json +1221 -1221
  98. package/build/contracts/TestGovernance.json +315 -315
  99. package/build/contracts/TestToken.json +475 -561
  100. package/build/contracts/TokenCustodian.json +220 -220
  101. package/build/contracts/TokenInfo.json +3 -3
  102. package/build/contracts/UUPSProxiable.json +136 -136
  103. package/build/contracts/UUPSProxy.json +87 -87
  104. package/build/contracts/UUPSUtils.json +43 -43
  105. package/build/contracts-sizes.txt +6 -6
  106. package/contracts/agreements/AgreementBase.sol +1 -1
  107. package/contracts/agreements/AgreementLibrary.sol +1 -1
  108. package/contracts/agreements/ConstantFlowAgreementV1.sol +1 -1
  109. package/contracts/agreements/InstantDistributionAgreementV1.sol +1 -1
  110. package/contracts/gov/SuperfluidGovernanceBase.sol +1 -1
  111. package/contracts/gov/SuperfluidGovernanceII.sol +1 -1
  112. package/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol +7 -10
  113. package/contracts/interfaces/agreements/IInstantDistributionAgreementV1.sol +11 -18
  114. package/contracts/interfaces/superfluid/ISuperApp.sol +7 -9
  115. package/contracts/interfaces/superfluid/ISuperToken.sol +36 -44
  116. package/contracts/interfaces/superfluid/ISuperfluid.sol +17 -21
  117. package/contracts/interfaces/superfluid/ISuperfluidGovernance.sol +1 -1
  118. package/contracts/interfaces/superfluid/ISuperfluidToken.sol +13 -14
  119. package/contracts/libs/BaseRelayRecipient.sol +1 -1
  120. package/contracts/libs/CallUtils.sol +1 -1
  121. package/contracts/libs/ERC1820RegistryCompiled.sol +1 -1
  122. package/contracts/libs/ERC777Helper.sol +1 -1
  123. package/contracts/libs/EventsEmitter.sol +2 -2
  124. package/contracts/libs/FixedSizeData.sol +2 -2
  125. package/contracts/libs/SlotsBitmapLibrary.sol +1 -1
  126. package/contracts/mocks/AgreementMock.sol +1 -1
  127. package/contracts/mocks/CFAAppMocks.sol +6 -6
  128. package/contracts/mocks/CFALibraryMock.sol +2 -2
  129. package/contracts/mocks/CallUtilsMock.sol +1 -1
  130. package/contracts/mocks/CallUtilsTester.sol +1 -1
  131. package/contracts/mocks/CustomSuperTokenMock.sol +1 -1
  132. package/contracts/mocks/ERC777SenderRecipientMock.sol +1 -1
  133. package/contracts/mocks/FakeSuperfluidMock.sol +1 -1
  134. package/contracts/mocks/ForwarderMock.sol +1 -1
  135. package/contracts/mocks/IDASuperAppTester.sol +2 -2
  136. package/contracts/mocks/IDAv1LibraryMock.sol +3 -3
  137. package/contracts/mocks/MockSmartWallet.sol +1 -1
  138. package/contracts/mocks/MultiFlowTesterApp.sol +2 -2
  139. package/contracts/mocks/SuperAppMocks.sol +15 -12
  140. package/contracts/mocks/SuperTokenFactoryMock.sol +1 -1
  141. package/contracts/mocks/SuperTokenMock.sol +1 -1
  142. package/contracts/mocks/SuperfluidDestructorMock.sol +1 -1
  143. package/contracts/mocks/SuperfluidGovernanceIIMock.sol +1 -1
  144. package/contracts/mocks/SuperfluidMock.sol +2 -2
  145. package/contracts/mocks/UUPSProxiableMock.sol +1 -1
  146. package/contracts/superfluid/FullUpgradableSuperTokenProxy.sol +2 -2
  147. package/contracts/superfluid/SuperToken.sol +1 -1
  148. package/contracts/superfluid/SuperTokenFactory.sol +1 -1
  149. package/contracts/superfluid/Superfluid.sol +4 -4
  150. package/contracts/superfluid/SuperfluidToken.sol +1 -1
  151. package/contracts/tokens/MaticBridgedNativeSuperToken.sol +1 -1
  152. package/contracts/tokens/PureSuperToken.sol +1 -1
  153. package/contracts/tokens/SETH.sol +1 -1
  154. package/contracts/upgradability/UUPSProxiable.sol +1 -1
  155. package/contracts/upgradability/UUPSProxy.sol +1 -1
  156. package/contracts/upgradability/UUPSUtils.sol +1 -1
  157. package/contracts/utils/BatchLiquidator.sol +1 -1
  158. package/contracts/utils/Resolver.sol +1 -1
  159. package/contracts/utils/SuperUpgrader.sol +6 -6
  160. package/contracts/utils/SuperfluidLoader.sol +1 -1
  161. package/contracts/utils/TOGA.sol +1 -1
  162. package/contracts/utils/TestGovernance.sol +2 -2
  163. package/contracts/utils/TestToken.sol +2 -2
  164. package/contracts/utils/TokenCustodian.sol +1 -1
  165. package/package.json +5 -3
  166. package/scripts/deploy-framework.js +5 -5
  167. package/scripts/deploy-super-token.js +13 -4
  168. package/scripts/gov-create-new-app-registration-key.js +2 -1
  169. package/scripts/gov-create-new-factory-registration.js +1 -1
  170. package/scripts/libs/getConfig.js +21 -3
  171. package/scripts/resolver-list-super-token.js +1 -0
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { CallUtils } from "../libs/CallUtils.sol";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { CallUtils } from "../libs/CallUtils.sol";
5
5
  import { IRelayRecipient } from "../interfaces/utils/IRelayRecipient.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperfluid,
@@ -26,7 +26,7 @@ contract IDASuperAppTester is ISuperApp {
26
26
  uint32 indexId)
27
27
  {
28
28
  _host = host;
29
- _host.registerApp(configWord);
29
+ _host.registerAppWithKey(configWord, "");
30
30
  _ida = ida;
31
31
  _token = token;
32
32
  _indexId = indexId;
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
  pragma experimental ABIEncoderV2;
4
4
 
5
5
  import {ISuperfluid, ISuperfluidToken, ISuperToken} from "../interfaces/superfluid/ISuperfluid.sol";
@@ -157,7 +157,7 @@ contract IDAv1LibraryMock {
157
157
  /**************************************************************************
158
158
  * Subscription Operations
159
159
  *************************************************************************/
160
-
160
+
161
161
  function approveSubscriptionTest(
162
162
  ISuperfluidToken token,
163
163
  address publisher,
@@ -265,7 +265,7 @@ contract IDAv1LibrarySuperAppMock is IDAv1LibraryMock, SuperAppBase {
265
265
  SuperAppDefinitions.BEFORE_AGREEMENT_TERMINATED_NOOP |
266
266
  SuperAppDefinitions.AFTER_AGREEMENT_TERMINATED_NOOP;
267
267
 
268
- host.registerApp(configWord);
268
+ host.registerAppWithKey(configWord, "");
269
269
  }
270
270
 
271
271
  function afterAgreementCreated(
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ISuperToken, IERC20 } from "../superfluid/Superfluid.sol";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperfluid,
@@ -41,7 +41,7 @@ contract MultiFlowTesterApp is SuperAppBase {
41
41
  SuperAppDefinitions.BEFORE_AGREEMENT_CREATED_NOOP |
42
42
  SuperAppDefinitions.BEFORE_AGREEMENT_TERMINATED_NOOP;
43
43
 
44
- _host.registerApp(configWord);
44
+ _host.registerAppWithKey(configWord, "");
45
45
  }
46
46
 
47
47
  function _parseUserData(
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperfluid,
@@ -51,9 +51,9 @@ contract SuperAppMock is ISuperApp {
51
51
 
52
52
  constructor(ISuperfluid host, uint256 configWord, bool doubleRegistration) {
53
53
  _host = host;
54
- _host.registerApp(configWord);
54
+ _host.registerAppWithKey(configWord, "");
55
55
  if (doubleRegistration) {
56
- _host.registerApp(configWord);
56
+ _host.registerAppWithKey(configWord, "");
57
57
  }
58
58
  _aux = new SuperAppMockAux();
59
59
  }
@@ -461,7 +461,7 @@ contract SuperAppMockReturningEmptyCtx {
461
461
 
462
462
  constructor(ISuperfluid host) {
463
463
  _host = host;
464
- _host.registerApp(SuperAppDefinitions.APP_LEVEL_FINAL);
464
+ _host.registerAppWithKey(SuperAppDefinitions.APP_LEVEL_FINAL, "");
465
465
  }
466
466
 
467
467
  function beforeAgreementCreated(
@@ -522,7 +522,7 @@ contract SuperAppMockReturningInvalidCtx {
522
522
 
523
523
  constructor(ISuperfluid host) {
524
524
  _host = host;
525
- _host.registerApp(SuperAppDefinitions.APP_LEVEL_FINAL);
525
+ _host.registerAppWithKey(SuperAppDefinitions.APP_LEVEL_FINAL, "");
526
526
  }
527
527
 
528
528
  function afterAgreementCreated(
@@ -563,7 +563,7 @@ contract SuperAppMock2ndLevel {
563
563
 
564
564
  constructor(ISuperfluid host, SuperAppMock app, AgreementMock agreement) {
565
565
  _host = host;
566
- _host.registerApp(SuperAppDefinitions.APP_LEVEL_SECOND);
566
+ _host.registerAppWithKey(SuperAppDefinitions.APP_LEVEL_SECOND, "");
567
567
  _app = app;
568
568
  _agreement = agreement;
569
569
  }
@@ -597,14 +597,17 @@ contract SuperAppMock2ndLevel {
597
597
  }
598
598
  }
599
599
 
600
- // The default SuperApp mock that does many tricks
600
+ // An Super App that uses registerAppWithKey
601
601
  contract SuperAppMockWithRegistrationkey {
602
-
603
- ISuperfluid private _host;
604
-
605
602
  constructor(ISuperfluid host, uint256 configWord, string memory registrationKey) {
606
- _host = host;
607
- _host.registerAppWithKey(configWord, registrationKey);
603
+ host.registerAppWithKey(configWord, registrationKey);
604
+ }
605
+ }
606
+
607
+ // An Super App that uses registerAppWithKey
608
+ contract SuperAppMockUsingDeprecatedRegisterApp {
609
+ constructor(ISuperfluid host, uint256 configWord) {
610
+ host.registerApp(configWord);
608
611
  }
609
612
  }
610
613
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { SuperTokenMock } from "./SuperTokenMock.sol";
5
5
  import {
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperfluid,
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
2
  // solhint-disable
3
- pragma solidity 0.8.13;
3
+ pragma solidity 0.8.14;
4
4
 
5
5
  contract SuperfluidDestructorMock {
6
6
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
5
5
  import { SuperfluidGovernanceII } from "../gov/SuperfluidGovernanceII.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  Superfluid,
@@ -171,7 +171,7 @@ contract SuperfluidMock is Superfluid {
171
171
  function jailApp(ISuperApp app)
172
172
  external
173
173
  {
174
- _jailApp(app, 0);
174
+ _jailApp(app, 6942);
175
175
  }
176
176
 
177
177
  }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ISuperTokenFactory } from "../interfaces/superfluid/ISuperTokenFactory.sol";
5
5
  import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol";
@@ -32,7 +32,7 @@ contract FullUpgradableSuperTokenProxy is Proxy {
32
32
  assembly { // solium-disable-line
33
33
  factory := sload(_FACTORY_SLOT)
34
34
  }
35
- require(address(factory) != address(0), "Not initialized");
35
+ assert(address(factory) != address(0));
36
36
  return address(factory.getSuperTokenLogic());
37
37
  }
38
38
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperTokenFactory,
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
5
5
 
@@ -255,7 +255,7 @@ contract Superfluid is
255
255
  external view override
256
256
  returns (address logic)
257
257
  {
258
- if (address(_superTokenFactory) == address(0)) return address(0);
258
+ assert(address(_superTokenFactory) != address(0));
259
259
  if (NON_UPGRADABLE_DEPLOYMENT) return address(_superTokenFactory);
260
260
  else return UUPSProxiable(address(_superTokenFactory)).getCodeAddress();
261
261
  }
@@ -1076,9 +1076,9 @@ contract Superfluid is
1076
1076
  if (actionSelector == ISuperApp.beforeAgreementCreated.selector ||
1077
1077
  actionSelector == ISuperApp.afterAgreementCreated.selector ||
1078
1078
  actionSelector == ISuperApp.beforeAgreementUpdated.selector ||
1079
- actionSelector == ISuperApp.afterAgreementCreated.selector ||
1079
+ actionSelector == ISuperApp.afterAgreementUpdated.selector ||
1080
1080
  actionSelector == ISuperApp.beforeAgreementTerminated.selector ||
1081
- actionSelector == ISuperApp.afterAgreementCreated.selector) {
1081
+ actionSelector == ISuperApp.afterAgreementTerminated.selector) {
1082
1082
  revert("SF: agreement callback is not action");
1083
1083
  }
1084
1084
  _;
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol";
5
5
  import { ISuperAgreement } from "../interfaces/superfluid/ISuperAgreement.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperToken,
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperToken,
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperToken,
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { UUPSUtils } from "./UUPSUtils.sol";
5
5
  import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { UUPSUtils } from "./UUPSUtils.sol";
5
5
  import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  /**
5
5
  * @title UUPS (Universal Upgradeable Proxy Standard) Shared Library
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ISuperfluid, ISuperAgreement, ISuperToken } from "../interfaces/superfluid/ISuperfluid.sol";
5
5
  import { IConstantFlowAgreementV1 } from "../interfaces/agreements/IConstantFlowAgreementV1.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
5
5
  import { IResolver } from "../interfaces/utils/IResolver.sol";
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
5
5
  import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
@@ -39,7 +39,7 @@ contract SuperUpgrader is AccessControlEnumerable {
39
39
  /**
40
40
  * @notice The user should ERC20.approve this contract.
41
41
  * @dev Execute upgrade function in the name of the user
42
- * @param superTokenAddr Super Token Address to upgrade
42
+ * @param superTokenAddr Super Token Address to upgrade
43
43
  * @param account User address that previous approved this contract.
44
44
  * @param amount Amount value to be upgraded.
45
45
  */
@@ -50,7 +50,7 @@ contract SuperUpgrader is AccessControlEnumerable {
50
50
  )
51
51
  external
52
52
  {
53
- require(msg.sender == account ||
53
+ require(msg.sender == account ||
54
54
  (hasRole(BACKEND_ROLE, msg.sender) &&
55
55
  !_optout[account])
56
56
  , "operation not allowed");
@@ -69,14 +69,14 @@ contract SuperUpgrader is AccessControlEnumerable {
69
69
  }
70
70
 
71
71
  /**
72
- * @dev Test if account is member BACKEND_ROLE
72
+ * @dev Test if account is member BACKEND_ROLE
73
73
  */
74
74
  function isBackendAgent(address account) external view returns(bool yes) {
75
75
  return hasRole(BACKEND_ROLE, account);
76
76
  }
77
77
 
78
78
  /**
79
- * @dev Add account to BACKEND_ROLE
79
+ * @dev Add account to BACKEND_ROLE
80
80
  */
81
81
  function grantBackendAgent(address account) external {
82
82
  require(account != address(0), "operation not allowed");
@@ -85,7 +85,7 @@ contract SuperUpgrader is AccessControlEnumerable {
85
85
  }
86
86
 
87
87
  /**
88
- * @dev Remove account to BACKEND_ROLE
88
+ * @dev Remove account to BACKEND_ROLE
89
89
  */
90
90
  function revokeBackendAgent(address account) external {
91
91
  // grantRole will check if sender is adminRole member
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { IResolver } from "../interfaces/utils/IResolver.sol";
5
5
  import {
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
5
5
 
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import {
5
5
  ISuperfluid,
@@ -12,7 +12,7 @@ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
12
12
 
13
13
  /**
14
14
  * @title Test governance contract
15
- * @author Superfluid
15
+ * @author Superfluid
16
16
  * @dev A initializable version of the governance for testing purpose
17
17
  */
18
18
  contract TestGovernance is
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
5
5
 
@@ -23,7 +23,7 @@ contract TestToken is ERC20 {
23
23
  * @dev See {ERC20-_mint}.
24
24
  */
25
25
  function mint(address account, uint256 amount) public returns (bool) {
26
- require(amount <= MINT_LIMIT, "Don't mint too many");
26
+ assert(amount <= MINT_LIMIT); // no revert msg for you, bad boy
27
27
  ERC20._mint(account, amount);
28
28
  return true;
29
29
  }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPLv3
2
- pragma solidity 0.8.13;
2
+ pragma solidity 0.8.14;
3
3
 
4
4
  import { IERC777 } from "@openzeppelin/contracts/token/ERC777/IERC777.sol";
5
5
  import { IERC1820Registry } from "@openzeppelin/contracts/utils/introspection/IERC1820Registry.sol";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superfluid-finance/ethereum-contracts",
3
- "version": "1.2.3-dev.f94fdbb.0",
3
+ "version": "1.3.1-dev.7df8a6a.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": {
@@ -51,12 +51,13 @@
51
51
  "pre-commit": "if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi",
52
52
  "pre-commit:lint": "yarn lint",
53
53
  "check-updates": "ncu --target minor --dep prod,dev",
54
- "cloc": "bash tasks/cloc.sh"
54
+ "cloc": "bash tasks/cloc.sh",
55
+ "docgen": "rm -rf docs/api; hardhat docgen"
55
56
  },
56
57
  "dependencies": {
57
58
  "@decentral.ee/web3-helpers": "0.5.3",
58
59
  "@openzeppelin/contracts": "4.5.0",
59
- "@superfluid-finance/js-sdk": "^0.6.2-dev.f94fdbb.0",
60
+ "@superfluid-finance/js-sdk": "^0.6.2-dev.7df8a6a.0",
60
61
  "@truffle/contract": "4.5.5",
61
62
  "ethereumjs-tx": "2.1.2",
62
63
  "ethereumjs-util": "7.1.4",
@@ -72,6 +73,7 @@
72
73
  "readline": "1.3.0",
73
74
  "solhint": "3.3.7",
74
75
  "solidity-coverage": "0.7.20",
76
+ "solidity-docgen": "^0.6.0-beta.10",
75
77
  "truffle-flattener": "^1.6.0",
76
78
  "truffle-plugin-verify": "^0.5.25"
77
79
  }
@@ -78,14 +78,14 @@ async function deployContractIfCodeChanged(
78
78
  * @param {boolean} options.isTruffle Whether the script is used within native truffle framework
79
79
  * @param {Web3} options.web3 Injected web3 instance
80
80
  * @param {Address} options.from Address to deploy contracts from
81
- * @param {boolean} options.newTestResolver Force to create a new resolver (overridng env: CREATE_NEW_RESOLVER)
82
- * @param {boolean} options.useMocks Use mock contracts instead (overridng env: USE_MOCKS)
81
+ * @param {boolean} options.newTestResolver Force to create a new resolver (overriding env: CREATE_NEW_RESOLVER)
82
+ * @param {boolean} options.useMocks Use mock contracts instead (overriding env: USE_MOCKS)
83
83
  * @param {boolean} options.nonUpgradable Deploy contracts configured to be non-upgradable
84
- * (overridng env: NON_UPGRADABLE)
84
+ * (overriding env: NON_UPGRADABLE)
85
85
  * @param {boolean} options.appWhiteListing Deploy contracts configured to require app white listing
86
- * (overridng env: ENABLE_APP_WHITELISTING)
86
+ * (overriding env: ENABLE_APP_WHITELISTING)
87
87
  * @param {boolean} options.resetSuperfluidFramework Reset the superfluid framework deployment
88
- * (overridng env: RESET_SUPERFLUID_FRAMEWORK)
88
+ * (overriding env: RESET_SUPERFLUID_FRAMEWORK)
89
89
  * @param {boolean} options.protocolReleaseVersion Specify the protocol release version to be used
90
90
  * (overriding env: RELEASE_VERSION)
91
91
  *
@@ -19,8 +19,10 @@ const {
19
19
  * Usage: npx truffle exec scripts/deploy-super-token.js : {UNDERLYING_TOKEN_SYMBOL_OR_ADDRESS}
20
20
  *
21
21
  * NOTE:
22
- * - If the `UNDERLYING_TOKEN_SYMBOL_OR_ADDRESS` is the ZERO_ADDRESS or the native token symbol
22
+ * - If the `UNDERLYING_TOKEN_SYMBOL_OR_ADDRESS` is the ZERO_ADDRESS or the (known) native token symbol
23
23
  * of the network, then the SETH contract will be deployed.
24
+ * If the name of the network's native token isn't known by the framework, it can be provided
25
+ * via ENV var NATIVE_TOKEN_SYMBOL.
24
26
  * - Otherwise an ERC20 super token wrapper will be created for the underlying ERC20 token specified in
25
27
  * UNDERLYING_TOKEN_SYMBOL_OR_ADDRESS. This underlying token needs to already be registered in the resolver.
26
28
  * - A resolver entry `supertokens.${protocolReleaseVersion}.${UNDERLYING_TOKEN_SYMBOL}x` will be created
@@ -80,7 +82,14 @@ module.exports = eval(`(${S.toString()})()`)(async function (
80
82
  tokenSymbolOrAddress === sf.config.nativeTokenSymbol
81
83
  ) {
82
84
  // deploy wrapper for the native token
83
- tokenSymbol = sf.config.nativeTokenSymbol;
85
+ tokenSymbol =
86
+ sf.config.nativeTokenSymbol || process.env.NATIVE_TOKEN_SYMBOL;
87
+ if (tokenSymbol === undefined) {
88
+ throw new Error(
89
+ "Native token symbol unknown. You can set it with ENV var NATIVE_TOKEN_SYMBOL"
90
+ );
91
+ }
92
+
84
93
  superTokenKey = `supertokens.${protocolReleaseVersion}.${tokenSymbol}x`;
85
94
  deploymentFn = async () => {
86
95
  console.log("Creating SETH Proxy...");
@@ -92,8 +101,8 @@ module.exports = eval(`(${S.toString()})()`)(async function (
92
101
  await seth.initialize(
93
102
  ZERO_ADDRESS,
94
103
  18,
95
- `Super ${sf.config.nativeTokenSymbol}`,
96
- `${sf.config.nativeTokenSymbol}x`
104
+ `Super ${tokenSymbol}`,
105
+ `${tokenSymbol}x`
97
106
  );
98
107
  return seth;
99
108
  };
@@ -19,7 +19,8 @@ const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
19
19
  * Note: the key itself doesn't have much meaning, it could be "stolen" from a broadcast tx anyway.
20
20
  * But since it's bound to a deployer address, that doesn't really matter.
21
21
  *
22
- * Usage: npx truffle exec scripts/create-new-app-registration-key.js : {DEPLOYER} {REGISTRATION_KEY} [EXPIRATION_TS]
22
+ * Usage:
23
+ * npx truffle exec scripts/gov-create-new-app-registration-key.js : {DEPLOYER} {REGISTRATION_KEY} [EXPIRATION_TS]
23
24
  * EXPIRATION_TS is a Unix timestamp in seconds for when the key should expire.
24
25
  * If not set, we default to 90 days in the future.
25
26
  * Hint: you may use https://www.unixtimestamp.com/ to calculate a timestamp
@@ -14,7 +14,7 @@ const {
14
14
  * @param {Address} options.from Address to deploy contracts from
15
15
  * @param {boolean} options.protocolReleaseVersion Specify the protocol release version to be used
16
16
  *
17
- * Usage: npx truffle exec scripts/create-new-factory-registration.js : {FACTORY_ADDRESS}
17
+ * Usage: npx truffle exec scripts/gov-create-new-factory-registration.js : {FACTORY_ADDRESS}
18
18
  */
19
19
  module.exports = eval(`(${S.toString()})({
20
20
  doNotPrintColonArgs: true
@@ -102,12 +102,19 @@ module.exports = function getConfig(chainId) {
102
102
  // governance default configs
103
103
  gov_enableAppWhiteListing: true,
104
104
  // misc
105
- disableTestGovernance: true,
105
+ // disableTestGovernance: true,
106
106
  data: {
107
107
  initialBlockNumber: 5000000,
108
108
  getLogsRange: 5000,
109
109
  },
110
110
  },
111
+ 97: {
112
+ // BSC chapel testnet
113
+ data: {
114
+ initialBlockNumber: 19437500,
115
+ getLogsRange: 10000,
116
+ },
117
+ },
111
118
 
112
119
  //
113
120
  // Optimistic Ethereum: https://community.optimism.io/docs/
@@ -177,7 +184,7 @@ module.exports = function getConfig(chainId) {
177
184
  // governance default configs
178
185
  gov_enableAppWhiteListing: true,
179
186
  // misc
180
- disableTestGovernance: true,
187
+ // disableTestGovernance: true,
181
188
  data: {
182
189
  initialBlockNumber: 14700000,
183
190
  getLogsRange: 50000,
@@ -202,7 +209,18 @@ module.exports = function getConfig(chainId) {
202
209
  // governance default configs
203
210
  gov_enableAppWhiteListing: true,
204
211
  // misc
205
- disableTestGovernance: true,
212
+ // disableTestGovernance: true,
213
+ data: {
214
+ initialBlockNumber: 13075000,
215
+ getLogsRange: 50000,
216
+ },
217
+ },
218
+ 44787: {
219
+ // Celo alfajores testnet
220
+ data: {
221
+ initialBlockNumber: 11519000,
222
+ getLogsRange: 50000,
223
+ },
206
224
  },
207
225
  };
208
226
 
@@ -42,6 +42,7 @@ module.exports = eval(`(${S.toString()})()`)(async function (
42
42
  "SuperfluidGovernanceBase",
43
43
  "SuperToken",
44
44
  "Resolver",
45
+ "IAccessControlEnumerable",
45
46
  ],
46
47
  contractLoader: builtTruffleContractLoader,
47
48
  });