@gooddollar/goodprotocol 2.2.0-beta.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) 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 -1
  6. package/artifacts/abis/InvitesV2.min.json +1 -1
  7. package/artifacts/abis/UpdateReserveRatio.min.json +1 -0
  8. package/artifacts/abis/Voters.min.json +1 -0
  9. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  10. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  11. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  12. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  13. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  14. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  15. package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
  16. package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  38. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  39. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  40. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  41. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  42. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
  43. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.json +69 -0
  44. package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
  45. package/artifacts/contracts/MentoInterfaces.sol/IBroker.json +131 -4
  46. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
  47. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
  48. package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
  49. package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
  50. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  51. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
  52. package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.dbg.json +4 -0
  53. package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.json +42 -0
  54. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  55. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  56. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
  57. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  58. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  59. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  60. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  61. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  62. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  63. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  64. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  65. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  66. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  67. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  68. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  69. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
  70. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +40 -2
  71. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +1 -1
  72. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +15 -2
  73. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  74. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  75. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  76. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +59 -2
  77. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.json +2 -2
  95. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.json +2 -2
  97. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  102. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  103. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  105. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  107. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  109. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  110. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  111. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  113. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  115. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  116. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  117. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  118. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  119. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  120. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  121. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  122. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  123. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  124. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  125. package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
  126. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  127. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  128. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
  129. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.json +2 -2
  130. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  131. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  132. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  133. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  134. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  135. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  136. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  137. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  138. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  139. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  140. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  141. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  142. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  143. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  144. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  145. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  146. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  147. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  148. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  149. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  150. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  151. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  152. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  153. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  154. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  155. package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
  156. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  157. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  158. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  159. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  160. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  161. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  162. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  163. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  164. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  165. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  166. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  167. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  168. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  169. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  170. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  171. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  172. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
  173. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  174. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  175. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  176. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  177. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
  178. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  179. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
  180. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.json +2 -2
  181. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  182. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  183. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  184. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  185. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  186. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  187. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  188. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
  189. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
  190. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
  191. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
  192. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
  193. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
  194. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  195. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  196. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  197. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  198. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  199. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  200. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
  201. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  202. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  203. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  204. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  205. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  206. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
  207. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
  208. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.json +2 -2
  209. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  210. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  211. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  212. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  213. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  214. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  215. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  216. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  217. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
  218. package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.dbg.json +4 -0
  219. package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.json +77 -0
  220. package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.dbg.json +4 -0
  221. package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.json +24 -0
  222. package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.dbg.json +4 -0
  223. package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.json +60 -0
  224. package/contracts/MentoInterfaces.sol +247 -203
  225. package/contracts/fuseFaucet/Faucet.sol +15 -2
  226. package/contracts/identity/IdentityV3.sol +5 -0
  227. package/contracts/identity/IdentityV4.sol +25 -3
  228. package/contracts/invite/InvitesV2.sol +30 -10
  229. package/contracts/reserve/GenericDistributionHelper.sol +35 -7
  230. package/contracts/ubi/UBISchemeV2.sol +8 -1
  231. package/contracts/utils/UpdateReserveRatio.sol +121 -0
  232. package/hardhat.config.ts +2 -2
  233. package/package.json +1 -3
  234. package/releases/deploy-settings.json +3 -0
  235. package/releases/deployment.json +29 -17
  236. package/test/helpers.ts +4 -1
  237. package/test/identity/IdentityV4.test.ts +16 -6
  238. package/test/invite/InvitesV2.test.ts +50 -5
  239. package/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -1
  240. package/types/contracts/MentoInterfaces.sol/IBancorExchangeProvider.ts +54 -0
  241. package/types/contracts/MentoInterfaces.sol/IBroker.ts +99 -7
  242. package/types/contracts/fuseFaucet/{Faucet.ts → Faucet.sol/Faucet.ts} +1 -1
  243. package/types/contracts/{utils/UpdateReserveRatioAfterXDC.sol/MentoExchange.ts → fuseFaucet/Faucet.sol/Voters.ts} +34 -12
  244. package/types/contracts/fuseFaucet/{Faucet copy.sol/index.ts → Faucet.sol/index.ts} +2 -1
  245. package/types/contracts/fuseFaucet/index.ts +2 -1
  246. package/types/contracts/identity/IdentityV3.ts +46 -0
  247. package/types/contracts/identity/IdentityV4.ts +22 -0
  248. package/types/contracts/invite/InvitesV2.ts +106 -0
  249. package/types/contracts/utils/{ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.ts → UpdateReserveRatio.sol/CreateReserveExchange.ts} +10 -32
  250. package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +1 -0
  251. package/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -1
  252. package/types/factories/contracts/MentoInterfaces.sol/IBancorExchangeProvider__factory.ts +69 -0
  253. package/types/factories/contracts/MentoInterfaces.sol/IBroker__factory.ts +131 -4
  254. package/types/factories/contracts/fuseFaucet/Faucet.sol/Faucet__factory.ts +914 -0
  255. package/types/factories/contracts/fuseFaucet/Faucet.sol/Voters__factory.ts +54 -0
  256. package/types/factories/contracts/fuseFaucet/Faucet.sol/index.ts +5 -0
  257. package/types/factories/contracts/fuseFaucet/index.ts +1 -1
  258. package/types/factories/contracts/identity/IdentityV3__factory.ts +39 -1
  259. package/types/factories/contracts/identity/IdentityV4__factory.ts +14 -1
  260. package/types/factories/contracts/invite/InvitesV2__factory.ts +58 -1
  261. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper__factory.ts +1 -1
  262. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest__factory.ts +1 -1
  263. package/types/factories/contracts/reserve/GenericDistributionHelper__factory.ts +1 -1
  264. package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
  265. package/types/factories/contracts/utils/BuyFromReserveHelper__factory.ts +1 -1
  266. package/types/factories/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +1 -1
  267. package/types/factories/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange__factory.ts +137 -0
  268. package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +1 -1
  269. package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +1 -0
  270. package/types/hardhat.d.ts +18 -9
  271. package/types/index.ts +8 -4
  272. package/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +0 -108
  273. package/types/contracts/IQuoter.sol/IQuoterV2.ts +0 -297
  274. package/types/contracts/IQuoter.sol/index.ts +0 -4
  275. package/types/contracts/IUniswapV3.sol/IUniswapV3Factory.ts +0 -155
  276. package/types/contracts/Interfaces.sol/AToken.ts +0 -81
  277. package/types/contracts/Interfaces.sol/IAaveIncentivesControllerV3.ts +0 -156
  278. package/types/contracts/Interfaces.sol/ILendingPoolV3.ts +0 -254
  279. package/types/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet.ts +0 -1439
  280. package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor.ts +0 -648
  281. package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable.ts +0 -843
  282. package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +0 -4
  283. package/types/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper.ts +0 -1252
  284. package/types/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper.ts +0 -1357
  285. package/types/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper.ts +0 -1247
  286. package/types/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
  287. package/types/contracts/reserve/GoodReserveADai.ts +0 -2212
  288. package/types/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2.ts +0 -1808
  289. package/types/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
  290. package/types/contracts/token/GoodDollar18.ts +0 -1871
  291. package/types/contracts/utils/BuyGDClone.sol/BuyGDCloneV2.ts +0 -464
  292. package/types/contracts/utils/BuyGDClone.sol/IQuoterV2.ts +0 -184
  293. package/types/contracts/utils/BuyGDClone.sol/ISwapRouter.ts +0 -306
  294. package/types/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677.ts +0 -108
  295. package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange.ts +0 -81
  296. package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +0 -5
  297. package/types/contracts/utils/ReserveRestore.sol/MentoExchange.ts +0 -81
  298. package/types/contracts/utils/ReserveRestore.sol/ReserveRestore.ts +0 -112
  299. package/types/contracts/utils/ReserveRestore.sol/index.ts +0 -5
  300. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +0 -122
  301. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
  302. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange.ts +0 -81
  303. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC.ts +0 -122
  304. package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
  305. package/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +0 -146
  306. package/types/factories/contracts/IQuoter.sol/IQuoterV2__factory.ts +0 -226
  307. package/types/factories/contracts/IQuoter.sol/index.ts +0 -4
  308. package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Factory__factory.ts +0 -84
  309. package/types/factories/contracts/Interfaces.sol/AToken__factory.ts +0 -36
  310. package/types/factories/contracts/Interfaces.sol/IAaveIncentivesControllerV3__factory.ts +0 -88
  311. package/types/factories/contracts/Interfaces.sol/ILendingPoolV3__factory.ts +0 -186
  312. package/types/factories/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet__factory.ts +0 -945
  313. package/types/factories/contracts/fuseFaucet/Faucet copy.sol/index.ts +0 -4
  314. package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +0 -914
  315. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable__factory.ts +0 -572
  316. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor__factory.ts +0 -482
  317. package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +0 -4
  318. package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +0 -929
  319. package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper__factory.ts +0 -1017
  320. package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper__factory.ts +0 -935
  321. package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
  322. package/types/factories/contracts/reserve/GoodReserveADai__factory.ts +0 -1502
  323. package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2__factory.ts +0 -1240
  324. package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
  325. package/types/factories/contracts/token/GoodDollar18__factory.ts +0 -1257
  326. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneV2__factory.ts +0 -415
  327. package/types/factories/contracts/utils/BuyGDClone.sol/IQuoterV2__factory.ts +0 -126
  328. package/types/factories/contracts/utils/BuyGDClone.sol/ISwapRouter__factory.ts +0 -220
  329. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677__factory.ts +0 -86
  330. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange__factory.ts +0 -39
  331. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +0 -152
  332. package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +0 -5
  333. package/types/factories/contracts/utils/ReserveRestore.sol/MentoExchange__factory.ts +0 -39
  334. package/types/factories/contracts/utils/ReserveRestore.sol/ReserveRestore__factory.ts +0 -95
  335. package/types/factories/contracts/utils/ReserveRestore.sol/index.ts +0 -5
  336. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange__factory.ts +0 -39
  337. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -104
  338. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
  339. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange__factory.ts +0 -39
  340. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -115
  341. package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
