@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.
- package/artifacts/abis/CreateReserveExchange.min.json +1 -0
- package/artifacts/abis/IBancorExchangeProvider.min.json +1 -1
- package/artifacts/abis/IBroker.min.json +1 -1
- package/artifacts/abis/IdentityV3.min.json +1 -1
- package/artifacts/abis/IdentityV4.min.json +1 -1
- package/artifacts/abis/InvitesV2.min.json +1 -1
- package/artifacts/abis/UpdateReserveRatio.min.json +1 -0
- package/artifacts/abis/Voters.min.json +1 -0
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.json +69 -0
- package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBroker.json +131 -4
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.dbg.json +4 -0
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Voters.json +42 -0
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +40 -2
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +15 -2
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +59 -2
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.json +2 -2
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.json +2 -2
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.json +2 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.dbg.json +4 -0
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange.json +77 -0
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.dbg.json +4 -0
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/MentoExchange.json +24 -0
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.dbg.json +4 -0
- package/artifacts/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.json +60 -0
- package/contracts/MentoInterfaces.sol +247 -203
- package/contracts/fuseFaucet/Faucet.sol +15 -2
- package/contracts/identity/IdentityV3.sol +5 -0
- package/contracts/identity/IdentityV4.sol +25 -3
- package/contracts/invite/InvitesV2.sol +30 -10
- package/contracts/reserve/GenericDistributionHelper.sol +35 -7
- package/contracts/ubi/UBISchemeV2.sol +8 -1
- package/contracts/utils/UpdateReserveRatio.sol +121 -0
- package/hardhat.config.ts +2 -2
- package/package.json +1 -3
- package/releases/deploy-settings.json +3 -0
- package/releases/deployment.json +29 -17
- package/test/helpers.ts +4 -1
- package/test/identity/IdentityV4.test.ts +16 -6
- package/test/invite/InvitesV2.test.ts +50 -5
- package/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -1
- package/types/contracts/MentoInterfaces.sol/IBancorExchangeProvider.ts +54 -0
- package/types/contracts/MentoInterfaces.sol/IBroker.ts +99 -7
- package/types/contracts/fuseFaucet/{Faucet.ts → Faucet.sol/Faucet.ts} +1 -1
- package/types/contracts/{utils/UpdateReserveRatioAfterXDC.sol/MentoExchange.ts → fuseFaucet/Faucet.sol/Voters.ts} +34 -12
- package/types/contracts/fuseFaucet/{Faucet copy.sol/index.ts → Faucet.sol/index.ts} +2 -1
- package/types/contracts/fuseFaucet/index.ts +2 -1
- package/types/contracts/identity/IdentityV3.ts +46 -0
- package/types/contracts/identity/IdentityV4.ts +22 -0
- package/types/contracts/invite/InvitesV2.ts +106 -0
- package/types/contracts/utils/{ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.ts → UpdateReserveRatio.sol/CreateReserveExchange.ts} +10 -32
- package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +1 -0
- package/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -1
- package/types/factories/contracts/MentoInterfaces.sol/IBancorExchangeProvider__factory.ts +69 -0
- package/types/factories/contracts/MentoInterfaces.sol/IBroker__factory.ts +131 -4
- package/types/factories/contracts/fuseFaucet/Faucet.sol/Faucet__factory.ts +914 -0
- package/types/factories/contracts/fuseFaucet/Faucet.sol/Voters__factory.ts +54 -0
- package/types/factories/contracts/fuseFaucet/Faucet.sol/index.ts +5 -0
- package/types/factories/contracts/fuseFaucet/index.ts +1 -1
- package/types/factories/contracts/identity/IdentityV3__factory.ts +39 -1
- package/types/factories/contracts/identity/IdentityV4__factory.ts +14 -1
- package/types/factories/contracts/invite/InvitesV2__factory.ts +58 -1
- package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper__factory.ts +1 -1
- package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest__factory.ts +1 -1
- package/types/factories/contracts/reserve/GenericDistributionHelper__factory.ts +1 -1
- package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyFromReserveHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +1 -1
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/CreateReserveExchange__factory.ts +137 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +1 -1
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +1 -0
- package/types/hardhat.d.ts +18 -9
- package/types/index.ts +8 -4
- package/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +0 -108
- package/types/contracts/IQuoter.sol/IQuoterV2.ts +0 -297
- package/types/contracts/IQuoter.sol/index.ts +0 -4
- package/types/contracts/IUniswapV3.sol/IUniswapV3Factory.ts +0 -155
- package/types/contracts/Interfaces.sol/AToken.ts +0 -81
- package/types/contracts/Interfaces.sol/IAaveIncentivesControllerV3.ts +0 -156
- package/types/contracts/Interfaces.sol/ILendingPoolV3.ts +0 -254
- package/types/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet.ts +0 -1439
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor.ts +0 -648
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable.ts +0 -843
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +0 -4
- package/types/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper.ts +0 -1252
- package/types/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper.ts +0 -1357
- package/types/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper.ts +0 -1247
- package/types/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
- package/types/contracts/reserve/GoodReserveADai.ts +0 -2212
- package/types/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2.ts +0 -1808
- package/types/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
- package/types/contracts/token/GoodDollar18.ts +0 -1871
- package/types/contracts/utils/BuyGDClone.sol/BuyGDCloneV2.ts +0 -464
- package/types/contracts/utils/BuyGDClone.sol/IQuoterV2.ts +0 -184
- package/types/contracts/utils/BuyGDClone.sol/ISwapRouter.ts +0 -306
- package/types/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677.ts +0 -108
- package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange.ts +0 -81
- package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +0 -5
- package/types/contracts/utils/ReserveRestore.sol/MentoExchange.ts +0 -81
- package/types/contracts/utils/ReserveRestore.sol/ReserveRestore.ts +0 -112
- package/types/contracts/utils/ReserveRestore.sol/index.ts +0 -5
- package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +0 -122
- package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
- package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange.ts +0 -81
- package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC.ts +0 -122
- package/types/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
- package/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +0 -146
- package/types/factories/contracts/IQuoter.sol/IQuoterV2__factory.ts +0 -226
- package/types/factories/contracts/IQuoter.sol/index.ts +0 -4
- package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Factory__factory.ts +0 -84
- package/types/factories/contracts/Interfaces.sol/AToken__factory.ts +0 -36
- package/types/factories/contracts/Interfaces.sol/IAaveIncentivesControllerV3__factory.ts +0 -88
- package/types/factories/contracts/Interfaces.sol/ILendingPoolV3__factory.ts +0 -186
- package/types/factories/contracts/fuseFaucet/Faucet copy.sol/DebugFaucet__factory.ts +0 -945
- package/types/factories/contracts/fuseFaucet/Faucet copy.sol/index.ts +0 -4
- package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +0 -914
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable__factory.ts +0 -572
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor__factory.ts +0 -482
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +0 -4
- package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +0 -929
- package/types/factories/contracts/mocks/GenericDistributionHelperTest.sol/CeloDistributionHelperTestHelper__factory.ts +0 -1017
- package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper__factory.ts +0 -935
- package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +0 -4
- package/types/factories/contracts/reserve/GoodReserveADai__factory.ts +0 -1502
- package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2__factory.ts +0 -1240
- package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +0 -4
- package/types/factories/contracts/token/GoodDollar18__factory.ts +0 -1257
- package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneV2__factory.ts +0 -415
- package/types/factories/contracts/utils/BuyGDClone.sol/IQuoterV2__factory.ts +0 -126
- package/types/factories/contracts/utils/BuyGDClone.sol/ISwapRouter__factory.ts +0 -220
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677__factory.ts +0 -86
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange__factory.ts +0 -39
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +0 -152
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +0 -5
- package/types/factories/contracts/utils/ReserveRestore.sol/MentoExchange__factory.ts +0 -39
- package/types/factories/contracts/utils/ReserveRestore.sol/ReserveRestore__factory.ts +0 -95
- package/types/factories/contracts/utils/ReserveRestore.sol/index.ts +0 -5
- package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/MentoExchange__factory.ts +0 -39
- package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -104
- package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/index.ts +0 -5
- package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/MentoExchange__factory.ts +0 -39
- package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/UpdateReserveRatioAfterXDC__factory.ts +0 -115
- package/types/factories/contracts/utils/UpdateReserveSettingsForXdc.sol/index.ts +0 -5
|
@@ -7,8 +7,9 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
|
|
7
7
|
import "../Interfaces.sol";
|
|
8
8
|
import "../utils/NameService.sol";
|
|
9
9
|
import "../utils/DAOUpgradeableContract.sol";
|
|
10
|
+
import "../ubi/UBISchemeV2.sol";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
import "hardhat/console.sol";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @title InvitesV1 contract that handles invites with pre allocated bounty pool
|
|
@@ -59,6 +60,9 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
59
60
|
|
|
60
61
|
bytes32 private campaignCode;
|
|
61
62
|
|
|
63
|
+
uint8 public minimumClaims; // minimum claims required for invitee to be eligible for bounty
|
|
64
|
+
uint8 public minimumDays; // minimum days since join required for invitee to be eligible for bounty
|
|
65
|
+
|
|
62
66
|
event InviteeJoined(address indexed inviter, address indexed invitee);
|
|
63
67
|
event InviterBounty(
|
|
64
68
|
address indexed inviter,
|
|
@@ -173,8 +177,21 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
173
177
|
|
|
174
178
|
function canCollectBountyFor(address _invitee) public view returns (bool) {
|
|
175
179
|
address invitedBy = users[_invitee].invitedBy;
|
|
180
|
+
bool hasMinClaims = true;
|
|
181
|
+
|
|
182
|
+
try
|
|
183
|
+
UBISchemeV2(nameService.getAddress("UBISCHEME")).totalClaimsPerUser(
|
|
184
|
+
_invitee
|
|
185
|
+
)
|
|
186
|
+
returns (uint256 claims) {
|
|
187
|
+
hasMinClaims = claims >= minimumClaims;
|
|
188
|
+
} catch {
|
|
189
|
+
hasMinClaims = true; // if call fails for any reason we dont want to block bounty collection
|
|
190
|
+
}
|
|
176
191
|
|
|
177
192
|
return
|
|
193
|
+
block.timestamp >= users[_invitee].joinedAt + minimumDays * 1 days && // wait at least 7 day before allowing bounty collection
|
|
194
|
+
hasMinClaims && // invitee needs to have made at least 3 claim
|
|
178
195
|
users[_invitee].bountyAtJoin > 0 &&
|
|
179
196
|
!users[_invitee].bountyPaid &&
|
|
180
197
|
getIdentity().isWhitelisted(_invitee) &&
|
|
@@ -248,14 +265,6 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
248
265
|
uint256 joinedAt = users[_invitee].joinedAt;
|
|
249
266
|
Level memory level = levels[users[invitedBy].level];
|
|
250
267
|
|
|
251
|
-
//hardcoded for users invited before the bountyAtJoin change
|
|
252
|
-
if (bountyToPay == 0) {
|
|
253
|
-
uint precision = 10 ** goodDollar.decimals();
|
|
254
|
-
bountyToPay = joinedAt > 1687878272
|
|
255
|
-
? 1000 * precision
|
|
256
|
-
: 500 * precision;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
268
|
// if inviter level is now higher than when invitee joined or the base level has changed
|
|
260
269
|
// we give level bounty if it is higher otherwise the original bounty at the time the user registered
|
|
261
270
|
|
|
@@ -338,6 +347,12 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
338
347
|
codeToUser[campaignCode] = address(this);
|
|
339
348
|
}
|
|
340
349
|
|
|
350
|
+
/// @notice set minimum claims and days required for invitee to be eligible for reward
|
|
351
|
+
function setMinimums(uint8 _minClaims, uint8 _minDays) public ownerOrAvatar {
|
|
352
|
+
minimumClaims = _minClaims;
|
|
353
|
+
minimumDays = _minDays;
|
|
354
|
+
}
|
|
355
|
+
|
|
341
356
|
function end() public ownerOrAvatar isActive {
|
|
342
357
|
uint256 gdBalance = goodDollar.balanceOf(address(this));
|
|
343
358
|
goodDollar.transfer(msg.sender, gdBalance);
|
|
@@ -345,6 +360,10 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
345
360
|
active = false;
|
|
346
361
|
}
|
|
347
362
|
|
|
363
|
+
function setOwner(address _owner) public ownerOrAvatar {
|
|
364
|
+
owner = _owner;
|
|
365
|
+
}
|
|
366
|
+
|
|
348
367
|
/// @notice helper function to get current chain id
|
|
349
368
|
/// @return chainId id
|
|
350
369
|
function _chainId() internal view returns (uint256 chainId) {
|
|
@@ -363,8 +382,9 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
363
382
|
* 2.1 prevent multichain claims
|
|
364
383
|
* 2.2 record bounty at join time
|
|
365
384
|
* 2.3 support campaignCode
|
|
385
|
+
* 2.4 minimum claims and days requirement for bounty eligibility
|
|
366
386
|
*/
|
|
367
387
|
function version() public pure returns (string memory) {
|
|
368
|
-
return "2.
|
|
388
|
+
return "2.4";
|
|
369
389
|
}
|
|
370
390
|
}
|
|
@@ -298,6 +298,8 @@ contract GenericDistributionHelper is
|
|
|
298
298
|
uint256 amountToSell,
|
|
299
299
|
uint256 minReceived
|
|
300
300
|
) internal returns (uint256 nativeBought) {
|
|
301
|
+
if (amountToSell == 0) return 0;
|
|
302
|
+
|
|
301
303
|
address[] memory gdPools = STATIC_ORACLE.getAllPoolsForPair(
|
|
302
304
|
reserveToken,
|
|
303
305
|
address(nativeToken())
|
|
@@ -306,17 +308,35 @@ contract GenericDistributionHelper is
|
|
|
306
308
|
reserveToken,
|
|
307
309
|
gasToken
|
|
308
310
|
);
|
|
311
|
+
|
|
312
|
+
if (gdPools.length == 0 || gasPools.length == 0) {
|
|
313
|
+
emit BuyNativeFailed("no pools available", amountToSell, minReceived);
|
|
314
|
+
return 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// initialize with first pool and track max liquidity
|
|
309
318
|
uint24 gasFee = IUniswapV3Pool(gasPools[0]).fee();
|
|
310
|
-
|
|
311
|
-
for (
|
|
312
|
-
|
|
313
|
-
|
|
319
|
+
uint256 maxGasBalance = ERC20(gasToken).balanceOf(gasPools[0]);
|
|
320
|
+
for (uint256 i = 1; i < gasPools.length; i++) {
|
|
321
|
+
uint256 balance = ERC20(gasToken).balanceOf(gasPools[i]);
|
|
322
|
+
if (balance > maxGasBalance) {
|
|
323
|
+
maxGasBalance = balance;
|
|
324
|
+
gasFee = IUniswapV3Pool(gasPools[i]).fee();
|
|
325
|
+
}
|
|
314
326
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
|
|
328
|
+
uint24 gdFee = IUniswapV3Pool(gdPools[0]).fee();
|
|
329
|
+
uint256 maxStableBalance = ERC20(reserveToken).balanceOf(gdPools[0]);
|
|
330
|
+
for (uint256 i = 1; i < gdPools.length; i++) {
|
|
331
|
+
uint256 balance = ERC20(reserveToken).balanceOf(gdPools[i]);
|
|
332
|
+
if (balance > maxStableBalance) {
|
|
333
|
+
maxStableBalance = balance;
|
|
334
|
+
gdFee = IUniswapV3Pool(gdPools[i]).fee();
|
|
335
|
+
}
|
|
318
336
|
}
|
|
337
|
+
|
|
319
338
|
ERC20(nativeToken()).approve(address(ROUTER), amountToSell);
|
|
339
|
+
|
|
320
340
|
uint256 amountOutMinimum = (minReceived * (100 - feeSettings.maxSlippage)) /
|
|
321
341
|
100; // 5% slippage
|
|
322
342
|
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
|
|
@@ -331,11 +351,19 @@ contract GenericDistributionHelper is
|
|
|
331
351
|
amountIn: amountToSell,
|
|
332
352
|
amountOutMinimum: amountOutMinimum
|
|
333
353
|
});
|
|
354
|
+
|
|
334
355
|
try ROUTER.exactInput(params) returns (uint256 amountOut) {
|
|
335
356
|
return amountOut;
|
|
336
357
|
} catch Error(string memory reason) {
|
|
337
358
|
emit BuyNativeFailed(reason, amountToSell, amountOutMinimum);
|
|
338
359
|
return 0;
|
|
360
|
+
} catch {
|
|
361
|
+
emit BuyNativeFailed(
|
|
362
|
+
"swap reverted without reason",
|
|
363
|
+
amountToSell,
|
|
364
|
+
amountOutMinimum
|
|
365
|
+
);
|
|
366
|
+
return 0;
|
|
339
367
|
}
|
|
340
368
|
}
|
|
341
369
|
}
|
|
@@ -386,7 +386,14 @@ contract UBISchemeV2 is DAOUpgradeableContract {
|
|
|
386
386
|
if (
|
|
387
387
|
currentDay == (block.timestamp - periodStart) / (1 days) && dailyUbi > 0
|
|
388
388
|
) {
|
|
389
|
-
return
|
|
389
|
+
return
|
|
390
|
+
hasClaimed(
|
|
391
|
+
IIdentityV2(nameService.getAddress("IDENTITY")).getWhitelistedRoot(
|
|
392
|
+
_member
|
|
393
|
+
)
|
|
394
|
+
)
|
|
395
|
+
? 0
|
|
396
|
+
: dailyUbi;
|
|
390
397
|
}
|
|
391
398
|
return estimateNextDailyUBI();
|
|
392
399
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import "../utils/NameService.sol";
|
|
5
|
+
import "../Interfaces.sol";
|
|
6
|
+
import "../DAOStackInterfaces.sol";
|
|
7
|
+
import "../MentoInterfaces.sol";
|
|
8
|
+
|
|
9
|
+
import "hardhat/console.sol";
|
|
10
|
+
|
|
11
|
+
interface MentoExchange {
|
|
12
|
+
function reserve() external view returns (address);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @notice set the new reserve ratio on Celo for xdc reserve deploy
|
|
17
|
+
*/
|
|
18
|
+
contract UpdateReserveRatio {
|
|
19
|
+
address owner;
|
|
20
|
+
|
|
21
|
+
constructor(address _owner) {
|
|
22
|
+
owner = _owner;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function upgrade(
|
|
26
|
+
Controller _controller,
|
|
27
|
+
address _mentoExchange,
|
|
28
|
+
bytes32 _exchangeId,
|
|
29
|
+
uint32 _reserveRatio,
|
|
30
|
+
uint256 _verifyCurrentSupply,
|
|
31
|
+
uint256 _newTotalSupply
|
|
32
|
+
) external {
|
|
33
|
+
require(msg.sender == owner, "only owner can call this");
|
|
34
|
+
address avatar = _controller.avatar();
|
|
35
|
+
//verify that the total supply the new reserve ratio was based on still applies
|
|
36
|
+
require(
|
|
37
|
+
ERC20(Avatar(avatar).nativeToken()).totalSupply() == _verifyCurrentSupply,
|
|
38
|
+
"total supply mismatch"
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
if (block.chainid == 42220) {
|
|
42
|
+
IBancorExchangeProvider.PoolExchange
|
|
43
|
+
memory _exchange = IBancorExchangeProvider(_mentoExchange)
|
|
44
|
+
.getPoolExchange(_exchangeId);
|
|
45
|
+
|
|
46
|
+
_exchange.reserveRatio = _reserveRatio;
|
|
47
|
+
_exchange.tokenSupply = _newTotalSupply;
|
|
48
|
+
|
|
49
|
+
(bool ok, bytes memory result) = _controller.genericCall(
|
|
50
|
+
address(_mentoExchange),
|
|
51
|
+
abi.encodeCall(
|
|
52
|
+
IBancorExchangeProvider.updateExchange,
|
|
53
|
+
(_exchangeId, _exchange)
|
|
54
|
+
),
|
|
55
|
+
address(avatar),
|
|
56
|
+
0
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
require(ok, "update failed");
|
|
60
|
+
console.log("update done");
|
|
61
|
+
bool updated = abi.decode(result, (bool));
|
|
62
|
+
require(updated, "not updated");
|
|
63
|
+
} else {
|
|
64
|
+
IBancorExchangeProvider.PoolExchange memory _exchange;
|
|
65
|
+
|
|
66
|
+
_exchange.reserveRatio = _reserveRatio;
|
|
67
|
+
_exchange.tokenSupply = _newTotalSupply;
|
|
68
|
+
_exchange.reserveAsset = 0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1; //usdc on xdc
|
|
69
|
+
_exchange.tokenAddress = Avatar(avatar).nativeToken();
|
|
70
|
+
_exchange.reserveBalance = 200000 * 1e6; // 200k USDC on xdc
|
|
71
|
+
_exchange.exitContribution = 10000000; //10%
|
|
72
|
+
|
|
73
|
+
(bool ok, bytes memory result) = _controller.genericCall(
|
|
74
|
+
address(_mentoExchange),
|
|
75
|
+
abi.encodeCall(IBancorExchangeProvider.createExchange, (_exchange)),
|
|
76
|
+
address(avatar),
|
|
77
|
+
0
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
require(ok, "create failed");
|
|
81
|
+
console.log("create done");
|
|
82
|
+
bytes32 created = abi.decode(result, (bytes32));
|
|
83
|
+
console.logBytes32(created);
|
|
84
|
+
require(created != bytes32(0), "not created");
|
|
85
|
+
}
|
|
86
|
+
owner = address(0); //mark as run;
|
|
87
|
+
// prevent executing again
|
|
88
|
+
require(_controller.unregisterSelf(avatar), "unregistering failed");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
contract CreateReserveExchange {
|
|
93
|
+
address owner;
|
|
94
|
+
|
|
95
|
+
constructor(address _owner) {
|
|
96
|
+
owner = _owner;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function upgrade(
|
|
100
|
+
Controller _controller,
|
|
101
|
+
address _mentoExchange,
|
|
102
|
+
IBancorExchangeProvider.PoolExchange memory _exchange
|
|
103
|
+
) external {
|
|
104
|
+
require(msg.sender == owner, "only owner can call this");
|
|
105
|
+
address avatar = _controller.avatar();
|
|
106
|
+
|
|
107
|
+
(bool ok, ) = _controller.genericCall(
|
|
108
|
+
address(_mentoExchange),
|
|
109
|
+
abi.encodeCall(IBancorExchangeProvider.createExchange, _exchange),
|
|
110
|
+
address(avatar),
|
|
111
|
+
0
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
// console.log("createExchange %s", ok);
|
|
115
|
+
require(ok, "createExchange failed");
|
|
116
|
+
|
|
117
|
+
owner = address(0); //mark as run;
|
|
118
|
+
// prevent executing again
|
|
119
|
+
require(_controller.unregisterSelf(avatar), "unregistering failed");
|
|
120
|
+
}
|
|
121
|
+
}
|
package/hardhat.config.ts
CHANGED
|
@@ -29,7 +29,7 @@ envEnc.config();
|
|
|
29
29
|
config();
|
|
30
30
|
|
|
31
31
|
const mnemonic = process.env.MNEMONIC || "test test test test test test test test test test test junk";
|
|
32
|
-
const deployerPrivateKey = process.env.
|
|
32
|
+
const deployerPrivateKey = process.env.PRIVATE_KEY || ethers.utils.hexZeroPad("0x11", 32);
|
|
33
33
|
const infura_api = process.env.INFURA_API;
|
|
34
34
|
const alchemy_key = process.env.ALCHEMY_KEY;
|
|
35
35
|
const etherscan_key = process.env.ETHERSCAN_KEY;
|
|
@@ -41,7 +41,7 @@ const MAINNET_URL = "https://mainnet.infura.io/v3/" + infura_api;
|
|
|
41
41
|
|
|
42
42
|
const xdc = {
|
|
43
43
|
accounts: { mnemonic },
|
|
44
|
-
url: "https://rpc.
|
|
44
|
+
url: "https://rpc.xdc.org",
|
|
45
45
|
gas: 3000000,
|
|
46
46
|
gasPrice: 12.5e9,
|
|
47
47
|
chainId: 50
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddollar/goodprotocol",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "GoodDollar Protocol",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.x"
|
|
@@ -128,8 +128,6 @@
|
|
|
128
128
|
"press-any-key": "^0.1.1",
|
|
129
129
|
"prompt": "^1.3.0",
|
|
130
130
|
"regenerator-runtime": "^0.13.9",
|
|
131
|
-
"sharp": "^0.34.5",
|
|
132
|
-
"sharp-phash": "^2.2.0",
|
|
133
131
|
"solhint": "*",
|
|
134
132
|
"solidity-coverage": "^0.8.4",
|
|
135
133
|
"truffle": "^5.11.5",
|
|
@@ -311,6 +311,9 @@
|
|
|
311
311
|
"production-xdc": {
|
|
312
312
|
"gasPrice": 12.5e9,
|
|
313
313
|
"superfluidHost": "0x0000000000000000000000000000000000000000",
|
|
314
|
+
"reserve": {
|
|
315
|
+
"gasToken": "0x951857744785e80e2de051c32ee7b25f9c458c42"
|
|
316
|
+
},
|
|
314
317
|
"ubi": {
|
|
315
318
|
"maxInactiveDays": 14,
|
|
316
319
|
"minActiveUsers": 30000
|
package/releases/deployment.json
CHANGED
|
@@ -568,12 +568,12 @@
|
|
|
568
568
|
"development-mainnet": { "networkId": 1 },
|
|
569
569
|
"test": {
|
|
570
570
|
"ProxyFactory": "0xCd7c00Ac6dc51e8dCc773971Ac9221cC582F3b1b",
|
|
571
|
-
"NameService": "
|
|
572
|
-
"GReputation": "
|
|
573
|
-
"CompoundVotingMachine": "
|
|
574
|
-
"ClaimersDistribution": "
|
|
571
|
+
"NameService": "0x79a8656f72F7F3F1C658718b5C9Fe808e2D6Ab39",
|
|
572
|
+
"GReputation": "0xFde4C515250562688C4E84cBe82Cf9af9F5d46Ae",
|
|
573
|
+
"CompoundVotingMachine": "0xd5e9cE20E33818a30e3626aAB3D1db9f09Ea8181",
|
|
574
|
+
"ClaimersDistribution": "0xde7FB3BA189eC8Fb278f0B8f1F005526eB489254",
|
|
575
575
|
"GovernanceStaking": "0xf5C3953Ae4639806fcbCC3196f71dd81B0da4348",
|
|
576
|
-
"UBIScheme": "
|
|
576
|
+
"UBIScheme": "0x8f298403715F62f8958Aa1cd1cfDE6cE9B47319e",
|
|
577
577
|
"ProtocolUpgradeFuse": "0xDDa0648FA8c9cD593416EC37089C2a2E6060B45c",
|
|
578
578
|
"network": "test",
|
|
579
579
|
"networkId": 4447,
|
|
@@ -592,23 +592,23 @@
|
|
|
592
592
|
},
|
|
593
593
|
"test-mainnet": {
|
|
594
594
|
"ProxyFactory": "0x70E5370b8981Abc6e14C91F4AcE823954EFC8eA3",
|
|
595
|
-
"NameService": "
|
|
596
|
-
"GReputation": "
|
|
597
|
-
"CompoundVotingMachine": "
|
|
598
|
-
"GoodMarketMaker": "
|
|
599
|
-
"GoodReserveCDai": "
|
|
600
|
-
"ExchangeHelper": "
|
|
601
|
-
"GoodFundManager": "
|
|
602
|
-
"StakersDistribution": "
|
|
595
|
+
"NameService": "0xA1de3421535CF40A6B341F165F1671878C48f1de",
|
|
596
|
+
"GReputation": "0x81099494e5325Bd6237EB67cA116514137E10Ba6",
|
|
597
|
+
"CompoundVotingMachine": "0xB7D090220BA506CCe0D2d0de3005893534Dc5f46",
|
|
598
|
+
"GoodMarketMaker": "0x31a7e4029bDe7eDd07b497B850474b0c65bd6D3f",
|
|
599
|
+
"GoodReserveCDai": "0x879892FbE36f7499Bea8744a01550190c078A68E",
|
|
600
|
+
"ExchangeHelper": "0x4fE75c387D27724d0a27b78fE6229E0f1385Db48",
|
|
601
|
+
"GoodFundManager": "0x1D98610e8702C66479565F73EBF3289Cff607e95",
|
|
602
|
+
"StakersDistribution": "0xde979777C259a24b623b7783be44F5810FC54B51",
|
|
603
603
|
"ProtocolUpgrade": "0xbe18A1B61ceaF59aEB6A9bC81AB4FB87D56Ba167",
|
|
604
604
|
"UniswapV2SwapHelper": "0x25C0a2F0A077F537Bd11897F04946794c2f6f1Ef",
|
|
605
605
|
"CompoundStakingFactory": "0x01cf58e264d7578D4C67022c58A24CbC4C4a304E",
|
|
606
606
|
"AaveStakingFactory": "0xd038A2EE73b64F30d65802Ad188F27921656f28F",
|
|
607
607
|
"StakingContracts": [
|
|
608
|
-
["
|
|
609
|
-
["
|
|
608
|
+
["0x31553691c8225B730914Ab2FC6b7EC6dbbBf52cd", 13888],
|
|
609
|
+
["0xbfaeAb1e80726804Dcf46653961A538095cCC6AD", "6944"]
|
|
610
610
|
],
|
|
611
|
-
"DonationsStaking": "
|
|
611
|
+
"DonationsStaking": "0x1935252558E7FE0AF6cDB6897bb5c6dB81620577",
|
|
612
612
|
"network": "test-mainnet",
|
|
613
613
|
"networkId": 4447,
|
|
614
614
|
"ForeignBridge": "0x7B4f352Cd40114f12e82fC675b5BA8C7582FC513",
|
|
@@ -673,6 +673,7 @@
|
|
|
673
673
|
"ProxyFactory": "0x5BE34022c26FA03a8d6926314a42414c7ca2dF51",
|
|
674
674
|
"GuardiansSafe": "0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec",
|
|
675
675
|
"CUSD": "0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1",
|
|
676
|
+
"USDC": "0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1",
|
|
676
677
|
"ReserveToken": "0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1",
|
|
677
678
|
"Identity": "0x27a4a02C9ed591E1a86e2e5D05870292c34622C9",
|
|
678
679
|
"DAOCreator": "0xa2B9993D198904e4bdCE48379FDff65405607F42",
|
|
@@ -686,6 +687,17 @@
|
|
|
686
687
|
"Invites": "0x6bd698566632bf2e81e2278f1656CB24aAF06D2e",
|
|
687
688
|
"UBIScheme": "0x22867567E2D80f2049200E25C6F31CB6Ec2F0faf",
|
|
688
689
|
"MpbBridge": "0xa3247276DbCC76Dd7705273f766eB3E8a5ecF4a5",
|
|
689
|
-
"BulkWhitelist": "0xe8861A20452Db53dF685F1d9e6B7017de3DB0E46"
|
|
690
|
+
"BulkWhitelist": "0xe8861A20452Db53dF685F1d9e6B7017de3DB0E46",
|
|
691
|
+
"UniswapV3Router": "0x3b9edecc4286ba33ea6e27119c2a4db99829839d",
|
|
692
|
+
"UniswapV3RouterOfficial": "0xaa52bB8110fE38D0d2d2AF0B85C3A3eE622CA455",
|
|
693
|
+
"StaticOracle": "0x725244458f011551Dde1104c9728746EEBEA19f9",
|
|
694
|
+
"WXDC": "0x951857744785e80e2de051c32ee7b25f9c458c42",
|
|
695
|
+
"MentoProxyAdmin": "0x8471406C3Bff67Cc6538481C8550364bda6Ca691",
|
|
696
|
+
"MentoExchangeProvider": "0x2fFBB49055d487DdBBb0C052Cd7c2a02A7971e41",
|
|
697
|
+
"MentoExpansionController": "0x5557E9dEF86ad6564462741a7A3f3679C1223f5d",
|
|
698
|
+
"MentoReserve": "0x94A3240f484A04F5e3d524f528d02694c109463b",
|
|
699
|
+
"MentoBroker": "0x88de45906D4F5a57315c133620cfa484cB297541",
|
|
700
|
+
"DistributionHelper": "0xB8A0d4b97327a0B6dD0705dC290AE26aA38a7d2b",
|
|
701
|
+
"USDCEXchangeId": "0xf8d028730f58a008390c265fca425bb912e4c7efa370d4cef756a06f5029acd2"
|
|
690
702
|
}
|
|
691
703
|
}
|
package/test/helpers.ts
CHANGED
|
@@ -459,7 +459,10 @@ export const deployUBI = async (deployedDAO, withFirstClaim = true) => {
|
|
|
459
459
|
|
|
460
460
|
await genericCall(gd, encoded);
|
|
461
461
|
|
|
462
|
-
console.log("set firstclaim,ubischeme as scheme and starting..."
|
|
462
|
+
console.log("set firstclaim,ubischeme as scheme and starting...", {
|
|
463
|
+
ubischeme: ubiScheme.address,
|
|
464
|
+
firstClaim: firstClaim.address
|
|
465
|
+
});
|
|
463
466
|
await setSchemes([firstClaim.address, ubiScheme.address]);
|
|
464
467
|
|
|
465
468
|
if (withFirstClaim) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
-
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
|
+
import { loadFixture, time } from "@nomicfoundation/hardhat-network-helpers";
|
|
3
3
|
import { expect } from "chai";
|
|
4
4
|
import { IGoodDollar, IIdentity, IdentityV3, IdentityV4 } from "../../types";
|
|
5
5
|
import { createDAO, increaseTime, advanceBlocks } from "../helpers";
|
|
@@ -107,11 +107,14 @@ describe("IdentityV4", () => {
|
|
|
107
107
|
// await expect(identity.connect(signers[2]).setAuthenticationPeriod(10)).reverted;
|
|
108
108
|
// });
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
it("should retun the last reverify period as authenticationPeriod", async () => {
|
|
111
|
+
await expect(identity.setReverifyDaysOptions([1, 7, 111])).not.reverted;
|
|
112
|
+
expect(await identity.authenticationPeriod()).eq(111);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("should enforce order in reverify days options", async () => {
|
|
116
|
+
await expect(identity.setReverifyDaysOptions([1, 111, 7])).reverted;
|
|
117
|
+
});
|
|
115
118
|
|
|
116
119
|
it("should revert when non admin tries to pause", async () => {
|
|
117
120
|
await expect(identity.connect(signers[2]).pause(true)).reverted;
|
|
@@ -411,6 +414,10 @@ describe("IdentityV4", () => {
|
|
|
411
414
|
});
|
|
412
415
|
|
|
413
416
|
it("should follow reverify schedule and cycle authCount", async () => {
|
|
417
|
+
// set timestamp to a fixed point (now) to avoid exclusion of old users
|
|
418
|
+
// due to initialDate set in hardhat config
|
|
419
|
+
const block = await ethers.provider.getBlock("latest");
|
|
420
|
+
await time.setNextBlockTimestamp(Number((Date.now() / 1000).toFixed(0)));
|
|
414
421
|
await expect(identity.setReverifyDaysOptions([1, 7, 180])).not.reverted;
|
|
415
422
|
|
|
416
423
|
const u = signers[12];
|
|
@@ -450,5 +457,8 @@ describe("IdentityV4", () => {
|
|
|
450
457
|
expect(await identity.isWhitelisted(u.address)).to.be.true;
|
|
451
458
|
// cleanup (remove whitelisted) to avoid affecting other tests
|
|
452
459
|
await identity.removeWhitelisted(u.address);
|
|
460
|
+
|
|
461
|
+
// restore time to normal flow
|
|
462
|
+
time.setNextBlockTimestamp(block.timestamp);
|
|
453
463
|
});
|
|
454
464
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
-
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
|
+
import { loadFixture, time } from "@nomicfoundation/hardhat-network-helpers";
|
|
3
3
|
import { expect } from "chai";
|
|
4
|
-
import { InvitesV2, IGoodDollar, IIdentity, IdentityV2 } from "../../types";
|
|
4
|
+
import { InvitesV2, IGoodDollar, IIdentity, IdentityV2, UBISchemeV2 } from "../../types";
|
|
5
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
6
6
|
import IdentityABI from "@gooddollar/goodcontracts/build/contracts/Identity.json";
|
|
7
7
|
|
|
@@ -15,6 +15,8 @@ describe("InvitesV2", () => {
|
|
|
15
15
|
|
|
16
16
|
let avatar, gd: IGoodDollar, Controller, id: IdentityV2, setDAOAddress, setSchemes;
|
|
17
17
|
|
|
18
|
+
let ubi: UBISchemeV2;
|
|
19
|
+
|
|
18
20
|
const initialState = async () => {};
|
|
19
21
|
before(async () => {
|
|
20
22
|
[founder, inviter1, inviter2, invitee1, invitee2, invitee3, invitee4, invitee5, invitee6, invitee7, invitee8] =
|
|
@@ -40,10 +42,10 @@ describe("InvitesV2", () => {
|
|
|
40
42
|
invites = (await upgrades.deployProxy(InvitesV2, [nameService.address, 500, founder.address], {
|
|
41
43
|
kind: "uups"
|
|
42
44
|
})) as InvitesV2;
|
|
43
|
-
|
|
45
|
+
ubi = await upgrades.deployProxy(await ethers.getContractFactory("UBISchemeV2"), [nameService.address, 1000]);
|
|
46
|
+
await setDAOAddress("UBISCHEME", ubi.address);
|
|
44
47
|
gd = (await ethers.getContractAt("IGoodDollar", gooddollar, founder)) as IGoodDollar;
|
|
45
48
|
id = (await ethers.getContractAt("IdentityV3", identity, founder)) as IdentityV2;
|
|
46
|
-
|
|
47
49
|
await gd["mint(address,uint256)"](invites.address, BN.from(5000));
|
|
48
50
|
await loadFixture(initialState);
|
|
49
51
|
// await gd.transfer(invites.address, BN.from(5000));
|
|
@@ -69,7 +71,7 @@ describe("InvitesV2", () => {
|
|
|
69
71
|
it("should have version", async () => {
|
|
70
72
|
expect(await invites.active()).to.be.true;
|
|
71
73
|
const version = await invites.version();
|
|
72
|
-
expect(version).to.be.equal("2.
|
|
74
|
+
expect(version).to.be.equal("2.4");
|
|
73
75
|
});
|
|
74
76
|
|
|
75
77
|
it("should let anyone join", async () => {
|
|
@@ -410,4 +412,47 @@ describe("InvitesV2", () => {
|
|
|
410
412
|
await invites.end();
|
|
411
413
|
expect(await gd.balanceOf(invites.address).then(_ => _.toNumber())).to.be.eq(0);
|
|
412
414
|
});
|
|
415
|
+
|
|
416
|
+
describe("minimums", () => {
|
|
417
|
+
it("should not allow bounty collection before minimum days", async () => {
|
|
418
|
+
await loadFixture(initialState);
|
|
419
|
+
await invites.setMinimums(0, 1);
|
|
420
|
+
await invites.setCampaignCode(ethers.utils.formatBytes32String("test"));
|
|
421
|
+
|
|
422
|
+
const tx = await invites
|
|
423
|
+
.connect(invitee1)
|
|
424
|
+
.join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.formatBytes32String("test"));
|
|
425
|
+
const { events } = await tx.wait();
|
|
426
|
+
const bountyEvent = events.find(_ => _.event === "InviterBounty");
|
|
427
|
+
expect(bountyEvent).undefined;
|
|
428
|
+
|
|
429
|
+
await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
|
|
430
|
+
|
|
431
|
+
expect(await invites.canCollectBountyFor(invitee1.address)).to.be.false;
|
|
432
|
+
await time.increase(1 * 24 * 3600); // increase time by 2 days
|
|
433
|
+
expect(await invites.canCollectBountyFor(invitee1.address)).to.be.true;
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
it("should not allow bounty collection before minimum claims", async () => {
|
|
437
|
+
await loadFixture(initialState);
|
|
438
|
+
await invites.setMinimums(1, 0);
|
|
439
|
+
await invites.setCampaignCode(ethers.utils.formatBytes32String("test"));
|
|
440
|
+
|
|
441
|
+
const tx = await invites
|
|
442
|
+
.connect(invitee1)
|
|
443
|
+
.join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.formatBytes32String("test"));
|
|
444
|
+
const { events } = await tx.wait();
|
|
445
|
+
const bountyEvent = events.find(_ => _.event === "InviterBounty");
|
|
446
|
+
expect(bountyEvent).undefined;
|
|
447
|
+
|
|
448
|
+
await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
|
|
449
|
+
|
|
450
|
+
expect(await invites.canCollectBountyFor(invitee1.address)).to.be.false;
|
|
451
|
+
await ubi
|
|
452
|
+
.connect(invitee1)
|
|
453
|
+
.claim()
|
|
454
|
+
.then(_ => _.wait());
|
|
455
|
+
expect(await invites.canCollectBountyFor(invitee1.address)).to.be.true;
|
|
456
|
+
});
|
|
457
|
+
});
|
|
413
458
|
});
|