@gooddollar/goodprotocol 2.0.25-beta.0 → 2.0.25-beta.10
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/BulkWhitelist.min.json +1 -0
- package/artifacts/abis/CompoundVotingMachine.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/EternalStorage.min.json +1 -0
- package/artifacts/abis/FuseOldBridgeKill.min.json +1 -0
- package/artifacts/abis/FuseStakingV3.min.json +1 -1
- package/artifacts/abis/GoodFundManager.min.json +1 -1
- package/artifacts/abis/GoodFundManagerTest.min.json +1 -1
- package/artifacts/abis/GoodMarketMaker.min.json +1 -1
- package/artifacts/abis/GoodReserveCDai.min.json +1 -1
- package/artifacts/abis/IQuoterV2.min.json +1 -1
- package/artifacts/abis/ISwapRouter.min.json +1 -1
- package/artifacts/abis/IUpgradeabilityOwnerStorage.min.json +1 -0
- package/artifacts/abis/Initializable.min.json +1 -0
- package/artifacts/abis/InvitesV2.min.json +1 -1
- package/artifacts/abis/LastauthReduction.min.json +1 -0
- package/artifacts/abis/OneTimeReward.min.json +1 -0
- package/artifacts/abis/Ownable.min.json +1 -0
- package/artifacts/abis/ReserveRestore.min.json +1 -0
- package/artifacts/abis/Upgradeable.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/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 +4 -0
- package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +4 -0
- package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.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 +20 -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 +15 -2
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +4 -0
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.json +291 -0
- 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/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/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +21 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +21 -2
- 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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- 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 +21 -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/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/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/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/SwapHelperTest.sol/SwapHelperTest.json +2 -2
- 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/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/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/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +21 -2
- 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 +6 -6
- 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 +3 -3
- 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 +7 -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 +21 -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/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/GoodDollar.sol/GoodDollar.json +2 -2
- 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/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- 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/UBIScheme.sol/UBIScheme.json +2 -2
- 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/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/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +4 -0
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.json +67 -0
- 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/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.json +2 -2
- 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/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.json +10 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.json +31 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.json +24 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.json +24 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.json +56 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.json +10 -0
- 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/LastauthReduction.sol/LastauthReduction.dbg.json +4 -0
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +81 -0
- 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/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
- 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/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/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +4 -0
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +91 -0
- package/contracts/Interfaces.sol +122 -0
- package/contracts/governance/CompoundVotingMachine.sol +26 -11
- package/contracts/governance/StakersDistribution.sol +13 -13
- package/contracts/invite/InvitesV2.sol +60 -43
- package/contracts/invite/OneTimeReward.sol +87 -0
- package/contracts/reserve/DistributionHelper.sol +29 -10
- package/contracts/reserve/ExchangeHelper.sol +16 -7
- package/contracts/reserve/GoodMarketMaker.sol +43 -53
- package/contracts/reserve/GoodReserveCDai.sol +44 -16
- package/contracts/staking/FuseStakingV3.sol +4 -2
- package/contracts/staking/GoodFundManager.sol +44 -4
- package/contracts/utils/BulkWhitelist.sol +51 -0
- package/contracts/utils/BuyGDClone.sol +0 -122
- package/contracts/utils/FuseOldBridgeKill.sol +123 -0
- package/contracts/utils/LastauthReduction.sol +92 -0
- package/contracts/utils/ReserveRestore.sol +157 -0
- package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- package/dist/test-sdk/deploySuperGoodDollar.js +1 -1
- package/package.json +19 -20
- package/releases/deployment.json +612 -599
- package/scripts/analytics/activeStakers.ts +25 -0
- package/scripts/analytics/activeUsersCount.ts +80 -26
- package/scripts/analytics/activeWalletsStats.ts +155 -22
- package/scripts/analytics/checkBridgeBalances.ts +442 -0
- package/scripts/deployFullDAO.ts +6 -4
- package/scripts/fv.ts +148 -35
- package/scripts/multichain-deploy/helpers.ts +10 -8
- package/scripts/proposals/identityAuthPeriod.ts +229 -0
- package/scripts/proposals/reserveRestore.ts +429 -0
- package/scripts/test/localOldDaoDeploy.ts +2 -1
- package/scripts/utils.ts +28 -16
- package/test/governance/CompoundVotingMachine.daoscheme.ts +3 -0
- package/test/governance/CompoundVotingMachine.guardian.test.ts +76 -21
- package/test/governance/CompoundVotingMachine.state.test.ts +31 -28
- package/test/governance/StakersDistribution.test.ts +79 -5
- package/test/helpers.ts +9 -0
- package/test/invite/InvitesV2.test.ts +165 -271
- package/test/reserve/DistributionHelper.test.ts +10 -10
- package/test/reserve/GoodMarketMaker.test.ts +75 -26
- package/test/reserve/GoodReserveCDai.test.ts +2 -1
- package/test/staking/FuseStaking.test.ts +23 -54
- package/test/staking/StakingRewards.test.ts +106 -29
- package/test/utils/ProtocolUpgrade.test.ts +1 -0
- package/tsconfig.json +1 -1
- package/types/@openzeppelin/contracts/access/Ownable.ts +175 -0
- package/types/@openzeppelin/contracts/access/index.ts +1 -0
- package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.ts +1 -1
- package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.ts +1 -1
- package/types/contracts/Interfaces.sol/index.ts +2 -0
- package/types/contracts/governance/CompoundVotingMachine.ts +44 -3
- package/types/contracts/invite/InvitesV2.ts +32 -0
- package/types/contracts/invite/OneTimeReward.ts +521 -0
- package/types/contracts/invite/index.ts +1 -0
- package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.ts +35 -0
- package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.ts +35 -0
- package/types/contracts/mocks/GoodFundManagerTest.ts +35 -0
- package/types/contracts/reserve/DistributionHelper.ts +35 -0
- package/types/contracts/reserve/GoodMarketMaker.ts +3 -3
- package/types/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.ts +5 -5
- package/types/contracts/staking/FuseStakingV3.sol/FuseStakingV3.ts +7 -2
- package/types/contracts/staking/GoodFundManager.ts +35 -0
- package/types/contracts/utils/BulkWhitelist.ts +153 -0
- package/types/contracts/utils/BuyGDClone.sol/index.ts +0 -2
- package/types/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.ts +108 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.ts +89 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/Initializable.ts +87 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/Ownable.ts +148 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
- package/types/contracts/utils/LastauthReduction.ts +168 -0
- package/types/contracts/utils/ReserveRestore.ts +201 -0
- package/types/contracts/utils/index.ts +5 -0
- package/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +78 -0
- package/types/factories/@openzeppelin/contracts/access/index.ts +1 -0
- package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2__factory.ts +1 -1
- package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter__factory.ts +1 -1
- package/types/factories/contracts/Interfaces.sol/index.ts +2 -0
- package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +1 -1
- package/types/factories/contracts/fuseFaucet/FuseFaucetV2__factory.ts +1 -1
- package/types/factories/contracts/fuseFaucet/FuseFaucet__factory.ts +1 -1
- package/types/factories/contracts/governance/ClaimersDistribution__factory.ts +1 -1
- package/types/factories/contracts/governance/CompoundVotingMachine__factory.ts +19 -1
- package/types/factories/contracts/governance/GReputation__factory.ts +1 -1
- package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/contracts/governance/GovernanceStaking__factory.ts +1 -1
- package/types/factories/contracts/governance/Reputation__factory.ts +1 -1
- package/types/factories/contracts/governance/StakersDistribution__factory.ts +1 -1
- package/types/factories/contracts/identity/IdentityV2__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesV1__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesV2__factory.ts +14 -1
- package/types/factories/contracts/invite/OneTimeReward__factory.ts +361 -0
- package/types/factories/contracts/invite/index.ts +1 -0
- package/types/factories/contracts/mocks/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +20 -1
- package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest__factory.ts +20 -1
- package/types/factories/contracts/mocks/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodFundManagerTest__factory.ts +20 -1
- package/types/factories/contracts/mocks/IdentityMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/OverMintTester.sol/OverMintTester__factory.ts +1 -1
- package/types/factories/contracts/mocks/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/contracts/mocks/SwapHelperTest__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock2__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock3__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock4__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock__factory.ts +1 -1
- package/types/factories/contracts/reserve/DistributionHelper__factory.ts +20 -1
- package/types/factories/contracts/reserve/ExchangeHelper__factory.ts +1 -1
- package/types/factories/contracts/reserve/GoodMarketMaker__factory.ts +5 -5
- package/types/factories/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai__factory.ts +2 -2
- package/types/factories/contracts/staking/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/contracts/staking/BaseShareField__factory.ts +1 -1
- package/types/factories/contracts/staking/DonationsStaking__factory.ts +1 -1
- package/types/factories/contracts/staking/FuseStakingV3.sol/FuseStakingV3__factory.ts +6 -1
- package/types/factories/contracts/staking/GoodFundManager__factory.ts +20 -1
- package/types/factories/contracts/staking/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/contracts/token/GoodDollar__factory.ts +1 -1
- package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +1 -1
- package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
- package/types/factories/contracts/ubi/UBIScheme__factory.ts +1 -1
- package/types/factories/contracts/utils/AdminWalletFuse__factory.ts +1 -1
- package/types/factories/contracts/utils/AdminWallet__factory.ts +1 -1
- package/types/factories/contracts/utils/BulkWhitelist__factory.ts +123 -0
- package/types/factories/contracts/utils/BuyAndBridgeHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDClone__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/DonateGDClone__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/index.ts +0 -2
- package/types/factories/contracts/utils/DAOContract__factory.ts +1 -1
- package/types/factories/contracts/utils/DAOUpgradeableContract__factory.ts +1 -1
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill__factory.ts +82 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage__factory.ts +43 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Initializable__factory.ts +75 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Ownable__factory.ts +105 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
- package/types/factories/contracts/utils/GDFaucet__factory.ts +1 -1
- package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper__factory.ts +1 -1
- package/types/factories/contracts/utils/IdentityFix__factory.ts +1 -1
- package/types/factories/contracts/utils/LastauthReduction__factory.ts +134 -0
- package/types/factories/contracts/utils/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/OneTimePaymentsV2__factory.ts +1 -1
- package/types/factories/contracts/utils/OneTimePayments__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeFuseRecover__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeFuse__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeRecover__factory.ts +1 -1
- package/types/factories/contracts/utils/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/ReserveRestore__factory.ts +144 -0
- package/types/factories/contracts/utils/index.ts +4 -0
- package/types/hardhat.d.ts +97 -16
- package/types/index.ts +18 -4
- package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +0 -4
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +0 -4
- package/contracts/utils/.DS_Store +0 -0
- package/yarn.lock +0 -23715
|
@@ -59,6 +59,9 @@ contract GoodReserveCDai is
|
|
|
59
59
|
|
|
60
60
|
bool public gdxDisabled;
|
|
61
61
|
bool public discountDisabled;
|
|
62
|
+
|
|
63
|
+
uint256 private _reentrantStatus;
|
|
64
|
+
|
|
62
65
|
// Emits when new GD tokens minted
|
|
63
66
|
event UBIMinted(
|
|
64
67
|
//epoch of UBI
|
|
@@ -186,19 +189,21 @@ contract GoodReserveCDai is
|
|
|
186
189
|
uint256 _tokenAmount,
|
|
187
190
|
uint256 _minReturn,
|
|
188
191
|
address _targetAddress
|
|
189
|
-
) external returns (uint256) {
|
|
192
|
+
) external nonReentrant returns (uint256) {
|
|
190
193
|
ERC20 buyWith = ERC20(cDaiAddress);
|
|
191
194
|
uint256 gdReturn = getMarketMaker().buy(buyWith, _tokenAmount);
|
|
192
195
|
_targetAddress = _targetAddress == address(0x0)
|
|
193
196
|
? msg.sender
|
|
194
197
|
: _targetAddress;
|
|
195
198
|
address exchangeHelper = nameService.getAddress("EXCHANGE_HELPER");
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
|
|
200
|
+
require(
|
|
201
|
+
buyWith.transferFrom(msg.sender, address(this), _tokenAmount) == true,
|
|
202
|
+
"transferFrom failed, make sure you approved input token transfer"
|
|
203
|
+
);
|
|
204
|
+
|
|
201
205
|
require(gdReturn >= _minReturn, "GD return must be above the minReturn");
|
|
206
|
+
|
|
202
207
|
_mintGoodDollars(_targetAddress, gdReturn, true);
|
|
203
208
|
//mint GDX
|
|
204
209
|
_mintGDX(_targetAddress, gdReturn);
|
|
@@ -224,7 +229,7 @@ contract GoodReserveCDai is
|
|
|
224
229
|
address _token,
|
|
225
230
|
address _to,
|
|
226
231
|
uint256 _amount
|
|
227
|
-
) external {
|
|
232
|
+
) external nonReentrant {
|
|
228
233
|
getMarketMaker().mintFromReserveRatio(ERC20(_token), _amount);
|
|
229
234
|
_mintGoodDollars(_to, _amount, false);
|
|
230
235
|
//mint GDX
|
|
@@ -247,16 +252,24 @@ contract GoodReserveCDai is
|
|
|
247
252
|
uint256 _minReturn,
|
|
248
253
|
address _target,
|
|
249
254
|
address _seller
|
|
250
|
-
) external returns (uint256, uint256) {
|
|
255
|
+
) external nonReentrant returns (uint256, uint256) {
|
|
251
256
|
require(paused() == false, "paused");
|
|
252
257
|
GoodMarketMaker mm = getMarketMaker();
|
|
253
258
|
if (msg.sender != nameService.getAddress("EXCHANGE_HELPER")) {
|
|
254
|
-
IGoodDollar(nameService.getAddress("GOODDOLLAR")).burnFrom(
|
|
255
|
-
msg.sender,
|
|
256
|
-
_gdAmount
|
|
257
|
-
);
|
|
258
259
|
_seller = msg.sender;
|
|
259
260
|
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* transferfrom and then burn instead of burnfrom to make sure funds after fee are valid
|
|
264
|
+
* ie specifically for addresses that hold stolen funds who has 100% fee applied
|
|
265
|
+
*/
|
|
266
|
+
IGoodDollar(nameService.getAddress("GOODDOLLAR")).transferFrom(
|
|
267
|
+
msg.sender,
|
|
268
|
+
address(this),
|
|
269
|
+
_gdAmount
|
|
270
|
+
);
|
|
271
|
+
IGoodDollar(nameService.getAddress("GOODDOLLAR")).burn(_gdAmount);
|
|
272
|
+
|
|
260
273
|
_target = _target == address(0x0) ? msg.sender : _target;
|
|
261
274
|
//discount on exit contribution based on gdx
|
|
262
275
|
|
|
@@ -358,18 +371,21 @@ contract GoodReserveCDai is
|
|
|
358
371
|
* @dev only FundManager or other with mint G$ permission can call this to trigger minting.
|
|
359
372
|
* Reserve sends UBI + interest to FundManager.
|
|
360
373
|
* @param _daiToConvert DAI amount to convert cDAI
|
|
361
|
-
* @param _startingCDAIBalance Initial cDAI balance before staking collect process start
|
|
362
374
|
* @param _interestToken The token that was transfered to the reserve
|
|
363
375
|
* @return gdUBI,interestInCdai how much GD UBI was minted and how much cDAI collected from staking contracts
|
|
364
376
|
*/
|
|
365
377
|
function mintUBI(
|
|
366
378
|
uint256 _daiToConvert,
|
|
367
|
-
uint256 _startingCDAIBalance,
|
|
379
|
+
uint256 /*_startingCDAIBalance*/, // dont trust it, use reserveSupply from marketmaker instead
|
|
368
380
|
ERC20 _interestToken
|
|
369
|
-
) external returns (uint256, uint256) {
|
|
381
|
+
) external nonReentrant returns (uint256, uint256) {
|
|
370
382
|
cERC20(cDaiAddress).mint(_daiToConvert);
|
|
383
|
+
|
|
384
|
+
(uint256 reserveSupply, , , ) = getMarketMaker().reserveTokens(cDaiAddress);
|
|
385
|
+
|
|
371
386
|
uint256 interestInCdai = _interestToken.balanceOf(address(this)) -
|
|
372
|
-
|
|
387
|
+
reserveSupply;
|
|
388
|
+
|
|
373
389
|
uint256 gdInterestToMint = getMarketMaker().mintInterest(
|
|
374
390
|
_interestToken,
|
|
375
391
|
interestInCdai
|
|
@@ -519,4 +535,16 @@ contract GoodReserveCDai is
|
|
|
519
535
|
function when() public pure override returns (CallPhase) {
|
|
520
536
|
return CallPhase.Pre;
|
|
521
537
|
}
|
|
538
|
+
|
|
539
|
+
modifier nonReentrant() {
|
|
540
|
+
// On the first call to nonReentrant, _status will be _NOT_ENTERED
|
|
541
|
+
require(_reentrantStatus != 1, "ReentrancyGuard: reentrant call");
|
|
542
|
+
|
|
543
|
+
// Any calls to nonReentrant after this point will fail
|
|
544
|
+
_reentrantStatus = 1;
|
|
545
|
+
_;
|
|
546
|
+
// By storing the original value once again, a refund is triggered (see
|
|
547
|
+
// https://eips.ethereum.org/EIPS/eip-2200)
|
|
548
|
+
_reentrantStatus = 0;
|
|
549
|
+
}
|
|
522
550
|
}
|
|
@@ -103,7 +103,7 @@ contract FuseStakingV3 is Initializable, OwnableUpgradeable {
|
|
|
103
103
|
validators.push(address(0xcb876A393F05a6677a8a029f1C6D7603B416C0A6));
|
|
104
104
|
stakeBackRatio = 33333; //%33
|
|
105
105
|
communityPoolRatio = 33333; //%33
|
|
106
|
-
maxSlippageRatio =
|
|
106
|
+
maxSlippageRatio = 600; //0.6%
|
|
107
107
|
keeperFeeRatio = 30; //0.03%
|
|
108
108
|
RATIO_BASE = 100000; //100%
|
|
109
109
|
uniswap = Uniswap(
|
|
@@ -146,10 +146,12 @@ contract FuseStakingV3 is Initializable, OwnableUpgradeable {
|
|
|
146
146
|
|
|
147
147
|
function updateSettings(
|
|
148
148
|
uint256 _stakeBackRatio,
|
|
149
|
-
uint256 _communityPoolRatio
|
|
149
|
+
uint256 _communityPoolRatio,
|
|
150
|
+
uint256 _maxSlippageRatio
|
|
150
151
|
) external onlyGuardian {
|
|
151
152
|
communityPoolRatio = _communityPoolRatio;
|
|
152
153
|
stakeBackRatio = _stakeBackRatio;
|
|
154
|
+
maxSlippageRatio = _maxSlippageRatio;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
function stake() public payable returns (bool) {
|
|
@@ -32,6 +32,13 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
32
32
|
//address of the active staking contracts
|
|
33
33
|
address[] public activeContracts;
|
|
34
34
|
|
|
35
|
+
// Rewards per block for particular Staking contract
|
|
36
|
+
mapping(address => Reward) public rewardsForStakingContract;
|
|
37
|
+
|
|
38
|
+
uint256 private _reentrantStatus;
|
|
39
|
+
|
|
40
|
+
/** ADD NEW VARIABLES AFTER THIS LINE **/
|
|
41
|
+
|
|
35
42
|
event GasCostSet(uint256 newGasCost);
|
|
36
43
|
event CollectInterestTimeThresholdSet(
|
|
37
44
|
uint256 newCollectInterestTimeThreshold
|
|
@@ -62,8 +69,7 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
62
69
|
uint256 maxGasAmountSoFar; // Max gas amount that can spend to collect this interest according to interest amount
|
|
63
70
|
bool maxGasLargerOrEqualRequired; // Bool that indicates if max gas amount larger or equal to actual gas needed
|
|
64
71
|
}
|
|
65
|
-
|
|
66
|
-
mapping(address => Reward) public rewardsForStakingContract;
|
|
72
|
+
|
|
67
73
|
// Emits when `transferInterest` transfers
|
|
68
74
|
// funds to the staking contract and to
|
|
69
75
|
// the bridge
|
|
@@ -221,7 +227,7 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
221
227
|
function collectInterest(
|
|
222
228
|
address[] calldata _stakingContracts,
|
|
223
229
|
bool _forceAndWaiverRewards
|
|
224
|
-
) external {
|
|
230
|
+
) external nonReentrant {
|
|
225
231
|
uint256 initialGas = gasleft();
|
|
226
232
|
uint256 gdUBI;
|
|
227
233
|
uint256 interestInCdai;
|
|
@@ -242,6 +248,10 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
242
248
|
// elements are sorted by balances from lowest to highest
|
|
243
249
|
|
|
244
250
|
if (_stakingContracts[i - 1] != address(0x0)) {
|
|
251
|
+
require(
|
|
252
|
+
isActiveContract(_stakingContracts[i - 1]),
|
|
253
|
+
"collectInterest: not a dao contract"
|
|
254
|
+
);
|
|
245
255
|
IGoodStaking(_stakingContracts[i - 1]).collectUBIInterest(
|
|
246
256
|
reserveAddress
|
|
247
257
|
);
|
|
@@ -277,7 +287,11 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
277
287
|
if (
|
|
278
288
|
block.timestamp >= lastCollectedInterest + collectInterestTimeThreshold
|
|
279
289
|
) {
|
|
280
|
-
require(
|
|
290
|
+
require(
|
|
291
|
+
interestInCdai >= gasPriceIncDAI ||
|
|
292
|
+
gdUBI >= interestMultiplier * gdRewardToMint,
|
|
293
|
+
"UBI < gas costs"
|
|
294
|
+
); // This require is necessary to keeper can not abuse this function
|
|
281
295
|
} else {
|
|
282
296
|
require(
|
|
283
297
|
interestInCdai >= interestMultiplier * gasPriceIncDAI ||
|
|
@@ -299,6 +313,20 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
299
313
|
lastCollectedInterestBlock = block.number;
|
|
300
314
|
}
|
|
301
315
|
|
|
316
|
+
/**
|
|
317
|
+
* @dev verifies that contract was added to the approved staking contracts in the past, and is not blacklisted
|
|
318
|
+
* @param _contract address of the contract
|
|
319
|
+
* @return isActive true if contract is active
|
|
320
|
+
**/
|
|
321
|
+
function isActiveContract(
|
|
322
|
+
address _contract
|
|
323
|
+
) public view returns (bool isActive) {
|
|
324
|
+
return
|
|
325
|
+
!rewardsForStakingContract[_contract].isBlackListed &&
|
|
326
|
+
(rewardsForStakingContract[_contract].blockStart > 0 ||
|
|
327
|
+
rewardsForStakingContract[_contract].blockEnd > 0);
|
|
328
|
+
}
|
|
329
|
+
|
|
302
330
|
/**
|
|
303
331
|
* @dev Function that get interest informations of staking contracts in the sorted array by highest interest to lowest interest amount
|
|
304
332
|
* @return array of interestInfo struct
|
|
@@ -467,4 +495,16 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
|
|
|
467
495
|
function getActiveContractsCount() public view returns (uint256) {
|
|
468
496
|
return activeContracts.length;
|
|
469
497
|
}
|
|
498
|
+
|
|
499
|
+
modifier nonReentrant() {
|
|
500
|
+
// On the first call to nonReentrant, _status will be _NOT_ENTERED
|
|
501
|
+
require(_reentrantStatus != 1, "ReentrancyGuard: reentrant call");
|
|
502
|
+
|
|
503
|
+
// Any calls to nonReentrant after this point will fail
|
|
504
|
+
_reentrantStatus = 1;
|
|
505
|
+
_;
|
|
506
|
+
// By storing the original value once again, a refund is triggered (see
|
|
507
|
+
// https://eips.ethereum.org/EIPS/eip-2200)
|
|
508
|
+
_reentrantStatus = 0;
|
|
509
|
+
}
|
|
470
510
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
import "../Interfaces.sol";
|
|
5
|
+
import "../utils/NameService.sol";
|
|
6
|
+
import "./AdminWallet.sol";
|
|
7
|
+
|
|
8
|
+
/* @title Admin wallet contract allowing whitelisting and topping up of
|
|
9
|
+
* addresses
|
|
10
|
+
*/
|
|
11
|
+
contract BulkWhitelist {
|
|
12
|
+
AdminWallet adminWallet;
|
|
13
|
+
|
|
14
|
+
constructor(AdminWallet _adminWallet) {
|
|
15
|
+
adminWallet = _adminWallet;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
modifier onlyAdmin() {
|
|
19
|
+
require(adminWallet.isAdmin(msg.sender), "not admin");
|
|
20
|
+
_;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
receive() external payable {}
|
|
24
|
+
|
|
25
|
+
function whitelist(
|
|
26
|
+
address[] memory _user,
|
|
27
|
+
string[] memory _did,
|
|
28
|
+
uint256[] memory orgChain,
|
|
29
|
+
uint256[] memory dateAuthenticated
|
|
30
|
+
) external onlyAdmin {
|
|
31
|
+
for (uint i = 0; i < _user.length; i++) {
|
|
32
|
+
adminWallet.whitelist(
|
|
33
|
+
_user[i],
|
|
34
|
+
_did[i],
|
|
35
|
+
orgChain[i],
|
|
36
|
+
dateAuthenticated[i]
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
uint256 toTop = address(this).balance;
|
|
40
|
+
payable(address(msg.sender)).transfer(toTop);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function removeWhitelisted(address[] memory _user) external onlyAdmin {
|
|
44
|
+
for (uint i = 0; i < _user.length; i++) {
|
|
45
|
+
adminWallet.removeWhitelist(_user[i]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
uint256 toTop = address(this).balance;
|
|
49
|
+
payable(address(msg.sender)).transfer(toTop);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -6,128 +6,6 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
|
6
6
|
import "@mean-finance/uniswap-v3-oracle/solidity/interfaces/IStaticOracle.sol";
|
|
7
7
|
import "../Interfaces.sol";
|
|
8
8
|
|
|
9
|
-
// @uniswap/v3-core
|
|
10
|
-
interface ISwapRouter {
|
|
11
|
-
struct ExactInputSingleParams {
|
|
12
|
-
address tokenIn;
|
|
13
|
-
address tokenOut;
|
|
14
|
-
uint24 fee;
|
|
15
|
-
address recipient;
|
|
16
|
-
uint256 amountIn;
|
|
17
|
-
uint256 amountOutMinimum;
|
|
18
|
-
uint160 sqrtPriceLimitX96;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/// @notice Swaps `amountIn` of one token for as much as possible of another token
|
|
22
|
-
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
23
|
-
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
24
|
-
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
|
|
25
|
-
/// @return amountOut The amount of the received token
|
|
26
|
-
function exactInputSingle(
|
|
27
|
-
ExactInputSingleParams calldata params
|
|
28
|
-
) external payable returns (uint256 amountOut);
|
|
29
|
-
|
|
30
|
-
struct ExactInputParams {
|
|
31
|
-
bytes path;
|
|
32
|
-
address recipient;
|
|
33
|
-
uint256 amountIn;
|
|
34
|
-
uint256 amountOutMinimum;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
|
|
38
|
-
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
39
|
-
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
40
|
-
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
|
|
41
|
-
/// @return amountOut The amount of the received token
|
|
42
|
-
function exactInput(
|
|
43
|
-
ExactInputParams calldata params
|
|
44
|
-
) external payable returns (uint256 amountOut);
|
|
45
|
-
|
|
46
|
-
struct ExactOutputSingleParams {
|
|
47
|
-
address tokenIn;
|
|
48
|
-
address tokenOut;
|
|
49
|
-
uint24 fee;
|
|
50
|
-
address recipient;
|
|
51
|
-
uint256 amountOut;
|
|
52
|
-
uint256 amountInMaximum;
|
|
53
|
-
uint160 sqrtPriceLimitX96;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// @notice Swaps as little as possible of one token for `amountOut` of another token
|
|
57
|
-
/// that may remain in the router after the swap.
|
|
58
|
-
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
|
|
59
|
-
/// @return amountIn The amount of the input token
|
|
60
|
-
function exactOutputSingle(
|
|
61
|
-
ExactOutputSingleParams calldata params
|
|
62
|
-
) external payable returns (uint256 amountIn);
|
|
63
|
-
|
|
64
|
-
struct ExactOutputParams {
|
|
65
|
-
bytes path;
|
|
66
|
-
address recipient;
|
|
67
|
-
uint256 amountOut;
|
|
68
|
-
uint256 amountInMaximum;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
|
|
72
|
-
/// that may remain in the router after the swap.
|
|
73
|
-
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
|
|
74
|
-
/// @return amountIn The amount of the input token
|
|
75
|
-
function exactOutput(
|
|
76
|
-
ExactOutputParams calldata params
|
|
77
|
-
) external payable returns (uint256 amountIn);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface IQuoterV2 {
|
|
81
|
-
/// @notice Returns the amount out received for a given exact input swap without executing the swap
|
|
82
|
-
/// @param path The path of the swap, i.e. each token pair and the pool fee
|
|
83
|
-
/// @param amountIn The amount of the first token to swap
|
|
84
|
-
/// @return amountOut The amount of the last token that would be received
|
|
85
|
-
/// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path
|
|
86
|
-
/// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path
|
|
87
|
-
/// @return gasEstimate The estimate of the gas that the swap consumes
|
|
88
|
-
function quoteExactInput(
|
|
89
|
-
bytes memory path,
|
|
90
|
-
uint256 amountIn
|
|
91
|
-
)
|
|
92
|
-
external
|
|
93
|
-
returns (
|
|
94
|
-
uint256 amountOut,
|
|
95
|
-
uint160[] memory sqrtPriceX96AfterList,
|
|
96
|
-
uint32[] memory initializedTicksCrossedList,
|
|
97
|
-
uint256 gasEstimate
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
struct QuoteExactInputSingleParams {
|
|
101
|
-
address tokenIn;
|
|
102
|
-
address tokenOut;
|
|
103
|
-
uint256 amountIn;
|
|
104
|
-
uint24 fee;
|
|
105
|
-
uint160 sqrtPriceLimitX96;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/// @notice Returns the amount out received for a given exact input but for a swap of a single pool
|
|
109
|
-
/// @param params The params for the quote, encoded as `QuoteExactInputSingleParams`
|
|
110
|
-
/// tokenIn The token being swapped in
|
|
111
|
-
/// tokenOut The token being swapped out
|
|
112
|
-
/// fee The fee of the token pool to consider for the pair
|
|
113
|
-
/// amountIn The desired input amount
|
|
114
|
-
/// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
|
|
115
|
-
/// @return amountOut The amount of `tokenOut` that would be received
|
|
116
|
-
/// @return sqrtPriceX96After The sqrt price of the pool after the swap
|
|
117
|
-
/// @return initializedTicksCrossed The number of initialized ticks that the swap crossed
|
|
118
|
-
/// @return gasEstimate The estimate of the gas that the swap consumes
|
|
119
|
-
function quoteExactInputSingle(
|
|
120
|
-
QuoteExactInputSingleParams memory params
|
|
121
|
-
)
|
|
122
|
-
external
|
|
123
|
-
returns (
|
|
124
|
-
uint256 amountOut,
|
|
125
|
-
uint160 sqrtPriceX96After,
|
|
126
|
-
uint32 initializedTicksCrossed,
|
|
127
|
-
uint256 gasEstimate
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
9
|
/*
|
|
132
10
|
* @title BuyGDClone
|
|
133
11
|
* @notice This contract allows users to swap Celo or cUSD for GoodDollar (GD) tokens.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8;
|
|
3
|
+
|
|
4
|
+
import "../Interfaces.sol";
|
|
5
|
+
|
|
6
|
+
interface IUpgradeabilityOwnerStorage {
|
|
7
|
+
function upgradeabilityOwner() external view returns (address);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
contract Upgradeable {
|
|
11
|
+
// Avoid using onlyUpgradeabilityOwner name to prevent issues with implementation from proxy contract
|
|
12
|
+
modifier onlyIfUpgradeabilityOwner() {
|
|
13
|
+
require(
|
|
14
|
+
msg.sender ==
|
|
15
|
+
IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner()
|
|
16
|
+
);
|
|
17
|
+
/* solcov ignore next */
|
|
18
|
+
_;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @title EternalStorage
|
|
24
|
+
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
|
|
25
|
+
*/
|
|
26
|
+
contract EternalStorage {
|
|
27
|
+
mapping(bytes32 => uint256) internal uintStorage;
|
|
28
|
+
mapping(bytes32 => string) internal stringStorage;
|
|
29
|
+
mapping(bytes32 => address) internal addressStorage;
|
|
30
|
+
mapping(bytes32 => bytes) internal bytesStorage;
|
|
31
|
+
mapping(bytes32 => bool) internal boolStorage;
|
|
32
|
+
mapping(bytes32 => int256) internal intStorage;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @title Ownable
|
|
37
|
+
* @dev This contract has an owner address providing basic authorization control
|
|
38
|
+
*/
|
|
39
|
+
contract Ownable is EternalStorage {
|
|
40
|
+
bytes4 internal constant UPGRADEABILITY_OWNER = 0x6fde8202; // upgradeabilityOwner()
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @dev Event to show ownership has been transferred
|
|
44
|
+
* @param previousOwner representing the address of the previous owner
|
|
45
|
+
* @param newOwner representing the address of the new owner
|
|
46
|
+
*/
|
|
47
|
+
event OwnershipTransferred(address previousOwner, address newOwner);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @dev Throws if called by any account other than the owner.
|
|
51
|
+
*/
|
|
52
|
+
modifier onlyOwner() {
|
|
53
|
+
require(msg.sender == owner());
|
|
54
|
+
/* solcov ignore next */
|
|
55
|
+
_;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @dev Throws if called by any account other than contract itself or owner.
|
|
60
|
+
*/
|
|
61
|
+
modifier onlyRelevantSender() {
|
|
62
|
+
// proxy owner if used through proxy, address(0) otherwise
|
|
63
|
+
(bool ok, bytes memory addr) = address(this).call(
|
|
64
|
+
abi.encodeWithSelector(UPGRADEABILITY_OWNER)
|
|
65
|
+
);
|
|
66
|
+
address upgowner = abi.decode(addr, (address));
|
|
67
|
+
require(
|
|
68
|
+
(ok && upgowner != address(0)) || // covers usage without calling through storage proxy
|
|
69
|
+
msg.sender ==
|
|
70
|
+
IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner() || // covers usage through regular proxy calls
|
|
71
|
+
msg.sender == address(this) // covers calls through upgradeAndCall proxy method
|
|
72
|
+
);
|
|
73
|
+
/* solcov ignore next */
|
|
74
|
+
_;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
bytes32 internal constant OWNER =
|
|
78
|
+
0x02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c0; // keccak256(abi.encodePacked("owner"))
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @dev Tells the address of the owner
|
|
82
|
+
* @return the address of the owner
|
|
83
|
+
*/
|
|
84
|
+
function owner() public view returns (address) {
|
|
85
|
+
return addressStorage[OWNER];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @dev Allows the current owner to transfer control of the contract to a newOwner.
|
|
90
|
+
* @param newOwner the address to transfer ownership to.
|
|
91
|
+
*/
|
|
92
|
+
function transferOwnership(address newOwner) external onlyOwner {
|
|
93
|
+
require(newOwner != address(0));
|
|
94
|
+
setOwner(newOwner);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @dev Sets a new owner address
|
|
99
|
+
*/
|
|
100
|
+
function setOwner(address newOwner) internal {
|
|
101
|
+
emit OwnershipTransferred(owner(), newOwner);
|
|
102
|
+
addressStorage[OWNER] = newOwner;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
contract Initializable is EternalStorage {
|
|
107
|
+
bytes32 internal constant INITIALIZED =
|
|
108
|
+
0x0a6f646cd611241d8073675e00d1a1ff700fbf1b53fcf473de56d1e6e4b714ba; // keccak256(abi.encodePacked("isInitialized"))
|
|
109
|
+
|
|
110
|
+
function setInitialize() internal {
|
|
111
|
+
boolStorage[INITIALIZED] = true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function isInitialized() public view returns (bool) {
|
|
115
|
+
return boolStorage[INITIALIZED];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
contract FuseOldBridgeKill is Initializable, Upgradeable {
|
|
120
|
+
function end() external {
|
|
121
|
+
IGoodDollar(0x495d133B938596C9984d462F007B676bDc57eCEC).renounceMinter();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import "../utils/NameService.sol";
|
|
5
|
+
import "../Interfaces.sol";
|
|
6
|
+
import "../reserve/GoodReserveCDai.sol";
|
|
7
|
+
import "../identity/IdentityV2.sol";
|
|
8
|
+
import "hardhat/console.sol";
|
|
9
|
+
|
|
10
|
+
contract LastauthReduction {
|
|
11
|
+
NameService ns;
|
|
12
|
+
|
|
13
|
+
uint public reduceByDays = 90;
|
|
14
|
+
uint public startingPeriodDays = 180 + 90 * 5;
|
|
15
|
+
uint public finalPeriod = 180;
|
|
16
|
+
address public manager;
|
|
17
|
+
|
|
18
|
+
constructor(NameService _ns) {
|
|
19
|
+
ns = _ns;
|
|
20
|
+
manager = msg.sender;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function reduce() external {
|
|
24
|
+
require(msg.sender == manager, "not manager");
|
|
25
|
+
|
|
26
|
+
address avatar = ns.dao().avatar();
|
|
27
|
+
|
|
28
|
+
IdentityV2 id = IdentityV2(ns.getAddress("IDENTITY"));
|
|
29
|
+
|
|
30
|
+
Controller ctrl = Controller(ns.getAddress("CONTROLLER"));
|
|
31
|
+
uint curPeriod = id.authenticationPeriod();
|
|
32
|
+
|
|
33
|
+
IIdentity oldId = id.oldIdentity();
|
|
34
|
+
|
|
35
|
+
if (curPeriod <= finalPeriod) {
|
|
36
|
+
// prevent executing again
|
|
37
|
+
require(ctrl.unregisterSelf(avatar), "unregistering failed");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool ok;
|
|
42
|
+
if (curPeriod > startingPeriodDays) {
|
|
43
|
+
(ok, ) = ctrl.genericCall(
|
|
44
|
+
address(id),
|
|
45
|
+
abi.encodeCall(
|
|
46
|
+
IdentityV2.setAuthenticationPeriod,
|
|
47
|
+
(startingPeriodDays)
|
|
48
|
+
),
|
|
49
|
+
address(avatar),
|
|
50
|
+
0
|
|
51
|
+
);
|
|
52
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
53
|
+
|
|
54
|
+
if (address(oldId) != address(0)) {
|
|
55
|
+
(ok, ) = ctrl.genericCall(
|
|
56
|
+
address(oldId),
|
|
57
|
+
abi.encodeCall(
|
|
58
|
+
IdentityV2.setAuthenticationPeriod,
|
|
59
|
+
(startingPeriodDays)
|
|
60
|
+
),
|
|
61
|
+
address(avatar),
|
|
62
|
+
0
|
|
63
|
+
);
|
|
64
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
(ok, ) = ctrl.genericCall(
|
|
68
|
+
address(id),
|
|
69
|
+
abi.encodeCall(
|
|
70
|
+
IdentityV2.setAuthenticationPeriod,
|
|
71
|
+
(curPeriod - reduceByDays)
|
|
72
|
+
),
|
|
73
|
+
address(avatar),
|
|
74
|
+
0
|
|
75
|
+
);
|
|
76
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
77
|
+
|
|
78
|
+
if (address(oldId) != address(0)) {
|
|
79
|
+
(ok, ) = ctrl.genericCall(
|
|
80
|
+
address(oldId),
|
|
81
|
+
abi.encodeCall(
|
|
82
|
+
IdentityV2.setAuthenticationPeriod,
|
|
83
|
+
(curPeriod - reduceByDays)
|
|
84
|
+
),
|
|
85
|
+
address(avatar),
|
|
86
|
+
0
|
|
87
|
+
);
|
|
88
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|