@gooddollar/goodprotocol 2.1.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (880) hide show
  1. package/artifacts/abis/CreateReserveExchange.min.json +1 -0
  2. package/artifacts/abis/IBancorExchangeProvider.min.json +1 -1
  3. package/artifacts/abis/IBroker.min.json +1 -1
  4. package/artifacts/abis/IdentityV3.min.json +1 -1
  5. package/artifacts/abis/IdentityV4.min.json +1 -0
  6. package/artifacts/abis/UpdateReserveRatio.min.json +1 -0
  7. package/artifacts/abis/Voters.min.json +1 -0
  8. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  10. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  11. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  12. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  13. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  14. package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
  15. package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  38. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  39. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  40. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  41. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
  42. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.json +69 -0
  43. package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
  44. package/artifacts/contracts/MentoInterfaces.sol/IBroker.json +131 -4
  45. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
  46. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
  47. package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
  48. package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
  49. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  50. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
  51. package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.dbg.json +4 -0
  52. package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.json +42 -0
  53. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  54. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  55. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
  56. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  57. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  58. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  59. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  60. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  61. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  62. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  63. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  64. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  65. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  66. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  67. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  68. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
  69. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +40 -2
  70. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +4 -0
  71. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +1175 -0
  72. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  73. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  74. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  75. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.json +2 -2
  93. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.json +2 -2
  95. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  102. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  103. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  105. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  107. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  109. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  110. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  111. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  113. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  115. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  116. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  117. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  118. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  119. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  120. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  121. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  122. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  123. package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
  124. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  125. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  126. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
  127. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.json +2 -2
  128. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  129. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  130. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  131. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  132. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  133. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  134. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  135. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  136. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  137. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  138. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  139. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  140. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  141. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  142. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  143. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  144. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  145. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  146. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  147. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  148. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  149. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  150. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  151. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  152. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  153. package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
  154. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  155. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  156. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  157. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  158. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  159. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  160. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  161. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  162. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  163. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  164. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  165. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  166. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  167. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  168. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  169. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  170. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
  171. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  172. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  173. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  174. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  175. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
  176. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  177. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
  178. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.json +2 -2
  179. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  180. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  181. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  182. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  183. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  184. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  185. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  186. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
  187. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
  188. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
  189. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
  190. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
  191. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
  192. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  193. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  194. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  195. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  196. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  197. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  198. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
  199. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  200. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  201. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  202. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  203. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  204. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
  205. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
  206. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.json +2 -2
  207. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  208. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  209. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  210. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  211. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  212. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  213. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  214. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  215. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
  216. package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.dbg.json +4 -0
  217. package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.json +77 -0
  218. package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.dbg.json +4 -0
  219. package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.json +24 -0
  220. package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.dbg.json +4 -0
  221. package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.json +60 -0
  222. package/contracts/MentoInterfaces.sol +247 -203
  223. package/contracts/fuseFaucet/Faucet.sol +15 -2
  224. package/contracts/identity/IdentityV3.sol +5 -3
  225. package/contracts/identity/IdentityV4.sol +600 -0
  226. package/contracts/invite/InvitesV2.sol +30 -10
  227. package/contracts/reserve/GenericDistributionHelper.sol +35 -7
  228. package/contracts/ubi/UBISchemeV2.sol +8 -1
  229. package/contracts/utils/UpdateReserveRatio.sol +121 -0
  230. package/hardhat.config.ts +2 -3
  231. package/package.json +6 -4
  232. package/releases/deploy-settings.json +3 -0
  233. package/releases/deployment.json +703 -1
  234. package/test/governance/ClaimersDistribution.test.ts +1 -1
  235. package/test/governance/CompoundVotingMachine.castvote.test.ts +30 -30
  236. package/test/helpers.ts +80 -196
  237. package/test/identity/IdentityV3.test.ts +53 -129
  238. package/test/identity/IdentityV4.test.ts +464 -0
  239. package/test/invite/InvitesV2.test.ts +50 -5
  240. package/test/reserve/GenericDistributionHelper.e2e.test.ts +445 -0
  241. package/test/utils/AdminWallet.test.ts +14 -15
  242. package/types/contracts/MentoInterfaces.sol/IBancorExchangeProvider.ts +54 -0
  243. package/types/contracts/MentoInterfaces.sol/IBroker.ts +99 -7
  244. package/types/contracts/fuseFaucet/{Faucet.ts → Faucet.sol/Faucet.ts} +1 -1
  245. package/types/{@openzeppelin/contracts/utils/introspection/ERC165.ts → contracts/fuseFaucet/Faucet.sol/Voters.ts} +30 -29
  246. package/types/contracts/fuseFaucet/{SuperfluidBaseFacuet.sol → Faucet.sol}/index.ts +2 -1
  247. package/types/contracts/fuseFaucet/index.ts +2 -1
  248. package/types/contracts/identity/IdentityV3.ts +46 -0
  249. package/types/contracts/identity/{IdentityV2.ts → IdentityV4.ts} +166 -55
  250. package/types/contracts/identity/index.ts +1 -0
  251. package/types/contracts/invite/{InvitesFuseV2.ts → InvitesV2 copy.sol/InvitesV2.ts } +358 -53
  252. package/types/contracts/{IQuoter.sol/index.ts → invite/InvitesV2 copy.sol/index.ts } +1 -1
  253. package/types/contracts/utils/{ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.ts → UpdateReserveRatio.sol/CreateReserveExchange.ts} +10 -32
  254. package/types/contracts/utils/{UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts → UpdateReserveRatio.sol/UpdateReserveRatio.ts} +22 -5
  255. package/types/contracts/utils/{ProtocolUpgradeV4Mento.sol → UpdateReserveRatio.sol}/index.ts +2 -1
  256. package/types/contracts/utils/index.ts +2 -0
  257. package/types/factories/contracts/MentoInterfaces.sol/IBancorExchangeProvider__factory.ts +69 -0
  258. package/types/factories/contracts/MentoInterfaces.sol/IBroker__factory.ts +131 -4
  259. package/types/factories/contracts/fuseFaucet/Faucet.sol/Faucet__factory.ts +914 -0
  260. package/types/factories/contracts/fuseFaucet/Faucet.sol/Voters__factory.ts +54 -0
  261. package/types/factories/contracts/fuseFaucet/Faucet.sol/index.ts +5 -0
  262. package/types/factories/contracts/fuseFaucet/index.ts +1 -1
  263. package/types/factories/contracts/identity/IdentityV3__factory.ts +39 -1
  264. package/types/factories/contracts/identity/IdentityV4__factory.ts +1226 -0
  265. package/types/factories/contracts/identity/index.ts +1 -0
  266. package/types/factories/contracts/invite/InvitesV2 copy.sol/InvitesV2__factory.ts +748 -0
  267. package/types/{contracts/fuseFaucet/Faucet copy.sol → factories/contracts/invite/InvitesV2 copy.sol}/index.ts +1 -1
  268. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper__factory.ts +1 -1
  269. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest__factory.ts +1 -1
  270. package/types/factories/contracts/reserve/GenericDistributionHelper__factory.ts +1 -1
  271. package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
  272. package/types/factories/contracts/utils/BuyFromReserveHelper__factory.ts +1 -1
  273. package/types/factories/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +1 -1
  274. package/types/factories/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange__factory.ts +137 -0
  275. package/types/factories/contracts/utils/{ReserveRestore.sol → UpdateReserveRatio.sol}/MentoExchange__factory.ts +1 -1
  276. package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +113 -0
  277. package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +6 -0
  278. package/types/factories/contracts/utils/index.ts +1 -0
  279. package/types/hardhat.d.ts +45 -0
  280. package/types/index.ts +10 -2
  281. package/scripts/ProxyFactory.json +0 -4425
  282. package/scripts/analytics/activeGDStakers.ts +0 -188
  283. package/scripts/analytics/activeStakers.ts +0 -25
  284. package/scripts/analytics/activeUsersCount.ts +0 -156
  285. package/scripts/analytics/activeWalletsStats.ts +0 -301
  286. package/scripts/analytics/checkActiveWallets.ts +0 -60
  287. package/scripts/analytics/checkBridgeBalances.ts +0 -442
  288. package/scripts/analytics/claimIncidentStats.ts +0 -98
  289. package/scripts/analytics/faucetStats.ts +0 -130
  290. package/scripts/analytics/gdinflow.ts +0 -57
  291. package/scripts/analytics/goodHolders.ts +0 -46
  292. package/scripts/analytics/goodgiveback.ts +0 -64
  293. package/scripts/analytics/p2pTxs.ts +0 -564
  294. package/scripts/analytics/stuckgd.ts +0 -70
  295. package/scripts/analytics/tokenInOutStats.ts +0 -48
  296. package/scripts/analytics/whitelistsyncIssue.ts +0 -87
  297. package/scripts/bulkProof.ts +0 -202
  298. package/scripts/bulkWhitelist.ts +0 -31
  299. package/scripts/deployGnosisSafe.ts +0 -111
  300. package/scripts/fetchOrDeployProxyFactory.ts +0 -46
  301. package/scripts/fv.ts +0 -263
  302. package/scripts/gdx/gdxAirdropCalculation.ts +0 -479
  303. package/scripts/getFounders.ts +0 -32
  304. package/scripts/governance/README.md +0 -70
  305. package/scripts/governance/airdropCalculation.ts +0 -1119
  306. package/scripts/governance/airdropCalculationRecover.ts +0 -416
  307. package/scripts/governance/airdropCalculationSorted.ts +0 -438
  308. package/scripts/governance/goodCheckpointSorted.ts +0 -300
  309. package/scripts/keeper/fishInactive.ts +0 -47
  310. package/scripts/minimize.sh +0 -17
  311. package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -131
  312. package/scripts/multichain-deploy/1_basicdao-deploy.ts +0 -294
  313. package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -152
  314. package/scripts/multichain-deploy/2b_otp-deploy.ts +0 -73
  315. package/scripts/multichain-deploy/3_gdSavings-deploy.ts +0 -190
  316. package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -129
  317. package/scripts/multichain-deploy/5_gov-deploy.ts +0 -179
  318. package/scripts/multichain-deploy/6_testnetFaucet.ts +0 -85
  319. package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +0 -123
  320. package/scripts/multichain-deploy/8_disthelper-deploy.ts +0 -152
  321. package/scripts/multichain-deploy/createUniswapTestPools.ts +0 -163
  322. package/scripts/multichain-deploy/flattened/Avatar.sol +0 -913
  323. package/scripts/multichain-deploy/flattened/Controller.sol +0 -1891
  324. package/scripts/multichain-deploy/flattened/FeeFormula.sol +0 -1290
  325. package/scripts/multichain-deploy/fulldeploy.sh +0 -26
  326. package/scripts/multichain-deploy/helpers.ts +0 -647
  327. package/scripts/multichain-deploy/multichainWrapper-deploy.ts +0 -59
  328. package/scripts/multichain-deploy/verifyEtherscan.ts +0 -177
  329. package/scripts/proposals/gip-14_1.ts +0 -251
  330. package/scripts/proposals/gip-15.ts +0 -427
  331. package/scripts/proposals/gip-25-xdc-upgrade-ubi.ts +0 -746
  332. package/scripts/proposals/gips-14_1.md +0 -29
  333. package/scripts/proposals/hack-ubi-recovery.ts +0 -414
  334. package/scripts/proposals/identityAuthPeriod.ts +0 -229
  335. package/scripts/proposals/reserveRestore.ts +0 -474
  336. package/scripts/proposals/updateDistHelper.ts +0 -180
  337. package/scripts/proposals/v4Upgrade.ts +0 -845
  338. package/scripts/releaser.js +0 -24
  339. package/scripts/staking/stakersGdRewardsCalculation.ts +0 -64
  340. package/scripts/upgradeScheme.ts +0 -97
  341. package/scripts/upgradeToV2/upgradeToV2.ts +0 -853
  342. package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -939
  343. package/scripts/upgradeToV3/v3-fix.ts +0 -120
  344. package/scripts/upgradeToV3/v3-fuse-multichain.ts +0 -117
  345. package/scripts/upgradeToV3/v3-upgrade.ts +0 -219
  346. package/scripts/upgrades/celo-defi-ubi-deploy.ts +0 -184
  347. package/scripts/upgrades/identity-upgrade.ts +0 -126
  348. package/scripts/upgrades/multichain-formula-upgrade.ts +0 -143
  349. package/scripts/upgrades/multichain-temp-fix.ts +0 -129
  350. package/scripts/upgrades/restoreFunds.ts +0 -91
  351. package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +0 -159
  352. package/scripts/upgrades/transferDaoToGuardians.ts +0 -80
  353. package/scripts/upgrades/upgradeAdminWallet.ts +0 -29
  354. package/scripts/upgrades/upgradeFaucet.ts +0 -46
  355. package/scripts/utils.ts +0 -50
  356. package/scripts/verify.ts +0 -67
  357. package/scripts/voltageswaps.ts +0 -46
  358. package/types/@gooddollar/bridge-contracts/contracts/messagePassingBridge/IMessagePassingBridge.sol/ILayerZeroFeeEstimator.ts +0 -134
  359. package/types/@gooddollar/bridge-contracts/contracts/messagePassingBridge/IMessagePassingBridge.sol/IMessagePassingBridge.ts +0 -798
  360. package/types/@mean-finance/uniswap-v3-oracle/solidity/interfaces/IStaticOracle.ts +0 -694
  361. package/types/@openzeppelin/contracts/access/AccessControl.ts +0 -388
  362. package/types/@openzeppelin/contracts/access/IAccessControl.ts +0 -331
  363. package/types/@openzeppelin/contracts/access/Ownable.ts +0 -175
  364. package/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.ts +0 -87
  365. package/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +0 -108
  366. package/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.ts +0 -108
  367. package/types/@openzeppelin/contracts/proxy/Proxy.ts +0 -55
  368. package/types/@openzeppelin/contracts/proxy/beacon/IBeacon.ts +0 -87
  369. package/types/@openzeppelin/contracts/proxy/utils/Initializable.ts +0 -69
  370. package/types/@openzeppelin/contracts/security/Pausable.ts +0 -111
  371. package/types/@openzeppelin/contracts/token/ERC20/ERC20.ts +0 -444
  372. package/types/@openzeppelin/contracts/token/ERC20/IERC20.ts +0 -322
  373. package/types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +0 -364
  374. package/types/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.ts +0 -177
  375. package/types/@openzeppelin/contracts/token/ERC721/IERC721.ts +0 -527
  376. package/types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.ts +0 -581
  377. package/types/@openzeppelin/contracts/token/ERC777/IERC777.ts +0 -616
  378. package/types/@openzeppelin/contracts/token/ERC777/IERC777Recipient.ts +0 -130
  379. package/types/@openzeppelin/contracts/token/ERC777/IERC777Sender.ts +0 -130
  380. package/types/@openzeppelin/contracts/utils/introspection/IERC165.ts +0 -102
  381. package/types/@openzeppelin/contracts/utils/introspection/IERC1820Registry.ts +0 -420
  382. package/types/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.ts +0 -477
  383. package/types/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.ts +0 -400
  384. package/types/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.ts +0 -408
  385. package/types/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.ts +0 -331
  386. package/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.ts +0 -187
  387. package/types/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable.ts +0 -107
  388. package/types/@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol/IERC1822ProxiableUpgradeable.ts +0 -87
  389. package/types/@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.ts +0 -120
  390. package/types/@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.ts +0 -87
  391. package/types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.ts +0 -69
  392. package/types/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.ts +0 -228
  393. package/types/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.ts +0 -123
  394. package/types/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.ts +0 -69
  395. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.ts +0 -456
  396. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.ts +0 -322
  397. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.ts +0 -519
  398. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.ts +0 -494
  399. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.ts +0 -364
  400. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol/ERC20PermitUpgradeable.ts +0 -563
  401. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable.ts +0 -177
  402. package/types/@openzeppelin/contracts-upgradeable/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable.ts +0 -1097
  403. package/types/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.ts +0 -69
  404. package/types/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.ts +0 -69
  405. package/types/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.ts +0 -120
  406. package/types/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.ts +0 -102
  407. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.ts +0 -1427
  408. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IInstantDistributionAgreementV1.ts +0 -1219
  409. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IConstantInflowNFT.ts +0 -828
  410. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IConstantOutflowNFT.ts +0 -891
  411. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IFlowNFTBase.ts +0 -765
  412. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperAgreement.ts +0 -152
  413. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperApp.ts +0 -417
  414. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperToken.ts +0 -2698
  415. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperTokenFactory.ts +0 -449
  416. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.ts +0 -1643
  417. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluidGovernance.ts +0 -523
  418. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluidToken.ts +0 -996
  419. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ERC20WithTokenInfo.ts +0 -364
  420. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ISETH.sol/ISETH.ts +0 -2791
  421. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ISETH.sol/ISETHCustom.ts +0 -163
  422. package/types/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/TokenInfo.ts +0 -109
  423. package/types/@superfluid-finance/ethereum-contracts/contracts/libs/EventsEmitter.ts +0 -82
  424. package/types/@superfluid-finance/ethereum-contracts/contracts/superfluid/ConstantInflowNFT.ts +0 -1039
  425. package/types/@superfluid-finance/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT.ts +0 -1102
  426. package/types/@superfluid-finance/ethereum-contracts/contracts/superfluid/FlowNFTBase.ts +0 -954
  427. package/types/@superfluid-finance/ethereum-contracts/contracts/upgradability/UUPSProxiable.ts +0 -197
  428. package/types/@uniswap/v2-periphery/contracts/interfaces/IWETH.ts +0 -159
  429. package/types/@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.ts +0 -354
  430. package/types/contracts/DAOStackInterfaces.sol/Avatar.ts +0 -121
  431. package/types/contracts/DAOStackInterfaces.sol/Controller.ts +0 -572
  432. package/types/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.ts +0 -128
  433. package/types/contracts/DAOStackInterfaces.sol/IntVoteInterface.ts +0 -494
  434. package/types/contracts/DAOStackInterfaces.sol/ReputationInterface.ts +0 -270
  435. package/types/contracts/DAOStackInterfaces.sol/SchemeRegistrar.ts +0 -168
  436. package/types/contracts/IQuoter.sol/IQuoterV2.ts +0 -297
  437. package/types/contracts/IUniswapV3.sol/INonfungiblePositionManager.ts +0 -151
  438. package/types/contracts/IUniswapV3.sol/IUniswapV3Factory.ts +0 -155
  439. package/types/contracts/IUniswapV3.sol/IUniswapV3Pool.ts +0 -192
  440. package/types/contracts/Interfaces.sol/AToken.ts +0 -81
  441. package/types/contracts/Interfaces.sol/AggregatorV3Interface.ts +0 -198
  442. package/types/contracts/Interfaces.sol/CERC20.ts +0 -602
  443. package/types/contracts/Interfaces.sol/ERC20.ts +0 -424
  444. package/types/contracts/Interfaces.sol/IAaveIncentivesController.ts +0 -156
  445. package/types/contracts/Interfaces.sol/IAaveIncentivesControllerV3.ts +0 -156
  446. package/types/contracts/Interfaces.sol/IAdminWallet.ts +0 -176
  447. package/types/contracts/Interfaces.sol/IDonationStaking.ts +0 -97
  448. package/types/contracts/Interfaces.sol/IERC2917.ts +0 -722
  449. package/types/contracts/Interfaces.sol/IFirstClaimPool.ts +0 -133
  450. package/types/contracts/Interfaces.sol/IGoodDollar.ts +0 -938
  451. package/types/contracts/Interfaces.sol/IGoodStaking.ts +0 -272
  452. package/types/contracts/Interfaces.sol/IHasRouter.ts +0 -81
  453. package/types/contracts/Interfaces.sol/IIdentity.ts +0 -534
  454. package/types/contracts/Interfaces.sol/IIdentityV2.ts +0 -620
  455. package/types/contracts/Interfaces.sol/ILendingPool.ts +0 -245
  456. package/types/contracts/Interfaces.sol/ILendingPoolV3.ts +0 -254
  457. package/types/contracts/Interfaces.sol/IMultichainRouter.ts +0 -168
  458. package/types/contracts/Interfaces.sol/INameService.ts +0 -84
  459. package/types/contracts/Interfaces.sol/IQuoterV2.ts +0 -184
  460. package/types/contracts/Interfaces.sol/ISwapRouter.ts +0 -306
  461. package/types/contracts/Interfaces.sol/IUBIScheme.ts +0 -121
  462. package/types/contracts/Interfaces.sol/ProxyAdmin.ts +0 -261
  463. package/types/contracts/Interfaces.sol/Reserve.ts +0 -112
  464. package/types/contracts/Interfaces.sol/Staking.ts +0 -165
  465. package/types/contracts/Interfaces.sol/Uniswap.ts +0 -434
  466. package/types/contracts/Interfaces.sol/UniswapFactory.ts +0 -104
  467. package/types/contracts/Interfaces.sol/UniswapPair.ts +0 -193
  468. package/types/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet.ts +0 -1439
  469. package/types/contracts/fuseFaucet/FuseFaucet.ts +0 -537
  470. package/types/contracts/fuseFaucet/FuseFaucetV2.ts +0 -929
  471. package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor.ts +0 -648
  472. package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable.ts +0 -843
  473. package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.ts +0 -1032
  474. package/types/contracts/governance/ClaimersDistribution.ts +0 -676
  475. package/types/contracts/governance/CompoundVotingMachine.ts +0 -1790
  476. package/types/contracts/governance/GReputation.ts +0 -2258
  477. package/types/contracts/governance/GovernanceStaking.ts +0 -1401
  478. package/types/contracts/governance/MultiBaseGovernanceShareField.ts +0 -422
  479. package/types/contracts/governance/Reputation.ts +0 -1029
  480. package/types/contracts/governance/StakersDistribution.ts +0 -1000
  481. package/types/contracts/invite/InvitesV1.ts +0 -839
  482. package/types/contracts/invite/OneTimeReward.ts +0 -521
  483. package/types/contracts/mocks/AaveMock.ts +0 -1096
  484. package/types/contracts/mocks/AaveUSDMockOracle.ts +0 -87
  485. package/types/contracts/mocks/BatUSDMockOracle.ts +0 -87
  486. package/types/contracts/mocks/CBATMock.ts +0 -1286
  487. package/types/contracts/mocks/CDAILowWorthMock.ts +0 -1251
  488. package/types/contracts/mocks/CDAIMock.ts +0 -1303
  489. package/types/contracts/mocks/CDAINonMintableMock.ts +0 -1251
  490. package/types/contracts/mocks/CDecimalsMock.ts +0 -1286
  491. package/types/contracts/mocks/CSDTMock.ts +0 -1286
  492. package/types/contracts/mocks/CUSDCMock.ts +0 -1286
  493. package/types/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.ts +0 -1226
  494. package/types/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.ts +0 -1279
  495. package/types/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper.ts +0 -1252
  496. package/types/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.ts +0 -87
  497. package/types/contracts/mocks/DAIMock.ts +0 -1171
  498. package/types/contracts/mocks/DaiEthPriceMockOracle.ts +0 -87
  499. package/types/contracts/mocks/DecimalsMock.ts +0 -1096
  500. package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.ts +0 -1393
  501. package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.ts +0 -1456
  502. package/types/contracts/mocks/EthUSDMockOracle.ts +0 -138
  503. package/types/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.ts +0 -131
  504. package/types/contracts/mocks/GasPriceMockOracle.ts +0 -120
  505. package/types/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper.ts +0 -1357
  506. package/types/contracts/mocks/GoodCompoundStakingTest.ts +0 -2044
  507. package/types/contracts/mocks/GoodFundManagerTest.ts +0 -1268
  508. package/types/contracts/mocks/IdentityMock.ts +0 -554
  509. package/types/contracts/mocks/IncentiveControllerMock.ts +0 -212
  510. package/types/contracts/mocks/LendingPoolMock.ts +0 -1331
  511. package/types/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.ts +0 -176
  512. package/types/contracts/mocks/OverMintTester.sol/OverMintTester.ts +0 -178
  513. package/types/contracts/mocks/OverMintTesterRegularStake.ts +0 -178
  514. package/types/contracts/mocks/PayableMock.ts +0 -89
  515. package/types/contracts/mocks/SixteenDecimalsTokenMock.ts +0 -1096
  516. package/types/contracts/mocks/SwapHelperTest.ts +0 -118
  517. package/types/contracts/mocks/TwentyDecimalsTokenMock.ts +0 -1096
  518. package/types/contracts/mocks/UpgradableMocks.sol/UpgradableMock.ts +0 -379
  519. package/types/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.ts +0 -339
  520. package/types/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.ts +0 -365
  521. package/types/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.ts +0 -365
  522. package/types/contracts/mocks/UsdcMock.sol/USDCMock.ts +0 -1096
  523. package/types/contracts/reserve/CeloDistributionHelper.ts +0 -1226
  524. package/types/contracts/reserve/DistributionHelper.ts +0 -1393
  525. package/types/contracts/reserve/ExchangeHelper.ts +0 -584
  526. package/types/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper.ts +0 -1247
  527. package/types/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
  528. package/types/contracts/reserve/GoodMarketMaker.ts +0 -1054
  529. package/types/contracts/reserve/GoodReserveADai.ts +0 -2212
  530. package/types/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.ts +0 -166
  531. package/types/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.ts +0 -2190
  532. package/types/contracts/staking/BaseShareField.ts +0 -456
  533. package/types/contracts/staking/BaseShareFieldV2.ts +0 -368
  534. package/types/contracts/staking/DonationsStaking.ts +0 -851
  535. package/types/contracts/staking/FuseStakingV3.sol/FuseStakingV3.ts +0 -1280
  536. package/types/contracts/staking/FuseStakingV3.sol/IConsensus.ts +0 -232
  537. package/types/contracts/staking/FuseStakingV3.sol/PegSwap.ts +0 -112
  538. package/types/contracts/staking/GoodFundManager.ts +0 -1228
  539. package/types/contracts/staking/SimpleStaking.ts +0 -1598
  540. package/types/contracts/staking/SimpleStakingV2.ts +0 -1495
  541. package/types/contracts/staking/UniswapV2SwapHelper.ts +0 -123
  542. package/types/contracts/staking/aave/AaveStakingFactory.ts +0 -323
  543. package/types/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2.ts +0 -1808
  544. package/types/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
  545. package/types/contracts/staking/aave/GoodAaveStaking.ts +0 -1843
  546. package/types/contracts/staking/aave/GoodAaveStakingV2.ts +0 -1808
  547. package/types/contracts/staking/compound/CompoundStakingFactory.ts +0 -284
  548. package/types/contracts/staking/compound/GoodCompoundStaking.ts +0 -1932
  549. package/types/contracts/staking/compound/GoodCompoundStakingV2.ts +0 -1717
  550. package/types/contracts/token/ERC20PresetMinterPauserUpgradeable.ts +0 -1204
  551. package/types/contracts/token/ERC677.sol/ERC677.ts +0 -141
  552. package/types/contracts/token/ERC677.sol/ERC677Receiver.ts +0 -115
  553. package/types/contracts/token/GoodDollar.ts +0 -1871
  554. package/types/contracts/token/GoodDollar18.ts +0 -1871
  555. package/types/contracts/token/GoodDollar2.ts +0 -1871
  556. package/types/contracts/token/IFeesFormula.ts +0 -110
  557. package/types/contracts/token/MultichainFeeFormula.ts +0 -131
  558. package/types/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.ts +0 -195
  559. package/types/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.ts +0 -115
  560. package/types/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.ts +0 -650
  561. package/types/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.ts +0 -3462
  562. package/types/contracts/token/superfluid/ISuperToken.ts +0 -2203
  563. package/types/contracts/token/superfluid/SuperGoodDollar.ts +0 -3866
  564. package/types/contracts/token/superfluid/SuperToken.ts +0 -2441
  565. package/types/contracts/token/superfluid/SuperfluidToken.ts +0 -996
  566. package/types/contracts/token/superfluid/UUPSProxiable.ts +0 -197
  567. package/types/contracts/token/superfluid/UUPSProxy.sol/Proxy.ts +0 -55
  568. package/types/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.ts +0 -104
  569. package/types/contracts/ubi/UBIScheme.ts +0 -1606
  570. package/types/contracts/utils/AdminWallet.ts +0 -1359
  571. package/types/contracts/utils/AdminWalletFuse.ts +0 -1507
  572. package/types/contracts/utils/BancorFormula.ts +0 -990
  573. package/types/contracts/utils/BulkWhitelist.ts +0 -153
  574. package/types/contracts/utils/BuyAndBridgeHelper.ts +0 -293
  575. package/types/contracts/utils/BuyGDClone.sol/BuyGDClone.ts +0 -430
  576. package/types/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.ts +0 -716
  577. package/types/contracts/utils/BuyGDClone.sol/BuyGDCloneV2.ts +0 -464
  578. package/types/contracts/utils/BuyGDClone.sol/DonateGDClone.ts +0 -582
  579. package/types/contracts/utils/BuyGDClone.sol/IQuoterV2.ts +0 -184
  580. package/types/contracts/utils/BuyGDClone.sol/ISwapRouter.ts +0 -306
  581. package/types/contracts/utils/DAOContract.ts +0 -166
  582. package/types/contracts/utils/DAOUpgradeableContract.ts +0 -325
  583. package/types/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677.ts +0 -108
  584. package/types/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.ts +0 -108
  585. package/types/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.ts +0 -89
  586. package/types/contracts/utils/FuseOldBridgeKill.sol/Initializable.ts +0 -87
  587. package/types/contracts/utils/FuseOldBridgeKill.sol/Ownable.ts +0 -148
  588. package/types/contracts/utils/GDFaucet.ts +0 -224
  589. package/types/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.ts +0 -1899
  590. package/types/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.ts +0 -143
  591. package/types/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.ts +0 -135
  592. package/types/contracts/utils/IdentityFix.ts +0 -139
  593. package/types/contracts/utils/MultiCall.sol/Multicall.ts +0 -310
  594. package/types/contracts/utils/MultichainBridgeHelper.ts +0 -175
  595. package/types/contracts/utils/NameService.ts +0 -420
  596. package/types/contracts/utils/OneTimePayments.ts +0 -426
  597. package/types/contracts/utils/OneTimePaymentsV2.ts +0 -484
  598. package/types/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.ts +0 -114
  599. package/types/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.ts +0 -278
  600. package/types/contracts/utils/ProtocolUpgradeFuse.ts +0 -167
  601. package/types/contracts/utils/ProtocolUpgradeFuseRecover.ts +0 -167
  602. package/types/contracts/utils/ProtocolUpgradeRecover.ts +0 -270
  603. package/types/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.ts +0 -163
  604. package/types/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.ts +0 -313
  605. package/types/contracts/utils/ReputationTestHelper.ts +0 -177
  606. package/types/contracts/utils/ReserveRestore.sol/MentoExchange.ts +0 -81
  607. package/types/contracts/utils/ReserveRestore.sol/ReserveRestore.ts +0 -112
  608. package/types/contracts/utils/ReserveRestore.sol/index.ts +0 -5
  609. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange.ts +0 -81
  610. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
  611. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange.ts +0 -81
  612. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC.ts +0 -122
  613. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
  614. package/types/factories/@gooddollar/bridge-contracts/contracts/messagePassingBridge/IMessagePassingBridge.sol/ILayerZeroFeeEstimator__factory.ts +0 -79
  615. package/types/factories/@gooddollar/bridge-contracts/contracts/messagePassingBridge/IMessagePassingBridge.sol/IMessagePassingBridge__factory.ts +0 -446
  616. package/types/factories/@mean-finance/uniswap-v3-oracle/solidity/interfaces/IStaticOracle__factory.ts +0 -410
  617. package/types/factories/@openzeppelin/contracts/access/AccessControl__factory.ts +0 -230
  618. package/types/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +0 -198
  619. package/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +0 -78
  620. package/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.ts +0 -39
  621. package/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +0 -146
  622. package/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade__factory.ts +0 -71
  623. package/types/factories/@openzeppelin/contracts/proxy/Proxy__factory.ts +0 -31
  624. package/types/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.ts +0 -39
  625. package/types/factories/@openzeppelin/contracts/proxy/utils/Initializable__factory.ts +0 -39
  626. package/types/factories/@openzeppelin/contracts/security/Pausable__factory.ts +0 -65
  627. package/types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +0 -349
  628. package/types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +0 -206
  629. package/types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +0 -248
  630. package/types/factories/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit__factory.ts +0 -101
  631. package/types/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.ts +0 -311
  632. package/types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata__factory.ts +0 -356
  633. package/types/factories/@openzeppelin/contracts/token/ERC777/IERC777Recipient__factory.ts +0 -64
  634. package/types/factories/@openzeppelin/contracts/token/ERC777/IERC777Sender__factory.ts +0 -64
  635. package/types/factories/@openzeppelin/contracts/token/ERC777/IERC777__factory.ts +0 -417
  636. package/types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.ts +0 -42
  637. package/types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.ts +0 -45
  638. package/types/factories/@openzeppelin/contracts/utils/introspection/IERC1820Registry__factory.ts +0 -239
  639. package/types/factories/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable__factory.ts +0 -292
  640. package/types/factories/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable__factory.ts +0 -247
  641. package/types/factories/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable__factory.ts +0 -247
  642. package/types/factories/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable__factory.ts +0 -202
  643. package/types/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.ts +0 -91
  644. package/types/factories/@openzeppelin/contracts-upgradeable/interfaces/IERC1271Upgradeable__factory.ts +0 -50
  645. package/types/factories/@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol/IERC1822ProxiableUpgradeable__factory.ts +0 -43
  646. package/types/factories/@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable__factory.ts +0 -88
  647. package/types/factories/@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable__factory.ts +0 -39
  648. package/types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable__factory.ts +0 -39
  649. package/types/factories/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable__factory.ts +0 -128
  650. package/types/factories/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable__factory.ts +0 -78
  651. package/types/factories/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable__factory.ts +0 -43
  652. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable__factory.ts +0 -345
  653. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable__factory.ts +0 -209
  654. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable__factory.ts +0 -344
  655. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable__factory.ts +0 -352
  656. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable__factory.ts +0 -252
  657. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol/ERC20PermitUpgradeable__factory.ts +0 -388
  658. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable__factory.ts +0 -105
  659. package/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/presets/ERC20PresetMinterPauserUpgradeable__factory.ts +0 -748
  660. package/types/factories/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable__factory.ts +0 -39
  661. package/types/factories/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable__factory.ts +0 -39
  662. package/types/factories/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable__factory.ts +0 -58
  663. package/types/factories/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable__factory.ts +0 -45
  664. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1__factory.ts +0 -1064
  665. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IInstantDistributionAgreementV1__factory.ts +0 -1015
  666. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IConstantInflowNFT__factory.ts +0 -551
  667. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IConstantOutflowNFT__factory.ts +0 -614
  668. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/IFlowNFTBase__factory.ts +0 -515
  669. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperAgreement__factory.ts +0 -78
  670. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperApp__factory.ts +0 -275
  671. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperTokenFactory__factory.ts +0 -276
  672. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperToken__factory.ts +0 -1839
  673. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluidGovernance__factory.ts +0 -282
  674. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluidToken__factory.ts +0 -697
  675. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid__factory.ts +0 -1156
  676. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ERC20WithTokenInfo__factory.ts +0 -248
  677. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ISETH.sol/ISETHCustom__factory.ts +0 -59
  678. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/ISETH.sol/ISETH__factory.ts +0 -1869
  679. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/interfaces/tokens/TokenInfo__factory.ts +0 -65
  680. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/libs/EventsEmitter__factory.ts +0 -87
  681. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/superfluid/ConstantInflowNFT__factory.ts +0 -758
  682. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT__factory.ts +0 -817
  683. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/superfluid/FlowNFTBase__factory.ts +0 -645
  684. package/types/factories/@superfluid-finance/ethereum-contracts/contracts/upgradability/UUPSProxiable__factory.ts +0 -104
  685. package/types/factories/@uniswap/v2-periphery/contracts/interfaces/IWETH__factory.ts +0 -67
  686. package/types/factories/@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory__factory.ts +0 -222
  687. package/types/factories/contracts/DAOStackInterfaces.sol/Avatar__factory.ts +0 -62
  688. package/types/factories/contracts/DAOStackInterfaces.sol/Controller__factory.ts +0 -362
  689. package/types/factories/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface__factory.ts +0 -72
  690. package/types/factories/contracts/DAOStackInterfaces.sol/IntVoteInterface__factory.ts +0 -349
  691. package/types/factories/contracts/DAOStackInterfaces.sol/ReputationInterface__factory.ts +0 -168
  692. package/types/factories/contracts/DAOStackInterfaces.sol/SchemeRegistrar__factory.ts +0 -114
  693. package/types/factories/contracts/IQuoter.sol/IQuoterV2__factory.ts +0 -226
  694. package/types/factories/contracts/IQuoter.sol/index.ts +0 -4
  695. package/types/factories/contracts/IUniswapV3.sol/INonfungiblePositionManager__factory.ts +0 -121
  696. package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Factory__factory.ts +0 -84
  697. package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Pool__factory.ts +0 -121
  698. package/types/factories/contracts/Interfaces.sol/AToken__factory.ts +0 -36
  699. package/types/factories/contracts/Interfaces.sol/AggregatorV3Interface__factory.ts +0 -121
  700. package/types/factories/contracts/Interfaces.sol/CERC20__factory.ts +0 -384
  701. package/types/factories/contracts/Interfaces.sol/ERC20__factory.ts +0 -288
  702. package/types/factories/contracts/Interfaces.sol/IAaveIncentivesControllerV3__factory.ts +0 -88
  703. package/types/factories/contracts/Interfaces.sol/IAaveIncentivesController__factory.ts +0 -83
  704. package/types/factories/contracts/Interfaces.sol/IAdminWallet__factory.ts +0 -78
  705. package/types/factories/contracts/Interfaces.sol/IDonationStaking__factory.ts +0 -33
  706. package/types/factories/contracts/Interfaces.sol/IERC2917__factory.ts +0 -496
  707. package/types/factories/contracts/Interfaces.sol/IFirstClaimPool__factory.ts +0 -65
  708. package/types/factories/contracts/Interfaces.sol/IGoodDollar__factory.ts +0 -598
  709. package/types/factories/contracts/Interfaces.sol/IGoodStaking__factory.ts +0 -178
  710. package/types/factories/contracts/Interfaces.sol/IHasRouter__factory.ts +0 -39
  711. package/types/factories/contracts/Interfaces.sol/IIdentityV2__factory.ts +0 -334
  712. package/types/factories/contracts/Interfaces.sol/IIdentity__factory.ts +0 -287
  713. package/types/factories/contracts/Interfaces.sol/ILendingPoolV3__factory.ts +0 -186
  714. package/types/factories/contracts/Interfaces.sol/ILendingPool__factory.ts +0 -171
  715. package/types/factories/contracts/Interfaces.sol/IMultichainRouter__factory.ts +0 -82
  716. package/types/factories/contracts/Interfaces.sol/INameService__factory.ts +0 -45
  717. package/types/factories/contracts/Interfaces.sol/IQuoterV2__factory.ts +0 -126
  718. package/types/factories/contracts/Interfaces.sol/ISwapRouter__factory.ts +0 -220
  719. package/types/factories/contracts/Interfaces.sol/IUBIScheme__factory.ts +0 -71
  720. package/types/factories/contracts/Interfaces.sol/ProxyAdmin__factory.ts +0 -131
  721. package/types/factories/contracts/Interfaces.sol/Reserve__factory.ts +0 -55
  722. package/types/factories/contracts/Interfaces.sol/Staking__factory.ts +0 -77
  723. package/types/factories/contracts/Interfaces.sol/UniswapFactory__factory.ts +0 -50
  724. package/types/factories/contracts/Interfaces.sol/UniswapPair__factory.ts +0 -120
  725. package/types/factories/contracts/Interfaces.sol/Uniswap__factory.ts +0 -275
  726. package/types/factories/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet__factory.ts +0 -945
  727. package/types/factories/contracts/fuseFaucet/Faucet copy.sol/index.ts +0 -4
  728. package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +0 -914
  729. package/types/factories/contracts/fuseFaucet/FuseFaucetV2__factory.ts +0 -627
  730. package/types/factories/contracts/fuseFaucet/FuseFaucet__factory.ts +0 -389
  731. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable__factory.ts +0 -572
  732. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor__factory.ts +0 -482
  733. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +0 -4
  734. package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet__factory.ts +0 -663
  735. package/types/factories/contracts/governance/ClaimersDistribution__factory.ts +0 -430
  736. package/types/factories/contracts/governance/CompoundVotingMachine__factory.ts +0 -1226
  737. package/types/factories/contracts/governance/GReputation__factory.ts +0 -1493
  738. package/types/factories/contracts/governance/GovernanceStaking__factory.ts +0 -948
  739. package/types/factories/contracts/governance/MultiBaseGovernanceShareField__factory.ts +0 -240
  740. package/types/factories/contracts/governance/Reputation__factory.ts +0 -696
  741. package/types/factories/contracts/governance/StakersDistribution__factory.ts +0 -617
  742. package/types/factories/contracts/identity/IdentityV2__factory.ts +0 -1150
  743. package/types/factories/contracts/invite/InvitesFuseV2__factory.ts +0 -574
  744. package/types/factories/contracts/invite/InvitesV1__factory.ts +0 -556
  745. package/types/factories/contracts/invite/OneTimeReward__factory.ts +0 -361
  746. package/types/factories/contracts/mocks/AaveMock__factory.ts +0 -743
  747. package/types/factories/contracts/mocks/AaveUSDMockOracle__factory.ts +0 -75
  748. package/types/factories/contracts/mocks/BatUSDMockOracle__factory.ts +0 -75
  749. package/types/factories/contracts/mocks/CBATMock__factory.ts +0 -847
  750. package/types/factories/contracts/mocks/CDAILowWorthMock__factory.ts +0 -834
  751. package/types/factories/contracts/mocks/CDAIMock__factory.ts +0 -860
  752. package/types/factories/contracts/mocks/CDAINonMintableMock__factory.ts +0 -834
  753. package/types/factories/contracts/mocks/CDecimalsMock__factory.ts +0 -847
  754. package/types/factories/contracts/mocks/CSDTMock__factory.ts +0 -847
  755. package/types/factories/contracts/mocks/CUSDCMock__factory.ts +0 -847
  756. package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper__factory.ts +0 -949
  757. package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest__factory.ts +0 -919
  758. package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +0 -929
  759. package/types/factories/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle__factory.ts +0 -75
  760. package/types/factories/contracts/mocks/DAIMock__factory.ts +0 -784
  761. package/types/factories/contracts/mocks/DaiEthPriceMockOracle__factory.ts +0 -79
  762. package/types/factories/contracts/mocks/DecimalsMock__factory.ts +0 -758
  763. package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +0 -1040
  764. package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest__factory.ts +0 -1007
  765. package/types/factories/contracts/mocks/EthUSDMockOracle__factory.ts +0 -108
  766. package/types/factories/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock__factory.ts +0 -132
  767. package/types/factories/contracts/mocks/GasPriceMockOracle__factory.ts +0 -88
  768. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper__factory.ts +0 -1017
  769. package/types/factories/contracts/mocks/GoodCompoundStakingTest__factory.ts +0 -1470
  770. package/types/factories/contracts/mocks/GoodFundManagerTest__factory.ts +0 -820
  771. package/types/factories/contracts/mocks/IdentityMock__factory.ts +0 -349
  772. package/types/factories/contracts/mocks/IncentiveControllerMock__factory.ts +0 -166
  773. package/types/factories/contracts/mocks/LendingPoolMock__factory.ts +0 -927
  774. package/types/factories/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest__factory.ts +0 -68
  775. package/types/factories/contracts/mocks/OverMintTester.sol/OverMintTester__factory.ts +0 -152
  776. package/types/factories/contracts/mocks/OverMintTesterRegularStake__factory.ts +0 -156
  777. package/types/factories/contracts/mocks/PayableMock__factory.ts +0 -69
  778. package/types/factories/contracts/mocks/SixteenDecimalsTokenMock__factory.ts +0 -747
  779. package/types/factories/contracts/mocks/SwapHelperTest__factory.ts +0 -96
  780. package/types/factories/contracts/mocks/TwentyDecimalsTokenMock__factory.ts +0 -747
  781. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock2__factory.ts +0 -236
  782. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock3__factory.ts +0 -249
  783. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock4__factory.ts +0 -249
  784. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock__factory.ts +0 -262
  785. package/types/factories/contracts/mocks/UsdcMock.sol/USDCMock__factory.ts +0 -743
  786. package/types/factories/contracts/reserve/CeloDistributionHelper__factory.ts +0 -919
  787. package/types/factories/contracts/reserve/DistributionHelper__factory.ts +0 -1003
  788. package/types/factories/contracts/reserve/ExchangeHelper__factory.ts +0 -427
  789. package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper__factory.ts +0 -935
  790. package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
  791. package/types/factories/contracts/reserve/GoodMarketMaker__factory.ts +0 -687
  792. package/types/factories/contracts/reserve/GoodReserveADai__factory.ts +0 -1502
  793. package/types/factories/contracts/reserve/GoodReserveCDai.sol/ContributionCalc__factory.ts +0 -83
  794. package/types/factories/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai__factory.ts +0 -1489
  795. package/types/factories/contracts/staking/BaseShareFieldV2__factory.ts +0 -251
  796. package/types/factories/contracts/staking/BaseShareField__factory.ts +0 -307
  797. package/types/factories/contracts/staking/DonationsStaking__factory.ts +0 -580
  798. package/types/factories/contracts/staking/FuseStakingV3.sol/FuseStakingV3__factory.ts +0 -814
  799. package/types/factories/contracts/staking/FuseStakingV3.sol/IConsensus__factory.ts +0 -119
  800. package/types/factories/contracts/staking/FuseStakingV3.sol/PegSwap__factory.ts +0 -49
  801. package/types/factories/contracts/staking/GoodFundManager__factory.ts +0 -778
  802. package/types/factories/contracts/staking/SimpleStakingV2__factory.ts +0 -999
  803. package/types/factories/contracts/staking/SimpleStaking__factory.ts +0 -1061
  804. package/types/factories/contracts/staking/UniswapV2SwapHelper__factory.ts +0 -101
  805. package/types/factories/contracts/staking/aave/AaveStakingFactory__factory.ts +0 -262
  806. package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2__factory.ts +0 -1240
  807. package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
  808. package/types/factories/contracts/staking/aave/GoodAaveStakingV2__factory.ts +0 -1240
  809. package/types/factories/contracts/staking/aave/GoodAaveStaking__factory.ts +0 -1276
  810. package/types/factories/contracts/staking/compound/CompoundStakingFactory__factory.ts +0 -249
  811. package/types/factories/contracts/staking/compound/GoodCompoundStakingV2__factory.ts +0 -1182
  812. package/types/factories/contracts/staking/compound/GoodCompoundStaking__factory.ts +0 -1316
  813. package/types/factories/contracts/token/ERC20PresetMinterPauserUpgradeable__factory.ts +0 -829
  814. package/types/factories/contracts/token/ERC677.sol/ERC677Receiver__factory.ts +0 -55
  815. package/types/factories/contracts/token/ERC677.sol/ERC677__factory.ts +0 -78
  816. package/types/factories/contracts/token/GoodDollar18__factory.ts +0 -1257
  817. package/types/factories/contracts/token/GoodDollar2__factory.ts +0 -1257
  818. package/types/factories/contracts/token/GoodDollar__factory.ts +0 -1257
  819. package/types/factories/contracts/token/IFeesFormula__factory.ts +0 -60
  820. package/types/factories/contracts/token/MultichainFeeFormula__factory.ts +0 -113
  821. package/types/factories/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit__factory.ts +0 -114
  822. package/types/factories/contracts/token/superfluid/ERC20Permit.sol/SelfApprove__factory.ts +0 -49
  823. package/types/factories/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom__factory.ts +0 -370
  824. package/types/factories/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar__factory.ts +0 -2301
  825. package/types/factories/contracts/token/superfluid/ISuperToken__factory.ts +0 -1577
  826. package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +0 -2687
  827. package/types/factories/contracts/token/superfluid/SuperToken__factory.ts +0 -1770
  828. package/types/factories/contracts/token/superfluid/SuperfluidToken__factory.ts +0 -697
  829. package/types/factories/contracts/token/superfluid/UUPSProxiable__factory.ts +0 -104
  830. package/types/factories/contracts/token/superfluid/UUPSProxy.sol/Proxy__factory.ts +0 -31
  831. package/types/factories/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy__factory.ts +0 -83
  832. package/types/factories/contracts/ubi/UBIScheme__factory.ts +0 -1055
  833. package/types/factories/contracts/utils/AdminWalletFuse__factory.ts +0 -967
  834. package/types/factories/contracts/utils/AdminWallet__factory.ts +0 -882
  835. package/types/factories/contracts/utils/BancorFormula__factory.ts +0 -677
  836. package/types/factories/contracts/utils/BulkWhitelist__factory.ts +0 -123
  837. package/types/factories/contracts/utils/BuyAndBridgeHelper__factory.ts +0 -237
  838. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory__factory.ts +0 -602
  839. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneV2__factory.ts +0 -415
  840. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDClone__factory.ts +0 -389
  841. package/types/factories/contracts/utils/BuyGDClone.sol/DonateGDClone__factory.ts +0 -503
  842. package/types/factories/contracts/utils/BuyGDClone.sol/IQuoterV2__factory.ts +0 -126
  843. package/types/factories/contracts/utils/BuyGDClone.sol/ISwapRouter__factory.ts +0 -220
  844. package/types/factories/contracts/utils/DAOContract__factory.ts +0 -121
  845. package/types/factories/contracts/utils/DAOUpgradeableContract__factory.ts +0 -227
  846. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677__factory.ts +0 -86
  847. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill__factory.ts +0 -82
  848. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage__factory.ts +0 -43
  849. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Initializable__factory.ts +0 -75
  850. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Ownable__factory.ts +0 -105
  851. package/types/factories/contracts/utils/GDFaucet__factory.ts +0 -191
  852. package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper__factory.ts +0 -1330
  853. package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter__factory.ts +0 -74
  854. package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl__factory.ts +0 -84
  855. package/types/factories/contracts/utils/IdentityFix__factory.ts +0 -113
  856. package/types/factories/contracts/utils/MultiCall.sol/Multicall__factory.ts +0 -218
  857. package/types/factories/contracts/utils/MultichainBridgeHelper__factory.ts +0 -134
  858. package/types/factories/contracts/utils/NameService__factory.ts +0 -293
  859. package/types/factories/contracts/utils/OneTimePaymentsV2__factory.ts +0 -369
  860. package/types/factories/contracts/utils/OneTimePayments__factory.ts +0 -323
  861. package/types/factories/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker__factory.ts +0 -62
  862. package/types/factories/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade__factory.ts +0 -207
  863. package/types/factories/contracts/utils/ProtocolUpgradeFuseRecover__factory.ts +0 -146
  864. package/types/factories/contracts/utils/ProtocolUpgradeFuse__factory.ts +0 -142
  865. package/types/factories/contracts/utils/ProtocolUpgradeRecover__factory.ts +0 -184
  866. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange__factory.ts +0 -39
  867. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +0 -152
  868. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +0 -5
  869. package/types/factories/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy__factory.ts +0 -133
  870. package/types/factories/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967__factory.ts +0 -223
  871. package/types/factories/contracts/utils/ReputationTestHelper__factory.ts +0 -141
  872. package/types/factories/contracts/utils/ReserveRestore.sol/ReserveRestore__factory.ts +0 -95
  873. package/types/factories/contracts/utils/ReserveRestore.sol/index.ts +0 -5
  874. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange__factory.ts +0 -39
  875. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -110
  876. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
  877. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange__factory.ts +0 -39
  878. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -115
  879. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
  880. /package/types/contracts/utils/{ProtocolUpgradeV4Mento.sol → UpdateReserveRatio.sol}/MentoExchange.ts +0 -0
