@gooddollar/goodprotocol 2.1.4 → 2.2.0-beta.1

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 (292) hide show
  1. package/artifacts/abis/IdentityV4.min.json +1 -0
  2. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  3. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  8. package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
  9. package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  35. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
  36. package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
  37. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
  38. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
  39. package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
  40. package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
  41. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  42. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  43. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  44. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
  45. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  46. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  47. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  48. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  49. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  50. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  51. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  52. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  53. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
  54. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +2 -2
  55. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +4 -0
  56. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +1162 -0
  57. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  58. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  59. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  60. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  95. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  101. package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
  102. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  103. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  104. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
  105. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  106. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  107. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  108. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  109. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  110. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  111. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  112. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  113. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  114. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  115. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  116. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  117. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  118. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  119. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  120. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  121. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  122. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  123. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  124. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  125. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  126. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  127. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  128. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  129. package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
  130. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  131. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  133. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  134. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  135. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  136. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  137. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  138. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  139. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  140. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  141. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  142. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  143. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  144. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  145. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  146. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  147. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  148. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  149. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  150. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
  151. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  152. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
  153. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  154. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  155. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  156. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  157. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  158. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  159. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  160. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
  161. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
  162. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
  163. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
  164. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
  165. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
  166. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  167. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  168. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  169. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  170. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  171. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  172. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  173. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  174. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  175. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  176. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  177. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
  178. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
  179. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  180. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  181. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  182. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  183. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  184. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  185. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  186. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  187. package/contracts/identity/IdentityV3.sol +0 -3
  188. package/contracts/identity/IdentityV4.sol +578 -0
  189. package/hardhat.config.ts +3 -4
  190. package/package.json +8 -4
  191. package/releases/deployment.json +691 -1
  192. package/test/governance/ClaimersDistribution.test.ts +1 -1
  193. package/test/governance/CompoundVotingMachine.castvote.test.ts +30 -30
  194. package/test/helpers.ts +76 -195
  195. package/test/identity/IdentityV3.test.ts +53 -129
  196. package/test/identity/IdentityV4.test.ts +454 -0
  197. package/test/reserve/GenericDistributionHelper.e2e.test.ts +445 -0
  198. package/test/utils/AdminWallet.test.ts +14 -15
  199. package/types/contracts/identity/IdentityV4.ts +2001 -0
  200. package/types/contracts/identity/index.ts +1 -0
  201. package/types/contracts/utils/UpdateReserveRatio.sol/MentoExchange.ts +81 -0
  202. package/types/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.ts +134 -0
  203. package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
  204. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +7 -2
  205. package/types/contracts/utils/index.ts +2 -0
  206. package/types/factories/contracts/identity/IdentityV3__factory.ts +1 -1
  207. package/types/factories/contracts/identity/IdentityV4__factory.ts +1213 -0
  208. package/types/factories/contracts/identity/index.ts +1 -0
  209. package/types/factories/contracts/utils/UpdateReserveRatio.sol/MentoExchange__factory.ts +39 -0
  210. package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +113 -0
  211. package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
  212. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +9 -15
  213. package/types/factories/contracts/utils/index.ts +1 -0
  214. package/types/hardhat.d.ts +27 -0
  215. package/types/index.ts +4 -0
  216. package/scripts/ProxyFactory.json +0 -4425
  217. package/scripts/analytics/activeGDStakers.ts +0 -188
  218. package/scripts/analytics/activeStakers.ts +0 -25
  219. package/scripts/analytics/activeUsersCount.ts +0 -156
  220. package/scripts/analytics/activeWalletsStats.ts +0 -301
  221. package/scripts/analytics/checkActiveWallets.ts +0 -60
  222. package/scripts/analytics/checkBridgeBalances.ts +0 -442
  223. package/scripts/analytics/claimIncidentStats.ts +0 -98
  224. package/scripts/analytics/faucetStats.ts +0 -130
  225. package/scripts/analytics/gdinflow.ts +0 -57
  226. package/scripts/analytics/goodHolders.ts +0 -46
  227. package/scripts/analytics/goodgiveback.ts +0 -64
  228. package/scripts/analytics/p2pTxs.ts +0 -564
  229. package/scripts/analytics/stuckgd.ts +0 -70
  230. package/scripts/analytics/tokenInOutStats.ts +0 -48
  231. package/scripts/analytics/whitelistsyncIssue.ts +0 -87
  232. package/scripts/bulkProof.ts +0 -202
  233. package/scripts/bulkWhitelist.ts +0 -31
  234. package/scripts/deployGnosisSafe.ts +0 -111
  235. package/scripts/fetchOrDeployProxyFactory.ts +0 -46
  236. package/scripts/fv.ts +0 -263
  237. package/scripts/gdx/gdxAirdropCalculation.ts +0 -479
  238. package/scripts/getFounders.ts +0 -32
  239. package/scripts/governance/README.md +0 -70
  240. package/scripts/governance/airdropCalculation.ts +0 -1119
  241. package/scripts/governance/airdropCalculationRecover.ts +0 -416
  242. package/scripts/governance/airdropCalculationSorted.ts +0 -438
  243. package/scripts/governance/goodCheckpointSorted.ts +0 -300
  244. package/scripts/keeper/fishInactive.ts +0 -47
  245. package/scripts/minimize.sh +0 -17
  246. package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -131
  247. package/scripts/multichain-deploy/1_basicdao-deploy.ts +0 -294
  248. package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -152
  249. package/scripts/multichain-deploy/2b_otp-deploy.ts +0 -73
  250. package/scripts/multichain-deploy/3_gdSavings-deploy.ts +0 -190
  251. package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -129
  252. package/scripts/multichain-deploy/5_gov-deploy.ts +0 -179
  253. package/scripts/multichain-deploy/6_testnetFaucet.ts +0 -85
  254. package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +0 -123
  255. package/scripts/multichain-deploy/8_disthelper-deploy.ts +0 -152
  256. package/scripts/multichain-deploy/createUniswapTestPools.ts +0 -163
  257. package/scripts/multichain-deploy/flattened/Avatar.sol +0 -913
  258. package/scripts/multichain-deploy/flattened/Controller.sol +0 -1891
  259. package/scripts/multichain-deploy/flattened/FeeFormula.sol +0 -1290
  260. package/scripts/multichain-deploy/fulldeploy.sh +0 -26
  261. package/scripts/multichain-deploy/helpers.ts +0 -647
  262. package/scripts/multichain-deploy/multichainWrapper-deploy.ts +0 -59
  263. package/scripts/multichain-deploy/verifyEtherscan.ts +0 -177
  264. package/scripts/proposals/gip-14_1.ts +0 -251
  265. package/scripts/proposals/gip-15.ts +0 -427
  266. package/scripts/proposals/gip-25-xdc-upgrade-ubi.ts +0 -746
  267. package/scripts/proposals/gips-14_1.md +0 -29
  268. package/scripts/proposals/hack-ubi-recovery.ts +0 -414
  269. package/scripts/proposals/identityAuthPeriod.ts +0 -229
  270. package/scripts/proposals/reserveRestore.ts +0 -474
  271. package/scripts/proposals/updateDistHelper.ts +0 -180
  272. package/scripts/proposals/v4Upgrade.ts +0 -845
  273. package/scripts/releaser.js +0 -24
  274. package/scripts/staking/stakersGdRewardsCalculation.ts +0 -64
  275. package/scripts/upgradeScheme.ts +0 -97
  276. package/scripts/upgradeToV2/upgradeToV2.ts +0 -853
  277. package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -939
  278. package/scripts/upgradeToV3/v3-fix.ts +0 -120
  279. package/scripts/upgradeToV3/v3-fuse-multichain.ts +0 -117
  280. package/scripts/upgradeToV3/v3-upgrade.ts +0 -219
  281. package/scripts/upgrades/celo-defi-ubi-deploy.ts +0 -184
  282. package/scripts/upgrades/identity-upgrade.ts +0 -126
  283. package/scripts/upgrades/multichain-formula-upgrade.ts +0 -143
  284. package/scripts/upgrades/multichain-temp-fix.ts +0 -129
  285. package/scripts/upgrades/restoreFunds.ts +0 -91
  286. package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +0 -159
  287. package/scripts/upgrades/transferDaoToGuardians.ts +0 -80
  288. package/scripts/upgrades/upgradeAdminWallet.ts +0 -29
  289. package/scripts/upgrades/upgradeFaucet.ts +0 -46
  290. package/scripts/utils.ts +0 -50
  291. package/scripts/verify.ts +0 -67
  292. package/scripts/voltageswaps.ts +0 -46
