@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superfluid-finance/ethereum-contracts",
3
- "version": "1.7.2-dev.09f3be3.0",
3
+ "version": "1.7.2-dev.1ef77a5.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": {
@@ -22,7 +22,6 @@
22
22
  "artifacts/contracts/**/*.json",
23
23
  "!/**/*.dbg.json",
24
24
  "dev-scripts/**/*",
25
- "ops-scripts/**/*",
26
25
  "scripts/**/*",
27
26
  "utils/**/*",
28
27
  "/build/typechain/**/*"
@@ -43,6 +42,7 @@
43
42
  "build:typechain": "tsc -p tsconfig.typechain.json",
44
43
  "build:dev-scripts": "rm -rf dev-scripts/*.d.ts dev-scripts/*.d.ts.map; tsc -p tsconfig.scripts.json",
45
44
  "build:contracts-size": "tasks/print-contract-sizes.sh | tee build/contracts-sizes.txt",
45
+ "verify-framework": "tasks/etherscan-verify-framework.sh",
46
46
  "testenv:start": "test/testenv-ctl.sh start",
47
47
  "testenv:stop": "test/testenv-ctl.sh stop",
48
48
  "testenv:deploy": "yarn run-truffle exec ops-scripts/deploy-test-environment.js : TEST",
@@ -79,7 +79,7 @@
79
79
  "@safe-global/safe-core-sdk": "^3.3.3",
80
80
  "@safe-global/safe-service-client": "^2.0.1",
81
81
  "@safe-global/safe-web3-lib": "^1.9.3",
82
- "@superfluid-finance/js-sdk": "^0.6.4-dev.09f3be3.0",
82
+ "@superfluid-finance/js-sdk": "^0.6.4-dev.1ef77a5.0",
83
83
  "@truffle/contract": "4.6.18",
84
84
  "ethereumjs-tx": "2.1.2",
85
85
  "ethereumjs-util": "7.1.5",
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "devDependencies": {
89
89
  "@nomiclabs/hardhat-truffle5": "^2.0.7",
90
- "@superfluid-finance/metadata": "git+https://github.com/superfluid-finance/metadata.git",
90
+ "@superfluid-finance/metadata": "^1.1.11-dev.1ef77a5.0",
91
91
  "async": "^3.2.4",
92
92
  "csv-writer": "^1.6.0",
93
93
  "ganache-time-traveler": "1.0.16",
@@ -97,6 +97,6 @@
97
97
  "solidity-coverage": "0.8.2",
98
98
  "solidity-docgen": "^0.6.0-beta.35",
99
99
  "truffle-flattener": "^1.6.0",
100
- "truffle-plugin-verify": "0.6.2"
100
+ "truffle-plugin-verify": "0.6.4"
101
101
  }
102
102
  }