@@ -1,1891 +0,0 @@
1
- // File: openzeppelin-solidity/contracts/ownership/Ownable.sol
2
-
3
- pragma solidity ^0.5.0;
4
-
5
- /**
6
- * @title Ownable
7
- * @dev The Ownable contract has an owner address, and provides basic authorization control
8
- * functions, this simplifies the implementation of "user permissions".
9
- */
10
- contract Ownable {
11
- address private _owner;
12
-
13
- event OwnershipTransferred(
14
- address indexed previousOwner,
15
- address indexed newOwner
16
- );
17
-
18
- /**
19
- * @dev The Ownable constructor sets the original `owner` of the contract to the sender
20
- * account.
21
- */
22
- constructor() internal {
23
- _owner = msg.sender;
24
- emit OwnershipTransferred(address(0), _owner);
25
- }
26
-
27
- /**
28
- * @return the address of the owner.
29
- */
30
- function owner() public view returns (address) {
31
- return _owner;
32
- }
33
-
34
- /**
35
- * @dev Throws if called by any account other than the owner.
36
- */
37
- modifier onlyOwner() {
38
- require(isOwner());
39
- _;
40
- }
41
-
42
- /**
43
- * @return true if `msg.sender` is the owner of the contract.
44
- */
45
- function isOwner() public view returns (bool) {
46
- return msg.sender == _owner;
47
- }
48
-
49
- /**
50
- * @dev Allows the current owner to relinquish control of the contract.
51
- * @notice Renouncing to ownership will leave the contract without an owner.
52
- * It will not be possible to call the functions with the `onlyOwner`
53
- * modifier anymore.
54
- */
55
- function renounceOwnership() public onlyOwner {
56
- emit OwnershipTransferred(_owner, address(0));
57
- _owner = address(0);
58
- }
59
-
60
- /**
61
- * @dev Allows the current owner to transfer control of the contract to a newOwner.
62
- * @param newOwner The address to transfer ownership to.
63
- */
64
- function transferOwnership(address newOwner) public onlyOwner {
65
- _transferOwnership(newOwner);
66
- }
67
-
68
- /**
69
- * @dev Transfers control of the contract to a newOwner.
70
- * @param newOwner The address to transfer ownership to.
71
- */
72
- function _transferOwnership(address newOwner) internal {
73
- require(newOwner != address(0));
74
- emit OwnershipTransferred(_owner, newOwner);
75
- _owner = newOwner;
76
- }
77
- }
78
-
79
- // File: @daostack/infra/contracts/Reputation.sol
80
-
81
- pragma solidity ^0.5.4;
82
-
83
- /**
84
- * @title Reputation system
85
- * @dev A DAO has Reputation System which allows peers to rate other peers in order to build trust .
86
- * A reputation is use to assign influence measure to a DAO'S peers.
87
- * Reputation is similar to regular tokens but with one crucial difference: It is non-transferable.
88
- * The Reputation contract maintain a map of address to reputation value.
89
- * It provides an onlyOwner functions to mint and burn reputation _to (or _from) a specific address.
90
- */
91
-
92
- contract Reputation is Ownable {
93
- uint8 public decimals = 18; //Number of decimals of the smallest unit
94
- // Event indicating minting of reputation to an address.
95
- event Mint(address indexed _to, uint256 _amount);
96
- // Event indicating burning of reputation for an address.
97
- event Burn(address indexed _from, uint256 _amount);
98
-
99
- /// @dev `Checkpoint` is the structure that attaches a block number to a
100
- /// given value, the block number attached is the one that last changed the
101
- /// value
102
- struct Checkpoint {
103
- // `fromBlock` is the block number that the value was generated from
104
- uint128 fromBlock;
105
- // `value` is the amount of reputation at a specific block number
106
- uint128 value;
107
- }
108
-
109
- // `balances` is the map that tracks the balance of each address, in this
110
- // contract when the balance changes the block number that the change
111
- // occurred is also included in the map
112
- mapping(address => Checkpoint[]) balances;
113
-
114
- // Tracks the history of the `totalSupply` of the reputation
115
- Checkpoint[] totalSupplyHistory;
116
-
117
- /// @notice Constructor to create a Reputation
118
- constructor() public {}
119
-
120
- /// @dev This function makes it easy to get the total number of reputation
121
- /// @return The total number of reputation
122
- function totalSupply() public view returns (uint256) {
123
- return totalSupplyAt(block.number);
124
- }
125
-
126
- ////////////////
127
- // Query balance and totalSupply in History
128
- ////////////////
129
- /**
130
- * @dev return the reputation amount of a given owner
131
- * @param _owner an address of the owner which we want to get his reputation
132
- */
133
- function balanceOf(address _owner) public view returns (uint256 balance) {
134
- return balanceOfAt(_owner, block.number);
135
- }
136
-
137
- /// @dev Queries the balance of `_owner` at a specific `_blockNumber`
138
- /// @param _owner The address from which the balance will be retrieved
139
- /// @param _blockNumber The block number when the balance is queried
140
- /// @return The balance at `_blockNumber`
141
- function balanceOfAt(
142
- address _owner,
143
- uint256 _blockNumber
144
- ) public view returns (uint256) {
145
- if (
146
- (balances[_owner].length == 0) ||
147
- (balances[_owner][0].fromBlock > _blockNumber)
148
- ) {
149
- return 0;
150
- // This will return the expected balance during normal situations
151
- } else {
152
- return getValueAt(balances[_owner], _blockNumber);
153
- }
154
- }
155
-
156
- /// @notice Total amount of reputation at a specific `_blockNumber`.
157
- /// @param _blockNumber The block number when the totalSupply is queried
158
- /// @return The total amount of reputation at `_blockNumber`
159
- function totalSupplyAt(uint256 _blockNumber) public view returns (uint256) {
160
- if (
161
- (totalSupplyHistory.length == 0) ||
162
- (totalSupplyHistory[0].fromBlock > _blockNumber)
163
- ) {
164
- return 0;
165
- // This will return the expected totalSupply during normal situations
166
- } else {
167
- return getValueAt(totalSupplyHistory, _blockNumber);
168
- }
169
- }
170
-
171
- /// @notice Generates `_amount` reputation that are assigned to `_owner`
172
- /// @param _user The address that will be assigned the new reputation
173
- /// @param _amount The quantity of reputation generated
174
- /// @return True if the reputation are generated correctly
175
- function mint(
176
- address _user,
177
- uint256 _amount
178
- ) public onlyOwner returns (bool) {
179
- uint256 curTotalSupply = totalSupply();
180
- require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
181
- uint256 previousBalanceTo = balanceOf(_user);
182
- require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
183
- updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
184
- updateValueAtNow(balances[_user], previousBalanceTo + _amount);
185
- emit Mint(_user, _amount);
186
- return true;
187
- }
188
-
189
- /// @notice Burns `_amount` reputation from `_owner`
190
- /// @param _user The address that will lose the reputation
191
- /// @param _amount The quantity of reputation to burn
192
- /// @return True if the reputation are burned correctly
193
- function burn(
194
- address _user,
195
- uint256 _amount
196
- ) public onlyOwner returns (bool) {
197
- uint256 curTotalSupply = totalSupply();
198
- uint256 amountBurned = _amount;
199
- uint256 previousBalanceFrom = balanceOf(_user);
200
- if (previousBalanceFrom < amountBurned) {
201
- amountBurned = previousBalanceFrom;
202
- }
203
- updateValueAtNow(totalSupplyHistory, curTotalSupply - amountBurned);
204
- updateValueAtNow(balances[_user], previousBalanceFrom - amountBurned);
205
- emit Burn(_user, amountBurned);
206
- return true;
207
- }
208
-
209
- ////////////////
210
- // Internal helper functions to query and set a value in a snapshot array
211
- ////////////////
212
-
213
- /// @dev `getValueAt` retrieves the number of reputation at a given block number
214
- /// @param checkpoints The history of values being queried
215
- /// @param _block The block number to retrieve the value at
216
- /// @return The number of reputation being queried
217
- function getValueAt(
218
- Checkpoint[] storage checkpoints,
219
- uint256 _block
220
- ) internal view returns (uint256) {
221
- if (checkpoints.length == 0) {
222
- return 0;
223
- }
224
-
225
- // Shortcut for the actual value
226
- if (_block >= checkpoints[checkpoints.length - 1].fromBlock) {
227
- return checkpoints[checkpoints.length - 1].value;
228
- }
229
- if (_block < checkpoints[0].fromBlock) {
230
- return 0;
231
- }
232
-
233
- // Binary search of the value in the array
234
- uint256 min = 0;
235
- uint256 max = checkpoints.length - 1;
236
- while (max > min) {
237
- uint256 mid = (max + min + 1) / 2;
238
- if (checkpoints[mid].fromBlock <= _block) {
239
- min = mid;
240
- } else {
241
- max = mid - 1;
242
- }
243
- }
244
- return checkpoints[min].value;
245
- }
246
-
247
- /// @dev `updateValueAtNow` used to update the `balances` map and the
248
- /// `totalSupplyHistory`
249
- /// @param checkpoints The history of data being updated
250
- /// @param _value The new number of reputation
251
- function updateValueAtNow(
252
- Checkpoint[] storage checkpoints,
253
- uint256 _value
254
- ) internal {
255
- require(uint128(_value) == _value); //check value is in the 128 bits bounderies
256
- if (
257
- (checkpoints.length == 0) ||
258
- (checkpoints[checkpoints.length - 1].fromBlock < block.number)
259
- ) {
260
- Checkpoint storage newCheckPoint = checkpoints[checkpoints.length++];
261
- newCheckPoint.fromBlock = uint128(block.number);
262
- newCheckPoint.value = uint128(_value);
263
- } else {
264
- Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length - 1];
265
- oldCheckPoint.value = uint128(_value);
266
- }
267
- }
268
- }
269
-
270
- // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
271
-
272
- pragma solidity ^0.5.0;
273
-
274
- /**
275
- * @title ERC20 interface
276
- * @dev see https://github.com/ethereum/EIPs/issues/20
277
- */
278
- interface IERC20 {
279
- function transfer(address to, uint256 value) external returns (bool);
280
-
281
- function approve(address spender, uint256 value) external returns (bool);
282
-
283
- function transferFrom(
284
- address from,
285
- address to,
286
- uint256 value
287
- ) external returns (bool);
288
-
289
- function totalSupply() external view returns (uint256);
290
-
291
- function balanceOf(address who) external view returns (uint256);
292
-
293
- function allowance(
294
- address owner,
295
- address spender
296
- ) external view returns (uint256);
297
-
298
- event Transfer(address indexed from, address indexed to, uint256 value);
299
-
300
- event Approval(address indexed owner, address indexed spender, uint256 value);
301
- }
302
-
303
- // File: openzeppelin-solidity/contracts/math/SafeMath.sol
304
-
305
- pragma solidity ^0.5.0;
306
-
307
- /**
308
- * @title SafeMath
309
- * @dev Unsigned math operations with safety checks that revert on error
310
- */
311
- library SafeMath {
312
- /**
313
- * @dev Multiplies two unsigned integers, reverts on overflow.
314
- */
315
- function mul(uint256 a, uint256 b) internal pure returns (uint256) {
316
- // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
317
- // benefit is lost if 'b' is also tested.
318
- // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
319
- if (a == 0) {
320
- return 0;
321
- }
322
-
323
- uint256 c = a * b;
324
- require(c / a == b);
325
-
326
- return c;
327
- }
328
-
329
- /**
330
- * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
331
- */
332
- function div(uint256 a, uint256 b) internal pure returns (uint256) {
333
- // Solidity only automatically asserts when dividing by 0
334
- require(b > 0);
335
- uint256 c = a / b;
336
- // assert(a == b * c + a % b); // There is no case in which this doesn't hold
337
-
338
- return c;
339
- }
340
-
341
- /**
342
- * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
343
- */
344
- function sub(uint256 a, uint256 b) internal pure returns (uint256) {
345
- require(b <= a);
346
- uint256 c = a - b;
347
-
348
- return c;
349
- }
350
-
351
- /**
352
- * @dev Adds two unsigned integers, reverts on overflow.
353
- */
354
- function add(uint256 a, uint256 b) internal pure returns (uint256) {
355
- uint256 c = a + b;
356
- require(c >= a);
357
-
358
- return c;
359
- }
360
-
361
- /**
362
- * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
363
- * reverts when dividing by zero.
364
- */
365
- function mod(uint256 a, uint256 b) internal pure returns (uint256) {
366
- require(b != 0);
367
- return a % b;
368
- }
369
- }
370
-
371
- // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
372
-
373
- pragma solidity ^0.5.0;
374
-
375
- /**
376
- * @title Standard ERC20 token
377
- *
378
- * @dev Implementation of the basic standard token.
379
- * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
380
- * Originally based on code by FirstBlood:
381
- * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
382
- *
383
- * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
384
- * all accounts just by listening to said events. Note that this isn't required by the specification, and other
385
- * compliant implementations may not do it.
386
- */
387
- contract ERC20 is IERC20 {
388
- using SafeMath for uint256;
389
-
390
- mapping(address => uint256) private _balances;
391
-
392
- mapping(address => mapping(address => uint256)) private _allowed;
393
-
394
- uint256 private _totalSupply;
395
-
396
- /**
397
- * @dev Total number of tokens in existence
398
- */
399
- function totalSupply() public view returns (uint256) {
400
- return _totalSupply;
401
- }
402
-
403
- /**
404
- * @dev Gets the balance of the specified address.
405
- * @param owner The address to query the balance of.
406
- * @return An uint256 representing the amount owned by the passed address.
407
- */
408
- function balanceOf(address owner) public view returns (uint256) {
409
- return _balances[owner];
410
- }
411
-
412
- /**
413
- * @dev Function to check the amount of tokens that an owner allowed to a spender.
414
- * @param owner address The address which owns the funds.
415
- * @param spender address The address which will spend the funds.
416
- * @return A uint256 specifying the amount of tokens still available for the spender.
417
- */
418
- function allowance(
419
- address owner,
420
- address spender
421
- ) public view returns (uint256) {
422
- return _allowed[owner][spender];
423
- }
424
-
425
- /**
426
- * @dev Transfer token for a specified address
427
- * @param to The address to transfer to.
428
- * @param value The amount to be transferred.
429
- */
430
- function transfer(address to, uint256 value) public returns (bool) {
431
- _transfer(msg.sender, to, value);
432
- return true;
433
- }
434
-
435
- /**
436
- * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
437
- * Beware that changing an allowance with this method brings the risk that someone may use both the old
438
- * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
439
- * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
440
- * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
441
- * @param spender The address which will spend the funds.
442
- * @param value The amount of tokens to be spent.
443
- */
444
- function approve(address spender, uint256 value) public returns (bool) {
445
- require(spender != address(0));
446
-
447
- _allowed[msg.sender][spender] = value;
448
- emit Approval(msg.sender, spender, value);
449
- return true;
450
- }
451
-
452
- /**
453
- * @dev Transfer tokens from one address to another.
454
- * Note that while this function emits an Approval event, this is not required as per the specification,
455
- * and other compliant implementations may not emit the event.
456
- * @param from address The address which you want to send tokens from
457
- * @param to address The address which you want to transfer to
458
- * @param value uint256 the amount of tokens to be transferred
459
- */
460
- function transferFrom(
461
- address from,
462
- address to,
463
- uint256 value
464
- ) public returns (bool) {
465
- _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
466
- _transfer(from, to, value);
467
- emit Approval(from, msg.sender, _allowed[from][msg.sender]);
468
- return true;
469
- }
470
-
471
- /**
472
- * @dev Increase the amount of tokens that an owner allowed to a spender.
473
- * approve should be called when allowed_[_spender] == 0. To increment
474
- * allowed value is better to use this function to avoid 2 calls (and wait until
475
- * the first transaction is mined)
476
- * From MonolithDAO Token.sol
477
- * Emits an Approval event.
478
- * @param spender The address which will spend the funds.
479
- * @param addedValue The amount of tokens to increase the allowance by.
480
- */
481
- function increaseAllowance(
482
- address spender,
483
- uint256 addedValue
484
- ) public returns (bool) {
485
- require(spender != address(0));
486
-
487
- _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(
488
- addedValue
489
- );
490
- emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
491
- return true;
492
- }
493
-
494
- /**
495
- * @dev Decrease the amount of tokens that an owner allowed to a spender.
496
- * approve should be called when allowed_[_spender] == 0. To decrement
497
- * allowed value is better to use this function to avoid 2 calls (and wait until
498
- * the first transaction is mined)
499
- * From MonolithDAO Token.sol
500
- * Emits an Approval event.
501
- * @param spender The address which will spend the funds.
502
- * @param subtractedValue The amount of tokens to decrease the allowance by.
503
- */
504
- function decreaseAllowance(
505
- address spender,
506
- uint256 subtractedValue
507
- ) public returns (bool) {
508
- require(spender != address(0));
509
-
510
- _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(
511
- subtractedValue
512
- );
513
- emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
514
- return true;
515
- }
516
-
517
- /**
518
- * @dev Transfer token for a specified addresses
519
- * @param from The address to transfer from.
520
- * @param to The address to transfer to.
521
- * @param value The amount to be transferred.
522
- */
523
- function _transfer(address from, address to, uint256 value) internal {
524
- require(to != address(0));
525
-
526
- _balances[from] = _balances[from].sub(value);
527
- _balances[to] = _balances[to].add(value);
528
- emit Transfer(from, to, value);
529
- }
530
-
531
- /**
532
- * @dev Internal function that mints an amount of the token and assigns it to
533
- * an account. This encapsulates the modification of balances such that the
534
- * proper events are emitted.
535
- * @param account The account that will receive the created tokens.
536
- * @param value The amount that will be created.
537
- */
538
- function _mint(address account, uint256 value) internal {
539
- require(account != address(0));
540
-
541
- _totalSupply = _totalSupply.add(value);
542
- _balances[account] = _balances[account].add(value);
543
- emit Transfer(address(0), account, value);
544
- }
545
-
546
- /**
547
- * @dev Internal function that burns an amount of the token of a given
548
- * account.
549
- * @param account The account whose tokens will be burnt.
550
- * @param value The amount that will be burnt.
551
- */
552
- function _burn(address account, uint256 value) internal {
553
- require(account != address(0));
554
-
555
- _totalSupply = _totalSupply.sub(value);
556
- _balances[account] = _balances[account].sub(value);
557
- emit Transfer(account, address(0), value);
558
- }
559
-
560
- /**
561
- * @dev Internal function that burns an amount of the token of a given
562
- * account, deducting from the sender's allowance for said account. Uses the
563
- * internal burn function.
564
- * Emits an Approval event (reflecting the reduced allowance).
565
- * @param account The account whose tokens will be burnt.
566
- * @param value The amount that will be burnt.
567
- */
568
- function _burnFrom(address account, uint256 value) internal {
569
- _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
570
- _burn(account, value);
571
- emit Approval(account, msg.sender, _allowed[account][msg.sender]);
572
- }
573
- }
574
-
575
- // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol
576
-
577
- pragma solidity ^0.5.0;
578
-
579
- /**
580
- * @title Burnable Token
581
- * @dev Token that can be irreversibly burned (destroyed).
582
- */
583
- contract ERC20Burnable is ERC20 {
584
- /**
585
- * @dev Burns a specific amount of tokens.
586
- * @param value The amount of token to be burned.
587
- */
588
- function burn(uint256 value) public {
589
- _burn(msg.sender, value);
590
- }
591
-
592
- /**
593
- * @dev Burns a specific amount of tokens from the target address and decrements allowance
594
- * @param from address The address which you want to send tokens from
595
- * @param value uint256 The amount of token to be burned
596
- */
597
- function burnFrom(address from, uint256 value) public {
598
- _burnFrom(from, value);
599
- }
600
- }
601
-
602
- // File: @daostack/arc/contracts/controller/DAOToken.sol
603
-
604
- pragma solidity ^0.5.4;
605
-
606
- /**
607
- * @title DAOToken, base on zeppelin contract.
608
- * @dev ERC20 compatible token. It is a mintable, burnable token.
609
- */
610
-
611
- contract DAOToken is ERC20, ERC20Burnable, Ownable {
612
- string public name;
613
- string public symbol;
614
- // solhint-disable-next-line const-name-snakecase
615
- uint8 public constant decimals = 18;
616
- uint256 public cap;
617
-
618
- /**
619
- * @dev Constructor
620
- * @param _name - token name
621
- * @param _symbol - token symbol
622
- * @param _cap - token cap - 0 value means no cap
623
- */
624
- constructor(string memory _name, string memory _symbol, uint256 _cap) public {
625
- name = _name;
626
- symbol = _symbol;
627
- cap = _cap;
628
- }
629
-
630
- /**
631
- * @dev Function to mint tokens
632
- * @param _to The address that will receive the minted tokens.
633
- * @param _amount The amount of tokens to mint.
634
- */
635
- function mint(address _to, uint256 _amount) public onlyOwner returns (bool) {
636
- if (cap > 0) require(totalSupply().add(_amount) <= cap);
637
- _mint(_to, _amount);
638
- return true;
639
- }
640
- }
641
-
642
- // File: openzeppelin-solidity/contracts/utils/Address.sol
643
-
644
- pragma solidity ^0.5.0;
645
-
646
- /**
647
- * Utility library of inline functions on addresses
648
- */
649
- library Address {
650
- /**
651
- * Returns whether the target address is a contract
652
- * @dev This function will return false if invoked during the constructor of a contract,
653
- * as the code is not actually created until after the constructor finishes.
654
- * @param account address of the account to check
655
- * @return whether the target address is a contract
656
- */
657
- function isContract(address account) internal view returns (bool) {
658
- uint256 size;
659
- // XXX Currently there is no better way to check if there is a contract in an address
660
- // than to check the size of the code at that address.
661
- // See https://ethereum.stackexchange.com/a/14016/36603
662
- // for more details about how this works.
663
- // TODO Check this again before the Serenity release, because all addresses will be
664
- // contracts then.
665
- // solhint-disable-next-line no-inline-assembly
666
- assembly {
667
- size := extcodesize(account)
668
- }
669
- return size > 0;
670
- }
671
- }
672
-
673
- // File: @daostack/arc/contracts/libs/SafeERC20.sol
674
-
675
- /*
676
-
677
- SafeERC20 by daostack.
678
- The code is based on a fix by SECBIT Team.
679
-
680
- USE WITH CAUTION & NO WARRANTY
681
-
682
- REFERENCE & RELATED READING
683
- - https://github.com/ethereum/solidity/issues/4116
684
- - https://medium.com/@chris_77367/explaining-unexpected-reverts-starting-with-solidity-0-4-22-3ada6e82308c
685
- - https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
686
- - https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61
687
-
688
- */
689
- pragma solidity ^0.5.4;
690
-
691
- library SafeERC20 {
692
- using Address for address;
693
-
694
- bytes4 private constant TRANSFER_SELECTOR =
695
- bytes4(keccak256(bytes("transfer(address,uint256)")));
696
- bytes4 private constant TRANSFERFROM_SELECTOR =
697
- bytes4(keccak256(bytes("transferFrom(address,address,uint256)")));
698
- bytes4 private constant APPROVE_SELECTOR =
699
- bytes4(keccak256(bytes("approve(address,uint256)")));
700
-
701
- function safeTransfer(
702
- address _erc20Addr,
703
- address _to,
704
- uint256 _value
705
- ) internal {
706
- // Must be a contract addr first!
707
- require(_erc20Addr.isContract());
708
-
709
- (bool success, bytes memory returnValue) = // solhint-disable-next-line avoid-low-level-calls
710
- _erc20Addr.call(abi.encodeWithSelector(TRANSFER_SELECTOR, _to, _value));
711
- // call return false when something wrong
712
- require(success);
713
- //check return value
714
- require(
715
- returnValue.length == 0 ||
716
- (returnValue.length == 32 && (returnValue[31] != 0))
717
- );
718
- }
719
-
720
- function safeTransferFrom(
721
- address _erc20Addr,
722
- address _from,
723
- address _to,
724
- uint256 _value
725
- ) internal {
726
- // Must be a contract addr first!
727
- require(_erc20Addr.isContract());
728
-
729
- (bool success, bytes memory returnValue) = // solhint-disable-next-line avoid-low-level-calls
730
- _erc20Addr.call(
731
- abi.encodeWithSelector(TRANSFERFROM_SELECTOR, _from, _to, _value)
732
- );
733
- // call return false when something wrong
734
- require(success);
735
- //check return value
736
- require(
737
- returnValue.length == 0 ||
738
- (returnValue.length == 32 && (returnValue[31] != 0))
739
- );
740
- }
741
-
742
- function safeApprove(
743
- address _erc20Addr,
744
- address _spender,
745
- uint256 _value
746
- ) internal {
747
- // Must be a contract addr first!
748
- require(_erc20Addr.isContract());
749
-
750
- // safeApprove should only be called when setting an initial allowance,
751
- // or when resetting it to zero.
752
- require(
753
- (_value == 0) ||
754
- (IERC20(_erc20Addr).allowance(address(this), _spender) == 0)
755
- );
756
-
757
- (bool success, bytes memory returnValue) = // solhint-disable-next-line avoid-low-level-calls
758
- _erc20Addr.call(abi.encodeWithSelector(APPROVE_SELECTOR, _spender, _value));
759
- // call return false when something wrong
760
- require(success);
761
- //check return value
762
- require(
763
- returnValue.length == 0 ||
764
- (returnValue.length == 32 && (returnValue[31] != 0))
765
- );
766
- }
767
- }
768
-
769
- // File: @daostack/arc/contracts/controller/Avatar.sol
770
-
771
- pragma solidity ^0.5.4;
772
-
773
- /**
774
- * @title An Avatar holds tokens, reputation and ether for a controller
775
- */
776
- contract Avatar is Ownable {
777
- using SafeERC20 for address;
778
-
779
- string public orgName;
780
- DAOToken public nativeToken;
781
- Reputation public nativeReputation;
782
-
783
- event GenericCall(
784
- address indexed _contract,
785
- bytes _data,
786
- uint _value,
787
- bool _success
788
- );
789
- event SendEther(uint256 _amountInWei, address indexed _to);
790
- event ExternalTokenTransfer(
791
- address indexed _externalToken,
792
- address indexed _to,
793
- uint256 _value
794
- );
795
- event ExternalTokenTransferFrom(
796
- address indexed _externalToken,
797
- address _from,
798
- address _to,
799
- uint256 _value
800
- );
801
- event ExternalTokenApproval(
802
- address indexed _externalToken,
803
- address _spender,
804
- uint256 _value
805
- );
806
- event ReceiveEther(address indexed _sender, uint256 _value);
807
- event MetaData(string _metaData);
808
-
809
- /**
810
- * @dev the constructor takes organization name, native token and reputation system
811
- and creates an avatar for a controller
812
- */
813
- constructor(
814
- string memory _orgName,
815
- DAOToken _nativeToken,
816
- Reputation _nativeReputation
817
- ) public {
818
- orgName = _orgName;
819
- nativeToken = _nativeToken;
820
- nativeReputation = _nativeReputation;
821
- }
822
-
823
- /**
824
- * @dev enables an avatar to receive ethers
825
- */
826
- function() external payable {
827
- emit ReceiveEther(msg.sender, msg.value);
828
- }
829
-
830
- /**
831
- * @dev perform a generic call to an arbitrary contract
832
- * @param _contract the contract's address to call
833
- * @param _data ABI-encoded contract call to call `_contract` address.
834
- * @param _value value (ETH) to transfer with the transaction
835
- * @return bool success or fail
836
- * bytes - the return bytes of the called contract's function.
837
- */
838
- function genericCall(
839
- address _contract,
840
- bytes memory _data,
841
- uint256 _value
842
- ) public onlyOwner returns (bool success, bytes memory returnValue) {
843
- // solhint-disable-next-line avoid-call-value
844
- (success, returnValue) = _contract.call.value(_value)(_data);
845
- emit GenericCall(_contract, _data, _value, success);
846
- }
847
-
848
- /**
849
- * @dev send ethers from the avatar's wallet
850
- * @param _amountInWei amount to send in Wei units
851
- * @param _to send the ethers to this address
852
- * @return bool which represents success
853
- */
854
- function sendEther(
855
- uint256 _amountInWei,
856
- address payable _to
857
- ) public onlyOwner returns (bool) {
858
- _to.transfer(_amountInWei);
859
- emit SendEther(_amountInWei, _to);
860
- return true;
861
- }
862
-
863
- /**
864
- * @dev external token transfer
865
- * @param _externalToken the token contract
866
- * @param _to the destination address
867
- * @param _value the amount of tokens to transfer
868
- * @return bool which represents success
869
- */
870
- function externalTokenTransfer(
871
- IERC20 _externalToken,
872
- address _to,
873
- uint256 _value
874
- ) public onlyOwner returns (bool) {
875
- address(_externalToken).safeTransfer(_to, _value);
876
- emit ExternalTokenTransfer(address(_externalToken), _to, _value);
877
- return true;
878
- }
879
-
880
- /**
881
- * @dev external token transfer from a specific account
882
- * @param _externalToken the token contract
883
- * @param _from the account to spend token from
884
- * @param _to the destination address
885
- * @param _value the amount of tokens to transfer
886
- * @return bool which represents success
887
- */
888
- function externalTokenTransferFrom(
889
- IERC20 _externalToken,
890
- address _from,
891
- address _to,
892
- uint256 _value
893
- ) public onlyOwner returns (bool) {
894
- address(_externalToken).safeTransferFrom(_from, _to, _value);
895
- emit ExternalTokenTransferFrom(address(_externalToken), _from, _to, _value);
896
- return true;
897
- }
898
-
899
- /**
900
- * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
901
- * on behalf of msg.sender.
902
- * @param _externalToken the address of the Token Contract
903
- * @param _spender address
904
- * @param _value the amount of ether (in Wei) which the approval is referring to.
905
- * @return bool which represents a success
906
- */
907
- function externalTokenApproval(
908
- IERC20 _externalToken,
909
- address _spender,
910
- uint256 _value
911
- ) public onlyOwner returns (bool) {
912
- address(_externalToken).safeApprove(_spender, _value);
913
- emit ExternalTokenApproval(address(_externalToken), _spender, _value);
914
- return true;
915
- }
916
-
917
- /**
918
- * @dev metaData emits an event with a string, should contain the hash of some meta data.
919
- * @param _metaData a string representing a hash of the meta data
920
- * @return bool which represents a success
921
- */
922
- function metaData(string memory _metaData) public onlyOwner returns (bool) {
923
- emit MetaData(_metaData);
924
- return true;
925
- }
926
- }
927
-
928
- // File: @daostack/arc/contracts/globalConstraints/GlobalConstraintInterface.sol
929
-
930
- pragma solidity ^0.5.4;
931
-
932
- contract GlobalConstraintInterface {
933
- enum CallPhase {
934
- Pre,
935
- Post,
936
- PreAndPost
937
- }
938
-
939
- function pre(
940
- address _scheme,
941
- bytes32 _params,
942
- bytes32 _method
943
- ) public returns (bool);
944
-
945
- function post(
946
- address _scheme,
947
- bytes32 _params,
948
- bytes32 _method
949
- ) public returns (bool);
950
-
951
- /**
952
- * @dev when return if this globalConstraints is pre, post or both.
953
- * @return CallPhase enum indication Pre, Post or PreAndPost.
954
- */
955
- function when() public returns (CallPhase);
956
- }
957
-
958
- // File: @daostack/arc/contracts/controller/ControllerInterface.sol
959
-
960
- pragma solidity ^0.5.4;
961
-
962
- /**
963
- * @title Controller contract
964
- * @dev A controller controls the organizations tokens ,reputation and avatar.
965
- * It is subject to a set of schemes and constraints that determine its behavior.
966
- * Each scheme has it own parameters and operation permissions.
967
- */
968
- interface ControllerInterface {
969
- /**
970
- * @dev Mint `_amount` of reputation that are assigned to `_to` .
971
- * @param _amount amount of reputation to mint
972
- * @param _to beneficiary address
973
- * @return bool which represents a success
974
- */
975
- function mintReputation(
976
- uint256 _amount,
977
- address _to,
978
- address _avatar
979
- ) external returns (bool);
980
-
981
- /**
982
- * @dev Burns `_amount` of reputation from `_from`
983
- * @param _amount amount of reputation to burn
984
- * @param _from The address that will lose the reputation
985
- * @return bool which represents a success
986
- */
987
- function burnReputation(
988
- uint256 _amount,
989
- address _from,
990
- address _avatar
991
- ) external returns (bool);
992
-
993
- /**
994
- * @dev mint tokens .
995
- * @param _amount amount of token to mint
996
- * @param _beneficiary beneficiary address
997
- * @param _avatar address
998
- * @return bool which represents a success
999
- */
1000
- function mintTokens(
1001
- uint256 _amount,
1002
- address _beneficiary,
1003
- address _avatar
1004
- ) external returns (bool);
1005
-
1006
- /**
1007
- * @dev register or update a scheme
1008
- * @param _scheme the address of the scheme
1009
- * @param _paramsHash a hashed configuration of the usage of the scheme
1010
- * @param _permissions the permissions the new scheme will have
1011
- * @param _avatar address
1012
- * @return bool which represents a success
1013
- */
1014
- function registerScheme(
1015
- address _scheme,
1016
- bytes32 _paramsHash,
1017
- bytes4 _permissions,
1018
- address _avatar
1019
- ) external returns (bool);
1020
-
1021
- /**
1022
- * @dev unregister a scheme
1023
- * @param _avatar address
1024
- * @param _scheme the address of the scheme
1025
- * @return bool which represents a success
1026
- */
1027
- function unregisterScheme(
1028
- address _scheme,
1029
- address _avatar
1030
- ) external returns (bool);
1031
-
1032
- /**
1033
- * @dev unregister the caller's scheme
1034
- * @param _avatar address
1035
- * @return bool which represents a success
1036
- */
1037
- function unregisterSelf(address _avatar) external returns (bool);
1038
-
1039
- /**
1040
- * @dev add or update Global Constraint
1041
- * @param _globalConstraint the address of the global constraint to be added.
1042
- * @param _params the constraint parameters hash.
1043
- * @param _avatar the avatar of the organization
1044
- * @return bool which represents a success
1045
- */
1046
- function addGlobalConstraint(
1047
- address _globalConstraint,
1048
- bytes32 _params,
1049
- address _avatar
1050
- ) external returns (bool);
1051
-
1052
- /**
1053
- * @dev remove Global Constraint
1054
- * @param _globalConstraint the address of the global constraint to be remove.
1055
- * @param _avatar the organization avatar.
1056
- * @return bool which represents a success
1057
- */
1058
- function removeGlobalConstraint(
1059
- address _globalConstraint,
1060
- address _avatar
1061
- ) external returns (bool);
1062
-
1063
- /**
1064
- * @dev upgrade the Controller
1065
- * The function will trigger an event 'UpgradeController'.
1066
- * @param _newController the address of the new controller.
1067
- * @param _avatar address
1068
- * @return bool which represents a success
1069
- */
1070
- function upgradeController(
1071
- address _newController,
1072
- Avatar _avatar
1073
- ) external returns (bool);
1074
-
1075
- /**
1076
- * @dev perform a generic call to an arbitrary contract
1077
- * @param _contract the contract's address to call
1078
- * @param _data ABI-encoded contract call to call `_contract` address.
1079
- * @param _avatar the controller's avatar address
1080
- * @param _value value (ETH) to transfer with the transaction
1081
- * @return bool -success
1082
- * bytes - the return value of the called _contract's function.
1083
- */
1084
- function genericCall(
1085
- address _contract,
1086
- bytes calldata _data,
1087
- Avatar _avatar,
1088
- uint256 _value
1089
- ) external returns (bool, bytes memory);
1090
-
1091
- /**
1092
- * @dev send some ether
1093
- * @param _amountInWei the amount of ether (in Wei) to send
1094
- * @param _to address of the beneficiary
1095
- * @param _avatar address
1096
- * @return bool which represents a success
1097
- */
1098
- function sendEther(
1099
- uint256 _amountInWei,
1100
- address payable _to,
1101
- Avatar _avatar
1102
- ) external returns (bool);
1103
-
1104
- /**
1105
- * @dev send some amount of arbitrary ERC20 Tokens
1106
- * @param _externalToken the address of the Token Contract
1107
- * @param _to address of the beneficiary
1108
- * @param _value the amount of ether (in Wei) to send
1109
- * @param _avatar address
1110
- * @return bool which represents a success
1111
- */
1112
- function externalTokenTransfer(
1113
- IERC20 _externalToken,
1114
- address _to,
1115
- uint256 _value,
1116
- Avatar _avatar
1117
- ) external returns (bool);
1118
-
1119
- /**
1120
- * @dev transfer token "from" address "to" address
1121
- * One must to approve the amount of tokens which can be spend from the
1122
- * "from" account.This can be done using externalTokenApprove.
1123
- * @param _externalToken the address of the Token Contract
1124
- * @param _from address of the account to send from
1125
- * @param _to address of the beneficiary
1126
- * @param _value the amount of ether (in Wei) to send
1127
- * @param _avatar address
1128
- * @return bool which represents a success
1129
- */
1130
- function externalTokenTransferFrom(
1131
- IERC20 _externalToken,
1132
- address _from,
1133
- address _to,
1134
- uint256 _value,
1135
- Avatar _avatar
1136
- ) external returns (bool);
1137
-
1138
- /**
1139
- * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
1140
- * on behalf of msg.sender.
1141
- * @param _externalToken the address of the Token Contract
1142
- * @param _spender address
1143
- * @param _value the amount of ether (in Wei) which the approval is referring to.
1144
- * @return bool which represents a success
1145
- */
1146
- function externalTokenApproval(
1147
- IERC20 _externalToken,
1148
- address _spender,
1149
- uint256 _value,
1150
- Avatar _avatar
1151
- ) external returns (bool);
1152
-
1153
- /**
1154
- * @dev metaData emits an event with a string, should contain the hash of some meta data.
1155
- * @param _metaData a string representing a hash of the meta data
1156
- * @param _avatar Avatar
1157
- * @return bool which represents a success
1158
- */
1159
- function metaData(
1160
- string calldata _metaData,
1161
- Avatar _avatar
1162
- ) external returns (bool);
1163
-
1164
- /**
1165
- * @dev getNativeReputation
1166
- * @param _avatar the organization avatar.
1167
- * @return organization native reputation
1168
- */
1169
- function getNativeReputation(address _avatar) external view returns (address);
1170
-
1171
- function isSchemeRegistered(
1172
- address _scheme,
1173
- address _avatar
1174
- ) external view returns (bool);
1175
-
1176
- function getSchemeParameters(
1177
- address _scheme,
1178
- address _avatar
1179
- ) external view returns (bytes32);
1180
-
1181
- function getGlobalConstraintParameters(
1182
- address _globalConstraint,
1183
- address _avatar
1184
- ) external view returns (bytes32);
1185
-
1186
- function getSchemePermissions(
1187
- address _scheme,
1188
- address _avatar
1189
- ) external view returns (bytes4);
1190
-
1191
- /**
1192
- * @dev globalConstraintsCount return the global constraint pre and post count
1193
- * @return uint256 globalConstraintsPre count.
1194
- * @return uint256 globalConstraintsPost count.
1195
- */
1196
- function globalConstraintsCount(
1197
- address _avatar
1198
- ) external view returns (uint, uint);
1199
-
1200
- function isGlobalConstraintRegistered(
1201
- address _globalConstraint,
1202
- address _avatar
1203
- ) external view returns (bool);
1204
- }
1205
-
1206
- // File: @daostack/arc/contracts/controller/Controller.sol
1207
-
1208
- pragma solidity ^0.5.4;
1209
-
1210
- /**
1211
- * @title Controller contract
1212
- * @dev A controller controls the organizations tokens, reputation and avatar.
1213
- * It is subject to a set of schemes and constraints that determine its behavior.
1214
- * Each scheme has it own parameters and operation permissions.
1215
- */
1216
- contract Controller is ControllerInterface {
1217
- struct Scheme {
1218
- bytes32 paramsHash; // a hash "configuration" of the scheme
1219
- bytes4 permissions; // A bitwise flags of permissions,
1220
- // All 0: Not registered,
1221
- // 1st bit: Flag if the scheme is registered,
1222
- // 2nd bit: Scheme can register other schemes
1223
- // 3rd bit: Scheme can add/remove global constraints
1224
- // 4th bit: Scheme can upgrade the controller
1225
- // 5th bit: Scheme can call genericCall on behalf of
1226
- // the organization avatar
1227
- }
1228
-
1229
- struct GlobalConstraint {
1230
- address gcAddress;
1231
- bytes32 params;
1232
- }
1233
-
1234
- struct GlobalConstraintRegister {
1235
- bool isRegistered; //is registered
1236
- uint256 index; //index at globalConstraints
1237
- }
1238
-
1239
- mapping(address => Scheme) public schemes;
1240
-
1241
- Avatar public avatar;
1242
- DAOToken public nativeToken;
1243
- Reputation public nativeReputation;
1244
- // newController will point to the new controller after the present controller is upgraded
1245
- address public newController;
1246
- // globalConstraintsPre that determine pre conditions for all actions on the controller
1247
-
1248
- GlobalConstraint[] public globalConstraintsPre;
1249
- // globalConstraintsPost that determine post conditions for all actions on the controller
1250
- GlobalConstraint[] public globalConstraintsPost;
1251
- // globalConstraintsRegisterPre indicate if a globalConstraints is registered as a pre global constraint
1252
- mapping(address => GlobalConstraintRegister)
1253
- public globalConstraintsRegisterPre;
1254
- // globalConstraintsRegisterPost indicate if a globalConstraints is registered as a post global constraint
1255
- mapping(address => GlobalConstraintRegister)
1256
- public globalConstraintsRegisterPost;
1257
-
1258
- event MintReputation(
1259
- address indexed _sender,
1260
- address indexed _to,
1261
- uint256 _amount
1262
- );
1263
- event BurnReputation(
1264
- address indexed _sender,
1265
- address indexed _from,
1266
- uint256 _amount
1267
- );
1268
- event MintTokens(
1269
- address indexed _sender,
1270
- address indexed _beneficiary,
1271
- uint256 _amount
1272
- );
1273
- event RegisterScheme(address indexed _sender, address indexed _scheme);
1274
- event UnregisterScheme(address indexed _sender, address indexed _scheme);
1275
- event UpgradeController(
1276
- address indexed _oldController,
1277
- address _newController
1278
- );
1279
-
1280
- event AddGlobalConstraint(
1281
- address indexed _globalConstraint,
1282
- bytes32 _params,
1283
- GlobalConstraintInterface.CallPhase _when
1284
- );
1285
-
1286
- event RemoveGlobalConstraint(
1287
- address indexed _globalConstraint,
1288
- uint256 _index,
1289
- bool _isPre
1290
- );
1291
-
1292
- constructor(Avatar _avatar) public {
1293
- avatar = _avatar;
1294
- nativeToken = avatar.nativeToken();
1295
- nativeReputation = avatar.nativeReputation();
1296
- schemes[msg.sender] = Scheme({
1297
- paramsHash: bytes32(0),
1298
- permissions: bytes4(0x0000001F)
1299
- });
1300
- }
1301
-
1302
- // Do not allow mistaken calls:
1303
- // solhint-disable-next-line payable-fallback
1304
- function() external {
1305
- revert();
1306
- }
1307
-
1308
- // Modifiers:
1309
- modifier onlyRegisteredScheme() {
1310
- require(
1311
- schemes[msg.sender].permissions & bytes4(0x00000001) == bytes4(0x00000001)
1312
- );
1313
- _;
1314
- }
1315
-
1316
- modifier onlyRegisteringSchemes() {
1317
- require(
1318
- schemes[msg.sender].permissions & bytes4(0x00000002) == bytes4(0x00000002)
1319
- );
1320
- _;
1321
- }
1322
-
1323
- modifier onlyGlobalConstraintsScheme() {
1324
- require(
1325
- schemes[msg.sender].permissions & bytes4(0x00000004) == bytes4(0x00000004)
1326
- );
1327
- _;
1328
- }
1329
-
1330
- modifier onlyUpgradingScheme() {
1331
- require(
1332
- schemes[msg.sender].permissions & bytes4(0x00000008) == bytes4(0x00000008)
1333
- );
1334
- _;
1335
- }
1336
-
1337
- modifier onlyGenericCallScheme() {
1338
- require(
1339
- schemes[msg.sender].permissions & bytes4(0x00000010) == bytes4(0x00000010)
1340
- );
1341
- _;
1342
- }
1343
-
1344
- modifier onlyMetaDataScheme() {
1345
- require(
1346
- schemes[msg.sender].permissions & bytes4(0x00000010) == bytes4(0x00000010)
1347
- );
1348
- _;
1349
- }
1350
-
1351
- modifier onlySubjectToConstraint(bytes32 func) {
1352
- uint256 idx;
1353
- for (idx = 0; idx < globalConstraintsPre.length; idx++) {
1354
- require(
1355
- (GlobalConstraintInterface(globalConstraintsPre[idx].gcAddress)).pre(
1356
- msg.sender,
1357
- globalConstraintsPre[idx].params,
1358
- func
1359
- )
1360
- );
1361
- }
1362
- _;
1363
- for (idx = 0; idx < globalConstraintsPost.length; idx++) {
1364
- require(
1365
- (GlobalConstraintInterface(globalConstraintsPost[idx].gcAddress)).post(
1366
- msg.sender,
1367
- globalConstraintsPost[idx].params,
1368
- func
1369
- )
1370
- );
1371
- }
1372
- }
1373
-
1374
- modifier isAvatarValid(address _avatar) {
1375
- require(_avatar == address(avatar));
1376
- _;
1377
- }
1378
-
1379
- /**
1380
- * @dev Mint `_amount` of reputation that are assigned to `_to` .
1381
- * @param _amount amount of reputation to mint
1382
- * @param _to beneficiary address
1383
- * @return bool which represents a success
1384
- */
1385
- function mintReputation(
1386
- uint256 _amount,
1387
- address _to,
1388
- address _avatar
1389
- )
1390
- external
1391
- onlyRegisteredScheme
1392
- onlySubjectToConstraint("mintReputation")
1393
- isAvatarValid(_avatar)
1394
- returns (bool)
1395
- {
1396
- emit MintReputation(msg.sender, _to, _amount);
1397
- return nativeReputation.mint(_to, _amount);
1398
- }
1399
-
1400
- /**
1401
- * @dev Burns `_amount` of reputation from `_from`
1402
- * @param _amount amount of reputation to burn
1403
- * @param _from The address that will lose the reputation
1404
- * @return bool which represents a success
1405
- */
1406
- function burnReputation(
1407
- uint256 _amount,
1408
- address _from,
1409
- address _avatar
1410
- )
1411
- external
1412
- onlyRegisteredScheme
1413
- onlySubjectToConstraint("burnReputation")
1414
- isAvatarValid(_avatar)
1415
- returns (bool)
1416
- {
1417
- emit BurnReputation(msg.sender, _from, _amount);
1418
- return nativeReputation.burn(_from, _amount);
1419
- }
1420
-
1421
- /**
1422
- * @dev mint tokens .
1423
- * @param _amount amount of token to mint
1424
- * @param _beneficiary beneficiary address
1425
- * @return bool which represents a success
1426
- */
1427
- function mintTokens(
1428
- uint256 _amount,
1429
- address _beneficiary,
1430
- address _avatar
1431
- )
1432
- external
1433
- onlyRegisteredScheme
1434
- onlySubjectToConstraint("mintTokens")
1435
- isAvatarValid(_avatar)
1436
- returns (bool)
1437
- {
1438
- emit MintTokens(msg.sender, _beneficiary, _amount);
1439
- return nativeToken.mint(_beneficiary, _amount);
1440
- }
1441
-
1442
- /**
1443
- * @dev register a scheme
1444
- * @param _scheme the address of the scheme
1445
- * @param _paramsHash a hashed configuration of the usage of the scheme
1446
- * @param _permissions the permissions the new scheme will have
1447
- * @return bool which represents a success
1448
- */
1449
- function registerScheme(
1450
- address _scheme,
1451
- bytes32 _paramsHash,
1452
- bytes4 _permissions,
1453
- address _avatar
1454
- )
1455
- external
1456
- onlyRegisteringSchemes
1457
- onlySubjectToConstraint("registerScheme")
1458
- isAvatarValid(_avatar)
1459
- returns (bool)
1460
- {
1461
- Scheme memory scheme = schemes[_scheme];
1462
-
1463
- // Check scheme has at least the permissions it is changing, and at least the current permissions:
1464
- // Implementation is a bit messy. One must recall logic-circuits ^^
1465
-
1466
- // produces non-zero if sender does not have all of the perms that are changing between old and new
1467
- require(
1468
- bytes4(0x0000001f) &
1469
- (_permissions ^ scheme.permissions) &
1470
- (~schemes[msg.sender].permissions) ==
1471
- bytes4(0)
1472
- );
1473
-
1474
- // produces non-zero if sender does not have all of the perms in the old scheme
1475
- require(
1476
- bytes4(0x0000001f) &
1477
- (scheme.permissions & (~schemes[msg.sender].permissions)) ==
1478
- bytes4(0)
1479
- );
1480
-
1481
- // Add or change the scheme:
1482
- schemes[_scheme].paramsHash = _paramsHash;
1483
- schemes[_scheme].permissions = _permissions | bytes4(0x00000001);
1484
- emit RegisterScheme(msg.sender, _scheme);
1485
- return true;
1486
- }
1487
-
1488
- /**
1489
- * @dev unregister a scheme
1490
- * @param _scheme the address of the scheme
1491
- * @return bool which represents a success
1492
- */
1493
- function unregisterScheme(
1494
- address _scheme,
1495
- address _avatar
1496
- )
1497
- external
1498
- onlyRegisteringSchemes
1499
- onlySubjectToConstraint("unregisterScheme")
1500
- isAvatarValid(_avatar)
1501
- returns (bool)
1502
- {
1503
- //check if the scheme is registered
1504
- if (_isSchemeRegistered(_scheme) == false) {
1505
- return false;
1506
- }
1507
- // Check the unregistering scheme has enough permissions:
1508
- require(
1509
- bytes4(0x0000001f) &
1510
- (schemes[_scheme].permissions & (~schemes[msg.sender].permissions)) ==
1511
- bytes4(0)
1512
- );
1513
-
1514
- // Unregister:
1515
- emit UnregisterScheme(msg.sender, _scheme);
1516
- delete schemes[_scheme];
1517
- return true;
1518
- }
1519
-
1520
- /**
1521
- * @dev unregister the caller's scheme
1522
- * @return bool which represents a success
1523
- */
1524
- function unregisterSelf(
1525
- address _avatar
1526
- ) external isAvatarValid(_avatar) returns (bool) {
1527
- if (_isSchemeRegistered(msg.sender) == false) {
1528
- return false;
1529
- }
1530
- delete schemes[msg.sender];
1531
- emit UnregisterScheme(msg.sender, msg.sender);
1532
- return true;
1533
- }
1534
-
1535
- /**
1536
- * @dev add or update Global Constraint
1537
- * @param _globalConstraint the address of the global constraint to be added.
1538
- * @param _params the constraint parameters hash.
1539
- * @return bool which represents a success
1540
- */
1541
- function addGlobalConstraint(
1542
- address _globalConstraint,
1543
- bytes32 _params,
1544
- address _avatar
1545
- ) external onlyGlobalConstraintsScheme isAvatarValid(_avatar) returns (bool) {
1546
- GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(
1547
- _globalConstraint
1548
- ).when();
1549
- if (
1550
- (when == GlobalConstraintInterface.CallPhase.Pre) ||
1551
- (when == GlobalConstraintInterface.CallPhase.PreAndPost)
1552
- ) {
1553
- if (!globalConstraintsRegisterPre[_globalConstraint].isRegistered) {
1554
- globalConstraintsPre.push(GlobalConstraint(_globalConstraint, _params));
1555
- globalConstraintsRegisterPre[
1556
- _globalConstraint
1557
- ] = GlobalConstraintRegister(true, globalConstraintsPre.length - 1);
1558
- } else {
1559
- globalConstraintsPre[
1560
- globalConstraintsRegisterPre[_globalConstraint].index
1561
- ].params = _params;
1562
- }
1563
- }
1564
- if (
1565
- (when == GlobalConstraintInterface.CallPhase.Post) ||
1566
- (when == GlobalConstraintInterface.CallPhase.PreAndPost)
1567
- ) {
1568
- if (!globalConstraintsRegisterPost[_globalConstraint].isRegistered) {
1569
- globalConstraintsPost.push(
1570
- GlobalConstraint(_globalConstraint, _params)
1571
- );
1572
- globalConstraintsRegisterPost[
1573
- _globalConstraint
1574
- ] = GlobalConstraintRegister(true, globalConstraintsPost.length - 1);
1575
- } else {
1576
- globalConstraintsPost[
1577
- globalConstraintsRegisterPost[_globalConstraint].index
1578
- ].params = _params;
1579
- }
1580
- }
1581
- emit AddGlobalConstraint(_globalConstraint, _params, when);
1582
- return true;
1583
- }
1584
-
1585
- /**
1586
- * @dev remove Global Constraint
1587
- * @param _globalConstraint the address of the global constraint to be remove.
1588
- * @return bool which represents a success
1589
- */
1590
- // solhint-disable-next-line code-complexity
1591
- function removeGlobalConstraint(
1592
- address _globalConstraint,
1593
- address _avatar
1594
- ) external onlyGlobalConstraintsScheme isAvatarValid(_avatar) returns (bool) {
1595
- GlobalConstraintRegister memory globalConstraintRegister;
1596
- GlobalConstraint memory globalConstraint;
1597
- GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(
1598
- _globalConstraint
1599
- ).when();
1600
- bool retVal = false;
1601
-
1602
- if (
1603
- (when == GlobalConstraintInterface.CallPhase.Pre) ||
1604
- (when == GlobalConstraintInterface.CallPhase.PreAndPost)
1605
- ) {
1606
- globalConstraintRegister = globalConstraintsRegisterPre[
1607
- _globalConstraint
1608
- ];
1609
- if (globalConstraintRegister.isRegistered) {
1610
- if (globalConstraintRegister.index < globalConstraintsPre.length - 1) {
1611
- globalConstraint = globalConstraintsPre[
1612
- globalConstraintsPre.length - 1
1613
- ];
1614
- globalConstraintsPre[
1615
- globalConstraintRegister.index
1616
- ] = globalConstraint;
1617
- globalConstraintsRegisterPre[globalConstraint.gcAddress]
1618
- .index = globalConstraintRegister.index;
1619
- }
1620
- globalConstraintsPre.length--;
1621
- delete globalConstraintsRegisterPre[_globalConstraint];
1622
- retVal = true;
1623
- }
1624
- }
1625
- if (
1626
- (when == GlobalConstraintInterface.CallPhase.Post) ||
1627
- (when == GlobalConstraintInterface.CallPhase.PreAndPost)
1628
- ) {
1629
- globalConstraintRegister = globalConstraintsRegisterPost[
1630
- _globalConstraint
1631
- ];
1632
- if (globalConstraintRegister.isRegistered) {
1633
- if (globalConstraintRegister.index < globalConstraintsPost.length - 1) {
1634
- globalConstraint = globalConstraintsPost[
1635
- globalConstraintsPost.length - 1
1636
- ];
1637
- globalConstraintsPost[
1638
- globalConstraintRegister.index
1639
- ] = globalConstraint;
1640
- globalConstraintsRegisterPost[globalConstraint.gcAddress]
1641
- .index = globalConstraintRegister.index;
1642
- }
1643
- globalConstraintsPost.length--;
1644
- delete globalConstraintsRegisterPost[_globalConstraint];
1645
- retVal = true;
1646
- }
1647
- }
1648
- if (retVal) {
1649
- emit RemoveGlobalConstraint(
1650
- _globalConstraint,
1651
- globalConstraintRegister.index,
1652
- when == GlobalConstraintInterface.CallPhase.Pre
1653
- );
1654
- }
1655
- return retVal;
1656
- }
1657
-
1658
- /**
1659
- * @dev upgrade the Controller
1660
- * The function will trigger an event 'UpgradeController'.
1661
- * @param _newController the address of the new controller.
1662
- * @return bool which represents a success
1663
- */
1664
- function upgradeController(
1665
- address _newController,
1666
- Avatar _avatar
1667
- )
1668
- external
1669
- onlyUpgradingScheme
1670
- isAvatarValid(address(_avatar))
1671
- returns (bool)
1672
- {
1673
- require(newController == address(0)); // so the upgrade could be done once for a contract.
1674
- require(_newController != address(0));
1675
- newController = _newController;
1676
- avatar.transferOwnership(_newController);
1677
- require(avatar.owner() == _newController);
1678
- if (nativeToken.owner() == address(this)) {
1679
- nativeToken.transferOwnership(_newController);
1680
- require(nativeToken.owner() == _newController);
1681
- }
1682
- if (nativeReputation.owner() == address(this)) {
1683
- nativeReputation.transferOwnership(_newController);
1684
- require(nativeReputation.owner() == _newController);
1685
- }
1686
- emit UpgradeController(address(this), newController);
1687
- return true;
1688
- }
1689
-
1690
- /**
1691
- * @dev perform a generic call to an arbitrary contract
1692
- * @param _contract the contract's address to call
1693
- * @param _data ABI-encoded contract call to call `_contract` address.
1694
- * @param _avatar the controller's avatar address
1695
- * @param _value value (ETH) to transfer with the transaction
1696
- * @return bool -success
1697
- * bytes - the return value of the called _contract's function.
1698
- */
1699
- function genericCall(
1700
- address _contract,
1701
- bytes calldata _data,
1702
- Avatar _avatar,
1703
- uint256 _value
1704
- )
1705
- external
1706
- onlyGenericCallScheme
1707
- onlySubjectToConstraint("genericCall")
1708
- isAvatarValid(address(_avatar))
1709
- returns (bool, bytes memory)
1710
- {
1711
- return avatar.genericCall(_contract, _data, _value);
1712
- }
1713
-
1714
- /**
1715
- * @dev send some ether
1716
- * @param _amountInWei the amount of ether (in Wei) to send
1717
- * @param _to address of the beneficiary
1718
- * @return bool which represents a success
1719
- */
1720
- function sendEther(
1721
- uint256 _amountInWei,
1722
- address payable _to,
1723
- Avatar _avatar
1724
- )
1725
- external
1726
- onlyRegisteredScheme
1727
- onlySubjectToConstraint("sendEther")
1728
- isAvatarValid(address(_avatar))
1729
- returns (bool)
1730
- {
1731
- return avatar.sendEther(_amountInWei, _to);
1732
- }
1733
-
1734
- /**
1735
- * @dev send some amount of arbitrary ERC20 Tokens
1736
- * @param _externalToken the address of the Token Contract
1737
- * @param _to address of the beneficiary
1738
- * @param _value the amount of ether (in Wei) to send
1739
- * @return bool which represents a success
1740
- */
1741
- function externalTokenTransfer(
1742
- IERC20 _externalToken,
1743
- address _to,
1744
- uint256 _value,
1745
- Avatar _avatar
1746
- )
1747
- external
1748
- onlyRegisteredScheme
1749
- onlySubjectToConstraint("externalTokenTransfer")
1750
- isAvatarValid(address(_avatar))
1751
- returns (bool)
1752
- {
1753
- return avatar.externalTokenTransfer(_externalToken, _to, _value);
1754
- }
1755
-
1756
- /**
1757
- * @dev transfer token "from" address "to" address
1758
- * One must to approve the amount of tokens which can be spend from the
1759
- * "from" account.This can be done using externalTokenApprove.
1760
- * @param _externalToken the address of the Token Contract
1761
- * @param _from address of the account to send from
1762
- * @param _to address of the beneficiary
1763
- * @param _value the amount of ether (in Wei) to send
1764
- * @return bool which represents a success
1765
- */
1766
- function externalTokenTransferFrom(
1767
- IERC20 _externalToken,
1768
- address _from,
1769
- address _to,
1770
- uint256 _value,
1771
- Avatar _avatar
1772
- )
1773
- external
1774
- onlyRegisteredScheme
1775
- onlySubjectToConstraint("externalTokenTransferFrom")
1776
- isAvatarValid(address(_avatar))
1777
- returns (bool)
1778
- {
1779
- return avatar.externalTokenTransferFrom(_externalToken, _from, _to, _value);
1780
- }
1781
-
1782
- /**
1783
- * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
1784
- * on behalf of msg.sender.
1785
- * @param _externalToken the address of the Token Contract
1786
- * @param _spender address
1787
- * @param _value the amount of ether (in Wei) which the approval is referring to.
1788
- * @return bool which represents a success
1789
- */
1790
- function externalTokenApproval(
1791
- IERC20 _externalToken,
1792
- address _spender,
1793
- uint256 _value,
1794
- Avatar _avatar
1795
- )
1796
- external
1797
- onlyRegisteredScheme
1798
- onlySubjectToConstraint("externalTokenIncreaseApproval")
1799
- isAvatarValid(address(_avatar))
1800
- returns (bool)
1801
- {
1802
- return avatar.externalTokenApproval(_externalToken, _spender, _value);
1803
- }
1804
-
1805
- /**
1806
- * @dev metaData emits an event with a string, should contain the hash of some meta data.
1807
- * @param _metaData a string representing a hash of the meta data
1808
- * @param _avatar Avatar
1809
- * @return bool which represents a success
1810
- */
1811
- function metaData(
1812
- string calldata _metaData,
1813
- Avatar _avatar
1814
- ) external onlyMetaDataScheme isAvatarValid(address(_avatar)) returns (bool) {
1815
- return avatar.metaData(_metaData);
1816
- }
1817
-
1818
- /**
1819
- * @dev getNativeReputation
1820
- * @param _avatar the organization avatar.
1821
- * @return organization native reputation
1822
- */
1823
- function getNativeReputation(
1824
- address _avatar
1825
- ) external view isAvatarValid(_avatar) returns (address) {
1826
- return address(nativeReputation);
1827
- }
1828
-
1829
- function isSchemeRegistered(
1830
- address _scheme,
1831
- address _avatar
1832
- ) external view isAvatarValid(_avatar) returns (bool) {
1833
- return _isSchemeRegistered(_scheme);
1834
- }
1835
-
1836
- function getSchemeParameters(
1837
- address _scheme,
1838
- address _avatar
1839
- ) external view isAvatarValid(_avatar) returns (bytes32) {
1840
- return schemes[_scheme].paramsHash;
1841
- }
1842
-
1843
- function getSchemePermissions(
1844
- address _scheme,
1845
- address _avatar
1846
- ) external view isAvatarValid(_avatar) returns (bytes4) {
1847
- return schemes[_scheme].permissions;
1848
- }
1849
-
1850
- function getGlobalConstraintParameters(
1851
- address _globalConstraint,
1852
- address
1853
- ) external view returns (bytes32) {
1854
- GlobalConstraintRegister memory register = globalConstraintsRegisterPre[
1855
- _globalConstraint
1856
- ];
1857
-
1858
- if (register.isRegistered) {
1859
- return globalConstraintsPre[register.index].params;
1860
- }
1861
-
1862
- register = globalConstraintsRegisterPost[_globalConstraint];
1863
-
1864
- if (register.isRegistered) {
1865
- return globalConstraintsPost[register.index].params;
1866
- }
1867
- }
1868
-
1869
- /**
1870
- * @dev globalConstraintsCount return the global constraint pre and post count
1871
- * @return uint256 globalConstraintsPre count.
1872
- * @return uint256 globalConstraintsPost count.
1873
- */
1874
- function globalConstraintsCount(
1875
- address _avatar
1876
- ) external view isAvatarValid(_avatar) returns (uint, uint) {
1877
- return (globalConstraintsPre.length, globalConstraintsPost.length);
1878
- }
1879
-
1880
- function isGlobalConstraintRegistered(
1881
- address _globalConstraint,
1882
- address _avatar
1883
- ) external view isAvatarValid(_avatar) returns (bool) {
1884
- return (globalConstraintsRegisterPre[_globalConstraint].isRegistered ||
1885
- globalConstraintsRegisterPost[_globalConstraint].isRegistered);
1886
- }
1887
-
1888
- function _isSchemeRegistered(address _scheme) private view returns (bool) {
1889
- return (schemes[_scheme].permissions & bytes4(0x00000001) != bytes4(0));
1890
- }
1891
- }