@gooddollar/goodprotocol 2.0.13 → 2.0.14-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/abis/DistributionBridgeMock.min.json +1 -1
- package/artifacts/abis/DistributionHelper.min.json +1 -1
- package/artifacts/abis/DistributionHelperTest.min.json +1 -1
- package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -1
- package/artifacts/abis/GasPriceMockOracle.min.json +1 -1
- package/artifacts/abis/GoodCompoundStakingTest.min.json +1 -1
- package/artifacts/abis/GoodReserveCDai.min.json +1 -1
- package/artifacts/abis/IFeesFormula.min.json +1 -1
- package/artifacts/abis/ISuperGoodDollar.min.json +1 -1
- package/artifacts/abis/ISuperToken.min.json +1 -0
- package/artifacts/abis/MultichainFeeFormula.min.json +1 -0
- package/artifacts/abis/SuperGoodDollar.min.json +1 -1
- package/artifacts/abis/SuperToken.min.json +1 -1
- package/artifacts/abis/UBIScheme.min.json +1 -1
- package/artifacts/abis/UBISchemeV2.min.json +1 -1
- 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/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/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/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
- 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/GovernanceStaking.sol/GovernanceStaking.json +2 -2
- 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/Reputation.sol/Reputation.json +2 -2
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.json +2 -2
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.json +2 -2
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.json +2 -2
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.json +2 -2
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +122 -17
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +242 -17
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +256 -18
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.json +2 -2
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.json +15 -2
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +6 -6
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +2 -2
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.json +2 -2
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.json +2 -2
- 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/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- 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/OverMintTester.sol/OverMintTester.json +2 -2
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.json +2 -2
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.json +2 -2
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.json +2 -2
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.json +2 -2
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.json +2 -2
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.json +2 -2
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.json +2 -2
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.json +2 -2
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.json +2 -2
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.json +2 -2
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +242 -17
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +2 -2
- 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/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +45 -19
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
- 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/GoodFundManager.sol/GoodFundManager.json +2 -2
- 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/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.json +2 -2
- 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/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.json +2 -2
- 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/GoodDollar.sol/GoodDollar.json +2 -2
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +4 -0
- package/artifacts/contracts/token/{FeesFormula.sol → IFeesFormula.sol}/IFeesFormula.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +4 -0
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.json +58 -0
- 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/ISuperGoodDollar.sol/ISuperGoodDollar.json +159 -5
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.json +1609 -0
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +233 -190
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +198 -193
- 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/UUPSProxy.json +2 -2
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.json +2 -2
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +20 -2
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +20 -2
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -2
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.json +2 -2
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.json +2 -2
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.json +2 -2
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.json +2 -2
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
- 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/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +2 -2
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.json +2 -2
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.json +2 -2
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.json +2 -2
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.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/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.json +2 -2
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/contracts/invite/InvitesFuseV2.sol +3 -2
- package/contracts/mocks/DistributionBridgeMock.sol +42 -15
- package/contracts/mocks/DistributionHelperTest.sol +6 -2
- package/contracts/mocks/FeesFormularMock.sol +14 -14
- package/contracts/mocks/GasPriceMockOracle.sol +7 -1
- package/contracts/reserve/DistributionHelper.sol +147 -23
- package/contracts/reserve/GoodReserveCDai.sol +39 -47
- package/contracts/staking/GoodFundManager.sol +18 -37
- package/contracts/token/GoodDollar.sol +11 -16
- package/contracts/token/MultichainFeeFormula.sol +34 -0
- package/contracts/token/superfluid/ConstantFlowNFTs.sol +3 -0
- package/contracts/token/superfluid/ISuperGoodDollar.sol +4 -5
- package/contracts/token/superfluid/ISuperToken.sol +464 -0
- package/contracts/token/superfluid/SuperGoodDollar.sol +408 -376
- package/contracts/token/superfluid/SuperToken.sol +144 -144
- package/contracts/ubi/UBIScheme.sol +9 -5
- package/contracts/ubi/UBISchemeV2.sol +6 -0
- package/contracts/utils/AdminWallet.sol +2 -1
- package/contracts/utils/AdminWalletFuse.sol +2 -1
- package/contracts/utils/BuyAndBridgeHelper.sol +13 -13
- package/contracts/utils/MultiCall.sol +8 -10
- package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +233 -190
- package/dist/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +2 -2
- package/dist/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
- package/hardhat.config.ts +46 -15
- package/package.json +7 -7
- package/releases/deploy-settings.json +3 -1
- package/releases/deployment.json +6 -2
- package/scripts/analytics/faucetStats.ts +19 -15
- package/scripts/fv.ts +305 -0
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +18 -9
- package/scripts/multichain-deploy/helpers.ts +204 -64
- package/scripts/proposals/gip-15.ts +427 -0
- package/scripts/upgrades/multichain-formula-upgrade.ts +140 -0
- package/scripts/upgrades/restoreFunds.ts +91 -0
- package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +159 -0
- package/scripts/utils.ts +15 -0
- package/test/helpers.ts +73 -10
- package/test/reserve/DistributionHelper.test.ts +183 -218
- package/test/reserve/GoodReserveCDai.distribution.test.ts +21 -144
- package/test/reserve/GoodReserveCDai.test.ts +98 -302
- package/test/staking/StakingRewards.test.ts +324 -936
- package/test/token/CeloGasToken.test.ts +108 -0
- package/test/token/SuperGoodDollar.test.ts +15 -6
- package/test/utils/AdminWallet.test.ts +97 -38
- package/test/utils/BuyAndBridgeHelper.test.ts +9 -33
- package/truffle-config.js +24 -6
- package/types/ConstantInflowNFT.ts +969 -0
- package/types/ConstantOutflowNFT.ts +1031 -0
- package/types/DistributionBridgeMock.ts +203 -70
- package/types/DistributionHelper.ts +325 -30
- package/types/DistributionHelperTest.ts +325 -30
- package/types/DistributionHelperTestHelper.ts +355 -35
- package/types/FlowNFTBase.ts +887 -0
- package/types/GasPriceMockOracle.ts +29 -0
- package/types/GoodReserveCDai.ts +79 -20
- package/types/IConstantFlowAgreementV1.ts +1391 -0
- package/types/IConstantInflowNFT.ts +772 -0
- package/types/IConstantOutflowNFT.ts +834 -0
- package/types/IERC721.ts +487 -0
- package/types/IERC721Metadata.ts +538 -0
- package/types/IFlowNFTBase.ts +711 -0
- package/types/IInstantDistributionAgreementV1.ts +1183 -0
- package/types/ILayerZeroFeeEstimator.ts +136 -0
- package/types/IMessagePassingBridge.ts +774 -0
- package/types/ISETH.ts +2668 -0
- package/types/ISETHCustom.ts +161 -0
- package/types/ISuperGoodDollar.ts +277 -25
- package/types/ISuperToken.ts +202 -346
- package/types/ISuperfluid.ts +7 -2
- package/types/ISuperfluidGovernance.ts +40 -5
- package/types/MultichainFeeFormula.ts +130 -0
- package/types/SuperGoodDollar.ts +383 -349
- package/types/SuperToken.ts +319 -344
- package/types/UBIScheme.ts +36 -0
- package/types/UBISchemeV2.ts +36 -0
- package/types/factories/AaveMock__factory.ts +1 -1
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AaveUSDMockOracle__factory.ts +1 -1
- package/types/factories/AdminWalletFuse__factory.ts +1 -1
- package/types/factories/AdminWallet__factory.ts +1 -1
- package/types/factories/BancorFormula__factory.ts +1 -1
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__factory.ts +1 -1
- package/types/factories/BatUSDMockOracle__factory.ts +1 -1
- package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
- package/types/factories/BuyGDCloneFactory__factory.ts +1 -1
- package/types/factories/BuyGDClone__factory.ts +1 -1
- package/types/factories/CBATMock__factory.ts +1 -1
- package/types/factories/CDAILowWorthMock__factory.ts +1 -1
- package/types/factories/CDAIMock__factory.ts +1 -1
- package/types/factories/CDAINonMintableMock__factory.ts +1 -1
- package/types/factories/CDecimalsMock__factory.ts +1 -1
- package/types/factories/CSDTMock__factory.ts +1 -1
- package/types/factories/CUSDCMock__factory.ts +1 -1
- package/types/factories/ClaimersDistribution__factory.ts +1 -1
- package/types/factories/CompUSDMockOracle__factory.ts +1 -1
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/CompoundVotingMachine__factory.ts +1 -1
- package/types/factories/ConstantInflowNFT__factory.ts +758 -0
- package/types/factories/ConstantOutflowNFT__factory.ts +817 -0
- package/types/factories/DAIMock__factory.ts +1 -1
- package/types/factories/DAOContract__factory.ts +1 -1
- package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
- package/types/factories/DaiEthPriceMockOracle__factory.ts +1 -1
- package/types/factories/DecimalsMock__factory.ts +1 -1
- package/types/factories/DistributionBridgeMock__factory.ts +121 -16
- package/types/factories/DistributionHelperTestHelper__factory.ts +255 -17
- package/types/factories/DistributionHelperTest__factory.ts +241 -16
- package/types/factories/DistributionHelper__factory.ts +241 -16
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ERC1967Proxy__factory.ts +1 -1
- package/types/factories/ERC20PresetMinterPauserUpgradeable__factory.ts +1 -1
- package/types/factories/ERC20Upgradeable__factory.ts +1 -1
- package/types/factories/EthUSDMockOracle__factory.ts +1 -1
- package/types/factories/EventsEmitter__factory.ts +1 -1
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/Faucet__factory.ts +1 -1
- package/types/factories/FeesFormulaMock__factory.ts +1 -1
- package/types/factories/FlowNFTBase__factory.ts +642 -0
- package/types/factories/FuseFaucetV2__factory.ts +1 -1
- package/types/factories/FuseFaucet__factory.ts +1 -1
- package/types/factories/FuseStakingV3__factory.ts +1 -1
- package/types/factories/GDFaucet__factory.ts +1 -1
- package/types/factories/GReputation__factory.ts +1 -1
- package/types/factories/GasPriceMockOracle__factory.ts +14 -1
- package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -1
- package/types/factories/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/GoodDollar__factory.ts +1 -1
- package/types/factories/GoodFundManagerTest__factory.ts +1 -1
- package/types/factories/GoodFundManager__factory.ts +1 -1
- package/types/factories/GoodMarketMaker__factory.ts +1 -1
- package/types/factories/GoodReserveCDai__factory.ts +44 -18
- package/types/factories/GovernanceStaking__factory.ts +1 -1
- package/types/factories/IConstantFlowAgreementV1__factory.ts +1064 -0
- package/types/factories/IConstantInflowNFT__factory.ts +551 -0
- package/types/factories/IConstantOutflowNFT__factory.ts +614 -0
- package/types/factories/IERC721Metadata__factory.ts +356 -0
- package/types/factories/IERC721__factory.ts +308 -0
- package/types/factories/IFlowNFTBase__factory.ts +512 -0
- package/types/factories/IInstantDistributionAgreementV1__factory.ts +1015 -0
- package/types/factories/ILayerZeroFeeEstimator__factory.ts +79 -0
- package/types/factories/IMessagePassingBridge__factory.ts +446 -0
- package/types/factories/ISETHCustom__factory.ts +56 -0
- package/types/factories/ISETH__factory.ts +1866 -0
- package/types/factories/ISuperGoodDollar__factory.ts +159 -5
- package/types/factories/ISuperTokenFactory__factory.ts +5 -0
- package/types/factories/ISuperToken__factory.ts +130 -191
- package/types/factories/ISuperfluidGovernance__factory.ts +23 -5
- package/types/factories/ISuperfluid__factory.ts +10 -0
- package/types/factories/IdentityFix__factory.ts +1 -1
- package/types/factories/IdentityMock__factory.ts +1 -1
- package/types/factories/IdentityV2__factory.ts +1 -1
- package/types/factories/IncentiveControllerMock__factory.ts +1 -1
- package/types/factories/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +1 -1
- package/types/factories/LendingPoolMock__factory.ts +1 -1
- package/types/factories/Multicall__factory.ts +1 -1
- package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/MultichainFeeFormula__factory.ts +113 -0
- package/types/factories/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/NameService__factory.ts +1 -1
- package/types/factories/OneTimePaymentsV2__factory.ts +1 -1
- package/types/factories/OneTimePayments__factory.ts +1 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/OverMintTester__factory.ts +1 -1
- package/types/factories/PayableMock__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgrade__factory.ts +1 -1
- package/types/factories/ProxyFactory1967__factory.ts +1 -1
- package/types/factories/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/Reputation__factory.ts +1 -1
- package/types/factories/SixteenDecimalsTokenMock__factory.ts +1 -1
- package/types/factories/StakersDistribution__factory.ts +1 -1
- package/types/factories/StakingMockFixedAPY__factory.ts +1 -1
- package/types/factories/SuperGoodDollar__factory.ts +230 -187
- package/types/factories/SuperToken__factory.ts +197 -192
- package/types/factories/SwapHelperTest__factory.ts +1 -1
- package/types/factories/TwentyDecimalsTokenMock__factory.ts +1 -1
- package/types/factories/UBISchemeV2__factory.ts +19 -1
- package/types/factories/UBIScheme__factory.ts +19 -1
- package/types/factories/USDCMock__factory.ts +1 -1
- package/types/factories/UUPSProxy__factory.ts +1 -1
- package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/UpgradableMock2__factory.ts +1 -1
- package/types/factories/UpgradableMock3__factory.ts +1 -1
- package/types/factories/UpgradableMock4__factory.ts +1 -1
- package/types/factories/UpgradableMock__factory.ts +1 -1
- package/types/hardhat.d.ts +166 -4
- package/types/index.ts +34 -4
- package/yarn.lock +1288 -719
- package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +0 -4
- /package/contracts/token/{FeesFormula.sol → IFeesFormula.sol} +0 -0
|
@@ -15,8 +15,12 @@ contract DistributionHelperTest is DistributionHelper {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
contract DistributionHelperTestHelper is DistributionHelper {
|
|
18
|
-
function
|
|
18
|
+
function setOracle(IStaticOracle oracle) external {
|
|
19
|
+
STATIC_ORACLE = oracle;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function setBridges(address _fuseBridge, address _mpbBridge) external {
|
|
19
23
|
fuseBridge = _fuseBridge;
|
|
20
|
-
|
|
24
|
+
mpbBridge = IMessagePassingBridge(_mpbBridge);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity >=0.8;
|
|
3
3
|
|
|
4
|
-
import "../token/
|
|
4
|
+
import "../token/IFeesFormula.sol";
|
|
5
5
|
|
|
6
6
|
contract FeesFormulaMock is IFeesFormula {
|
|
7
|
-
|
|
7
|
+
uint256 public immutable feePerMillion;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
constructor(uint256 feePerMillion_) {
|
|
10
|
+
require(feePerMillion_ <= 1e6, "fee higher than 100%");
|
|
11
|
+
feePerMillion = feePerMillion_;
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
14
|
+
function getTxFees(
|
|
15
|
+
uint256 value,
|
|
16
|
+
address sender,
|
|
17
|
+
address recipient
|
|
18
|
+
) external view returns (uint256 fee, bool senderPays) {
|
|
19
|
+
return ((value * feePerMillion) / 1E6, true);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
pragma solidity >=0.8.0;
|
|
4
4
|
|
|
5
5
|
contract GasPriceMockOracle {
|
|
6
|
+
int price = 2500000000;
|
|
7
|
+
|
|
6
8
|
function latestAnswer() public view returns (int256) {
|
|
7
|
-
return
|
|
9
|
+
return price;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function setPrice(int _price) external {
|
|
13
|
+
price = _price;
|
|
8
14
|
}
|
|
9
15
|
}
|
|
@@ -5,8 +5,11 @@ pragma solidity ^0.8;
|
|
|
5
5
|
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
|
|
6
6
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
7
7
|
import "@openzeppelin/contracts/utils/math/Math.sol";
|
|
8
|
+
import "@mean-finance/uniswap-v3-oracle/solidity/interfaces/IStaticOracle.sol";
|
|
9
|
+
import "@gooddollar/bridge-contracts/contracts/messagePassingBridge/IMessagePassingBridge.sol";
|
|
8
10
|
|
|
9
11
|
import "../utils/DAOUpgradeableContract.sol";
|
|
12
|
+
import "./ExchangeHelper.sol";
|
|
10
13
|
|
|
11
14
|
// import "hardhat/console.sol";
|
|
12
15
|
|
|
@@ -19,11 +22,29 @@ contract DistributionHelper is
|
|
|
19
22
|
DAOUpgradeableContract,
|
|
20
23
|
AccessControlEnumerableUpgradeable
|
|
21
24
|
{
|
|
25
|
+
bytes32 public constant GUARDIAN_ROLE = keccak256("GUARDIAN_ROLE");
|
|
26
|
+
|
|
27
|
+
error FEE_LIMIT(uint256 fee);
|
|
28
|
+
|
|
29
|
+
//IStaticOracle(0xB210CE856631EeEB767eFa666EC7C1C57738d438); //@mean-finance/uniswap-v3-oracle
|
|
30
|
+
|
|
31
|
+
address public constant CELO_TOKEN =
|
|
32
|
+
0x3294395e62F4eB6aF3f1Fcf89f5602D90Fb3Ef69;
|
|
33
|
+
|
|
34
|
+
address public constant FUSE_TOKEN =
|
|
35
|
+
0x970B9bB2C0444F5E81e9d0eFb84C8ccdcdcAf84d;
|
|
36
|
+
|
|
37
|
+
address public constant USDC_TOKEN =
|
|
38
|
+
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
|
|
39
|
+
|
|
40
|
+
address public constant WETH_TOKEN =
|
|
41
|
+
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
|
|
42
|
+
|
|
22
43
|
enum TransferType {
|
|
23
44
|
FuseBridge,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
45
|
+
LayerZeroBridge,
|
|
46
|
+
AxelarBridge,
|
|
47
|
+
Contract
|
|
27
48
|
}
|
|
28
49
|
|
|
29
50
|
struct DistributionRecipient {
|
|
@@ -33,11 +54,22 @@ contract DistributionHelper is
|
|
|
33
54
|
TransferType transferType;
|
|
34
55
|
}
|
|
35
56
|
|
|
57
|
+
struct FeeSettings {
|
|
58
|
+
uint128 axelarBaseFeeUSD;
|
|
59
|
+
uint128 bridgeExecuteGas;
|
|
60
|
+
uint128 targetChainGasPrice;
|
|
61
|
+
uint128 maxFee;
|
|
62
|
+
uint128 minBalanceForFees;
|
|
63
|
+
uint8 percentageToSellForFee;
|
|
64
|
+
}
|
|
65
|
+
|
|
36
66
|
DistributionRecipient[] public distributionRecipients;
|
|
37
67
|
|
|
38
68
|
address public fuseBridge;
|
|
39
|
-
|
|
40
|
-
|
|
69
|
+
IMessagePassingBridge public mpbBridge;
|
|
70
|
+
FeeSettings public feeSettings; //previously anyGoodDollar_unused; //kept for storage layout upgrades
|
|
71
|
+
|
|
72
|
+
IStaticOracle public STATIC_ORACLE;
|
|
41
73
|
|
|
42
74
|
event Distribution(
|
|
43
75
|
uint256 distributed,
|
|
@@ -48,19 +80,81 @@ contract DistributionHelper is
|
|
|
48
80
|
event RecipientUpdated(DistributionRecipient recipient, uint256 index);
|
|
49
81
|
event RecipientAdded(DistributionRecipient recipient, uint256 index);
|
|
50
82
|
|
|
83
|
+
receive() external payable {}
|
|
84
|
+
|
|
51
85
|
function initialize(INameService _ns) external initializer {
|
|
52
86
|
__AccessControlEnumerable_init();
|
|
53
87
|
setDAO(_ns);
|
|
54
88
|
_setupRole(DEFAULT_ADMIN_ROLE, avatar); //this needs to happen after setDAO for avatar to be non empty
|
|
89
|
+
_setupRole(GUARDIAN_ROLE, avatar);
|
|
55
90
|
updateAddresses();
|
|
56
91
|
}
|
|
57
92
|
|
|
58
93
|
function updateAddresses() public {
|
|
59
94
|
fuseBridge = nameService.getAddress("BRIDGE_CONTRACT");
|
|
60
|
-
|
|
61
|
-
nameService.getAddress("
|
|
95
|
+
mpbBridge = IMessagePassingBridge(
|
|
96
|
+
nameService.getAddress("MPBBRIDGE_CONTRACT")
|
|
97
|
+
);
|
|
98
|
+
STATIC_ORACLE = IStaticOracle(0xB210CE856631EeEB767eFa666EC7C1C57738d438); //@mean-finance/uniswap-v3-oracle
|
|
99
|
+
_setupRole(GUARDIAN_ROLE, avatar);
|
|
100
|
+
_setupRole(GUARDIAN_ROLE, 0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec); //guardians on ethereum
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function setFeeSettings(
|
|
104
|
+
FeeSettings memory _feeData
|
|
105
|
+
) external onlyRole(GUARDIAN_ROLE) {
|
|
106
|
+
feeSettings = _feeData;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getTargetChainRefundAddress(
|
|
110
|
+
uint256 chainId
|
|
111
|
+
) public pure returns (address) {
|
|
112
|
+
if (chainId == 122) return 0xf96dADc6D71113F6500e97590760C924dA1eF70e; //avatar on fuse
|
|
113
|
+
if (chainId == 42220) return 0x495d133B938596C9984d462F007B676bDc57eCEC; //avatar on celo
|
|
114
|
+
|
|
115
|
+
revert("refund chainId");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function getTargetChainGasInEth(
|
|
119
|
+
uint256 gasCostWei,
|
|
120
|
+
uint256 chainId
|
|
121
|
+
) public view returns (uint256 quote) {
|
|
122
|
+
address baseToken;
|
|
123
|
+
if (chainId == 122) baseToken = FUSE_TOKEN;
|
|
124
|
+
else if (chainId == 42220) baseToken = CELO_TOKEN;
|
|
125
|
+
else revert("baseToken chainId");
|
|
126
|
+
|
|
127
|
+
uint24[] memory fees = new uint24[](1);
|
|
128
|
+
fees[0] = 3000;
|
|
129
|
+
(quote, ) = STATIC_ORACLE.quoteSpecificFeeTiersWithTimePeriod(
|
|
130
|
+
uint128(gasCostWei),
|
|
131
|
+
baseToken,
|
|
132
|
+
WETH_TOKEN,
|
|
133
|
+
fees,
|
|
134
|
+
60 //last 1 minute
|
|
62
135
|
);
|
|
63
|
-
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getAxelarFee(
|
|
139
|
+
uint256 targetChainId
|
|
140
|
+
) public view returns (uint256 feeInEth) {
|
|
141
|
+
uint256 executeFeeInEth = getTargetChainGasInEth(
|
|
142
|
+
feeSettings.bridgeExecuteGas * feeSettings.targetChainGasPrice,
|
|
143
|
+
targetChainId
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
uint24[] memory fees = new uint24[](1);
|
|
147
|
+
fees[0] = 500;
|
|
148
|
+
(uint256 baseFeeInEth, ) = STATIC_ORACLE
|
|
149
|
+
.quoteSpecificFeeTiersWithTimePeriod(
|
|
150
|
+
uint128(feeSettings.axelarBaseFeeUSD) / 1e12, //reduce to usdc 6 decimals
|
|
151
|
+
USDC_TOKEN,
|
|
152
|
+
WETH_TOKEN,
|
|
153
|
+
fees,
|
|
154
|
+
60 //last 1 minute
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
feeInEth = ((baseFeeInEth + executeFeeInEth) * 110) / 100; //add 10%
|
|
64
158
|
}
|
|
65
159
|
|
|
66
160
|
/**
|
|
@@ -73,6 +167,13 @@ contract DistributionHelper is
|
|
|
73
167
|
uint256 toDistribute = nativeToken().balanceOf(address(this));
|
|
74
168
|
if (toDistribute == 0) return;
|
|
75
169
|
|
|
170
|
+
if (address(this).balance < feeSettings.minBalanceForFees) {
|
|
171
|
+
uint256 gdToSellfForFee = (toDistribute *
|
|
172
|
+
feeSettings.percentageToSellForFee) / 100;
|
|
173
|
+
toDistribute -= gdToSellfForFee;
|
|
174
|
+
buyNativeWithGD(gdToSellfForFee);
|
|
175
|
+
}
|
|
176
|
+
|
|
76
177
|
uint256 totalDistributed;
|
|
77
178
|
for (uint256 i = 0; i < distributionRecipients.length; i++) {
|
|
78
179
|
DistributionRecipient storage r = distributionRecipients[i];
|
|
@@ -98,14 +199,7 @@ contract DistributionHelper is
|
|
|
98
199
|
function addOrUpdateRecipient(
|
|
99
200
|
DistributionRecipient memory _recipient
|
|
100
201
|
) external onlyRole(DEFAULT_ADMIN_ROLE) {
|
|
101
|
-
// console.log("addOrUpdate addr: %s", _recipient.addr);
|
|
102
202
|
for (uint256 i = 0; i < distributionRecipients.length; i++) {
|
|
103
|
-
// console.log(
|
|
104
|
-
// "addOrUpdate addr: %s idx: %s, recipient: %s",
|
|
105
|
-
// _recipient.addr,
|
|
106
|
-
// i,
|
|
107
|
-
// distributionRecipients[i].addr
|
|
108
|
-
// );
|
|
109
203
|
if (distributionRecipients[i].addr == _recipient.addr) {
|
|
110
204
|
distributionRecipients[i] = _recipient;
|
|
111
205
|
emit RecipientUpdated(_recipient, i);
|
|
@@ -132,18 +226,48 @@ contract DistributionHelper is
|
|
|
132
226
|
_amount,
|
|
133
227
|
abi.encodePacked(_recipient.addr)
|
|
134
228
|
);
|
|
135
|
-
} else if (_recipient.transferType == TransferType.
|
|
136
|
-
nativeToken().approve(address(
|
|
137
|
-
|
|
138
|
-
|
|
229
|
+
} else if (_recipient.transferType == TransferType.LayerZeroBridge) {
|
|
230
|
+
nativeToken().approve(address(mpbBridge), _amount);
|
|
231
|
+
(uint256 lzFee, ) = ILayerZeroFeeEstimator(address(mpbBridge))
|
|
232
|
+
.estimateSendFee(
|
|
233
|
+
mpbBridge.toLzChainId(_recipient.chainId),
|
|
234
|
+
address(this),
|
|
235
|
+
_recipient.addr,
|
|
236
|
+
_amount,
|
|
237
|
+
false,
|
|
238
|
+
abi.encodePacked(uint16(1), uint256(400000)) // 400k gas to execute bridge at target chain
|
|
239
|
+
);
|
|
240
|
+
if (lzFee > feeSettings.maxFee) revert FEE_LIMIT(lzFee);
|
|
241
|
+
|
|
242
|
+
mpbBridge.bridgeToWithLz{ value: lzFee }(
|
|
139
243
|
_recipient.addr,
|
|
244
|
+
_recipient.chainId,
|
|
140
245
|
_amount,
|
|
141
|
-
|
|
246
|
+
""
|
|
142
247
|
);
|
|
143
|
-
} else if (_recipient.transferType == TransferType.
|
|
248
|
+
} else if (_recipient.transferType == TransferType.AxelarBridge) {
|
|
249
|
+
nativeToken().approve(address(mpbBridge), _amount);
|
|
250
|
+
uint256 axlFee = getAxelarFee(_recipient.chainId);
|
|
251
|
+
|
|
252
|
+
if (axlFee > feeSettings.maxFee) revert FEE_LIMIT(axlFee);
|
|
253
|
+
|
|
254
|
+
mpbBridge.bridgeToWithAxelar{ value: axlFee }(
|
|
255
|
+
_recipient.addr,
|
|
256
|
+
_recipient.chainId,
|
|
257
|
+
_amount,
|
|
258
|
+
getTargetChainRefundAddress(_recipient.chainId)
|
|
259
|
+
);
|
|
260
|
+
} else if (_recipient.transferType == TransferType.Contract) {
|
|
144
261
|
nativeToken().transferAndCall(_recipient.addr, _amount, "");
|
|
145
|
-
} else if (_recipient.transferType == TransferType.Transfer) {
|
|
146
|
-
nativeToken().transfer(_recipient.addr, _amount);
|
|
147
262
|
}
|
|
148
263
|
}
|
|
264
|
+
|
|
265
|
+
function buyNativeWithGD(uint256 amountToSell) internal {
|
|
266
|
+
address[] memory path = new address[](2);
|
|
267
|
+
path[0] = nameService.getAddress("DAI");
|
|
268
|
+
path[1] = address(0);
|
|
269
|
+
address exchg = nameService.getAddress("EXCHANGE_HELPER");
|
|
270
|
+
nativeToken().approve(exchg, amountToSell);
|
|
271
|
+
ExchangeHelper(exchg).sell(path, amountToSell, 0, 0, address(this));
|
|
272
|
+
}
|
|
149
273
|
}
|
|
@@ -54,9 +54,11 @@ contract GoodReserveCDai is
|
|
|
54
54
|
/// @dev mark if user claimed his GDX
|
|
55
55
|
mapping(address => bool) public isClaimedGDX;
|
|
56
56
|
|
|
57
|
-
uint32
|
|
57
|
+
uint32 private unused_nonUbiBps; //keep for storage structure upgrades. //how much of expansion G$ to allocate for non Ubi causes
|
|
58
58
|
DistributionHelper public distributionHelper; //in charge of distributing non UBI to different recipients
|
|
59
59
|
|
|
60
|
+
bool public gdxDisabled;
|
|
61
|
+
bool public discountDisabled;
|
|
60
62
|
// Emits when new GD tokens minted
|
|
61
63
|
event UBIMinted(
|
|
62
64
|
//epoch of UBI
|
|
@@ -123,11 +125,10 @@ contract GoodReserveCDai is
|
|
|
123
125
|
|
|
124
126
|
event DistributionHelperSet(address distributionHelper, uint32 bps);
|
|
125
127
|
|
|
126
|
-
function initialize(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{
|
|
128
|
+
function initialize(
|
|
129
|
+
INameService _ns,
|
|
130
|
+
bytes32 _gdxAirdrop
|
|
131
|
+
) public virtual initializer {
|
|
131
132
|
__ERC20PresetMinterPauser_init("GDX", "G$X");
|
|
132
133
|
setDAO(_ns);
|
|
133
134
|
|
|
@@ -148,12 +149,6 @@ contract GoodReserveCDai is
|
|
|
148
149
|
gdxAirdrop = _gdxAirdrop;
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
//no longer required
|
|
152
|
-
// function setGDXAirdrop(bytes32 _airdrop) external {
|
|
153
|
-
// _onlyAvatar();
|
|
154
|
-
// gdxAirdrop = _airdrop;
|
|
155
|
-
// }
|
|
156
|
-
|
|
157
152
|
/// @dev GDX decimals
|
|
158
153
|
function decimals() public pure override returns (uint8) {
|
|
159
154
|
return 2;
|
|
@@ -264,11 +259,15 @@ contract GoodReserveCDai is
|
|
|
264
259
|
}
|
|
265
260
|
_target = _target == address(0x0) ? msg.sender : _target;
|
|
266
261
|
//discount on exit contribution based on gdx
|
|
267
|
-
uint256 gdx = balanceOf(_seller);
|
|
268
|
-
uint256 discount = gdx <= _gdAmount ? gdx : _gdAmount;
|
|
269
262
|
|
|
270
|
-
|
|
271
|
-
if (
|
|
263
|
+
uint256 discount;
|
|
264
|
+
if (discountDisabled == false) {
|
|
265
|
+
uint256 gdx = balanceOf(_seller);
|
|
266
|
+
discount = gdx <= _gdAmount ? gdx : _gdAmount;
|
|
267
|
+
|
|
268
|
+
//burn gdx used for discount
|
|
269
|
+
if (discount > 0) _burn(_seller, discount);
|
|
270
|
+
}
|
|
272
271
|
|
|
273
272
|
uint256 contributionAmount = 0;
|
|
274
273
|
uint256 gdAmountTemp = _gdAmount; // to prevent stack too deep errors
|
|
@@ -352,7 +351,7 @@ contract GoodReserveCDai is
|
|
|
352
351
|
|
|
353
352
|
/// @dev helper to mint GDX to make _mint more verbose
|
|
354
353
|
function _mintGDX(address _to, uint256 _gdx) internal {
|
|
355
|
-
_mint(_to, _gdx);
|
|
354
|
+
if (gdxDisabled == false) _mint(_to, _gdx);
|
|
356
355
|
}
|
|
357
356
|
|
|
358
357
|
/**
|
|
@@ -377,31 +376,15 @@ contract GoodReserveCDai is
|
|
|
377
376
|
);
|
|
378
377
|
uint256 gdExpansionToMint = getMarketMaker().mintExpansion(_interestToken);
|
|
379
378
|
|
|
380
|
-
uint256 nonUBI;
|
|
381
|
-
|
|
382
379
|
lastMinted = block.number;
|
|
383
380
|
uint256 gdUBI = gdInterestToMint + gdExpansionToMint;
|
|
384
381
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
//
|
|
389
|
-
|
|
390
|
-
// );
|
|
391
|
-
|
|
392
|
-
if (nonUbiBps > 0 && address(distributionHelper) != address(0)) {
|
|
393
|
-
nonUBI = (gdExpansionToMint * nonUbiBps) / 10000;
|
|
394
|
-
gdUBI -= nonUBI;
|
|
395
|
-
_mintGoodDollars(address(distributionHelper), nonUBI, false);
|
|
396
|
-
bool success = true;
|
|
397
|
-
try distributionHelper.onDistribution(nonUBI) {} catch {
|
|
398
|
-
success = false;
|
|
399
|
-
} //should not prevent mintUBI from completing
|
|
400
|
-
emit NonUBIMinted(address(distributionHelper), nonUBI, success);
|
|
401
|
-
}
|
|
382
|
+
require(address(distributionHelper) != address(0), "helper not set");
|
|
383
|
+
_mintGoodDollars(address(distributionHelper), gdUBI, false); //mintGoodDollars enforces that only minter can call mintUBI
|
|
384
|
+
|
|
385
|
+
// if bridging fails this will revert. this is expected behavior
|
|
386
|
+
distributionHelper.onDistribution(gdUBI);
|
|
402
387
|
|
|
403
|
-
//this enforces who can call the public mintUBI method. only an address with permissions at reserve of RESERVE_MINTER_ROLE
|
|
404
|
-
_mintGoodDollars(nameService.getAddress("FUND_MANAGER"), gdUBI, false);
|
|
405
388
|
emit UBIMinted(
|
|
406
389
|
lastMinted,
|
|
407
390
|
address(_interestToken),
|
|
@@ -417,15 +400,11 @@ contract GoodReserveCDai is
|
|
|
417
400
|
/**
|
|
418
401
|
* @notice allows Avatar to change or set the distribution helper
|
|
419
402
|
* @param _helper address of distributionhelper contract
|
|
420
|
-
* @param _bps how much of UBI to transfer in basis points
|
|
421
403
|
*/
|
|
422
|
-
function setDistributionHelper(DistributionHelper _helper
|
|
423
|
-
external
|
|
424
|
-
{
|
|
404
|
+
function setDistributionHelper(DistributionHelper _helper) external {
|
|
425
405
|
_onlyAvatar();
|
|
426
406
|
distributionHelper = _helper;
|
|
427
|
-
|
|
428
|
-
emit DistributionHelperSet(address(_helper), _bps);
|
|
407
|
+
emit DistributionHelperSet(address(_helper), 10000);
|
|
429
408
|
}
|
|
430
409
|
|
|
431
410
|
/**
|
|
@@ -436,13 +415,26 @@ contract GoodReserveCDai is
|
|
|
436
415
|
* @param _nom The numerator to calculate the global `reserveRatioDailyExpansion` from
|
|
437
416
|
* @param _denom The denominator to calculate the global `reserveRatioDailyExpansion` from
|
|
438
417
|
*/
|
|
439
|
-
function setReserveRatioDailyExpansion(
|
|
440
|
-
|
|
441
|
-
|
|
418
|
+
function setReserveRatioDailyExpansion(
|
|
419
|
+
uint256 _nom,
|
|
420
|
+
uint256 _denom
|
|
421
|
+
) external {
|
|
442
422
|
_onlyAvatar();
|
|
443
423
|
getMarketMaker().setReserveRatioDailyExpansion(_nom, _denom);
|
|
444
424
|
}
|
|
445
425
|
|
|
426
|
+
//
|
|
427
|
+
/**
|
|
428
|
+
* @dev Sets the GDX and discount disabled flags.
|
|
429
|
+
* @param _gdxDisabled Whether GDX minting is disabled or not.
|
|
430
|
+
* @param _discountDisabled Whether the discount for existing GDX holders is disabled or not.
|
|
431
|
+
*/
|
|
432
|
+
function setGDXDisabled(bool _gdxDisabled, bool _discountDisabled) external {
|
|
433
|
+
_onlyAvatar();
|
|
434
|
+
gdxDisabled = _gdxDisabled;
|
|
435
|
+
discountDisabled = _discountDisabled;
|
|
436
|
+
}
|
|
437
|
+
|
|
446
438
|
/**
|
|
447
439
|
* @dev Remove minting rights after it has transferred the cDAI funds to `_avatar`
|
|
448
440
|
* Only the Avatar can execute this method
|
|
@@ -238,14 +238,14 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
238
238
|
// DAI balance of the reserve contract
|
|
239
239
|
uint256 currentBalance = daiToken.balanceOf(reserveAddress);
|
|
240
240
|
uint256 startingCDAIBalance = iToken.balanceOf(reserveAddress);
|
|
241
|
-
for (uint256 i = _stakingContracts.length
|
|
241
|
+
for (uint256 i = _stakingContracts.length; i > 0; i--) {
|
|
242
242
|
// elements are sorted by balances from lowest to highest
|
|
243
243
|
|
|
244
|
-
if (_stakingContracts[i] != address(0x0)) {
|
|
245
|
-
IGoodStaking(_stakingContracts[i]).collectUBIInterest(
|
|
244
|
+
if (_stakingContracts[i - 1] != address(0x0)) {
|
|
245
|
+
IGoodStaking(_stakingContracts[i - 1]).collectUBIInterest(
|
|
246
|
+
reserveAddress
|
|
247
|
+
);
|
|
246
248
|
}
|
|
247
|
-
|
|
248
|
-
if (i == 0) break; // when active contracts length is 1 then gives error
|
|
249
249
|
}
|
|
250
250
|
// Finds the actual transferred DAI
|
|
251
251
|
uint256 daiToConvert = daiToken.balanceOf(reserveAddress) -
|
|
@@ -257,19 +257,6 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
257
257
|
startingCDAIBalance,
|
|
258
258
|
iToken
|
|
259
259
|
);
|
|
260
|
-
|
|
261
|
-
IGoodDollar token = IGoodDollar(nameService.getAddress("GOODDOLLAR"));
|
|
262
|
-
if (gdUBI > 0) {
|
|
263
|
-
//transfer ubi to avatar on sidechain via bridge
|
|
264
|
-
require(
|
|
265
|
-
token.transferAndCall(
|
|
266
|
-
nameService.getAddress("BRIDGE_CONTRACT"),
|
|
267
|
-
gdUBI,
|
|
268
|
-
abi.encodePacked(nameService.getAddress("UBI_RECIPIENT"))
|
|
269
|
-
),
|
|
270
|
-
"ubi bridge transfer failed"
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
260
|
}
|
|
274
261
|
|
|
275
262
|
uint256 gdRewardToMint;
|
|
@@ -285,22 +272,17 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
285
272
|
gdRewardToMint
|
|
286
273
|
);
|
|
287
274
|
|
|
288
|
-
uint256 gasPriceIncDAI = getGasPriceIncDAIorDAI(
|
|
289
|
-
initialGas - gasleft(),
|
|
290
|
-
false
|
|
291
|
-
);
|
|
275
|
+
uint256 gasPriceIncDAI = getGasPriceIncDAIorDAI(totalUsedGas, false);
|
|
292
276
|
|
|
293
277
|
if (
|
|
294
278
|
block.timestamp >= lastCollectedInterest + collectInterestTimeThreshold
|
|
295
279
|
) {
|
|
296
|
-
require(
|
|
297
|
-
interestInCdai >= gasPriceIncDAI,
|
|
298
|
-
"Collected interest value should be larger than spent gas costs"
|
|
299
|
-
); // This require is necessary to keeper can not abuse this function
|
|
280
|
+
require(interestInCdai >= gasPriceIncDAI, "UBI < gas costs"); // This require is necessary to keeper can not abuse this function
|
|
300
281
|
} else {
|
|
301
282
|
require(
|
|
302
|
-
interestInCdai >= interestMultiplier * gasPriceIncDAI
|
|
303
|
-
|
|
283
|
+
interestInCdai >= interestMultiplier * gasPriceIncDAI ||
|
|
284
|
+
gdUBI >= interestMultiplier * gdRewardToMint,
|
|
285
|
+
"UBI < X*gas costs"
|
|
304
286
|
);
|
|
305
287
|
}
|
|
306
288
|
}
|
|
@@ -400,10 +382,10 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
400
382
|
}
|
|
401
383
|
|
|
402
384
|
/// quick sort
|
|
403
|
-
function quick(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
{
|
|
385
|
+
function quick(
|
|
386
|
+
uint256[] memory data,
|
|
387
|
+
address[] memory addresses
|
|
388
|
+
) internal pure {
|
|
407
389
|
if (data.length > 1) {
|
|
408
390
|
quickPart(data, addresses, 0, data.length - 1);
|
|
409
391
|
}
|
|
@@ -447,11 +429,10 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
447
429
|
@param _inDAI indicates if result should return in DAI
|
|
448
430
|
@return Price of the gas in DAI/cDAI
|
|
449
431
|
*/
|
|
450
|
-
function getGasPriceIncDAIorDAI(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
{
|
|
432
|
+
function getGasPriceIncDAIorDAI(
|
|
433
|
+
uint256 _gasAmount,
|
|
434
|
+
bool _inDAI
|
|
435
|
+
) public view returns (uint256) {
|
|
455
436
|
AggregatorV3Interface gasPriceOracle = AggregatorV3Interface(
|
|
456
437
|
nameService.getAddress("GAS_PRICE_ORACLE")
|
|
457
438
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity >=0.8;
|
|
4
4
|
import "./ERC677.sol";
|
|
5
|
-
import "./
|
|
5
|
+
import "./IFeesFormula.sol";
|
|
6
6
|
import "../Interfaces.sol";
|
|
7
7
|
import "./ERC20PresetMinterPauserUpgradeable.sol";
|
|
8
8
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
@@ -60,11 +60,9 @@ contract GoodDollar is
|
|
|
60
60
|
_;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
function _authorizeUpgrade(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
onlyOwner
|
|
67
|
-
{}
|
|
63
|
+
function _authorizeUpgrade(
|
|
64
|
+
address newImplementation
|
|
65
|
+
) internal override onlyOwner {}
|
|
68
66
|
|
|
69
67
|
function decimals() public view virtual override returns (uint8) {
|
|
70
68
|
return 2;
|
|
@@ -115,11 +113,10 @@ contract GoodDollar is
|
|
|
115
113
|
* transferred
|
|
116
114
|
* @return a boolean that indicates if the operation was successful
|
|
117
115
|
*/
|
|
118
|
-
function transfer(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{
|
|
116
|
+
function transfer(
|
|
117
|
+
address to,
|
|
118
|
+
uint256 value
|
|
119
|
+
) public override(ERC20Upgradeable, ERC677) returns (bool) {
|
|
123
120
|
uint256 bruttoValue = _processFees(msg.sender, to, value);
|
|
124
121
|
return ERC20Upgradeable.transfer(to, bruttoValue);
|
|
125
122
|
}
|
|
@@ -184,11 +181,9 @@ contract GoodDollar is
|
|
|
184
181
|
* @dev Gets the current transaction fees
|
|
185
182
|
* @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
|
|
186
183
|
*/
|
|
187
|
-
function getFees(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
returns (uint256 fee, bool senderPays)
|
|
191
|
-
{
|
|
184
|
+
function getFees(
|
|
185
|
+
uint256 value
|
|
186
|
+
) public view returns (uint256 fee, bool senderPays) {
|
|
192
187
|
return formula.getTxFees(value, address(0), address(0));
|
|
193
188
|
}
|
|
194
189
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8;
|
|
3
|
+
|
|
4
|
+
import "./IFeesFormula.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This fee formula protects transfering any G$s locked in the now disfunctional multichain bridge
|
|
8
|
+
* by taxing them 100%. also preventing sending funds to the bridge.
|
|
9
|
+
*/
|
|
10
|
+
contract MultichainFeeFormula is IFeesFormula {
|
|
11
|
+
/**
|
|
12
|
+
* take any transfered funds from multichain bridge as fee
|
|
13
|
+
* for other txs fee will stay 0
|
|
14
|
+
*/
|
|
15
|
+
function getTxFees(
|
|
16
|
+
uint256 value,
|
|
17
|
+
address sender,
|
|
18
|
+
address recipient
|
|
19
|
+
) public view returns (uint256 fee, bool senderPays) {
|
|
20
|
+
senderPays = false;
|
|
21
|
+
|
|
22
|
+
if (sender == address(0xD17652350Cfd2A37bA2f947C910987a3B1A1c60d))
|
|
23
|
+
fee = value;
|
|
24
|
+
if (recipient == address(0xD17652350Cfd2A37bA2f947C910987a3B1A1c60d))
|
|
25
|
+
revert("multichain hack");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* required by old GoodDollar on ethereum
|
|
30
|
+
*/
|
|
31
|
+
function isRegistered() public pure returns (bool) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -4,7 +4,7 @@ pragma solidity >=0.8;
|
|
|
4
4
|
|
|
5
5
|
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol";
|
|
6
6
|
import { ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/CustomSuperTokenBase.sol";
|
|
7
|
-
import "../
|
|
7
|
+
import "../IFeesFormula.sol";
|
|
8
8
|
import "../../Interfaces.sol";
|
|
9
9
|
|
|
10
10
|
// GoodDollar specific functions
|
|
@@ -12,10 +12,9 @@ interface IGoodDollarCustom {
|
|
|
12
12
|
// view functions
|
|
13
13
|
function feeRecipient() external view returns (address);
|
|
14
14
|
|
|
15
|
-
function getFees(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
returns (uint256 fee, bool senderPays);
|
|
15
|
+
function getFees(
|
|
16
|
+
uint256 value
|
|
17
|
+
) external view returns (uint256 fee, bool senderPays);
|
|
19
18
|
|
|
20
19
|
function getFees(
|
|
21
20
|
uint256 value,
|