@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,29 +0,0 @@
1
- ## Mainnet on-chain proposal
2
-
3
- - On mainnet we send 10% to community pool and 50% of the remaining 90% (ie 45%) to the Celo UBI Pool, so in total its 55% we distribute via the distribution helper.
4
- - 10% of the 55% is 0.1818 or 1818 in bps
5
- - 45% of the 55% is 0.8182 or 8182 in bps
6
-
7
- | contract | method | arguments |
8
- | -------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
9
- | Reserve: 0xa150a825d425B36329D8294eeF8bD0fE68f8F6E0 | setDistributionHelper(DistributionHelper \_helper, uin32 \_bps) | (DistributionHelper:"0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0",5500) |
10
- | DistributionHelper: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | addOrUpdateRecipient(DistributionRecipient memory \_recipient) | {bps: 8182, chainId: 42220, addr: CeloUBIScheme:'0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1', transferType: 1} |
11
- | DistributionHelper: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | addOrUpdateRecipient(DistributionRecipient memory \_recipient) | {bps: 1818, chainId: 122, addr: FuseCommunitySafe:'0x5Eb5f5fE13d1D5e6440DbD5913412299Bc5B5564', transferType: 0} |
12
-
13
- ## Fuse on-chain proposal
14
-
15
- - On fuse we collect funds from FirstClaimPool and then transfer these funds + older funds in Avatar (also from older FirstClaimPool/Invite contracts funded by GoodLabs) to the UBI Pool on Celo via the multichain bridge
16
-
17
- | contract | method | arguments |
18
- | ------------------------------------------------------------ | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
- | FirstClaimPool: 0x18BcdF79A724648bF34eb06701be81bD072A2384 | end() | |
20
- | GoodDollar: 0x495d133B938596C9984d462F007B676bDc57eCEC | approve(address spender,uint256 amount) | (GoodDollarMintBurnWrapper:"0x031b2B7C7854dd8EE9C4A644D7e54aD17F56e3cB",128069283 + 463420500) |
21
- | MultichainRouter: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | function anySwapOut(address token,address to,uint256 amount,uint256 toChainID) | (GoodDollarMintBurnWrapper:"0x031b2B7C7854dd8EE9C4A644D7e54aD17F56e3cB",CeloUBIScheme:"0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1",128069283 + 463420500,42220) |
22
-
23
- ## To Test/Simulate on a forked chain
24
-
25
- - `npx hardhat node --fork https://rpc.fuse.io &`
26
- - `npx hardhat run scripts/proposals/gip-14_1.ts --network localhost`
27
- - Choose step:
28
- 1: run mainnet proposal
29
- 2: run fuse proposal
@@ -1,414 +0,0 @@
1
- /***
2
- * Bring UBI distribution to a temporary working state
3
- * Celo:
4
- * - upgrade bridge to be able to prevent UBI bridge transfers as result of the hack
5
- * - mark unexecuted bridge transfers as executed
6
- * - set UBI with new cycle params
7
- * - unpause ubi contract
8
- * Fuse:
9
- * - withdraw ubi to avatar and bridge ubi to contract on celo
10
- * - burn excess UBI tokens
11
- * - set UBI with new cycle params
12
- * - unpause ubi contract
13
- * Mainnet:
14
- * - withdraw excess UBI from bridge to avatar
15
- * - burn excess UBI from bridge
16
- *
17
- */
18
-
19
- import { network, ethers } from "hardhat";
20
- import { defaultsDeep, last } from "lodash";
21
- import prompt from "prompt";
22
-
23
- import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
24
-
25
- import ProtocolSettings from "../../releases/deploy-settings.json";
26
-
27
- import dao from "../../releases/deployment.json";
28
- import { BigNumber } from "ethers";
29
- let { name: networkName } = network;
30
-
31
- export const upgradeCelo = async () => {
32
- const isProduction = networkName.includes("production");
33
- let [root, ...signers] = await ethers.getSigners();
34
-
35
- if (isProduction) verifyProductionSigner(root);
36
-
37
- let guardian = root;
38
-
39
- //simulate produciton on fork
40
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
41
- networkName = "production-celo";
42
- }
43
-
44
- let release: { [key: string]: any } = dao[networkName];
45
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
46
-
47
- //simulate on fork, make sure safe has enough eth to simulate txs
48
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
49
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
50
-
51
- await root.sendTransaction({
52
- value: ethers.constants.WeiPerEther.mul(3),
53
- to: protocolSettings.guardiansSafe
54
- });
55
- }
56
-
57
- const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
58
- const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
59
-
60
- const NEWBRIDGE_IMPL = "0x691dE730D97d545c141D13ED5e9c12b7cB384a73";
61
-
62
- const ubiImpl = await ethers.deployContract("UBISchemeV2");
63
-
64
- console.log("got signers:", {
65
- networkName,
66
- root: root.address,
67
- guardian: guardian.address,
68
- balance: rootBalance,
69
- guardianBalance: guardianBalance
70
- });
71
-
72
- console.log("executing proposals");
73
-
74
- const proposalContracts = [
75
- release.MpbBridge, //controller -> upgrade bridge contract
76
- release.MpbBridge, //mark request 0x3d959d3438182af92242207591931a28de09296035c08e355167c1f9aae0f7ab as executed
77
- release.MpbBridge, //mark request 0x73dff6aa07a76330c9dbcb0920d9cbb67489e22d9dd452aaf867f4008f4e7598 as executed
78
- release.MpbBridge, //mark request 0x8bf2c3df2954005b4ce077b68fce35f80b0e94efee349db5a417cdc8e2c52ba2 as executed
79
- release.MpbBridge, //mark request 0x06d2ae5f6b7943c6d36da248512dfad48ace22c9447c3cacb9b403907678e5a2 as executed
80
- release.UBIScheme, //set new ubi contract
81
- release.UBIScheme, //set cycle length to 60 days
82
- release.UBIScheme //unpause ubi
83
- ];
84
-
85
- const proposalEthValues = proposalContracts.map(_ => 0);
86
-
87
- const proposalFunctionSignatures = [
88
- "upgradeTo(address)", // set new bridge name
89
- "preventRequest(uint256)", //prevent bridge hack ubi request
90
- "preventRequest(uint256)", //prevent bridge hack ubi request
91
- "preventRequest(uint256)", //prevent bridge hack ubi request
92
- "preventRequest(uint256)", //prevent bridge hack ubi request
93
- "upgradeTo(address)", // set new ubi contract
94
- "setCycleLength(uint256)", //set new cycle length
95
- "pause(bool)" // unpause ubi
96
- ];
97
-
98
- const proposalFunctionInputs = [
99
- ethers.utils.defaultAbiCoder.encode(["address"], [NEWBRIDGE_IMPL]),
100
- ethers.utils.defaultAbiCoder.encode(
101
- ["uint256"],
102
- ["0x3d959d3438182af92242207591931a28de09296035c08e355167c1f9aae0f7ab"]
103
- ),
104
- ethers.utils.defaultAbiCoder.encode(
105
- ["uint256"],
106
- ["0x73dff6aa07a76330c9dbcb0920d9cbb67489e22d9dd452aaf867f4008f4e7598"]
107
- ),
108
- ethers.utils.defaultAbiCoder.encode(
109
- ["uint256"],
110
- ["0x8bf2c3df2954005b4ce077b68fce35f80b0e94efee349db5a417cdc8e2c52ba2"]
111
- ),
112
- ethers.utils.defaultAbiCoder.encode(
113
- ["uint256"],
114
- ["0x06d2ae5f6b7943c6d36da248512dfad48ace22c9447c3cacb9b403907678e5a2"]
115
- ),
116
- ethers.utils.defaultAbiCoder.encode(["address"], [ubiImpl.address]),
117
- ethers.utils.defaultAbiCoder.encode(["uint256"], [60]),
118
- ethers.utils.defaultAbiCoder.encode(["bool"], [false])
119
- ];
120
-
121
- if (isProduction) {
122
- await executeViaSafe(
123
- proposalContracts,
124
- proposalEthValues,
125
- proposalFunctionSignatures,
126
- proposalFunctionInputs,
127
- protocolSettings.guardiansSafe,
128
- "celo"
129
- );
130
- } else {
131
- //simulation or dev envs
132
- await executeViaGuardian(
133
- proposalContracts,
134
- proposalEthValues,
135
- proposalFunctionSignatures,
136
- proposalFunctionInputs,
137
- guardian,
138
- networkName
139
- );
140
- }
141
-
142
- //perform sanity checks on fork, for production we need to wait until everything executed
143
- if (!isProduction) {
144
- let ubi = await ethers.getContractAt("UBISchemeV2", release.UBIScheme);
145
- let bridge = await ethers.getContractAt(
146
- ["function executedRequests(uint256) view returns (bool)"],
147
- release.MpbBridge
148
- );
149
-
150
- console.log(await bridge.executedRequests("0x3d959d3438182af92242207591931a28de09296035c08e355167c1f9aae0f7ab"));
151
- console.log(await bridge.executedRequests("0x73dff6aa07a76330c9dbcb0920d9cbb67489e22d9dd452aaf867f4008f4e7598"));
152
- console.log(await bridge.executedRequests("0x8bf2c3df2954005b4ce077b68fce35f80b0e94efee349db5a417cdc8e2c52ba2"));
153
- console.log(await bridge.executedRequests("0x06d2ae5f6b7943c6d36da248512dfad48ace22c9447c3cacb9b403907678e5a2"));
154
-
155
- console.log("cycle length", await ubi.cycleLength(), "ubi pause:", await ubi.paused());
156
- }
157
- };
158
-
159
- export const upgradeFuse = async () => {
160
- let [root] = await ethers.getSigners();
161
-
162
- const isProduction = networkName.includes("production");
163
-
164
- const isForkSimulation = networkName === "localhost";
165
-
166
- let networkEnv = networkName.split("-")[0];
167
- if (isForkSimulation) networkEnv = "production";
168
-
169
- if (networkEnv === "fuse") networkEnv = "development";
170
-
171
- let release: { [key: string]: any } = dao[networkEnv];
172
-
173
- let guardian = root;
174
- //simulate on fork, make sure safe has enough eth to simulate txs
175
- if (network.name === "localhost" || network.name === "fork") {
176
- guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
177
-
178
- await root.sendTransaction({
179
- value: ethers.constants.WeiPerEther.mul(3),
180
- to: guardian.address
181
- });
182
- }
183
-
184
- const NEWBRIDGE = release["MpbBridge"];
185
- const gd = await ethers.getContractAt("IERC20", release["GoodDollar"]);
186
- const ubiGdBalance = await gd.balanceOf(release.UBIScheme);
187
- const CELO_UBI_BALANCE = 1444008974;
188
- const KEEP_UBI = 11e2 * 60 * 70000; // to keep on fuse 11 G$ for 60 days for 70k users
189
- const EXCESS_UBI = ubiGdBalance.sub(BigNumber.from(KEEP_UBI));
190
- const BRIDGE_UBI = 40e2 * 60 * 70000 - CELO_UBI_BALANCE; // out of excess ubi to bridge to celo 40 G$ for 60 days for 70k users
191
- const BURN_UBI = EXCESS_UBI.sub(BigNumber.from(BRIDGE_UBI)).toString(); // out of excess ubi to burn
192
-
193
- console.log({ EXCESS_UBI, KEEP_UBI, BURN_UBI, BRIDGE_UBI });
194
- const gdTotalSupply = await gd.totalSupply();
195
-
196
- console.log({
197
- networkEnv,
198
- NEWBRIDGE,
199
- guardian: guardian.address,
200
- isForkSimulation,
201
- isProduction,
202
- avatarBalance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
203
- });
204
-
205
- const proposalContracts = [
206
- release.UBIScheme, //withdraw ubi
207
- release.GoodDollar, // burn
208
- release.GoodDollar, // approve to bridge
209
- release.MpbBridge, // execute bridge (needs value)
210
- release.UBIScheme, //set cycle length to 60 days
211
- release.UBIScheme //unpause ubi
212
- ];
213
-
214
- const proposalEthValues = proposalContracts.map(_ => ethers.constants.Zero);
215
- proposalEthValues[3] = ethers.utils.parseEther("0.8");
216
-
217
- const proposalFunctionSignatures = [
218
- "withdraw(uint256,address)", // withdraw excess ubi
219
- "burn(uint256)", // burn excess ubi
220
- "approve(address,uint256)", // approve bridge of excess ubi
221
- "bridgeTo(address,uint256,uint256,uint8)", // bridge request to celo ubi
222
- "setCycleLength(uint256)", //set new cycle length
223
- "pause(bool)" // unpause ubi
224
- ];
225
-
226
- const proposalFunctionInputs = [
227
- ethers.utils.defaultAbiCoder.encode(["uint256", "address"], [EXCESS_UBI, release.Avatar]), //setAddresses(bytes32[],address[])"
228
- ethers.utils.defaultAbiCoder.encode(["uint256"], [BURN_UBI]),
229
- ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [release.MpbBridge, BRIDGE_UBI]),
230
- ethers.utils.defaultAbiCoder.encode(
231
- ["address", "uint256", "uint256", "uint8"],
232
- [dao["production-celo"].UBIScheme, 42220, BRIDGE_UBI, 1]
233
- ),
234
- ethers.utils.defaultAbiCoder.encode(["uint256"], [60]),
235
- ethers.utils.defaultAbiCoder.encode(["bool"], [false])
236
- ];
237
-
238
- // make sure avatar has enough Fuse for bridge tx
239
- await root.sendTransaction({
240
- value: ethers.utils.parseEther("0.8"),
241
- to: release.Avatar
242
- });
243
-
244
- console.log(
245
- "bridge before allowance:",
246
- await gd.allowance(release.Avatar, release.MpbBridge),
247
- "avatarBalance",
248
- await ethers.provider.getBalance(root.address).then(_ => _.toString())
249
- );
250
-
251
- if (isProduction) {
252
- await executeViaSafe(
253
- proposalContracts,
254
- proposalEthValues,
255
- proposalFunctionSignatures,
256
- proposalFunctionInputs,
257
- release.GuardiansSafe,
258
- "fuse"
259
- );
260
- } else {
261
- await executeViaGuardian(
262
- proposalContracts,
263
- proposalEthValues,
264
- proposalFunctionSignatures,
265
- proposalFunctionInputs,
266
- guardian,
267
- networkEnv
268
- );
269
- }
270
-
271
- if (!isProduction) {
272
- let ubi = await ethers.getContractAt("UBISchemeV2", release.UBIScheme);
273
- let bridge = await ethers.getContractAt(
274
- [
275
- "event BridgeRequest(address indexed from, address indexed to, uint256 targetChainId, uint256 normalizedAmount, uint256 timestamp, uint8 bridge, uint256 indexed id)"
276
- ],
277
- release.MpbBridge
278
- );
279
-
280
- const finalAvatarBalance = await gd.balanceOf(release.Avatar);
281
-
282
- const finalgdTotalSupply = await gd.totalSupply();
283
- const finalubiGdBalance = await gd.balanceOf(release.UBIScheme);
284
- console.log("burned:", gdTotalSupply.sub(finalgdTotalSupply), "to burn:", EXCESS_UBI);
285
- console.log("ubi balance change:", ubiGdBalance.sub(finalubiGdBalance));
286
-
287
- console.log("cycle length", await ubi.cycleLength(), "ubi pause:", await ubi.paused());
288
- console.log("avatar balance:", finalAvatarBalance);
289
- console.log("bridge allowance:", await gd.allowance(release.Avatar, release.MpbBridge));
290
- const f = bridge.filters.BridgeRequest();
291
- const events = await bridge.queryFilter(f);
292
- console.log(last(events));
293
- }
294
- };
295
-
296
- export const upgradeMainnet = async () => {
297
- const isProduction = networkName.includes("production");
298
- let [root, ...signers] = await ethers.getSigners();
299
-
300
- if (isProduction) verifyProductionSigner(root);
301
-
302
- let guardian = root;
303
-
304
- //simulate produciton on fork
305
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
306
- networkName = "production-mainnet";
307
- }
308
-
309
- let release: { [key: string]: any } = dao[networkName];
310
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
311
-
312
- //simulate on fork, make sure safe has enough eth to simulate txs
313
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
314
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
315
-
316
- await root.sendTransaction({
317
- value: ethers.constants.WeiPerEther.mul(3),
318
- to: protocolSettings.guardiansSafe
319
- });
320
- }
321
-
322
- const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
323
- const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
324
-
325
- console.log("got signers:", {
326
- networkName,
327
- root: root.address,
328
- guardian: guardian.address,
329
- balance: rootBalance,
330
- guardianBalance: guardianBalance
331
- });
332
-
333
- const CELO_UBI_BURN = 20193470562 + 161547764498 + 146346390158 + 18293298769; //hacker minted ubi
334
- const FUSE_UBI_BURN = 20336841183; //hacker minted ubi, not including ubi left for 60 days
335
- const TOTAL_BURN = CELO_UBI_BURN + FUSE_UBI_BURN;
336
-
337
- const gd = await ethers.getContractAt("IERC20", release["GoodDollar"]);
338
- const [bridgeBalance, totalSupply] = await Promise.all([gd.balanceOf(release.MpbBridge), gd.totalSupply()]);
339
- console.log("executing proposals");
340
-
341
- const proposalContracts = [
342
- release.MpbBridge, //controller -> withdraw extra ubi funds from bridge
343
- release.GoodDollar //burn
344
- ];
345
-
346
- const proposalEthValues = proposalContracts.map(_ => 0);
347
-
348
- const proposalFunctionSignatures = [
349
- "withdraw(address,uint256)", // withdraw ubi
350
- "burn(uint256)" //burn ubi
351
- ];
352
-
353
- const proposalFunctionInputs = [
354
- ethers.utils.defaultAbiCoder.encode(
355
- ["address", "uint256"],
356
- ["0x67C5870b4A41D4Ebef24d2456547A03F1f3e094B", TOTAL_BURN]
357
- ),
358
- ethers.utils.defaultAbiCoder.encode(["uint256"], [TOTAL_BURN])
359
- ];
360
-
361
- if (isProduction) {
362
- await executeViaSafe(
363
- proposalContracts,
364
- proposalEthValues,
365
- proposalFunctionSignatures,
366
- proposalFunctionInputs,
367
- protocolSettings.guardiansSafe,
368
- "mainnet"
369
- );
370
- } else {
371
- //simulation or dev envs
372
- await executeViaGuardian(
373
- proposalContracts,
374
- proposalEthValues,
375
- proposalFunctionSignatures,
376
- proposalFunctionInputs,
377
- guardian,
378
- networkName
379
- );
380
- }
381
-
382
- //perform sanity checks on fork, for production we need to wait until everything executed
383
- if (!isProduction) {
384
- const [bridgeBalanceAfter, totalSupplyAfter] = await Promise.all([
385
- gd.balanceOf(release.MpbBridge),
386
- gd.totalSupply()
387
- ]);
388
- console.log("bridge balance before:", bridgeBalance.toString());
389
- console.log("bridge balance before:", bridgeBalanceAfter.toString());
390
- console.log("total supply before:", totalSupply.toString());
391
- console.log("total supply after:", totalSupplyAfter.toString());
392
- }
393
- };
394
-
395
- export const main = async () => {
396
- prompt.start();
397
- const { network } = await prompt.get(["network"]);
398
-
399
- console.log("running step:", { network });
400
- switch (network) {
401
- case "celo":
402
- await upgradeCelo();
403
- break;
404
- case "fuse":
405
- await upgradeFuse();
406
- break;
407
- case "mainnet":
408
- await upgradeMainnet();
409
-
410
- break;
411
- }
412
- };
413
-
414
- main().catch(console.log);
@@ -1,229 +0,0 @@
1
- /***
2
- * Bring UBI distribution to a temporary working state
3
- * Celo:
4
- * - upgrade bridge to be able to prevent UBI bridge transfers as result of the hack
5
- * - mark unexecuted bridge transfers as executed
6
- * - set UBI with new cycle params
7
- * - unpause ubi contract
8
- * Fuse:
9
- * - withdraw ubi to avatar and bridge ubi to contract on celo
10
- * - burn excess UBI tokens
11
- * - set UBI with new cycle params
12
- * - unpause ubi contract
13
- * Mainnet:
14
- * - withdraw excess UBI from bridge to avatar
15
- * - burn excess UBI from bridge
16
- *
17
- */
18
-
19
- import { network, ethers } from "hardhat";
20
- import { defaultsDeep, last } from "lodash";
21
- import prompt from "prompt";
22
-
23
- import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
24
-
25
- import ProtocolSettings from "../../releases/deploy-settings.json";
26
-
27
- import dao from "../../releases/deployment.json";
28
- let { name: networkName } = network;
29
-
30
- export const upgradeCelo = async () => {
31
- const isProduction = networkName.includes("production");
32
- let [root, ...signers] = await ethers.getSigners();
33
-
34
- if (isProduction) verifyProductionSigner(root);
35
-
36
- let guardian = root;
37
-
38
- //simulate produciton on fork
39
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
40
- networkName = "production-celo";
41
- }
42
-
43
- let release: { [key: string]: any } = dao[networkName];
44
- let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
45
-
46
- //simulate on fork, make sure safe has enough eth to simulate txs
47
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
48
- guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
49
-
50
- await root.sendTransaction({
51
- value: ethers.constants.WeiPerEther.mul(3),
52
- to: protocolSettings.guardiansSafe
53
- });
54
- }
55
-
56
- const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
57
- const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
58
-
59
-
60
- console.log("got signers:", {
61
- networkName,
62
- root: root.address,
63
- guardian: guardian.address,
64
- balance: rootBalance,
65
- guardianBalance: guardianBalance
66
- });
67
-
68
- const reducerContract = await ethers.deployContract("LastauthReduction", [release.NameService])
69
- console.log("executing proposals");
70
-
71
- const proposalContracts = [
72
- release.Controller,
73
- ];
74
-
75
- const proposalEthValues = proposalContracts.map(_ => 0);
76
-
77
- const proposalFunctionSignatures = [
78
- "registerScheme(address,bytes32,bytes4,address)", //make sure mpb is a registered scheme so it can mint G$ tokens
79
- ];
80
-
81
- const proposalFunctionInputs = [
82
- ethers.utils.defaultAbiCoder.encode(["address", "bytes32", "bytes4", "address"], [reducerContract.address, ethers.constants.HashZero, "0x0000001f", release.Avatar]),
83
- ];
84
-
85
- if (isProduction) {
86
- await executeViaSafe(
87
- proposalContracts,
88
- proposalEthValues,
89
- proposalFunctionSignatures,
90
- proposalFunctionInputs,
91
- protocolSettings.guardiansSafe,
92
- "celo"
93
- );
94
- } else {
95
- //simulation or dev envs
96
- await executeViaGuardian(
97
- proposalContracts,
98
- proposalEthValues,
99
- proposalFunctionSignatures,
100
- proposalFunctionInputs,
101
- guardian,
102
- networkName
103
- );
104
- }
105
-
106
- //perform sanity checks on fork, for production we need to wait until everything executed
107
- if (!isProduction) {
108
- try {
109
- while (true) {
110
- await reducerContract.reduce()
111
- let id = await ethers.getContractAt("IdentityV2", release.Identity);
112
- console.log("authperiod", await id.authenticationPeriod());
113
- }
114
- } catch (error) {
115
- console.log("reduce reverted:", error)
116
- }
117
-
118
- }
119
- };
120
-
121
- export const upgradeFuse = async () => {
122
- const isProduction = networkName.includes("production");
123
-
124
- let [root] = await ethers.getSigners();
125
-
126
- //simulate produciton on fork
127
- if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
128
- networkName = "production";
129
- }
130
-
131
- let networkEnv = networkName.split("-")[0];
132
-
133
-
134
- if (networkEnv === "fuse") networkEnv = "development";
135
-
136
- let release: { [key: string]: any } = dao[networkEnv];
137
-
138
- let guardian = root;
139
- console.log({ networkEnv })
140
- //simulate on fork, make sure safe has enough eth to simulate txs
141
- if (network.name === "hardhat" || network.name === "localhost" || network.name === "fork") {
142
- guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
143
-
144
- await root.sendTransaction({
145
- value: ethers.constants.WeiPerEther.mul(3),
146
- to: guardian.address
147
- });
148
- }
149
-
150
-
151
- console.log({
152
- networkEnv,
153
- guardian: guardian.address,
154
- isProduction,
155
- avatarBalance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
156
- });
157
-
158
- const reducerContract = await ethers.deployContract("LastauthReduction", [release.NameService])
159
-
160
- const proposalContracts = [
161
- release.Controller,
162
- ];
163
-
164
- const proposalEthValues = proposalContracts.map(_ => 0);
165
-
166
- const proposalFunctionSignatures = [
167
- "registerScheme(address,bytes32,bytes4,address)", //make sure mpb is a registered scheme so it can mint G$ tokens
168
- ];
169
-
170
- const proposalFunctionInputs = [
171
- ethers.utils.defaultAbiCoder.encode(["address", "bytes32", "bytes4", "address"], [reducerContract.address, ethers.constants.HashZero, "0x0000001f", release.Avatar]),
172
- ];
173
-
174
- if (isProduction) {
175
- await executeViaSafe(
176
- proposalContracts,
177
- proposalEthValues,
178
- proposalFunctionSignatures,
179
- proposalFunctionInputs,
180
- release.GuardiansSafe,
181
- "fuse"
182
- );
183
- } else {
184
- //simulation or dev envs
185
- await executeViaGuardian(
186
- proposalContracts,
187
- proposalEthValues,
188
- proposalFunctionSignatures,
189
- proposalFunctionInputs,
190
- guardian,
191
- networkName
192
- );
193
- }
194
-
195
- //perform sanity checks on fork, for production we need to wait until everything executed
196
- if (!isProduction) {
197
- try {
198
- while (true) {
199
- await reducerContract.reduce()
200
- let id = await ethers.getContractAt("IdentityV2", release.Identity);
201
- let idOld = await ethers.getContractAt("IdentityV2", release.IdentityOld);
202
-
203
- console.log("authperiod", await id.authenticationPeriod(), await idOld.authenticationPeriod());
204
- }
205
- } catch (error) {
206
- console.log("reduce reverted:", error)
207
- }
208
- }
209
-
210
-
211
- };
212
-
213
-
214
- export const main = async () => {
215
- prompt.start();
216
- const { network } = await prompt.get(["network"]);
217
-
218
- console.log("running step:", { network });
219
- switch (network) {
220
- case "celo":
221
- await upgradeCelo();
222
- break;
223
- case "fuse":
224
- await upgradeFuse();
225
- break;
226
- }
227
- };
228
-
229
- main().catch(console.log);