@@ -1,15 +0,0 @@
1
- module.exports = {
2
- globals: {
3
- web3: true,
4
- artifacts: true,
5
- describe: true,
6
- contract: true,
7
- before: true,
8
- beforeEach: true,
9
- it: true,
10
- assert: true,
11
- },
12
- rules: {
13
- "no-console": "off",
14
- },
15
- };
@@ -1,5 +0,0 @@
1
- {
2
- "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"},{\"name\":\"_interfaceHash\",\"type\":\"bytes32\"},{\"name\":\"_implementer\",\"type\":\"address\"}],\"name\":\"setInterfaceImplementer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getManager\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"},{\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_interfaceName\",\"type\":\"string\"}],\"name\":\"interfaceHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_contract\",\"type\":\"address\"},{\"name\":\"_interfaceId\",\"type\":\"bytes4\"}],\"name\":\"updateERC165Cache\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"},{\"name\":\"_interfaceHash\",\"type\":\"bytes32\"}],\"name\":\"getInterfaceImplementer\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_contract\",\"type\":\"address\"},{\"name\":\"_interfaceId\",\"type\":\"bytes4\"}],\"name\":\"implementsERC165InterfaceNoCache\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_contract\",\"type\":\"address\"},{\"name\":\"_interfaceId\",\"type\":\"bytes4\"}],\"name\":\"implementsERC165Interface\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"interfaceHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"implementer\",\"type\":\"address\"}],\"name\":\"InterfaceImplementerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newManager\",\"type\":\"address\"}],\"name\":\"ManagerChanged\",\"type\":\"event\"}]",
3
-
4
- "bin": "608060405234801561001057600080fd5b506109c5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c010000000000000000000000000000000000000000000000000000000090048063a41e7d5111610078578063a41e7d51146101d4578063aabbb8ca1461020a578063b705676514610236578063f712f3e814610280576100a5565b806329965a1d146100aa5780633d584063146100e25780635df8122f1461012457806365ba36c114610152575b600080fd5b6100e0600480360360608110156100c057600080fd5b50600160a060020a038135811691602081013591604090910135166102b6565b005b610108600480360360208110156100f857600080fd5b5035600160a060020a0316610570565b60408051600160a060020a039092168252519081900360200190f35b6100e06004803603604081101561013a57600080fd5b50600160a060020a03813581169160200135166105bc565b6101c26004803603602081101561016857600080fd5b81019060208101813564010000000081111561018357600080fd5b82018360208201111561019557600080fd5b803590602001918460018302840111640100000000831117156101b757600080fd5b5090925090506106b3565b60408051918252519081900360200190f35b6100e0600480360360408110156101ea57600080fd5b508035600160a060020a03169060200135600160e060020a0319166106ee565b6101086004803603604081101561022057600080fd5b50600160a060020a038135169060200135610778565b61026c6004803603604081101561024c57600080fd5b508035600160a060020a03169060200135600160e060020a0319166107ef565b604080519115158252519081900360200190f35b61026c6004803603604081101561029657600080fd5b508035600160a060020a03169060200135600160e060020a0319166108aa565b6000600160a060020a038416156102cd57836102cf565b335b9050336102db82610570565b600160a060020a031614610339576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b6103428361092a565b15610397576040805160e560020a62461bcd02815260206004820152601a60248201527f4d757374206e6f7420626520616e204552433136352068617368000000000000604482015290519081900360640190fd5b600160a060020a038216158015906103b85750600160a060020a0382163314155b156104ff5760405160200180807f455243313832305f4143434550545f4d4147494300000000000000000000000081525060140190506040516020818303038152906040528051906020012082600160a060020a031663249cb3fa85846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182600160a060020a0316600160a060020a031681526020019250505060206040518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d60208110156104a857600080fd5b5051146104ff576040805160e560020a62461bcd02815260206004820181905260248201527f446f6573206e6f7420696d706c656d656e742074686520696e74657266616365604482015290519081900360640190fd5b600160a060020a03818116600081815260208181526040808320888452909152808220805473ffffffffffffffffffffffffffffffffffffffff19169487169485179055518692917f93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db15391a450505050565b600160a060020a03818116600090815260016020526040812054909116151561059a5750806105b7565b50600160a060020a03808216600090815260016020526040902054165b919050565b336105c683610570565b600160a060020a031614610624576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b81600160a060020a031681600160a060020a0316146106435780610646565b60005b600160a060020a03838116600081815260016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169585169590951790945592519184169290917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a43509190a35050565b600082826040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090505b92915050565b6106f882826107ef565b610703576000610705565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031996909616808452958252808320805473ffffffffffffffffffffffffffffffffffffffff19169590971694909417909555908152600284528181209281529190925220805460ff19166001179055565b600080600160a060020a038416156107905783610792565b335b905061079d8361092a565b156107c357826107ad82826108aa565b6107b85760006107ba565b815b925050506106e8565b600160a060020a0390811660009081526020818152604080832086845290915290205416905092915050565b6000808061081d857f01ffc9a70000000000000000000000000000000000000000000000000000000061094c565b909250905081158061082d575080155b1561083d576000925050506106e8565b61084f85600160e060020a031961094c565b909250905081158061086057508015155b15610870576000925050506106e8565b61087a858561094c565b909250905060018214801561088f5750806001145b1561089f576001925050506106e8565b506000949350505050565b600160a060020a0382166000908152600260209081526040808320600160e060020a03198516845290915281205460ff1615156108f2576108eb83836107ef565b90506106e8565b50600160a060020a03808316600081815260208181526040808320600160e060020a0319871684529091529020549091161492915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000008082526004820183905260009182919060208160248189617530fa90519096909550935050505056fea165627a7a72305820377f4a2d4301ede9949f163f319021a6e9c687c292a5e2b2c4734c126b524e6c0029"
5
- }
@@ -1,99 +0,0 @@
1
- const {
2
- getScriptRunnerFactory: S,
3
- extractWeb3Options,
4
- } = require("./libs/common");
5
-
6
- const SuperfluidSDK = require("@superfluid-finance/js-sdk");
7
-
8
- const SuperfluidGovernanceIIProxy = artifacts.require(
9
- "SuperfluidGovernanceIIProxy"
10
- );
11
- const SuperfluidGovernanceII = artifacts.require("SuperfluidGovernanceII");
12
- const TOGA = artifacts.require("TOGA");
13
-
14
- const BatchLiquidator = artifacts.require("BatchLiquidator");
15
-
16
- /**
17
- * @dev Deploy auxiliary contracts: governance, TOGA, BatchLiquidator
18
- * To be used after a community mainnet deployment,
19
- * with the "handover account" set as message sender.
20
- * - deploy SuperfluidGovernanceII with proxy
21
- * - set 3Ps config
22
- * - deploy TOGA
23
- * - set TOGA as rewardAddress
24
- * - deploy BatchLiquidator
25
- *
26
- * @param web3 The web3 instance to be used
27
- * @param from address to use for funding the deployer account
28
- *
29
- * Usage: npx truffle exec ops-scripts/deploy-aux-contracts.js
30
- *
31
- * (optional) ENV vars:
32
- * - GOV_LIQUIDATION_PERIOD overrides the default value of 4 hours
33
- * - GOV_PATRICIAN_PERIOD overrides the default value of 30 minutes
34
- * - TOGA_MIN_BOND_DURATION overrides the default value of 7 days
35
- *
36
- * You may also need to set RESOLVER_ADDRESS if not yet set in js-sdk.
37
- */
38
- module.exports = eval(`(${S.toString()})()`)(async function (
39
- args,
40
- options = {}
41
- ) {
42
- let {protocolReleaseVersion} = options;
43
-
44
- console.log("======== Deploying auxiliary contracts ========");
45
-
46
- const sf = new SuperfluidSDK.Framework({
47
- ...extractWeb3Options(options),
48
- version: protocolReleaseVersion,
49
- });
50
- await sf.initialize();
51
-
52
- console.log("deploying production governance...");
53
- const govProxy = await SuperfluidGovernanceIIProxy.new();
54
- console.log("governance proxy deployed at:", govProxy.address);
55
- const govLogic = await SuperfluidGovernanceII.new();
56
- console.log("governance logic deployed at:", govLogic.address);
57
- await govLogic.castrate();
58
- console.log("marked gov logic as initialized (castrate)");
59
- await govProxy.initializeProxy(govLogic.address);
60
- console.log("governance proxy initialized with logic");
61
- const gov = await SuperfluidGovernanceII.at(govProxy.address);
62
-
63
- const liquidationPeriod = process.env.GOV_LIQUIDATION_PERIOD || 14400;
64
- const patricianPeriod = process.env.GOV_PATRICIAN_PERIOD || 1800;
65
- await gov.setPPPConfig(
66
- sf.host.address,
67
- "0x0000000000000000000000000000000000000000", // default - for all tokens
68
- liquidationPeriod,
69
- patricianPeriod
70
- );
71
- console.log(
72
- `set 3Ps config to liquidation period of ${liquidationPeriod} and patrician period of ${patricianPeriod}`
73
- );
74
-
75
- console.log("deploying solvency related contracts");
76
- const minBondDuration = process.env.TOGA_MIN_BOND_DURATION || 604800;
77
- const toga = await TOGA.new(
78
- sf.host.address,
79
- minBondDuration
80
- );
81
- console.log("TOGA deployed at:", toga.address);
82
-
83
- await gov.setRewardAddress(
84
- sf.host.address,
85
- "0x0000000000000000000000000000000000000000",
86
- toga.address
87
- );
88
- console.log("reward address set to TOGA");
89
-
90
- const batchLiquidator = await BatchLiquidator.new();
91
- console.log("BatchLiquidator deployed at:", batchLiquidator.address);
92
-
93
- console.log("");
94
- console.log("LEFT TO BE DONE MANUALLY:");
95
- console.log("replace old governance with new governance:");
96
- console.log(
97
- `gov.replaceGovernance(${sf.host.address}, ${govProxy.address})`
98
- );
99
- });
@@ -1,169 +0,0 @@
1
- const {getScriptRunnerFactory: S} = require("./libs/common");
2
-
3
- const SuperfluidSDK = require("@superfluid-finance/js-sdk");
4
- const Resolver = artifacts.require("Resolver");
5
-
6
- const SuperfluidLoader = artifacts.require("SuperfluidLoader");
7
- const CFAv1Forwarder = artifacts.require("CFAv1Forwarder");
8
-
9
- /**
10
- * @dev Deploy specified contract at a deterministic address (defined by sender, nonce)
11
- * This facilitates deployment of the contract at the same address across networks.
12
- * In order to make this easy, the script takes a private key of the deployer account and funds it.
13
- * Recommendation: create a new account (guaranteed to be at nonce 1 everywhere) for the deployer.
14
- *
15
- * Note: fee estimation does currently not work on optimism (mainnet and testnets).
16
- * It's unknown how to do an estimation of the overall cost (L1 and L2).
17
- * Solution: manually pre-fund the deployer account.
18
- *
19
- * @param web3 The web3 instance to be used
20
- * @param from address to use for funding the deployer account
21
- *
22
- * Usage: npx truffle exec ops-scripts/deploy-deterministically.js : {CONTRACT NAME} [{NONCE}]
23
- * CONTRACT NAME must be one of SuperfluidLoader, AgreementForwarder
24
- * If NONCE is not defined, 0 is assumed (-> first tx done from the deployer account)
25
- *
26
- * Required ENV var: DETERMINISTIC_DEPLOYER_PK
27
- *
28
- * (optional) ENV vars:
29
- * GAS_LIMIT: override the gas limit for networks with misbehaving estimation
30
- * GAS_PRICE: override the estimated gas price
31
- * EST_TX_COST: override the estimated tx cost (amount to be sent to deployer)
32
- * for networks with different cost derivation structure (Optimism)
33
- */
34
- module.exports = eval(`(${S.toString()})()`)(async function (
35
- args,
36
- options = {}
37
- ) {
38
- let {protocolReleaseVersion} = options;
39
-
40
- console.log("======== Deploying deterministically ========");
41
-
42
- let nonce = 0;
43
- if (args.length === 2) {
44
- nonce = parseInt(args.pop());
45
- if (nonce < 0) {
46
- console.error("nonce must be >= 0");
47
- process.exit(1);
48
- }
49
- } else if (args.length !== 1) {
50
- throw new Error("Wrong number of arguments");
51
- }
52
- const contractName = args.pop();
53
-
54
- const privKey = process.env.DETERMINISTIC_DEPLOYER_PK;
55
- const deployer = web3.eth.accounts.privateKeyToAccount(privKey);
56
- console.log("deployer:", deployer.address);
57
- console.log("nonce:", nonce);
58
-
59
- const chainId = await web3.eth.getChainId();
60
- const resolverAddr = SuperfluidSDK.getConfig(
61
- chainId,
62
- protocolReleaseVersion
63
- ).resolverAddress;
64
- console.log("resolver addr:", resolverAddr);
65
- const resolver = await Resolver.at(resolverAddr);
66
- const hostAddr = await resolver.get(`Superfluid.${protocolReleaseVersion}`);
67
- console.log("host addr:", hostAddr);
68
-
69
- let ContractArtifact;
70
- let deployArgs;
71
- if (contractName === "SuperfluidLoader") {
72
- ContractArtifact = SuperfluidLoader;
73
- deployArgs = [resolverAddr];
74
- console.log(
75
- `setting up SuperfluidLoader for chainId ${chainId}, resolver ${resolverAddr}`
76
- );
77
- } else if (contractName === "CFAv1Forwarder") {
78
- ContractArtifact = CFAv1Forwarder;
79
- deployArgs = [hostAddr];
80
- console.log(
81
- `setting up CFAv1Forwarder for chainId ${chainId}, host ${hostAddr}`
82
- );
83
- } else {
84
- throw new Error("Contract unknown / not supported");
85
- }
86
-
87
- const deployerTxCnt = await web3.eth.getTransactionCount(deployer.address);
88
- if (nonce !== deployerTxCnt) {
89
- console.error(
90
- `### ERR: requested nonce is ${nonce}, but next usable nonce is ${deployerTxCnt}`
91
- );
92
- process.exit(1);
93
- }
94
-
95
- const deployerBalance = await web3.eth.getBalance(deployer.address);
96
- console.log("deployer balance:", web3.utils.fromWei(deployerBalance));
97
-
98
- const gasPrice = process.env.GAS_PRICE || (await web3.eth.getGasPrice());
99
- console.log("gas price:", gasPrice);
100
-
101
- const Contract = new web3.eth.Contract(ContractArtifact.abi);
102
- const deployTx = Contract.deploy({
103
- data: ContractArtifact.bytecode,
104
- arguments: deployArgs,
105
- });
106
-
107
- const gasLimit = process.env.GAS_LIMIT || (await deployTx.estimateGas());
108
- console.log("gas limit:", gasLimit);
109
-
110
- const deployCode = deployTx.encodeABI();
111
-
112
- const BN = web3.utils.BN;
113
- // calc delta between deployer balance and estimated deployment cost
114
- // On Optimism, this won't reflect the actual cost bcs of missing L1 component, see https://community.optimism.io/docs/developers/build/transaction-fees/#estimating-the-total-fee
115
- const estTxCost = process.env.EST_TX_COST
116
- ? new BN(process.env.EST_TX_COST)
117
- : new BN(gasLimit).mul(new BN(gasPrice));
118
- console.log("estimated tx cost:", estTxCost.toString());
119
- const missingBalance = estTxCost.sub(new BN(deployerBalance));
120
- if (missingBalance.gt(new BN(0))) {
121
- console.log("deployer missing balance", missingBalance.toString());
122
- console.log("sending funding tx...");
123
- const fundingTxObj = {
124
- from: options.from || (await web3.eth.getAccounts())[0],
125
- to: deployer.address,
126
- value: missingBalance,
127
- };
128
- if (process.env.GAS_PRICE !== undefined) {
129
- fundingTxObj.gasPrice = gasPrice;
130
- }
131
- const fundingTx = await web3.eth.sendTransaction(fundingTxObj);
132
-
133
- console.log(
134
- `funded deployer account in tx ${fundingTx.transactionHash}`
135
- );
136
- } else {
137
- console.log("deployer account is already sufficiently funded");
138
- }
139
-
140
- // check if EIP-1559 enabled
141
- const lastBlock = await web3.eth.getBlock(await web3.eth.getBlockNumber());
142
- const hasEip1559 = lastBlock.baseFeePerGas !== undefined;
143
-
144
- const unsignedTx = {
145
- data: deployCode,
146
- gas: gasLimit,
147
- nonce,
148
- };
149
- if (hasEip1559) {
150
- console.log("creating EIP-1559 tx");
151
- unsignedTx.maxFeePerGas = gasPrice;
152
- unsignedTx.maxPriorityFeePerGas = gasPrice; // may cause overpaying, but not a big deal here
153
- } else {
154
- console.log("creating non-EIP-1559 tx");
155
- unsignedTx.gasPrice = gasPrice;
156
- }
157
-
158
- const signedTx = await web3.eth.accounts.signTransaction(
159
- unsignedTx,
160
- privKey
161
- );
162
- console.log("signed tx with tx hash:", signedTx.transactionHash);
163
-
164
- console.log("sending deploy tx...");
165
- const deployTxReceipt = await web3.eth.sendSignedTransaction(
166
- signedTx.rawTransaction
167
- );
168
- console.log("contract deployed at:", deployTxReceipt.contractAddress);
169
- });
@@ -1,83 +0,0 @@
1
- // Adapted from https://github.com/0xjac/ERC1820/blob/master/js/deployment.js
2
- const assert = require("assert").strict;
3
-
4
- const Transaction = require("ethereumjs-tx").Transaction;
5
- const ethUtils = require("ethereumjs-util");
6
- // TODO: this is a weird dependency, should probably get this from elsewhere
7
- const ERC1820Registry = require("./artifacts/ERC1820Registry.json");
8
- const {getScriptRunnerFactory: S, hasCode} = require("./libs/common");
9
-
10
- /**
11
- * @dev Deploy ERC1820 to the network.
12
- * @param web3 The web3 to be used
13
- * @param from address to deploy contracts from
14
- *
15
- * Usage: npx truffle exec ops-scripts/deploy-erc1820.js
16
- */
17
- module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
18
- args,
19
- options = {}
20
- ) {
21
- web3 = web3 || options.web3;
22
-
23
- const rawTransaction = {
24
- nonce: 0,
25
- gasPrice: 100000000000,
26
- value: 0,
27
- data: "0x" + ERC1820Registry.bin,
28
- gasLimit: 800000,
29
- v: 27,
30
- r: "0x1820182018201820182018201820182018201820182018201820182018201820",
31
- s: "0x1820182018201820182018201820182018201820182018201820182018201820",
32
- };
33
- const tx = new Transaction(rawTransaction);
34
- const res = {
35
- sender: ethUtils.toChecksumAddress(
36
- "0x" + tx.getSenderAddress().toString("hex")
37
- ),
38
- rawTx: "0x" + tx.serialize().toString("hex"),
39
- contractAddr: ethUtils.toChecksumAddress(
40
- "0x" +
41
- ethUtils
42
- .generateAddress(
43
- tx.getSenderAddress(),
44
- ethUtils.toBuffer(0)
45
- )
46
- .toString("hex")
47
- ),
48
- };
49
- assert.equal("0xa990077c3205cbDf861e17Fa532eeB069cE9fF96", res.sender);
50
- assert.equal(
51
- "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24",
52
- res.contractAddr
53
- );
54
-
55
- console.log("Checking ERC1820 deployment at", res.contractAddr);
56
- if (!(await hasCode(web3, res.contractAddr))) {
57
- console.log("Deploying...");
58
- const account = options.from || (await web3.eth.getAccounts())[0];
59
- console.log("Step 1: send ETH");
60
- // NOTE: we estimate gas when running test coverage w/ hardhat
61
- // otherwise there is a weird bug which requires the user to have
62
- // over 2k ETH to send the transaction
63
- const estimatedGasObject = {
64
- from: account,
65
- to: res.sender,
66
- value: "100000000000000000", //web3.utils.toWei(0.1)
67
- };
68
- if (process.env.IS_HARDHAT) {
69
- const estimatedGas = await web3.eth.estimateGas(estimatedGasObject);
70
- await web3.eth.sendTransaction({
71
- ...estimatedGasObject,
72
- gas: estimatedGas,
73
- });
74
- } else {
75
- await web3.eth.sendTransaction(estimatedGasObject);
76
- }
77
- console.log("Step 2: send signed transaction");
78
- await web3.eth.sendSignedTransaction(res.rawTx);
79
- console.log("Deployment done.");
80
- } else {
81
- console.log("ERC1820 is already deployed.");
82
- }
83
- });