@gooddollar/goodprotocol 1.0.29-beta.4 → 1.0.29
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/AdminWallet.min.json +1 -1
- package/artifacts/abis/GoodDollarMintBurnWrapper.min.json +1 -1
- package/artifacts/abis/GoodDollarStaking.min.json +1 -1
- package/artifacts/abis/GoodDollarStakingMock.min.json +1 -1
- package/artifacts/abis/IGoodDollar.min.json +1 -1
- package/artifacts/abis/IIdentity.min.json +1 -1
- package/artifacts/abis/UBIScheme.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/IGoodDollar.json +0 -39
- 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/IIdentity.json +0 -51
- 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/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.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 -15
- 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/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.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 +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
- 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 -15
- 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/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/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 +2 -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 +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 +2 -2
- 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/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +22 -15
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +56 -76
- 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/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/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -16
- 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/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/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/contracts/Interfaces.sol +0 -26
- package/contracts/governance/GReputation.sol +6 -19
- package/contracts/governance/GoodDollarStaking.sol +9 -23
- package/contracts/ubi/UBIScheme.sol +40 -45
- package/contracts/utils/AdminWallet.sol +11 -42
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +3 -13
- package/hardhat.config.ts +7 -21
- package/package.json +2 -3
- package/releases/deploy-settings.json +1 -36
- package/releases/deployment.json +53 -98
- package/scripts/analytics/gdinflow.ts +56 -0
- package/scripts/analytics/tokenInOutStats.ts +50 -0
- package/scripts/deployFullDAO.ts +19 -39
- package/scripts/multichain-deploy/{1_basicdao-deploy.ts → basicdao-deploy.ts} +52 -56
- package/scripts/multichain-deploy/{3_gdSavings-deploy.ts → gdSavings-deploy.ts} +76 -90
- package/scripts/multichain-deploy/helpers.ts +1 -0
- package/scripts/{upgrades → multichain-deploy}/nonubiDistribution-deploy.ts +5 -2
- package/scripts/test/localOldDaoDeploy.ts +3 -10
- package/test/helpers.ts +8 -12
- package/test/ubi/UBIScheme.test.ts +30 -30
- package/test/ubi/UBISchemeCycle.test.ts +7 -9
- package/test/utils/AdminWallet.test.ts +11 -33
- package/types/AdminWallet.ts +113 -124
- package/types/GoodDollarMintBurnWrapper.ts +0 -42
- package/types/GoodDollarStaking.ts +0 -34
- package/types/GoodDollarStakingMock.ts +0 -34
- package/types/IGoodDollar.ts +0 -54
- package/types/IIdentity.ts +0 -75
- package/types/UBIScheme.ts +40 -19
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AdminWallet__factory.ts +55 -75
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__factory.ts +1 -1
- package/types/factories/ClaimersDistribution__factory.ts +1 -1
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/CompoundVotingMachine__factory.ts +1 -1
- package/types/factories/DAOContract__factory.ts +1 -1
- package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
- package/types/factories/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
- package/types/factories/DistributionHelperTest__factory.ts +1 -1
- package/types/factories/DistributionHelper__factory.ts +1 -1
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/FuseFaucet__factory.ts +1 -1
- package/types/factories/FuseStakingV3__factory.ts +1 -1
- package/types/factories/GReputation__factory.ts +1 -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 -15
- package/types/factories/GoodDollarStakingMock__factory.ts +1 -14
- package/types/factories/GoodDollarStaking__factory.ts +1 -14
- 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 +1 -1
- package/types/factories/GovernanceStaking__factory.ts +1 -1
- package/types/factories/IGoodDollar__factory.ts +0 -39
- package/types/factories/IIdentity__factory.ts +0 -51
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/OverMintTester__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/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/Reputation__factory.ts +1 -1
- package/types/factories/StakersDistribution__factory.ts +1 -1
- package/types/factories/SwapHelperTest__factory.ts +1 -1
- package/types/factories/UBIScheme__factory.ts +21 -14
- 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 +0 -54
- package/types/index.ts +0 -12
- package/yarn.lock +4 -4
- package/artifacts/abis/Faucet.min.json +0 -1
- package/artifacts/abis/IGovernanceStaking.min.json +0 -1
- package/artifacts/abis/IIdentityV2.min.json +0 -1
- package/artifacts/abis/IdentityV2.min.json +0 -1
- package/artifacts/abis/InvitesV2.min.json +0 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +0 -4
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +0 -281
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +0 -4
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +0 -684
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +0 -4
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.json +0 -24
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +0 -4
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +0 -1000
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +0 -4
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +0 -586
- package/contracts/fuseFaucet/Faucet.sol +0 -247
- package/contracts/identity/IdentityV2.sol +0 -434
- package/contracts/invite/InvitesV2.sol +0 -316
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -45
- package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -143
- package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -121
- package/scripts/multichain-deploy/5_gov-deploy.ts +0 -123
- package/scripts/multichain-deploy/verifyEtherscan.ts +0 -112
- package/scripts/upgrades/identity-upgrade.ts +0 -153
- package/types/Faucet.ts +0 -1014
- package/types/IERC1271.ts +0 -109
- package/types/IGovernanceStaking.ts +0 -98
- package/types/IIdentityV2.ts +0 -526
- package/types/IdentityV2.ts +0 -1612
- package/types/InvitesV2.ts +0 -933
- package/types/factories/Faucet__factory.ts +0 -729
- package/types/factories/IERC1271__factory.ts +0 -47
- package/types/factories/IGovernanceStaking__factory.ts +0 -39
- package/types/factories/IIdentityV2__factory.ts +0 -293
- package/types/factories/IdentityV2__factory.ts +0 -1048
- package/types/factories/InvitesV2__factory.ts +0 -634
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"type": "function"
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
|
-
"bytecode": "
|
|
78
|
-
"deployedBytecode": "
|
|
77
|
+
"bytecode": "0x608060405234801561001057600080fd5b5060405161035c38038061035c83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6102c9806100936000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220a9e79a4dd3fd1fa013d0a2232cbff569221ba33b84f992e39b9a89213eb5edac64736f6c63430008080033",
|
|
78
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220a9e79a4dd3fd1fa013d0a2232cbff569221ba33b84f992e39b9a89213eb5edac64736f6c63430008080033",
|
|
79
79
|
"linkReferences": {},
|
|
80
80
|
"deployedLinkReferences": {}
|
|
81
81
|
}
|
package/contracts/Interfaces.sol
CHANGED
|
@@ -77,12 +77,6 @@ interface IGoodDollar is ERC20 {
|
|
|
77
77
|
) external returns (bool);
|
|
78
78
|
|
|
79
79
|
function formula() external view returns (address);
|
|
80
|
-
|
|
81
|
-
function setIdentity(address identity) external;
|
|
82
|
-
|
|
83
|
-
function identity() external view returns (address);
|
|
84
|
-
|
|
85
|
-
function owner() external view returns (address);
|
|
86
80
|
}
|
|
87
81
|
|
|
88
82
|
interface IERC2917 is ERC20 {
|
|
@@ -270,29 +264,9 @@ interface IIdentity {
|
|
|
270
264
|
|
|
271
265
|
function owner() external view returns (address);
|
|
272
266
|
|
|
273
|
-
function removeContract(address account) external;
|
|
274
|
-
|
|
275
|
-
function isDAOContract(address account) external view returns (bool);
|
|
276
|
-
|
|
277
|
-
function addrToDID(address account) external view returns (string memory);
|
|
278
|
-
|
|
279
267
|
event WhitelistedAdded(address user);
|
|
280
268
|
}
|
|
281
269
|
|
|
282
|
-
interface IIdentityV2 is IIdentity {
|
|
283
|
-
function addWhitelistedWithDIDAndChain(
|
|
284
|
-
address account,
|
|
285
|
-
string memory did,
|
|
286
|
-
uint256 orgChainId,
|
|
287
|
-
uint256 dateAuthenticated
|
|
288
|
-
) external;
|
|
289
|
-
|
|
290
|
-
function getWhitelistedRoot(address account)
|
|
291
|
-
external
|
|
292
|
-
view
|
|
293
|
-
returns (address root);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
270
|
interface IUBIScheme {
|
|
297
271
|
function currentDay() external view returns (uint256);
|
|
298
272
|
|
|
@@ -107,27 +107,17 @@ contract GReputation is Reputation {
|
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/// @notice internal function that overrides Reputation.sol with consideration to delegation
|
|
111
|
+
/// @param _user the address to mint for
|
|
112
|
+
/// @param _amount the amount of rep to mint
|
|
113
|
+
/// @return the actual amount minted
|
|
110
114
|
function _mint(address _user, uint256 _amount)
|
|
111
115
|
internal
|
|
112
116
|
override
|
|
113
117
|
returns (uint256)
|
|
114
118
|
{
|
|
115
|
-
return _mint(_user, _amount, false);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/// @notice internal function that overrides Reputation.sol with consideration to delegation
|
|
119
|
-
/// @param _user the address to mint for
|
|
120
|
-
/// @param _amount the amount of rep to mint
|
|
121
|
-
/// @return the actual amount minted
|
|
122
|
-
function _mint(
|
|
123
|
-
address _user,
|
|
124
|
-
uint256 _amount,
|
|
125
|
-
bool ignoreRepTarget
|
|
126
|
-
) internal returns (uint256) {
|
|
127
119
|
address repTarget = reputationRecipients[_user];
|
|
128
|
-
repTarget =
|
|
129
|
-
? repTarget
|
|
130
|
-
: _user;
|
|
120
|
+
repTarget = repTarget != address(0) ? repTarget : _user;
|
|
131
121
|
|
|
132
122
|
super._mint(repTarget, _amount);
|
|
133
123
|
|
|
@@ -424,10 +414,7 @@ contract GReputation is Reputation {
|
|
|
424
414
|
//if initiial state then set real balance
|
|
425
415
|
if (idHash == ROOT_STATE) {
|
|
426
416
|
uint256 curTotalSupply = totalSupplyLocalAt(block.number);
|
|
427
|
-
|
|
428
|
-
// also it should behave the same as blockchain sync proof which also doesnt use repTarget, but updates the same address as in the proof
|
|
429
|
-
_mint(_user, _balance, true);
|
|
430
|
-
|
|
417
|
+
_mint(_user, _balance);
|
|
431
418
|
updateValueAtNow(totalSupplyHistory, curTotalSupply); // we undo the totalsupply, as we alredy set the totalsupply of the airdrop
|
|
432
419
|
}
|
|
433
420
|
|
|
@@ -17,10 +17,6 @@ interface RewardsMinter {
|
|
|
17
17
|
function sendOrMint(address to, uint256 amount) external returns (uint256);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface IGovernanceStaking {
|
|
21
|
-
function withdrawRewards() external returns (uint256);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
/**
|
|
25
21
|
* @title Staking contract that allows citizens to stake G$ to get GOOD + G$ rewards
|
|
26
22
|
* it implements
|
|
@@ -275,7 +271,7 @@ contract GoodDollarStaking is
|
|
|
275
271
|
* @return gdRewards recieved G$ rewards
|
|
276
272
|
*/
|
|
277
273
|
function withdrawRewards()
|
|
278
|
-
|
|
274
|
+
public
|
|
279
275
|
returns (uint256 goodRewards, uint256 gdRewards)
|
|
280
276
|
{
|
|
281
277
|
uint256 gdRewardsShares = amountToShares(earned(msg.sender));
|
|
@@ -367,11 +363,6 @@ contract GoodDollarStaking is
|
|
|
367
363
|
emit GOODRewardsSet(_monthlyAmount);
|
|
368
364
|
}
|
|
369
365
|
|
|
370
|
-
function setBlockPerYear(uint128 _blocksPerYear) external {
|
|
371
|
-
_onlyAvatar();
|
|
372
|
-
numberOfBlocksPerYear = _blocksPerYear;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
366
|
/**
|
|
376
367
|
* @dev interest rate per one block in 1e18 precision.
|
|
377
368
|
* for example APY=5% then per block = nroot(1+0.05,numberOfBlocksPerYear)
|
|
@@ -474,19 +465,14 @@ contract GoodDollarStaking is
|
|
|
474
465
|
emit GOODRewardsSet(2 ether * 1e6);
|
|
475
466
|
|
|
476
467
|
//this will make sure rewards are set at 0, so no withdraw issue will happen.
|
|
477
|
-
|
|
478
|
-
bool ok
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
avatar,
|
|
486
|
-
0
|
|
487
|
-
);
|
|
488
|
-
require(ok, "calling setMonthlyRewards failed");
|
|
489
|
-
}
|
|
468
|
+
//on governacnestaking anyone withdrawing from now on will get 0 GOOD, not matter how long he has been staking
|
|
469
|
+
(bool ok, ) = dao.genericCall(
|
|
470
|
+
nameService.getAddress("GDAO_STAKING"),
|
|
471
|
+
abi.encodeWithSignature("setMonthlyRewards(uint256)", 0),
|
|
472
|
+
avatar,
|
|
473
|
+
0
|
|
474
|
+
);
|
|
475
|
+
require(ok, "calling setMonthlyRewards failed");
|
|
490
476
|
|
|
491
477
|
//this will set this contract as the GDAO_STAKING contract and give us minting rights on the reputation token
|
|
492
478
|
(ok, ) = dao.genericCall(
|
|
@@ -71,8 +71,7 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
71
71
|
//dont use first claim, and give ubi as usual
|
|
72
72
|
bool public useFirstClaimPool;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
uint256 public minActiveUsers;
|
|
74
|
+
uint256 public defaultDailyUbi;
|
|
76
75
|
|
|
77
76
|
// A pool of GD to give to activated users,
|
|
78
77
|
// since they will enter the UBI pool
|
|
@@ -100,14 +99,14 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
100
99
|
// Total claims per user stat
|
|
101
100
|
mapping(address => uint256) public totalClaimsPerUser;
|
|
102
101
|
|
|
103
|
-
bool public paused;
|
|
104
|
-
|
|
105
102
|
// Emits when a withdraw has been succeded
|
|
106
103
|
event WithdrawFromDao(uint256 prevBalance, uint256 newBalance);
|
|
107
104
|
|
|
108
105
|
// Emits when a user is activated
|
|
109
106
|
event ActivatedUser(address indexed account);
|
|
110
107
|
|
|
108
|
+
bool public paused;
|
|
109
|
+
|
|
111
110
|
// Emits when a fish has been succeded
|
|
112
111
|
event InactiveUserFished(
|
|
113
112
|
address indexed caller,
|
|
@@ -158,8 +157,8 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
158
157
|
iterationGasLimit = 150000;
|
|
159
158
|
periodStart = (block.timestamp / (1 days)) * 1 days + 12 hours; //set start time to GMT noon
|
|
160
159
|
startOfCycle = periodStart;
|
|
161
|
-
useFirstClaimPool =
|
|
162
|
-
|
|
160
|
+
useFirstClaimPool = true;
|
|
161
|
+
defaultDailyUbi = 5000;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
function setUseFirstClaimPool(bool _use) public {
|
|
@@ -286,20 +285,17 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
286
285
|
Funds storage funds = dailyUBIHistory[currentDay];
|
|
287
286
|
funds.hasWithdrawn = shouldWithdrawFromDAO;
|
|
288
287
|
funds.openAmount = currentBalance;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
if (activeUsersCount > 0) {
|
|
289
|
+
dailyUbi = dailyCyclePool / activeUsersCount;
|
|
290
|
+
} else if (useFirstClaimPool == false) {
|
|
291
|
+
dailyUbi = defaultDailyUbi;
|
|
292
|
+
}
|
|
293
293
|
emit UBICalculated(currentDay, dailyUbi, block.number);
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
return dailyUbi;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
function max(uint256 a, uint256 b) private pure returns (uint256) {
|
|
300
|
-
return a >= b ? a : b;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
299
|
/**
|
|
304
300
|
*@dev Sets the currentDay variable to amount of days
|
|
305
301
|
* since start of contract.
|
|
@@ -360,14 +356,12 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
360
356
|
* and emits an event in case of claimed.
|
|
361
357
|
* In case that `isFirstTime` is true, it awards the user.
|
|
362
358
|
* @param _account the account which recieves the funds
|
|
363
|
-
* @param _target the recipient of funds
|
|
364
359
|
* @param _amount the amount to transfer
|
|
365
360
|
* @param _isClaimed true for claimed
|
|
366
361
|
* @param _isFirstTime true for new user or fished user
|
|
367
362
|
*/
|
|
368
363
|
function _transferTokens(
|
|
369
364
|
address _account,
|
|
370
|
-
address _target,
|
|
371
365
|
uint256 _amount,
|
|
372
366
|
bool _isClaimed,
|
|
373
367
|
bool _isFirstTime
|
|
@@ -383,7 +377,7 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
383
377
|
|
|
384
378
|
// awards a new user or a fished user
|
|
385
379
|
if (_isFirstTime) {
|
|
386
|
-
uint256 awardAmount = firstClaimPool.awardUser(
|
|
380
|
+
uint256 awardAmount = firstClaimPool.awardUser(_account);
|
|
387
381
|
claimDay[currentDay].claimAmount += awardAmount;
|
|
388
382
|
emit UBIClaimed(_account, awardAmount);
|
|
389
383
|
} else {
|
|
@@ -392,7 +386,7 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
392
386
|
emit UBIClaimed(_account, _amount);
|
|
393
387
|
}
|
|
394
388
|
IGoodDollar token = nativeToken();
|
|
395
|
-
require(token.transfer(
|
|
389
|
+
require(token.transfer(_account, _amount), "claim transfer failed");
|
|
396
390
|
}
|
|
397
391
|
}
|
|
398
392
|
|
|
@@ -409,9 +403,11 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
409
403
|
{
|
|
410
404
|
_dailyCyclePool = currentBalance / cycleLength;
|
|
411
405
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
406
|
+
if (activeUsersCount > 0) {
|
|
407
|
+
_dailyUbi = _dailyCyclePool / activeUsersCount;
|
|
408
|
+
} else if (useFirstClaimPool == false) {
|
|
409
|
+
_dailyUbi = defaultDailyUbi;
|
|
410
|
+
}
|
|
415
411
|
return _dailyUbi;
|
|
416
412
|
}
|
|
417
413
|
|
|
@@ -451,10 +447,9 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
451
447
|
* calculats the amount the account can claims, and transfers the amount to the account.
|
|
452
448
|
* Emits the address of account and amount claimed.
|
|
453
449
|
* @param _account The claimer account
|
|
454
|
-
* @param _target recipient of funds
|
|
455
450
|
* @return A bool indicating if UBI was claimed
|
|
456
451
|
*/
|
|
457
|
-
function _claim(address _account
|
|
452
|
+
function _claim(address _account) internal returns (bool) {
|
|
458
453
|
// calculats the formula up today ie on day 0 there are no active users, on day 1 any user
|
|
459
454
|
// (new or active) will trigger the calculation with the active users count of the day before
|
|
460
455
|
// and so on. the new or inactive users that will become active today, will not take into account
|
|
@@ -467,16 +462,16 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
467
462
|
!fishedUsersAddresses[_account] &&
|
|
468
463
|
!hasClaimed(_account)
|
|
469
464
|
) {
|
|
470
|
-
_transferTokens(_account,
|
|
465
|
+
_transferTokens(_account, newDistribution, true, false);
|
|
471
466
|
return true;
|
|
472
467
|
} else if (!isNotNewUser(_account) || fishedUsersAddresses[_account]) {
|
|
473
468
|
// a unregistered or fished user
|
|
474
469
|
activeUsersCount += 1;
|
|
475
470
|
fishedUsersAddresses[_account] = false;
|
|
476
471
|
if (useFirstClaimPool) {
|
|
477
|
-
_transferTokens(_account,
|
|
472
|
+
_transferTokens(_account, 0, false, true);
|
|
478
473
|
} else {
|
|
479
|
-
_transferTokens(_account,
|
|
474
|
+
_transferTokens(_account, newDistribution, true, false);
|
|
480
475
|
}
|
|
481
476
|
emit ActivatedUser(_account);
|
|
482
477
|
return true;
|
|
@@ -491,13 +486,14 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
491
486
|
* @return A bool indicating if UBI was claimed
|
|
492
487
|
*/
|
|
493
488
|
function claim() public requireStarted returns (bool) {
|
|
494
|
-
|
|
495
|
-
.
|
|
496
|
-
|
|
497
|
-
|
|
489
|
+
require(
|
|
490
|
+
IIdentity(nameService.getAddress("IDENTITY")).isWhitelisted(msg.sender),
|
|
491
|
+
"UBIScheme: not whitelisted"
|
|
492
|
+
);
|
|
493
|
+
bool didClaim = _claim(msg.sender);
|
|
498
494
|
address claimerDistribution = nameService.getAddress("GDAO_CLAIMERS");
|
|
499
495
|
if (didClaim && claimerDistribution != address(0)) {
|
|
500
|
-
ClaimersDistribution(claimerDistribution).updateClaim(
|
|
496
|
+
ClaimersDistribution(claimerDistribution).updateClaim(msg.sender);
|
|
501
497
|
}
|
|
502
498
|
return didClaim;
|
|
503
499
|
}
|
|
@@ -528,7 +524,7 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
528
524
|
if (activeUsersCount > 0) {
|
|
529
525
|
activeUsersCount -= 1;
|
|
530
526
|
}
|
|
531
|
-
_transferTokens(msg.sender,
|
|
527
|
+
_transferTokens(msg.sender, newDistribution, false, false);
|
|
532
528
|
emit InactiveUserFished(msg.sender, _account, newDistribution);
|
|
533
529
|
return true;
|
|
534
530
|
}
|
|
@@ -576,19 +572,18 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
576
572
|
paused = _pause;
|
|
577
573
|
}
|
|
578
574
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
// }
|
|
575
|
+
function upgrade() public {
|
|
576
|
+
_onlyAvatar();
|
|
577
|
+
paused = true;
|
|
578
|
+
activeUsersCount = 50000; //estimated
|
|
579
|
+
dailyUbi = 0; //required so distributionformula will trigger
|
|
580
|
+
cycleLength = 30;
|
|
581
|
+
currentCycleLength = 0; //this will trigger a new cycle calculation in distribution formula
|
|
582
|
+
startOfCycle = block.timestamp - 91 days; //this will trigger a new calculation in distributionFormula
|
|
583
|
+
periodStart = 1646136000;
|
|
584
|
+
distributionFormula();
|
|
585
|
+
emit CycleLengthSet(cycleLength);
|
|
586
|
+
}
|
|
592
587
|
|
|
593
588
|
function setActiveUserCount(uint256 _activeUserCount) public {
|
|
594
589
|
_onlyAvatar();
|
|
@@ -4,10 +4,10 @@ pragma solidity >=0.8.0;
|
|
|
4
4
|
|
|
5
5
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
6
6
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
|
7
|
+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
7
8
|
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
|
8
9
|
|
|
9
10
|
import "../Interfaces.sol";
|
|
10
|
-
import "../utils/NameService.sol";
|
|
11
11
|
|
|
12
12
|
/* @title Admin wallet contract allowing whitelisting and topping up of
|
|
13
13
|
* addresses
|
|
@@ -15,6 +15,7 @@ import "../utils/NameService.sol";
|
|
|
15
15
|
contract AdminWallet is
|
|
16
16
|
Initializable,
|
|
17
17
|
UUPSUpgradeable,
|
|
18
|
+
OwnableUpgradeable,
|
|
18
19
|
AccessControlUpgradeable
|
|
19
20
|
{
|
|
20
21
|
bytes32 public constant WALLET_ADMIN_ROLE = keccak256("WALLET_ADMIN_ROLE");
|
|
@@ -27,13 +28,10 @@ contract AdminWallet is
|
|
|
27
28
|
uint256 public toppingTimes;
|
|
28
29
|
uint256 public gasPrice;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
IIdentity public identity;
|
|
31
32
|
|
|
32
33
|
mapping(uint256 => mapping(address => uint256)) toppings;
|
|
33
34
|
|
|
34
|
-
uint64 public maxDailyNewWallets;
|
|
35
|
-
uint64 public day;
|
|
36
|
-
|
|
37
35
|
event AdminsAdded(address payable[] indexed admins);
|
|
38
36
|
event AdminsRemoved(address[] indexed admins);
|
|
39
37
|
event WalletTopped(address indexed user, uint256 amount);
|
|
@@ -49,29 +47,17 @@ contract AdminWallet is
|
|
|
49
47
|
*/
|
|
50
48
|
function initialize(
|
|
51
49
|
address payable[] memory _admins,
|
|
52
|
-
NameService _ns,
|
|
53
50
|
address _owner,
|
|
54
|
-
|
|
51
|
+
IIdentity _identity
|
|
55
52
|
) public initializer {
|
|
56
53
|
__AccessControl_init_unchained();
|
|
54
|
+
__Ownable_init_unchained();
|
|
57
55
|
_setupRole(DEFAULT_ADMIN_ROLE, _owner);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_setDefaults(600000, 9e6, 3, _gasPrice);
|
|
61
|
-
nameService = _ns;
|
|
56
|
+
_setDefaults(600000, 9e6, 3, 1e10);
|
|
57
|
+
identity = _identity;
|
|
62
58
|
if (_admins.length > 0) {
|
|
63
59
|
addAdmins(_admins);
|
|
64
60
|
}
|
|
65
|
-
if (msg.sender != _owner) revokeRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
modifier onlyOwner() {
|
|
69
|
-
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not owner");
|
|
70
|
-
_;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function getIdentity() public view returns (IIdentityV2) {
|
|
74
|
-
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
75
61
|
}
|
|
76
62
|
|
|
77
63
|
function setDefaults(
|
|
@@ -185,45 +171,28 @@ contract AdminWallet is
|
|
|
185
171
|
onlyAdmin
|
|
186
172
|
reimburseGas
|
|
187
173
|
{
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/* @dev Function to add given address to whitelist of identity contract
|
|
192
|
-
* can only be done by admins of wallet and if wallet is an IdentityAdmin
|
|
193
|
-
*/
|
|
194
|
-
function whitelist(
|
|
195
|
-
address _user,
|
|
196
|
-
string memory _did,
|
|
197
|
-
uint256 orgChain,
|
|
198
|
-
uint256 dateAuthenticated
|
|
199
|
-
) public onlyAdmin reimburseGas {
|
|
200
|
-
getIdentity().addWhitelistedWithDIDAndChain(
|
|
201
|
-
_user,
|
|
202
|
-
_did,
|
|
203
|
-
orgChain,
|
|
204
|
-
dateAuthenticated
|
|
205
|
-
);
|
|
174
|
+
identity.addWhitelistedWithDID(_user, _did);
|
|
206
175
|
}
|
|
207
176
|
|
|
208
177
|
/* @dev Function to remove given address from whitelist of identity contract
|
|
209
178
|
* can only be done by admins of wallet and if wallet is an IdentityAdmin
|
|
210
179
|
*/
|
|
211
180
|
function removeWhitelist(address _user) public onlyAdmin reimburseGas {
|
|
212
|
-
|
|
181
|
+
identity.removeWhitelisted(_user);
|
|
213
182
|
}
|
|
214
183
|
|
|
215
184
|
/* @dev Function to add given address to blacklist of identity contract
|
|
216
185
|
* can only be done by admins of wallet and if wallet is an IdentityAdmin
|
|
217
186
|
*/
|
|
218
187
|
function blacklist(address _user) public onlyAdmin reimburseGas {
|
|
219
|
-
|
|
188
|
+
identity.addBlacklisted(_user);
|
|
220
189
|
}
|
|
221
190
|
|
|
222
191
|
/* @dev Function to remove given address from blacklist of identity contract
|
|
223
192
|
* can only be done by admins of wallet and if wallet is an IdentityAdmin
|
|
224
193
|
*/
|
|
225
194
|
function removeBlacklist(address _user) public onlyAdmin reimburseGas {
|
|
226
|
-
|
|
195
|
+
identity.removeBlacklisted(_user);
|
|
227
196
|
}
|
|
228
197
|
|
|
229
198
|
/* @dev Function to top given address with amount of G$ given in constructor
|
|
@@ -129,11 +129,11 @@ contract GoodDollarMintBurnWrapper is
|
|
|
129
129
|
uint256 maxIn; // single limit of each mint
|
|
130
130
|
uint256 capIn; // total limit of all mint
|
|
131
131
|
uint256 totalIn; // total minted minus burned
|
|
132
|
-
uint128 dailyCapIn; //cap per day
|
|
132
|
+
uint128 dailyCapIn; //cap per day (rewards sendOrMint only)
|
|
133
133
|
uint128 mintedToday; //total minted today
|
|
134
134
|
uint128 lastUpdate; //last update of dailyCap
|
|
135
|
-
uint128 totalRewards; // total rewards sent (sent + minted)
|
|
136
|
-
uint32 bpsPerDayIn; //basis points relative to token supply daily limit
|
|
135
|
+
uint128 totalRewards; // total rewards sent (sent + minted) (rewards sendOrMint only)
|
|
136
|
+
uint32 bpsPerDayIn; //basis points relative to token supply daily limit (rewards sendOrMint only)
|
|
137
137
|
uint128 lastDayReset; //last day we reset the daily limits
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -204,16 +204,6 @@ contract GoodDollarMintBurnWrapper is
|
|
|
204
204
|
_setupRole(DEFAULT_ADMIN_ROLE, _admin);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
function upgrade1() external {
|
|
208
|
-
if (updateFrequency == 0) {
|
|
209
|
-
updateFrequency = 90 days;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function upgrade2() external {
|
|
214
|
-
IGoodDollar(token).renounceMinter(); //moving to mint via Controller
|
|
215
|
-
}
|
|
216
|
-
|
|
217
207
|
function decimals() external view returns (uint8) {
|
|
218
208
|
return ERC20(token).decimals();
|
|
219
209
|
}
|
package/hardhat.config.ts
CHANGED
|
@@ -60,8 +60,8 @@ const hhconfig: HardhatUserConfig = {
|
|
|
60
60
|
network: "celo",
|
|
61
61
|
chainId: 42220,
|
|
62
62
|
urls: {
|
|
63
|
-
apiURL: "https://api.celoscan.io
|
|
64
|
-
browserURL: "https://celoscan.io
|
|
63
|
+
apiURL: "https://api.celoscan.io",
|
|
64
|
+
browserURL: "https://celoscan.io"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
]
|
|
@@ -129,20 +129,20 @@ const hhconfig: HardhatUserConfig = {
|
|
|
129
129
|
url: "https://rpc.fuse.io/",
|
|
130
130
|
chainId: 122,
|
|
131
131
|
gas: 6000000,
|
|
132
|
-
gasPrice:
|
|
132
|
+
gasPrice: 10000000000
|
|
133
133
|
},
|
|
134
134
|
fuseexplorer: {
|
|
135
135
|
accounts: { mnemonic },
|
|
136
136
|
url: "https://explorer-node.fuse.io/",
|
|
137
137
|
chainId: 122,
|
|
138
138
|
gas: 6000000,
|
|
139
|
-
gasPrice:
|
|
139
|
+
gasPrice: 10000000000
|
|
140
140
|
},
|
|
141
141
|
fusespark: {
|
|
142
142
|
accounts: { mnemonic },
|
|
143
143
|
url: "https://rpc.fusespark.io/",
|
|
144
144
|
gas: 3000000,
|
|
145
|
-
gasPrice:
|
|
145
|
+
gasPrice: 10000000000,
|
|
146
146
|
chainId: 123
|
|
147
147
|
},
|
|
148
148
|
"fuse-mainnet": {
|
|
@@ -157,7 +157,7 @@ const hhconfig: HardhatUserConfig = {
|
|
|
157
157
|
url: "https://rpc.fuse.io/",
|
|
158
158
|
chainId: 122,
|
|
159
159
|
gas: 6000000,
|
|
160
|
-
gasPrice:
|
|
160
|
+
gasPrice: 10000000000
|
|
161
161
|
},
|
|
162
162
|
"staging-mainnet": {
|
|
163
163
|
accounts: { mnemonic },
|
|
@@ -170,7 +170,7 @@ const hhconfig: HardhatUserConfig = {
|
|
|
170
170
|
accounts: [deployerPrivateKey],
|
|
171
171
|
url: "https://rpc.fuse.io/",
|
|
172
172
|
gas: 3000000,
|
|
173
|
-
gasPrice:
|
|
173
|
+
gasPrice: 10000000000,
|
|
174
174
|
chainId: 122
|
|
175
175
|
},
|
|
176
176
|
"production-mainnet": {
|
|
@@ -193,20 +193,6 @@ const hhconfig: HardhatUserConfig = {
|
|
|
193
193
|
gas: 3000000,
|
|
194
194
|
gasPrice: 500000000,
|
|
195
195
|
chainId: 42220
|
|
196
|
-
},
|
|
197
|
-
"staging-celo": {
|
|
198
|
-
accounts: { mnemonic },
|
|
199
|
-
url: "https://forno.celo.org",
|
|
200
|
-
gas: 3000000,
|
|
201
|
-
gasPrice: 150000000,
|
|
202
|
-
chainId: 42220
|
|
203
|
-
},
|
|
204
|
-
"development-celo": {
|
|
205
|
-
accounts: { mnemonic },
|
|
206
|
-
url: "https://forno.celo.org",
|
|
207
|
-
gas: 3000000,
|
|
208
|
-
gasPrice: 150000000,
|
|
209
|
-
chainId: 42220
|
|
210
196
|
}
|
|
211
197
|
},
|
|
212
198
|
mocha: {
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddollar/goodprotocol",
|
|
3
|
-
"version": "1.0.29
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "GoodDollar Protocol",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"prepack": "npm run minimize",
|
|
7
6
|
"build": "scripts/build.sh deploy",
|
|
8
7
|
"coverage:report": "export COVERALLS_REPO_TOKEN='qiXNelh1HXMAsoPah9yRD2yG2WlqrDfLh' && cat ../coverage/lcov.info coverage/lcov.info | coveralls",
|
|
9
8
|
"coverage": "export CODE_COVERAGE=true; hardhat --max-memory 6096 coverage",
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
},
|
|
57
56
|
"homepage": "https://gooddollar.org",
|
|
58
57
|
"dependencies": {
|
|
59
|
-
"@gooddollar/goodcontracts": "^2.6.
|
|
58
|
+
"@gooddollar/goodcontracts": "^2.6.2",
|
|
60
59
|
"@jsier/retrier": "^1.2.4",
|
|
61
60
|
"@openzeppelin/contracts": "^4.5.0",
|
|
62
61
|
"@openzeppelin/contracts-upgradeable": "^4.3.2",
|