@@ -218,6 +218,8 @@ interface IBancorExchangeProvider {
218
218
 
219
219
  /* ------- Functions ------- */
220
220
 
221
+ function AVATAR() external view returns (address);
222
+
221
223
  /**
222
224
  * @notice Retrieves the pool with the specified exchangeId.
223
225
  * @param exchangeId The id of the pool to be retrieved.
@@ -245,6 +247,11 @@ interface IBancorExchangeProvider {
245
247
  PoolExchange calldata exchange
246
248
  ) external returns (bytes32 exchangeId);
247
249
 
250
+ function updateExchange(
251
+ bytes32 exchangeId,
252
+ PoolExchange calldata exchange
253
+ ) external returns (bool updated);
254
+
248
255
  /**
249
256
  * @notice Delete a PoolExchange.
250
257
  * @param exchangeId The PoolExchange to be created.
@@ -533,39 +540,41 @@ interface IGoodDollarExchangeProvider {
533
540
  */
534
541
 
535
542
  interface ITradingLimits {
536
- /**
537
- * @dev The State struct contains the current state of a trading limit config.
538
- * @param lastUpdated0 The timestamp of the last reset of netflow0.
539
- * @param lastUpdated1 The timestamp of the last reset of netflow1.
540
- * @param netflow0 The current netflow of the asset for limit0.
541
- * @param netflow1 The current netflow of the asset for limit1.
542
- * @param netflowGlobal The current netflow of the asset for limitGlobal.
543
- */
544
- struct State {
545
- uint32 lastUpdated0;
546
- uint32 lastUpdated1;
547
- int48 netflow0;
548
- int48 netflow1;
549
- int48 netflowGlobal;
550
- }
551
-
552
- /**
553
- * @dev The Config struct contains the configuration of trading limits.
554
- * @param timestep0 The time window in seconds for limit0.
555
- * @param timestep1 The time window in seconds for limit1.
556
- * @param limit0 The limit0 for the asset.
557
- * @param limit1 The limit1 for the asset.
558
- * @param limitGlobal The global limit for the asset.
559
- * @param flags A bitfield of flags to enable/disable the individual limits.
560
- */
561
- struct Config {
562
- uint32 timestep0;
563
- uint32 timestep1;
564
- int48 limit0;
565
- int48 limit1;
566
- int48 limitGlobal;
567
- uint8 flags;
568
- }
543
+ /**
544
+ * @dev The State struct contains the current state of a trading limit config.
545
+ * @param lastUpdated0 The timestamp of the last reset of netflow0.
546
+ * @param lastUpdated1 The timestamp of the last reset of netflow1.
547
+ * @param netflow0 The current netflow of the asset for limit0.
548
+ * @param netflow1 The current netflow of the asset for limit1.
549
+ * @param netflowGlobal The current netflow of the asset for limitGlobal.
550
+ */
551
+ struct State {
552
+ uint32 lastUpdated0;
553
+ uint32 lastUpdated1;
554
+ int48 netflow0;
555
+ int48 netflow1;
556
+ int48 netflowGlobal;
557
+ }
558
+
559
+ /**
560
+ * @dev The Config struct contains the configuration of trading limits.
561
+ * @param timestep0 The time window in seconds for limit0.
562
+ * @param timestep1 The time window in seconds for limit1.
563
+ * @param limit0 The limit0 for the asset.
564
+ * @param limit1 The limit1 for the asset.
565
+ * @param limitGlobal The global limit for the asset.
566
+ * @param flags A bitfield of flags to enable/disable the individual limits.
567
+ */
568
+ struct Config {
569
+ uint32 timestep0;
570
+ uint32 timestep1;
571
+ int48 limit0In;
572
+ int48 limit0Out;
573
+ int48 limit1In;
574
+ int48 limit1Out;
575
+ int48 limitGlobal;
576
+ uint8 flags;
577
+ }
569
578
  }
570
579
 
571
580
  /*
@@ -573,174 +582,209 @@ interface ITradingLimits {
573
582
  * @notice The broker is responsible for executing swaps and keeping track of trading limits.
574
583
  */
575
584
  interface IBroker {
576
- /**
577
- * @notice Emitted when a swap occurs.
578
- * @param exchangeProvider The exchange provider used.
579
- * @param exchangeId The id of the exchange used.
580
- * @param trader The user that initiated the swap.
581
- * @param tokenIn The address of the token that was sold.
582
- * @param tokenOut The address of the token that was bought.
583
- * @param amountIn The amount of token sold.
584
- * @param amountOut The amount of token bought.
585
- */
586
- event Swap(
587
- address exchangeProvider,
588
- bytes32 indexed exchangeId,
589
- address indexed trader,
590
- address indexed tokenIn,
591
- address tokenOut,
592
- uint256 amountIn,
593
- uint256 amountOut
594
- );
595
-
596
- /**
597
- * @notice Emitted when a new trading limit is configured.
598
- * @param exchangeId the exchangeId to target.
599
- * @param token the token to target.
600
- * @param config the new trading limits config.
601
- */
602
- event TradingLimitConfigured(bytes32 exchangeId, address token, ITradingLimits.Config config);
603
-
604
- /**
605
- * @notice Allows the contract to be upgradable via the proxy.
606
- * @param _exchangeProviders The addresses of the ExchangeProvider contracts.
607
- * @param _reserves The address of the Reserve contract.
608
- */
609
- function initialize(address[] calldata _exchangeProviders, address[] calldata _reserves) external;
610
-
611
- /**
612
- * @notice Set the reserves for the exchange providers.
613
- * @param _exchangeProviders The addresses of the ExchangeProvider contracts.
614
- * @param _reserves The addresses of the Reserve contracts.
615
- */
616
- function setReserves(address[] calldata _exchangeProviders, address[] calldata _reserves) external;
617
-
618
- /**
619
- * @notice Add an exchange provider to the list of providers.
620
- * @param exchangeProvider The address of the exchange provider to add.
621
- * @param reserve The address of the reserve used by the exchange provider.
622
- * @return index The index of the newly added specified exchange provider.
623
- */
624
- function addExchangeProvider(address exchangeProvider, address reserve) external returns (uint256 index);
625
-
626
- /**
627
- * @notice Remove an exchange provider from the list of providers.
628
- * @param exchangeProvider The address of the exchange provider to remove.
629
- * @param index The index of the exchange provider being removed.
630
- */
631
- function removeExchangeProvider(address exchangeProvider, uint256 index) external;
632
-
633
- /**
634
- * @notice Calculate amountIn of tokenIn needed for a given amountOut of tokenOut.
635
- * @param exchangeProvider the address of the exchange provider for the pair.
636
- * @param exchangeId The id of the exchange to use.
637
- * @param tokenIn The token to be sold.
638
- * @param tokenOut The token to be bought.
639
- * @param amountOut The amount of tokenOut to be bought.
640
- * @return amountIn The amount of tokenIn to be sold.
641
- */
642
- function getAmountIn(
643
- address exchangeProvider,
644
- bytes32 exchangeId,
645
- address tokenIn,
646
- address tokenOut,
647
- uint256 amountOut
648
- ) external view returns (uint256 amountIn);
649
-
650
- /**
651
- * @notice Calculate amountOut of tokenOut received for a given amountIn of tokenIn.
652
- * @param exchangeProvider the address of the exchange provider for the pair.
653
- * @param exchangeId The id of the exchange to use.
654
- * @param tokenIn The token to be sold.
655
- * @param tokenOut The token to be bought.
656
- * @param amountIn The amount of tokenIn to be sold.
657
- * @return amountOut The amount of tokenOut to be bought.
658
- */
659
- function getAmountOut(
660
- address exchangeProvider,
661
- bytes32 exchangeId,
662
- address tokenIn,
663
- address tokenOut,
664
- uint256 amountIn
665
- ) external view returns (uint256 amountOut);
666
-
667
- /**
668
- * @notice Execute a token swap with fixed amountIn.
669
- * @param exchangeProvider the address of the exchange provider for the pair.
670
- * @param exchangeId The id of the exchange to use.
671
- * @param tokenIn The token to be sold.
672
- * @param tokenOut The token to be bought.
673
- * @param amountIn The amount of tokenIn to be sold.
674
- * @param amountOutMin Minimum amountOut to be received - controls slippage.
675
- * @return amountOut The amount of tokenOut to be bought.
676
- */
677
- function swapIn(
678
- address exchangeProvider,
679
- bytes32 exchangeId,
680
- address tokenIn,
681
- address tokenOut,
682
- uint256 amountIn,
683
- uint256 amountOutMin
684
- ) external returns (uint256 amountOut);
685
-
686
- /**
687
- * @notice Execute a token swap with fixed amountOut.
688
- * @param exchangeProvider the address of the exchange provider for the pair.
689
- * @param exchangeId The id of the exchange to use.
690
- * @param tokenIn The token to be sold.
691
- * @param tokenOut The token to be bought.
692
- * @param amountOut The amount of tokenOut to be bought.
693
- * @param amountInMax Maximum amount of tokenIn that can be traded.
694
- * @return amountIn The amount of tokenIn to be sold.
695
- */
696
- function swapOut(
697
- address exchangeProvider,
698
- bytes32 exchangeId,
699
- address tokenIn,
700
- address tokenOut,
701
- uint256 amountOut,
702
- uint256 amountInMax
703
- ) external returns (uint256 amountIn);
704
-
705
- /**
706
- * @notice Permissionless way to burn stables from msg.sender directly.
707
- * @param token The token getting burned.
708
- * @param amount The amount of the token getting burned.
709
- * @return True if transaction succeeds.
710
- */
711
- function burnStableTokens(address token, uint256 amount) external returns (bool);
712
-
713
- /**
714
- * @notice Configure trading limits for an (exchangeId, token) tuple.
715
- * @dev Will revert if the configuration is not valid according to the TradingLimits library.
716
- * Resets existing state according to the TradingLimits library logic.
717
- * Can only be called by owner.
718
- * @param exchangeId the exchangeId to target.
719
- * @param token the token to target.
720
- * @param config the new trading limits config.
721
- */
722
- function configureTradingLimit(bytes32 exchangeId, address token, ITradingLimits.Config calldata config) external;
723
-
724
- /**
725
- * @notice Get the list of registered exchange providers.
726
- * @dev This can be used by UI or clients to discover all pairs.
727
- * @return exchangeProviders the addresses of all exchange providers.
728
- */
729
- function getExchangeProviders() external view returns (address[] memory);
730
-
731
- /**
732
- * @notice Get the address of the exchange provider at a given index.
733
- * @dev Auto-generated getter for the exchangeProviders array.
734
- * @param index The index of the exchange provider.
735
- * @return exchangeProvider The address of the exchange provider.
736
- */
737
- function exchangeProviders(uint256 index) external view returns (address exchangeProvider);
738
-
739
- /**
740
- * @notice Check if a given address is an exchange provider.
741
- * @dev Auto-generated getter for the isExchangeProvider mapping.
742
- * @param exchangeProvider The address to check.
743
- * @return isExchangeProvider True if the address is an exchange provider, false otherwise.
744
- */
745
- function isExchangeProvider(address exchangeProvider) external view returns (bool);
585
+ /**
586
+ * @notice Emitted when a swap occurs.
587
+ * @param exchangeProvider The exchange provider used.
588
+ * @param exchangeId The id of the exchange used.
589
+ * @param trader The user that initiated the swap.
590
+ * @param tokenIn The address of the token that was sold.
591
+ * @param tokenOut The address of the token that was bought.
592
+ * @param amountIn The amount of token sold.
593
+ * @param amountOut The amount of token bought.
594
+ */
595
+ event Swap(
596
+ address exchangeProvider,
597
+ bytes32 indexed exchangeId,
598
+ address indexed trader,
599
+ address indexed tokenIn,
600
+ address tokenOut,
601
+ uint256 amountIn,
602
+ uint256 amountOut
603
+ );
604
+
605
+ /**
606
+ * @notice Emitted when a new trading limit is configured.
607
+ * @param exchangeId the exchangeId to target.
608
+ * @param token the token to target.
609
+ * @param config the new trading limits config.
610
+ */
611
+ event TradingLimitConfigured(
612
+ bytes32 exchangeId,
613
+ address token,
614
+ ITradingLimits.Config config
615
+ );
616
+
617
+ /**
618
+ * @notice Allows the contract to be upgradable via the proxy.
619
+ * @param _exchangeProviders The addresses of the ExchangeProvider contracts.
620
+ * @param _reserves The address of the Reserve contract.
621
+ */
622
+ function initialize(
623
+ address[] calldata _exchangeProviders,
624
+ address[] calldata _reserves
625
+ ) external;
626
+
627
+ /**
628
+ * @notice Set the reserves for the exchange providers.
629
+ * @param _exchangeProviders The addresses of the ExchangeProvider contracts.
630
+ * @param _reserves The addresses of the Reserve contracts.
631
+ */
632
+ function setReserves(
633
+ address[] calldata _exchangeProviders,
634
+ address[] calldata _reserves
635
+ ) external;
636
+
637
+ /**
638
+ * @notice Add an exchange provider to the list of providers.
639
+ * @param exchangeProvider The address of the exchange provider to add.
640
+ * @param reserve The address of the reserve used by the exchange provider.
641
+ * @return index The index of the newly added specified exchange provider.
642
+ */
643
+ function addExchangeProvider(
644
+ address exchangeProvider,
645
+ address reserve
646
+ ) external returns (uint256 index);
647
+
648
+ /**
649
+ * @notice Remove an exchange provider from the list of providers.
650
+ * @param exchangeProvider The address of the exchange provider to remove.
651
+ * @param index The index of the exchange provider being removed.
652
+ */
653
+ function removeExchangeProvider(
654
+ address exchangeProvider,
655
+ uint256 index
656
+ ) external;
657
+
658
+ /**
659
+ * @notice Calculate amountIn of tokenIn needed for a given amountOut of tokenOut.
660
+ * @param exchangeProvider the address of the exchange provider for the pair.
661
+ * @param exchangeId The id of the exchange to use.
662
+ * @param tokenIn The token to be sold.
663
+ * @param tokenOut The token to be bought.
664
+ * @param amountOut The amount of tokenOut to be bought.
665
+ * @return amountIn The amount of tokenIn to be sold.
666
+ */
667
+ function getAmountIn(
668
+ address exchangeProvider,
669
+ bytes32 exchangeId,
670
+ address tokenIn,
671
+ address tokenOut,
672
+ uint256 amountOut
673
+ ) external view returns (uint256 amountIn);
674
+
675
+ /**
676
+ * @notice Calculate amountOut of tokenOut received for a given amountIn of tokenIn.
677
+ * @param exchangeProvider the address of the exchange provider for the pair.
678
+ * @param exchangeId The id of the exchange to use.
679
+ * @param tokenIn The token to be sold.
680
+ * @param tokenOut The token to be bought.
681
+ * @param amountIn The amount of tokenIn to be sold.
682
+ * @return amountOut The amount of tokenOut to be bought.
683
+ */
684
+ function getAmountOut(
685
+ address exchangeProvider,
686
+ bytes32 exchangeId,
687
+ address tokenIn,
688
+ address tokenOut,
689
+ uint256 amountIn
690
+ ) external view returns (uint256 amountOut);
691
+
692
+ /**
693
+ * @notice Execute a token swap with fixed amountIn.
694
+ * @param exchangeProvider the address of the exchange provider for the pair.
695
+ * @param exchangeId The id of the exchange to use.
696
+ * @param tokenIn The token to be sold.
697
+ * @param tokenOut The token to be bought.
698
+ * @param amountIn The amount of tokenIn to be sold.
699
+ * @param amountOutMin Minimum amountOut to be received - controls slippage.
700
+ * @return amountOut The amount of tokenOut to be bought.
701
+ */
702
+ function swapIn(
703
+ address exchangeProvider,
704
+ bytes32 exchangeId,
705
+ address tokenIn,
706
+ address tokenOut,
707
+ uint256 amountIn,
708
+ uint256 amountOutMin
709
+ ) external returns (uint256 amountOut);
710
+
711
+ /**
712
+ * @notice Execute a token swap with fixed amountOut.
713
+ * @param exchangeProvider the address of the exchange provider for the pair.
714
+ * @param exchangeId The id of the exchange to use.
715
+ * @param tokenIn The token to be sold.
716
+ * @param tokenOut The token to be bought.
717
+ * @param amountOut The amount of tokenOut to be bought.
718
+ * @param amountInMax Maximum amount of tokenIn that can be traded.
719
+ * @return amountIn The amount of tokenIn to be sold.
720
+ */
721
+ function swapOut(
722
+ address exchangeProvider,
723
+ bytes32 exchangeId,
724
+ address tokenIn,
725
+ address tokenOut,
726
+ uint256 amountOut,
727
+ uint256 amountInMax
728
+ ) external returns (uint256 amountIn);
729
+
730
+ /**
731
+ * @notice Permissionless way to burn stables from msg.sender directly.
732
+ * @param token The token getting burned.
733
+ * @param amount The amount of the token getting burned.
734
+ * @return True if transaction succeeds.
735
+ */
736
+ function burnStableTokens(
737
+ address token,
738
+ uint256 amount
739
+ ) external returns (bool);
740
+
741
+ /**
742
+ * @notice Configure trading limits for an (exchangeId, token) tuple.
743
+ * @dev Will revert if the configuration is not valid according to the TradingLimits library.
744
+ * Resets existing state according to the TradingLimits library logic.
745
+ * Can only be called by owner.
746
+ * @param exchangeId the exchangeId to target.
747
+ * @param token the token to target.
748
+ * @param config the new trading limits config.
749
+ */
750
+ function configureTradingLimit(
751
+ bytes32 exchangeId,
752
+ address token,
753
+ ITradingLimits.Config calldata config
754
+ ) external;
755
+
756
+ /**
757
+ * @notice Get the list of registered exchange providers.
758
+ * @dev This can be used by UI or clients to discover all pairs.
759
+ * @return exchangeProviders the addresses of all exchange providers.
760
+ */
761
+ function getExchangeProviders() external view returns (address[] memory);
762
+
763
+ /**
764
+ * @notice Get the address of the exchange provider at a given index.
765
+ * @dev Auto-generated getter for the exchangeProviders array.
766
+ * @param index The index of the exchange provider.
767
+ * @return exchangeProvider The address of the exchange provider.
768
+ */
769
+ function exchangeProviders(
770
+ uint256 index
771
+ ) external view returns (address exchangeProvider);
772
+
773
+ /**
774
+ * @notice Check if a given address is an exchange provider.
775
+ * @dev Auto-generated getter for the isExchangeProvider mapping.
776
+ * @param exchangeProvider The address to check.
777
+ * @return isExchangeProvider True if the address is an exchange provider, false otherwise.
778
+ */
779
+ function isExchangeProvider(
780
+ address exchangeProvider
781
+ ) external view returns (bool);
782
+
783
+ function tradingLimitsState(
784
+ bytes32 eid
785
+ ) external view returns (ITradingLimits.State memory);
786
+
787
+ function tradingLimitsConfig(
788
+ bytes32 eid
789
+ ) external view returns (ITradingLimits.Config memory);
746
790
  }
@@ -8,6 +8,17 @@ import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"
8
8
  import "../Interfaces.sol";
9
9
  import "../utils/NameService.sol";
10
10
 
11
+ /// Voters interface + structs
12
+ interface Voters {
13
+ /// @notice The voter structure
14
+ struct Voter {
15
+ address account;
16
+ uint96 votingPower;
17
+ }
18
+
19
+ function voters(address _account) external view returns (Voter memory);
20
+ }
21
+
11
22
  /**
12
23
  * @title FuseFaucet contract that can top up users wallets
13
24
  */
@@ -241,8 +252,10 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
241
252
 
242
253
  // Check voting balance if contract is set
243
254
  if (votingContract != address(0)) {
244
- try ERC20(votingContract).balanceOf(_user) returns (uint256 balance) {
245
- if (balance > 0) {
255
+ try Voters(votingContract).voters(_user) returns (
256
+ Voters.Voter memory voter
257
+ ) {
258
+ if (voter.votingPower > 0) {
246
259
  return baseAmount * 2; // Double amount for voters
247
260
  }
248
261
  } catch {
@@ -58,6 +58,9 @@ contract IdentityV3 is
58
58
  event ContractAdded(address indexed account);
59
59
  event ContractRemoved(address indexed account);
60
60
 
61
+ event AccountConnected(address indexed connected, address indexed to);
62
+ event AccountDisconnected(address indexed disconnected, address indexed from);
63
+
61
64
  function initialize(
62
65
  address _owner,
63
66
  IIdentity _oldIdentity
@@ -419,6 +422,7 @@ contract IdentityV3 is
419
422
  require(connectedAccounts[account] == address(0x0), "already connected");
420
423
 
421
424
  connectedAccounts[account] = msg.sender;
425
+ emit AccountConnected(account, msg.sender);
422
426
  }
423
427
 
424
428
  /**
@@ -431,6 +435,7 @@ contract IdentityV3 is
431
435
  "unauthorized"
432
436
  );
433
437
  delete connectedAccounts[connected];
438
+ emit AccountDisconnected(connected, msg.sender);
434
439
  }
435
440
 
436
441
  /**
@@ -84,6 +84,13 @@ contract IdentityV4 is
84
84
  reverifyDaysOptions.push(180);
85
85
  }
86
86
 
87
+ /**
88
+ * @dev Returns the longest time (in days) that can pass before an authentication needs to be renewed for `account`
89
+ */
90
+ function authenticationPeriod() external view returns (uint256) {
91
+ return reverifyDaysOptions[reverifyDaysOptions.length - 1];
92
+ }
93
+
87
94
  /**
88
95
  * @dev used to initialize after deployment once nameservice is available
89
96
  */
@@ -111,6 +118,10 @@ contract IdentityV4 is
111
118
  // replace storage array
112
119
  delete reverifyDaysOptions;
113
120
  for (uint256 i = 0; i < options.length; i++) {
121
+ require(
122
+ i == 0 || options[i] > options[i - 1],
123
+ "options not in ascending order"
124
+ );
114
125
  reverifyDaysOptions.push(options[i]);
115
126
  }
116
127
  }
@@ -137,9 +148,15 @@ contract IdentityV4 is
137
148
  uint256 timestamp
138
149
  ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
139
150
  require(identities[account].status == 1, "not whitelisted");
151
+
140
152
  uint daysSinceAuthentication = (timestamp -
141
153
  identities[account].dateAuthenticated) / 1 days;
142
154
 
155
+ // temp exclusion post upgrade for previously authenticted users to start with authcount at last step
156
+ // can be removed in the future
157
+ if (identities[account].dateAuthenticated < 1772697574) {
158
+ identities[account].authCount = uint32(reverifyDaysOptions.length - 1);
159
+ }
143
160
  // should happen before updating dateAuthenticated
144
161
  if (shouldReverify(account, daysSinceAuthentication)) {
145
162
  identities[account].authCount += 1;
@@ -219,9 +236,14 @@ contract IdentityV4 is
219
236
  address account,
220
237
  uint daysSinceAuth
221
238
  ) public view returns (bool) {
222
- if (identities[account].authCount >= reverifyDaysOptions.length)
223
- return false;
224
- uint reverifyAfterDays = reverifyDaysOptions[identities[account].authCount];
239
+ uint32 authCount = identities[account].authCount;
240
+
241
+ // temp exclusion post upgrade for previously authenticted users to start with authcount at last step
242
+ // can be removed in the future
243
+ if (identities[account].dateAuthenticated < 1772697574) {
244
+ authCount = uint32(reverifyDaysOptions.length - 1);
245
+ }
246
+ uint reverifyAfterDays = reverifyDaysOptions[authCount];
225
247
  if (daysSinceAuth >= reverifyAfterDays) return true;
226
248
 
227
249
  return false;