@@ -1,126 +0,0 @@
1
- /***
2
- * Upgrade Fuse to support whitelisting with orgchain
3
- * Upgrade Plan:
4
- * - deploy Identity
5
- * - give adminWallet admin permissions
6
- * - give new identy admin permissions in old identity
7
- * - revoke deployer permissions
8
- * - replace pointers to old identity contract in:
9
- * - GoodDollar token
10
- * - NameService
11
- */
12
-
13
- import { network, ethers } from "hardhat";
14
- import { Contract } from "ethers";
15
- import { defaultsDeep } from "lodash";
16
- import { getImplementationAddress } from "@openzeppelin/upgrades-core";
17
- import OldIdentityABI from "@gooddollar/goodcontracts/build/contracts/Identity.min.json";
18
-
19
- import {
20
- deployDeterministic,
21
- printDeploy,
22
- executeViaGuardian,
23
- executeViaSafe,
24
- verifyProductionSigner
25
- } from "../multichain-deploy/helpers";
26
-
27
- import releaser from "../../scripts/releaser";
28
- import ProtocolSettings from "../../releases/deploy-settings.json";
29
-
30
- import dao from "../../releases/deployment.json";
31
- import { verifyContract } from "../multichain-deploy/helpers";
32
- const { name: networkName } = network;
33
-
34
- export const upgrade = async () => {
35
- let release: { [key: string]: any } = dao[networkName];
36
- const isProduction = networkName.includes("production");
37
- let [root, ...signers] = await ethers.getSigners();
38
-
39
- if (isProduction) verifyProductionSigner(root);
40
-
41
- let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
42
-
43
- console.log("got signers:", {
44
- networkName,
45
- root: root.address,
46
- balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
47
- Identity: release.Identity
48
- });
49
-
50
- let OldIdentity = await ethers.getContractAt(OldIdentityABI.abi, release.IdentityOld || release.Identity);
51
- // let Identity = await ethers.getContractAt("IdentityV2", release.Identity);
52
- // Identity = await ethers.getContractAt("IdentityV2", "0xb0cD4828Cc90C5BC28f4920Adf2Fd8F025003D7E");
53
- console.log("deploying new identity...", { old: OldIdentity.address });
54
- let Identity = (await deployDeterministic(
55
- {
56
- name: "IdentityV2",
57
- salt: "IdentityV2",
58
- isUpgradeable: true
59
- },
60
- [root.address, OldIdentity.address]
61
- ).then(printDeploy)) as Contract;
62
-
63
- let torelease = {
64
- Identity: Identity.address,
65
- IdentityOld: OldIdentity.address
66
- };
67
-
68
- await releaser(torelease, networkName, "deployment", false);
69
-
70
- console.log("calling initDAO...");
71
- const tx = await Identity.initDAO(release.NameService).then(printDeploy);
72
- await Identity.grantRole(
73
- ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
74
- release.AdminWallet
75
- ).then(printDeploy);
76
-
77
- //done via Avatar in proposal
78
- // await OldIdentity.addIdentityAdmin(Identity.address).then(printDeploy);
79
-
80
- const impl = await getImplementationAddress(ethers.provider, Identity.address);
81
- await verifyContract(impl, "IdentityV2", networkName);
82
-
83
- const proposalContracts = [
84
- release.GoodDollar, //controller -> set new identity in G$
85
- release.NameService, //nameservice modify to new Identity
86
- OldIdentity.address // add new Identity as admin in old identity
87
- ];
88
-
89
- const proposalEthValues = proposalContracts.map(_ => 0);
90
-
91
- const proposalFunctionSignatures = [
92
- "setIdentity(address)", //set Identity on GoodDollar token
93
- "setAddress(string,address)", //set new identity address in nameservice
94
- "addIdentityAdmin(address)"
95
- ];
96
-
97
- const proposalFunctionInputs = [
98
- ethers.utils.defaultAbiCoder.encode(["address"], [Identity.address]),
99
- ethers.utils.defaultAbiCoder.encode(["string", "address"], ["IDENTITY", Identity.address]),
100
- ethers.utils.defaultAbiCoder.encode(["address"], [Identity.address])
101
- ];
102
-
103
- if (isProduction) {
104
- await executeViaSafe(
105
- proposalContracts,
106
- proposalEthValues,
107
- proposalFunctionSignatures,
108
- proposalFunctionInputs,
109
- protocolSettings.guardiansSafe,
110
- "fuse"
111
- );
112
- } else {
113
- await executeViaGuardian(
114
- proposalContracts,
115
- proposalEthValues,
116
- proposalFunctionSignatures,
117
- proposalFunctionInputs,
118
- root
119
- );
120
- }
121
- };
122
-
123
- export const main = async () => {
124
- await upgrade().catch(console.log);
125
- };
126
- if (process.argv[1].includes("identity-upgrade")) main();
@@ -1,143 +0,0 @@
1
- /***
2
- * Upgrade FeeFormula to prevent usage of hacked multichain funds
3
- * Upgrade Plan:
4
- * - deploy new fee formula
5
- * - set token formula
6
- */
7
-
8
- import { network, ethers } from "hardhat";
9
- import { Contract } from "ethers";
10
- import { defaultsDeep } from "lodash";
11
-
12
- import { printDeploy, executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
13
-
14
- import ProtocolSettings from "../../releases/deploy-settings.json";
15
-
16
- import dao from "../../releases/deployment.json";
17
- import { verifyContract } from "../multichain-deploy/helpers";
18
- import { printError } from "graphql";
19
- let { name: networkName } = network;
20
-
21
- export const upgrade = async () => {
22
- const isProduction = networkName.includes("production");
23
- let [root, ...signers] = await ethers.getSigners();
24
-
25
- if (isProduction) verifyProductionSigner(root);
26
-
27
- let guardian = root;
28
- // simulate on fork
29
- if (network.name === "hardhat") {
30
- networkName = "production-mainnet";
31
- root = await ethers.getImpersonatedSigner("0x5128E3C1f8846724cc1007Af9b4189713922E4BB");
32
- }
33
-
34
- let release: { [key: string]: any } = dao[networkName];
35
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
36
-
37
- //make sure safe has enough eth to simulate txs
38
- if (network.name === "hardhat") {
39
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
40
- const funded = await ethers.getImpersonatedSigner("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266");
41
- await funded.sendTransaction({
42
- value: ethers.constants.WeiPerEther.mul(10),
43
- to: protocolSettings.guardiansSafe
44
- });
45
- }
46
-
47
- console.log("got signers:", {
48
- networkName,
49
- root: root.address,
50
- guardian: guardian.address,
51
- balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
52
- guardianBalance: await ethers.provider.getBalance(guardian.address).then(_ => _.toString())
53
- });
54
-
55
- let formulaImpl = (await ethers.deployContract("MultichainFeeFormula").then(printDeploy)) as Contract;
56
-
57
- if (isProduction) await verifyContract(formulaImpl, "MultichainFeeFormula", networkName);
58
-
59
- const proposalContracts = [
60
- release.GoodDollar //controller ->set fee formula
61
- ];
62
-
63
- const proposalEthValues = proposalContracts.map(_ => 0);
64
-
65
- const proposalFunctionSignatures = [
66
- "setFormula(address)" //upgrade formula
67
- ];
68
-
69
- const proposalFunctionInputs = [ethers.utils.defaultAbiCoder.encode(["address"], [formulaImpl.address])];
70
-
71
- if (isProduction) {
72
- await executeViaSafe(
73
- proposalContracts,
74
- proposalEthValues,
75
- proposalFunctionSignatures,
76
- proposalFunctionInputs,
77
- protocolSettings.guardiansSafe,
78
- "mainnet"
79
- );
80
- } else {
81
- //simulation or dev envs
82
- await executeViaGuardian(
83
- proposalContracts,
84
- proposalEthValues,
85
- proposalFunctionSignatures,
86
- proposalFunctionInputs,
87
- guardian,
88
- networkName
89
- );
90
- }
91
-
92
- //perform sanity checks
93
- let gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
94
- console.log("upgraded formula:", (await gd.formula()) == formulaImpl.address);
95
- let result = await gd["getFees(uint256,address,address)"](
96
- 50000000000,
97
- "0xd17652350cfd2a37ba2f947c910987a3b1a1c60d",
98
- "0xd17652350cfd2a37ba2f947c910987a3b1a1c60d"
99
- );
100
- console.log("verify new formula fee == amount:", result.fee.toNumber() === 50000000000);
101
-
102
- if (isProduction) {
103
- } else if (network.name === "hardhat") {
104
- console.log("simulating taxable tx on fork...");
105
- const anyMpc = await ethers.getImpersonatedSigner("0x647dC1366Da28f8A64EB831fC8E9F05C90d1EA5a");
106
- let gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
107
- const lockedBalance = await gd.balanceOf("0xd17652350cfd2a37ba2f947c910987a3b1a1c60d");
108
- console.log("anygooddollar locked balance 51098079793:", lockedBalance.toNumber() === 51098079793);
109
- let anygd = new ethers.Contract(
110
- "0xd17652350cfd2a37ba2f947c910987a3b1a1c60d",
111
- [
112
- "function withdrawVault(address from,uint amount,address to) external returns (uint)",
113
- "function depositVault(uint amount,address to) external returns (uint)",
114
- "event Transfer(address indexed from,address indexed to,uint value)"
115
- ],
116
- anyMpc
117
- );
118
- let anyRouter = new ethers.Contract(
119
- "0x765277EebeCA2e31912C9946eAe1021199B39C61",
120
- ["function changeVault(address token,address vault) external returns (bool)"],
121
- anyMpc
122
- );
123
-
124
- // make it easier to fake funds withdraw by setting vault as EOA account
125
- await anyRouter.changeVault(anygd.address, anyMpc.address).then(printDeploy);
126
-
127
- //perform txs that transfer funds
128
- await anygd.depositVault(lockedBalance, root.address).then(printDeploy);
129
- const tx = await anygd.withdrawVault(root.address, lockedBalance, root.address).then(printDeploy);
130
-
131
- console.log(
132
- "verify all funds sent to Avatar",
133
- tx.events.find(
134
- _ => _.args.to === "0x1ecFD1afb601C406fF0e13c3485f2d75699b6817" && _.args.value.eq(lockedBalance)
135
- ) !== undefined
136
- );
137
- }
138
- };
139
-
140
- export const main = async () => {
141
- await upgrade().catch(console.log);
142
- };
143
- if (process.argv[1].includes("formula-upgrade")) main();
@@ -1,129 +0,0 @@
1
- /***
2
- * Disable UBI bridge via multichain
3
- * Upgrade Plan:
4
- * - deploy new DistHelper
5
- * - disable multichain distribution
6
- * - create new distribution instead to guardians
7
- */
8
-
9
- import { network, ethers } from "hardhat";
10
- import { Contract } from "ethers";
11
- import { defaultsDeep } from "lodash";
12
- import { printDeploy, executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
13
-
14
- import ProtocolSettings from "../../releases/deploy-settings.json";
15
-
16
- import dao from "../../releases/deployment.json";
17
- import { verifyContract } from "../multichain-deploy/helpers";
18
- let { name: networkName } = network;
19
-
20
- export const upgrade = async () => {
21
- const isProduction = networkName.includes("production");
22
- let [root, ...signers] = await ethers.getSigners();
23
-
24
- if (isProduction) verifyProductionSigner(root);
25
-
26
- let guardian = root;
27
- // simulate on fork
28
- if (network.name === "hardhat") {
29
- networkName = "production-mainnet";
30
- root = await ethers.getImpersonatedSigner("0x5128E3C1f8846724cc1007Af9b4189713922E4BB");
31
- }
32
-
33
- let release: { [key: string]: any } = dao[networkName];
34
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
35
- //make sure safe has enough eth to simulate txs
36
- if (network.name === "hardhat") {
37
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
38
- await root.sendTransaction({ value: ethers.constants.WeiPerEther, to: protocolSettings.guardiansSafe });
39
- }
40
-
41
- console.log("got signers:", {
42
- networkName,
43
- root: root.address,
44
- guardian: guardian.address,
45
- balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
46
- guardianBalance: await ethers.provider.getBalance(guardian.address).then(_ => _.toString())
47
- });
48
-
49
- let networkEnv = networkName.split("-")[0];
50
- const fuseNetwork = networkEnv;
51
- if (networkEnv === "fuse") networkEnv = "development";
52
- const celoNetwork = networkEnv + "-celo";
53
-
54
- let f = await ethers.getContractFactory("GoodFundManager");
55
- console.log("bytecode", f.bytecode.length);
56
- // let newDistHelper = (await ethers
57
- // .deployContract("DistributionHelper", { maxFeePerGas: 22e9, nonce: 118 })
58
- // .then(printDeploy)) as Contract;
59
- let newDistHelper = (await (await ethers.getContractFactory("DistributionHelper"))
60
- .deploy({ maxFeePerGas: 15e9, maxPriorityFeePerGas: 1e9 })
61
- .then(printDeploy)) as Contract;
62
- if (isProduction) await verifyContract(newDistHelper, "GoodReserveCDai", networkName);
63
-
64
- const proposalContracts = [
65
- release.DistributionHelper, //controller -> upgrade disthelper
66
- release.DistributionHelper, //set new distribution params
67
- release.DistributionHelper //set new distribution params
68
- ];
69
-
70
- const proposalEthValues = proposalContracts.map(_ => 0);
71
-
72
- const proposalFunctionSignatures = [
73
- "upgradeTo(address)", //upgrade disthelper
74
- "addOrUpdateRecipient((uint32,uint32,address,uint8))", // remove multichain
75
- "addOrUpdateRecipient((uint32,uint32,address,uint8))" // guardians distribution
76
- ];
77
-
78
- const proposalFunctionInputs = [
79
- ethers.utils.defaultAbiCoder.encode(["address"], [newDistHelper.address]),
80
- ethers.utils.defaultAbiCoder.encode(
81
- ["uint32", "uint32", "address", "uint8"],
82
- [0, 42220, dao[celoNetwork].UBIScheme, 1]
83
- ),
84
- ethers.utils.defaultAbiCoder.encode(
85
- ["uint32", "uint32", "address", "uint8"],
86
- [8182, 42220, release.GuardiansSafe, 3] //ubi to guardians
87
- )
88
- ];
89
-
90
- if (isProduction) {
91
- await executeViaSafe(
92
- proposalContracts,
93
- proposalEthValues,
94
- proposalFunctionSignatures,
95
- proposalFunctionInputs,
96
- protocolSettings.guardiansSafe,
97
- "mainnet"
98
- );
99
- } else {
100
- //simulation or dev envs
101
- await executeViaGuardian(
102
- proposalContracts,
103
- proposalEthValues,
104
- proposalFunctionSignatures,
105
- proposalFunctionInputs,
106
- guardian,
107
- networkName
108
- );
109
- }
110
-
111
- if (!isProduction) {
112
- //check simulation results
113
- let fm = await ethers.getContractAt("GoodFundManager", release.GoodFundManager);
114
- let dh = await ethers.getContractAt("DistributionHelper", release.DistributionHelper);
115
-
116
- console.log(await dh.distributionRecipients(0));
117
- console.log(await dh.distributionRecipients(1));
118
- console.log(await dh.distributionRecipients(2));
119
- let tx = await (await fm.collectInterest(["0x7b7246c78e2f900d17646ff0cb2ec47d6ba10754"], true)).wait();
120
- let gd = await ethers.getContractAt("IGoodDollar", "0x67C5870b4A41D4Ebef24d2456547A03F1f3e094B");
121
- const safeBalance = await gd.balanceOf("0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec");
122
- console.log({ safeBalance }, tx.events);
123
- }
124
- };
125
-
126
- export const main = async () => {
127
- await upgrade().catch(console.log);
128
- };
129
- if (process.argv[1].includes("multichain-temp-fix")) main();
@@ -1,91 +0,0 @@
1
- /***
2
- * restore DAO funds accidently sent to ubischeme
3
- *
4
- ***/
5
-
6
- import { network, ethers } from "hardhat";
7
- import { reset } from "@nomicfoundation/hardhat-network-helpers";
8
- import { defaultsDeep } from "lodash";
9
- import { executeViaSafe, executeViaGuardian } from "../multichain-deploy/helpers";
10
- import ProtocolSettings from "../../releases/deploy-settings.json";
11
-
12
- import dao from "../../releases/deployment.json";
13
- let { name: networkName } = network;
14
-
15
- export const upgrade = async () => {
16
- let [root] = await ethers.getSigners();
17
-
18
- const NEW_UBISCHEME = "0x1c90f733e1724bd1dB47f84CDE4f9e83087cFB6d";
19
- const WITHDRAW_AMOUNT = "3000000000"; //30M G$
20
- const DAO_TREASURY = "0xCe69892CbDA078BbFAA3E5aE7A4b4d2Bf3E5c412";
21
-
22
- const isProduction = networkName.includes("production");
23
-
24
- const isForkSimulation = networkName === "localhost";
25
-
26
- let networkEnv = networkName.split("-")[0];
27
- if (isForkSimulation) {
28
- await reset("https://rpc.fuse.io");
29
-
30
- networkEnv = "production";
31
- }
32
-
33
- if (networkEnv === "fuse") networkEnv = "development";
34
-
35
- let release: { [key: string]: any } = dao[networkEnv];
36
-
37
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkEnv], ProtocolSettings["default"]);
38
-
39
- let guardian = root;
40
-
41
- if (isForkSimulation) {
42
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
43
- await root.sendTransaction({ value: ethers.constants.WeiPerEther, to: protocolSettings.guardiansSafe });
44
- }
45
-
46
- console.log({ networkEnv, guardian: guardian.address, isForkSimulation, isProduction });
47
- const proposalContracts = [
48
- release.UBIScheme, //upgrade
49
- release.UBIScheme // withdraw funds
50
- ];
51
-
52
- const proposalEthValues = proposalContracts.map(_ => 0);
53
-
54
- const proposalFunctionSignatures = [
55
- "upgradeTo(address)", // set new bridge name
56
- "withdraw(uint256,address)"
57
- ];
58
-
59
- const proposalFunctionInputs = [
60
- ethers.utils.defaultAbiCoder.encode(["address"], [NEW_UBISCHEME]),
61
- ethers.utils.defaultAbiCoder.encode(["uint256", "address"], [WITHDRAW_AMOUNT, DAO_TREASURY])
62
- ];
63
-
64
- if (isProduction) {
65
- await executeViaSafe(
66
- proposalContracts,
67
- proposalEthValues,
68
- proposalFunctionSignatures,
69
- proposalFunctionInputs,
70
- release.GuardiansSafe,
71
- "fuse"
72
- );
73
- } else {
74
- await executeViaGuardian(
75
- proposalContracts,
76
- proposalEthValues,
77
- proposalFunctionSignatures,
78
- proposalFunctionInputs,
79
- guardian,
80
- networkEnv
81
- );
82
- }
83
-
84
- if (isForkSimulation) {
85
- const gd = await ethers.getContractAt("IERC20", release["GoodDollar"]);
86
- const balanceAfter = await gd.balanceOf(DAO_TREASURY);
87
- console.log(balanceAfter);
88
- }
89
- };
90
-
91
- upgrade();
@@ -1,159 +0,0 @@
1
- /***
2
- * Upgrade celo's supergooddollar with support for superfluid nfts + celo gas token requirements
3
- * Upgrade Plan:
4
- * - deploy implementation
5
- * - call updateCode
6
- * - once nfts are deployed create and nft and set it
7
- */
8
-
9
- import { network, ethers } from "hardhat";
10
- import { Contract } from "ethers";
11
- import { defaultsDeep } from "lodash";
12
- import { getImplementationAddress } from "@openzeppelin/upgrades-core";
13
- // import OutNFT from "@superfluid-finance/ethereum-contracts/artifacts/contracts/superfluid/ConstantOutflowNFT.sol/ConstantOutflowNFT.json";
14
- // import InNFT from "@superfluid-finance/ethereum-contracts/artifacts/contracts/superfluid/ConstantInflowNFT.sol/ConstantInflowNFT.json";
15
- import {
16
- deployDeterministic,
17
- printDeploy,
18
- executeViaGuardian,
19
- executeViaSafe,
20
- verifyProductionSigner
21
- } from "../multichain-deploy/helpers";
22
-
23
- import ProtocolSettings from "../../releases/deploy-settings.json";
24
-
25
- import dao from "../../releases/deployment.json";
26
- import { verifyContract } from "../multichain-deploy/helpers";
27
- let { name: networkName } = network;
28
-
29
- networkName = networkName.replace("-fork", "");
30
-
31
- export const upgrade = async () => {
32
- const isProduction = networkName.includes("production");
33
- let [root, ...signers] = await ethers.getSigners();
34
- let withNFTs = true;
35
-
36
- if (isProduction) verifyProductionSigner(root);
37
- // simulate on fork
38
- if (network.name === "localhost") {
39
- await root.sendTransaction({
40
- to: "0xecA109A2686F074c9461bcb05656b19EF61FbC9e",
41
- value: ethers.constants.WeiPerEther
42
- });
43
- root = await ethers.getImpersonatedSigner(
44
- "0xecA109A2686F074c9461bcb05656b19EF61FbC9e"
45
- );
46
- networkName = "production-celo";
47
- } else withNFTs = true;
48
-
49
- let release: { [key: string]: any } = dao[networkName];
50
-
51
- let protocolSettings = defaultsDeep(
52
- {},
53
- ProtocolSettings[networkName],
54
- ProtocolSettings["default"]
55
- );
56
-
57
- console.log("got signers:", {
58
- withNFTs,
59
- networkName,
60
- root: root.address,
61
- balance: await ethers.provider
62
- .getBalance(root.address)
63
- .then(_ => _.toString())
64
- });
65
-
66
- const supergd = await ethers.getContractAt(
67
- "SuperGoodDollar",
68
- release.GoodDollar
69
- );
70
- const owner = await supergd.owner();
71
- const host = await supergd.getHost();
72
- const name = await supergd.name();
73
- const symbol = await supergd.symbol();
74
- console.log({ supergd: supergd.address, owner, host, symbol, name });
75
- let impl = await ethers
76
- .deployContract("SuperGoodDollar", [host])
77
- .then(printDeploy);
78
-
79
- await verifyContract(impl.address, "SuperGoodDollar", networkName);
80
-
81
- let outnftProxy, innftProxy;
82
- if (withNFTs) {
83
- outnftProxy = await ethers.deployContract("UUPSProxy").then(printDeploy);
84
- innftProxy = await ethers.deployContract("UUPSProxy").then(printDeploy);
85
-
86
- const outnftimpl = (await ethers
87
- .deployContract("ConstantOutflowNFT", [host, innftProxy.address])
88
- .then(printDeploy)) as Contract;
89
-
90
- const innftimpl = (await ethers
91
- .deployContract("ConstantInflowNFT", [host, outnftProxy.address])
92
- .then(printDeploy)) as Contract;
93
-
94
- await verifyContract(outnftimpl.address, "ConstantOutflowNFT", networkName);
95
-
96
- await verifyContract(innftimpl.address, "ConstantInflowNFT", networkName);
97
-
98
- await outnftProxy.initializeProxy(outnftimpl.address).then(printDeploy);
99
- await outnftimpl
100
- .attach(outnftProxy.address)
101
- .initialize(name + "-OutFlowNFT", symbol + "-OutFlowNFT")
102
- .then(printDeploy);
103
-
104
- await innftProxy.initializeProxy(innftimpl.address).then(printDeploy);
105
- await innftimpl
106
- .attach(innftProxy.address)
107
- .initialize(name + "-InFlowNFT", symbol + "-InFlowNFT")
108
- .then(printDeploy);
109
- }
110
- const proposalContracts = [
111
- release.GoodDollar, //upgrade
112
- release.GoodDollar //optionally set NFTs
113
- ];
114
-
115
- const proposalEthValues = proposalContracts.map(_ => 0);
116
-
117
- const proposalFunctionSignatures = [
118
- "updateCode(address)",
119
- "setNFTProxyContracts(address,address,address,address)"
120
- ];
121
-
122
- const proposalFunctionInputs = [
123
- ethers.utils.defaultAbiCoder.encode(["address"], [impl.address]),
124
- ethers.utils.defaultAbiCoder.encode(
125
- ["address", "address", "address", "address"],
126
- [
127
- outnftProxy.address,
128
- innftProxy.address,
129
- ethers.constants.AddressZero,
130
- ethers.constants.AddressZero
131
- ]
132
- )
133
- ];
134
-
135
- if (isProduction) {
136
- await executeViaSafe(
137
- proposalContracts.slice(0, withNFTs ? 2 : 1),
138
- proposalEthValues.slice(0, withNFTs ? 2 : 1),
139
- proposalFunctionSignatures.slice(0, withNFTs ? 2 : 1),
140
- proposalFunctionInputs.slice(0, withNFTs ? 2 : 1),
141
- "0xecA109A2686F074c9461bcb05656b19EF61FbC9e",
142
- "celo"
143
- );
144
- } else {
145
- await executeViaGuardian(
146
- proposalContracts.slice(0, withNFTs ? 2 : 1),
147
- proposalEthValues.slice(0, withNFTs ? 2 : 1),
148
- proposalFunctionSignatures.slice(0, withNFTs ? 2 : 1),
149
- proposalFunctionInputs.slice(0, withNFTs ? 2 : 1),
150
- root,
151
- networkName
152
- );
153
- }
154
- };
155
-
156
- export const main = async () => {
157
- await upgrade().catch(console.log);
158
- };
159
- if (process.argv[1].includes("superfluid-nft-celo-gas-token")) main();