@gooddollar/goodprotocol 1.0.29-beta.3 → 1.0.29-beta.5
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/ERC20PresetMinterPauserUpgradeable.min.json +1 -0
- package/artifacts/abis/ERC677.min.json +1 -0
- package/artifacts/abis/ERC677Receiver.min.json +1 -0
- package/artifacts/abis/GoodDollar.min.json +1 -0
- package/artifacts/abis/IFeesFormula.min.json +1 -0
- package/artifacts/abis/IIdentity.min.json +1 -1
- package/artifacts/abis/IIdentityV2.min.json +1 -1
- package/artifacts/abis/IdentityV2.min.json +1 -1
- package/artifacts/abis/InvitesV2.min.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.json +19 -0
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +19 -0
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/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 +33 -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 +38 -10
- 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 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
- package/artifacts/contracts/mocks/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/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +4 -0
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.json +755 -0
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +4 -0
- package/artifacts/contracts/token/ERC677.sol/ERC677.json +66 -0
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +4 -0
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.json +40 -0
- package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +4 -0
- package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.json +45 -0
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +4 -0
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.json +1180 -0
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.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/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 -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/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 +2 -0
- package/contracts/fuseFaucet/Faucet.sol +5 -3
- package/contracts/fuseFaucet/FuseFaucet.sol +1 -2
- package/contracts/governance/GReputation.sol +24 -10
- package/contracts/identity/IdentityV2.sol +79 -28
- package/contracts/invite/InvitesV1.sol +5 -24
- package/contracts/invite/InvitesV2.sol +8 -15
- package/contracts/mocks/UpgradableMocks.sol +5 -3
- package/contracts/token/ERC20PresetMinterPauserUpgradeable.sol +140 -0
- package/contracts/token/ERC677.sol +74 -0
- package/contracts/token/FeesFormula.sol +10 -0
- package/contracts/token/GoodDollar.sol +234 -0
- package/hardhat.config.ts +5 -5
- package/package.json +3 -2
- package/releases/deployment.json +9 -5
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +45 -28
- package/scripts/multichain-deploy/2_helpers-deploy.ts +1 -7
- package/scripts/multichain-deploy/verifyEtherscan.ts +33 -5
- package/test/faucet/Faucet.test.ts +184 -0
- package/test/{FuseFaucet.test.ts → faucet/FuseFaucet.test.ts} +4 -3
- package/test/governance/ClaimersDistribution.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.castvote.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.crossblockchain.ts +3 -2
- package/test/governance/CompoundVotingMachine.daoscheme.ts +3 -2
- package/test/governance/CompoundVotingMachine.delegate.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.guardian.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.propose.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.state.test.ts +3 -2
- package/test/governance/GReputation.test.ts +22 -14
- package/test/governance/GoodDollarStaking.gd.test.ts +2 -1
- package/test/governance/GoodDollarStaking.good.test.ts +2 -1
- package/test/governance/GovernanceStaking.test.ts +4 -3
- package/test/governance/Reputation.test.ts +2 -1
- package/test/governance/StakersDistribution.test.ts +26 -12
- package/test/helpers.ts +61 -29
- package/test/identity/IdentityV2.test.ts +481 -0
- package/test/{InvitesV1.test.ts → invite/InvitesV1.test.ts} +4 -3
- package/test/invite/InvitesV2.test.ts +355 -0
- package/test/reserve/DistributionHelper.test.ts +2 -1
- package/test/reserve/GoodMarketMaker.test.ts +15 -8
- package/test/reserve/GoodReserveCDai.cap.test.ts +8 -1
- package/test/reserve/GoodReserveCDai.distribution.test.ts +2 -1
- package/test/reserve/GoodReserveCDai.gdx.test.ts +2 -1
- package/test/reserve/GoodReserveCDai.pause.test.ts +2 -1
- package/test/reserve/GoodReserveCDai.test.ts +11 -28
- package/test/reserve/GoodReserveCDai.uniswap.test.ts +20 -18
- package/test/staking/CompoundStakingFactory.test.ts +8 -4
- package/test/staking/DifferentStakingTokens.test.ts +3 -2
- package/test/staking/DonationsStaking.test.ts +33 -24
- package/test/staking/FuseStaking.test.ts +2 -2
- package/test/staking/GoodAaveStakingFactory.test.ts +36 -30
- package/test/staking/SimpleDAIStaking.test.ts +12 -16
- package/test/staking/StakingRewards.test.ts +22 -18
- package/test/staking/StakingRewardsFixedAPY.test.ts +2 -1
- package/test/staking/SwapHelper.test.ts +20 -17
- package/test/staking/UsdcAaveStaking.test.ts +36 -33
- package/test/token/GoodDollar.test.ts +277 -0
- package/test/ubi/UBIScheme.e2e.test.ts +4 -3
- package/test/ubi/UBIScheme.test.ts +3 -2
- package/test/ubi/UBISchemeCycle.test.ts +2 -1
- package/test/utils/AdminWallet.test.ts +2 -1
- package/test/utils/DAOUpgradeableContract.test.ts +3 -2
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +2 -1
- package/test/utils/NameService.test.ts +37 -21
- package/test/utils/ProtocolUpgrade.test.ts +1 -0
- package/test/utils/ProxyFactory.test.ts +1 -0
- package/types/ERC20PermitUpgradeable.ts +522 -0
- package/types/ERC20PresetMinterPauserUpgradeable.ts +105 -1
- package/types/ERC677.ts +131 -0
- package/types/ERC677Receiver.ts +115 -0
- package/types/GoodDollar.ts +1705 -0
- package/types/IERC20PermitUpgradeable.ts +176 -0
- package/types/IFeesFormula.ts +111 -0
- package/types/IIdentity.ts +31 -0
- package/types/IIdentityV2.ts +31 -0
- package/types/IdentityV2.ts +69 -5
- package/types/InvitesV2.ts +61 -7
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AdminWallet__factory.ts +1 -1
- 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/ERC20PermitUpgradeable__factory.ts +375 -0
- package/types/factories/ERC20PresetMinterPauserUpgradeable__factory.ts +83 -2
- package/types/factories/ERC677Receiver__factory.ts +55 -0
- package/types/factories/ERC677__factory.ts +75 -0
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/Faucet__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 -1
- package/types/factories/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/GoodDollar__factory.ts +1228 -0
- 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/IERC20PermitUpgradeable__factory.ts +105 -0
- package/types/factories/IFeesFormula__factory.ts +57 -0
- package/types/factories/IIdentityV2__factory.ts +19 -0
- package/types/factories/IIdentity__factory.ts +19 -0
- package/types/factories/IdentityV2__factory.ts +32 -1
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +37 -9
- 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 +1 -1
- package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/UpgradableMock2__factory.ts +1 -1
- package/types/factories/UpgradableMock3__factory.ts +1 -1
- package/types/factories/UpgradableMock4__factory.ts +1 -1
- package/types/factories/UpgradableMock__factory.ts +1 -1
- package/types/hardhat.d.ts +63 -0
- package/types/index.ts +12 -0
- package/yarn.lock +11 -29
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
3
|
+
import { expect } from "chai";
|
|
4
|
+
import { Faucet, IGoodDollar, IIdentity } from "../../types";
|
|
5
|
+
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
6
|
+
import { createDAO } from "../helpers";
|
|
7
|
+
|
|
8
|
+
const BN = ethers.BigNumber;
|
|
9
|
+
|
|
10
|
+
describe("Faucet", () => {
|
|
11
|
+
let faucet: Faucet, founder: SignerWithAddress;
|
|
12
|
+
let user1 = ethers.Wallet.createRandom().connect(ethers.provider);
|
|
13
|
+
let user2 = ethers.Wallet.createRandom().connect(ethers.provider);
|
|
14
|
+
let signers;
|
|
15
|
+
|
|
16
|
+
let avatar, gd: IGoodDollar, Controller, id: IIdentity;
|
|
17
|
+
|
|
18
|
+
before(async () => {
|
|
19
|
+
[founder, ...signers] = await ethers.getSigners();
|
|
20
|
+
|
|
21
|
+
const FuseFaucetF = await ethers.getContractFactory("Faucet");
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
daoCreator,
|
|
25
|
+
controller,
|
|
26
|
+
avatar: av,
|
|
27
|
+
gd: gooddollar,
|
|
28
|
+
identity,
|
|
29
|
+
nameService
|
|
30
|
+
} = await loadFixture(createDAO);
|
|
31
|
+
|
|
32
|
+
Controller = controller;
|
|
33
|
+
avatar = av;
|
|
34
|
+
|
|
35
|
+
// await daoCreator.setSchemes(
|
|
36
|
+
// avatar,
|
|
37
|
+
// [identity],
|
|
38
|
+
// [ethers.constants.HashZero],
|
|
39
|
+
// ["0x0000001F"],
|
|
40
|
+
// ""
|
|
41
|
+
// );
|
|
42
|
+
//NameService _ns,
|
|
43
|
+
// uint64 _gasPrice,
|
|
44
|
+
// address relayer,
|
|
45
|
+
// address owner
|
|
46
|
+
faucet = (await upgrades.deployProxy(
|
|
47
|
+
FuseFaucetF,
|
|
48
|
+
[nameService.address, 1e10, signers[0].address, founder.address],
|
|
49
|
+
{
|
|
50
|
+
kind: "uups"
|
|
51
|
+
}
|
|
52
|
+
)) as Faucet;
|
|
53
|
+
|
|
54
|
+
gd = (await ethers.getContractAt(
|
|
55
|
+
"IGoodDollar",
|
|
56
|
+
gooddollar,
|
|
57
|
+
founder
|
|
58
|
+
)) as IGoodDollar;
|
|
59
|
+
id = (await ethers.getContractAt(
|
|
60
|
+
"IIdentity",
|
|
61
|
+
identity,
|
|
62
|
+
founder
|
|
63
|
+
)) as IIdentity;
|
|
64
|
+
|
|
65
|
+
await founder.sendTransaction({
|
|
66
|
+
value: ethers.utils.parseEther("1"),
|
|
67
|
+
to: faucet.address
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("should have balance", async () => {
|
|
72
|
+
const balance = await ethers.provider.getBalance(faucet.address);
|
|
73
|
+
expect(balance).to.equal(ethers.utils.parseEther("1"));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("should not unauthorized to top new user", async () => {
|
|
77
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
78
|
+
await expect(faucet.topWallet(user1.address)).revertedWith(
|
|
79
|
+
"not authorized"
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("should let new user top once", async () => {
|
|
84
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
85
|
+
const tx = await (
|
|
86
|
+
await faucet.connect(signers[0]).topWallet(user1.address)
|
|
87
|
+
).wait();
|
|
88
|
+
const balance = await ethers.provider.getBalance(user1.address);
|
|
89
|
+
expect(balance).to.equal(await faucet.toppingAmount());
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("should not let new user top more than once", async () => {
|
|
93
|
+
await user1.sendTransaction({
|
|
94
|
+
to: ethers.constants.AddressZero,
|
|
95
|
+
value: ethers.utils.parseUnits("400000", "gwei")
|
|
96
|
+
});
|
|
97
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
98
|
+
await expect(
|
|
99
|
+
faucet.connect(signers[0]).topWallet(user1.address)
|
|
100
|
+
).to.revertedWith("User not whitelisted or not first time");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("should not refund gas when reverted", async () => {
|
|
104
|
+
const balance = await ethers.provider.getBalance(founder.address);
|
|
105
|
+
const faucetBalance = await ethers.provider.getBalance(faucet.address);
|
|
106
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
107
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith(
|
|
108
|
+
"User not whitelisted or not first time"
|
|
109
|
+
);
|
|
110
|
+
const balanceAfter = await ethers.provider.getBalance(founder.address);
|
|
111
|
+
const faucetBalanceAfter = await ethers.provider.getBalance(faucet.address);
|
|
112
|
+
expect(faucetBalanceAfter).to.eq(faucetBalance);
|
|
113
|
+
expect(balanceAfter).to.lt(balance);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should let user top again once identified", async () => {
|
|
117
|
+
await id.addWhitelistedWithDID(user1.address, "did:1");
|
|
118
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
119
|
+
const tx = await (await faucet.topWallet(user1.address)).wait();
|
|
120
|
+
console.log(tx.gasUsed.toString());
|
|
121
|
+
const balance = await ethers.provider.getBalance(user1.address);
|
|
122
|
+
expect(balance).to.equal(await faucet.toppingAmount());
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("should not let identified user top over daily limit", async () => {
|
|
126
|
+
await user1.sendTransaction({
|
|
127
|
+
to: ethers.constants.AddressZero,
|
|
128
|
+
value: ethers.utils.parseUnits("400000", "gwei")
|
|
129
|
+
});
|
|
130
|
+
const tx = await (await faucet.topWallet(user1.address)).wait();
|
|
131
|
+
await user1.sendTransaction({
|
|
132
|
+
to: ethers.constants.AddressZero,
|
|
133
|
+
value: ethers.utils.parseUnits("400000", "gwei")
|
|
134
|
+
});
|
|
135
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
136
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith(
|
|
137
|
+
"max daily toppings"
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// it("should not top if wallet not half empty", async () => {
|
|
142
|
+
// expect(await faucet.canTop(founder.address)).to.false;
|
|
143
|
+
// await expect(faucet.topWallet(founder.address)).to.revertedWith(
|
|
144
|
+
// "User balance above minimum"
|
|
145
|
+
// );
|
|
146
|
+
// });
|
|
147
|
+
|
|
148
|
+
it("should not let user top over weekly limit", async () => {
|
|
149
|
+
for (let i = 0; i < 5; i++) {
|
|
150
|
+
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24]);
|
|
151
|
+
await (await faucet.topWallet(user1.address)).wait();
|
|
152
|
+
await user1.sendTransaction({
|
|
153
|
+
to: ethers.constants.AddressZero,
|
|
154
|
+
value: ethers.utils.parseUnits("5000000", "gwei")
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24]);
|
|
158
|
+
|
|
159
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
160
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith(
|
|
161
|
+
"User wallet has been topped too many times this week"
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
//should be able to top again after some days passed
|
|
165
|
+
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24 * 3]);
|
|
166
|
+
await ethers.provider.send("evm_mine", []);
|
|
167
|
+
|
|
168
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it("should reimburse gas costs", async () => {
|
|
172
|
+
const balance = await ethers.provider.getBalance(founder.address);
|
|
173
|
+
const tx = await (
|
|
174
|
+
await faucet
|
|
175
|
+
.connect(signers[0])
|
|
176
|
+
.topWallet(user2.address, { gasPrice: 1e9 })
|
|
177
|
+
).wait();
|
|
178
|
+
// const gasCosts = tx.gasUsed.mul(1e9);
|
|
179
|
+
// const afterRefund = gasCosts.sub(await faucet["gasRefund()"]());
|
|
180
|
+
const balanceAfter = await ethers.provider.getBalance(founder.address);
|
|
181
|
+
const diff = balance.sub(balanceAfter).toNumber();
|
|
182
|
+
expect(diff).to.lt(10000);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
|
-
import { FuseFaucet, IGoodDollar, IIdentity } from "
|
|
4
|
+
import { FuseFaucet, IGoodDollar, IIdentity } from "../../types";
|
|
4
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
5
|
-
import { createDAO } from "
|
|
6
|
+
import { createDAO } from "../helpers";
|
|
6
7
|
|
|
7
8
|
const BN = ethers.BigNumber;
|
|
8
9
|
|
|
@@ -25,7 +26,7 @@ describe("FuseFaucet", () => {
|
|
|
25
26
|
avatar: av,
|
|
26
27
|
gd: gooddollar,
|
|
27
28
|
identity
|
|
28
|
-
} = await createDAO
|
|
29
|
+
} = await loadFixture(createDAO);
|
|
29
30
|
|
|
30
31
|
Controller = controller;
|
|
31
32
|
avatar = av;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
import { ClaimersDistribution, GReputation } from "../../types";
|
|
4
5
|
import { createDAO, deployUBI, advanceBlocks, increaseTime } from "../helpers";
|
|
@@ -20,7 +21,7 @@ describe("ClaimersDistribution", () => {
|
|
|
20
21
|
[root, acct, claimer1, claimer2, claimer3, ...signers] =
|
|
21
22
|
await ethers.getSigners();
|
|
22
23
|
|
|
23
|
-
const deployedDAO = await createDAO
|
|
24
|
+
const deployedDAO = await loadFixture(createDAO);
|
|
24
25
|
let {
|
|
25
26
|
nameService: ns,
|
|
26
27
|
genericCall: gn,
|
|
@@ -49,7 +50,7 @@ describe("ClaimersDistribution", () => {
|
|
|
49
50
|
)) as ClaimersDistribution;
|
|
50
51
|
|
|
51
52
|
ubiScheme = ubi.ubiScheme;
|
|
52
|
-
setDAOAddress("GDAO_CLAIMERS", cd.address);
|
|
53
|
+
await setDAOAddress("GDAO_CLAIMERS", cd.address);
|
|
53
54
|
addWhitelisted(claimer1.address, "claimer1");
|
|
54
55
|
await addWhitelisted(claimer2.address, "claimer2");
|
|
55
56
|
await addWhitelisted(claimer3.address, "claimer3");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
// import { deployContract, deployMockContract, MockContract } from "ethereum-waffle";
|
|
4
5
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
@@ -30,7 +31,7 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
30
31
|
setDAOAddress,
|
|
31
32
|
nameService,
|
|
32
33
|
votingMachine
|
|
33
|
-
} = await createDAO
|
|
34
|
+
} = await loadFixture(createDAO);
|
|
34
35
|
gov = votingMachine;
|
|
35
36
|
grep = (await ethers.getContractAt(
|
|
36
37
|
"GReputation",
|
|
@@ -38,7 +39,7 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
38
39
|
)) as GReputation;
|
|
39
40
|
|
|
40
41
|
//this will give root minter permissions
|
|
41
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
42
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
42
43
|
|
|
43
44
|
await grep.mint(root.address, ethers.BigNumber.from("1000000"));
|
|
44
45
|
targets = [acct.address];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
4
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
@@ -23,7 +24,7 @@ describe("CompoundVotingMachine#cross blockchain", () => {
|
|
|
23
24
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
24
25
|
|
|
25
26
|
let { reputation, setDAOAddress, votingMachine, cdaiAddress, controller } =
|
|
26
|
-
await createDAO
|
|
27
|
+
await loadFixture(createDAO);
|
|
27
28
|
testaddr = controller;
|
|
28
29
|
grep = (await ethers.getContractAt(
|
|
29
30
|
"GReputation",
|
|
@@ -33,7 +34,7 @@ describe("CompoundVotingMachine#cross blockchain", () => {
|
|
|
33
34
|
gov = votingMachine;
|
|
34
35
|
|
|
35
36
|
//this will give root minter permissions
|
|
36
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
37
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
37
38
|
|
|
38
39
|
await grep.mint(root.address, ethers.BigNumber.from("1000000"));
|
|
39
40
|
targets = [root.address];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
// import { deployContract, deployMockContract, MockContract } from "ethereum-waffle";
|
|
4
5
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
@@ -69,7 +70,7 @@ describe("CompoundVotingMachine#DAOScheme", () => {
|
|
|
69
70
|
nameService,
|
|
70
71
|
votingMachine,
|
|
71
72
|
genericCall: gc
|
|
72
|
-
} = await createDAO
|
|
73
|
+
} = await loadFixture(createDAO);
|
|
73
74
|
Controller = controller;
|
|
74
75
|
avatar = av;
|
|
75
76
|
genericCall = gc;
|
|
@@ -82,7 +83,7 @@ describe("CompoundVotingMachine#DAOScheme", () => {
|
|
|
82
83
|
setAddress = setDAOAddress;
|
|
83
84
|
|
|
84
85
|
//this will give root minter permissions
|
|
85
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
86
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
86
87
|
|
|
87
88
|
//set voting machiine as scheme with permissions
|
|
88
89
|
await setSchemes([gov.address]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { TypedDataUtils } from "ethers-eip712";
|
|
3
4
|
import { expect } from "chai";
|
|
4
5
|
// import { deployContract, deployMockContract, MockContract } from "ethereum-waffle";
|
|
@@ -69,7 +70,7 @@ describe("CompoundVotingMachine#Delegation", () => {
|
|
|
69
70
|
setDAOAddress,
|
|
70
71
|
nameService,
|
|
71
72
|
votingMachine
|
|
72
|
-
} = await createDAO
|
|
73
|
+
} = await loadFixture(createDAO);
|
|
73
74
|
grep = (await ethers.getContractAt(
|
|
74
75
|
"GReputation",
|
|
75
76
|
reputation
|
|
@@ -78,7 +79,7 @@ describe("CompoundVotingMachine#Delegation", () => {
|
|
|
78
79
|
gov = votingMachine;
|
|
79
80
|
|
|
80
81
|
//this will give root minter permissions
|
|
81
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
82
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
82
83
|
|
|
83
84
|
await grep.mint(root.address, ethers.BigNumber.from("1000000"));
|
|
84
85
|
await grep.mint(acct.address, ethers.BigNumber.from("500000"));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
// import { deployContract, deployMockContract, MockContract } from "ethereum-waffle";
|
|
4
5
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
@@ -60,7 +61,7 @@ describe("CompoundVotingMachine#Guardian", () => {
|
|
|
60
61
|
genericCall,
|
|
61
62
|
nameService: ns,
|
|
62
63
|
votingMachine
|
|
63
|
-
} = await createDAO
|
|
64
|
+
} = await loadFixture(createDAO);
|
|
64
65
|
|
|
65
66
|
Controller = controller;
|
|
66
67
|
avatar = av;
|
|
@@ -75,7 +76,7 @@ describe("CompoundVotingMachine#Guardian", () => {
|
|
|
75
76
|
gov = votingMachine;
|
|
76
77
|
|
|
77
78
|
//this will give root minter permissions
|
|
78
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
79
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
79
80
|
|
|
80
81
|
//set voting machiine as scheme with permissions
|
|
81
82
|
await setSchemes([gov.address]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
4
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
@@ -24,7 +25,7 @@ describe("CompoundVotingMachine#propose", () => {
|
|
|
24
25
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
25
26
|
|
|
26
27
|
let { avatar, reputation, setDAOAddress, nameService, votingMachine } =
|
|
27
|
-
await createDAO
|
|
28
|
+
await loadFixture(createDAO);
|
|
28
29
|
|
|
29
30
|
grep = (await ethers.getContractAt(
|
|
30
31
|
"GReputation",
|
|
@@ -34,7 +35,7 @@ describe("CompoundVotingMachine#propose", () => {
|
|
|
34
35
|
gov = votingMachine;
|
|
35
36
|
|
|
36
37
|
//this will give root minter permissions
|
|
37
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
38
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
38
39
|
|
|
39
40
|
await grep.mint(root.address, ethers.BigNumber.from("1000000"));
|
|
40
41
|
targets = [root.address];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
import { GReputation, CompoundVotingMachine } from "../../types";
|
|
4
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
@@ -66,7 +67,7 @@ describe("CompoundVotingMachine#States", () => {
|
|
|
66
67
|
setDAOAddress,
|
|
67
68
|
nameService,
|
|
68
69
|
votingMachine
|
|
69
|
-
} = await createDAO
|
|
70
|
+
} = await loadFixture(createDAO);
|
|
70
71
|
|
|
71
72
|
grep = (await ethers.getContractAt(
|
|
72
73
|
"GReputation",
|
|
@@ -76,7 +77,7 @@ describe("CompoundVotingMachine#States", () => {
|
|
|
76
77
|
gov = votingMachine;
|
|
77
78
|
|
|
78
79
|
//this will give root minter permissions
|
|
79
|
-
setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
80
|
+
await setDAOAddress("GDAO_CLAIMERS", root.address);
|
|
80
81
|
|
|
81
82
|
//set voting machiine as scheme with permissions
|
|
82
83
|
await setSchemes([gov.address]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// import { GReputationInstance } from "../types/GReputation";
|
|
2
2
|
import MerkleTree, { checkProofOrdered } from "merkle-tree-solidity";
|
|
3
3
|
import { ethers, upgrades } from "hardhat";
|
|
4
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
4
5
|
import { BigNumber, Signer } from "ethers";
|
|
5
6
|
import { sign } from "crypto";
|
|
6
7
|
import { expect } from "chai";
|
|
@@ -19,7 +20,7 @@ type BlockChainState = {
|
|
|
19
20
|
blockNumber: BigNumber;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
export const getMerkleAndProof = (data, proofIdx) => {
|
|
23
|
+
export const getMerkleAndProof = async (data, proofIdx) => {
|
|
23
24
|
const elements = data.map(e =>
|
|
24
25
|
Buffer.from(
|
|
25
26
|
ethers.utils
|
|
@@ -35,7 +36,7 @@ export const getMerkleAndProof = (data, proofIdx) => {
|
|
|
35
36
|
);
|
|
36
37
|
|
|
37
38
|
//this will give repOwner minter permissions
|
|
38
|
-
setDAOAddress("GDAO_CLAIMERS", repOwner);
|
|
39
|
+
await setDAOAddress("GDAO_CLAIMERS", repOwner);
|
|
39
40
|
|
|
40
41
|
const merkleTree = new MerkleTree(elements, true);
|
|
41
42
|
|
|
@@ -78,7 +79,7 @@ describe("GReputation", () => {
|
|
|
78
79
|
setDAOAddress: sda,
|
|
79
80
|
avatar: av,
|
|
80
81
|
genericCall
|
|
81
|
-
} = await createDAO
|
|
82
|
+
} = await loadFixture(createDAO);
|
|
82
83
|
|
|
83
84
|
setDAOAddress = sda;
|
|
84
85
|
avatar = av;
|
|
@@ -99,7 +100,7 @@ describe("GReputation", () => {
|
|
|
99
100
|
// create merkle tree
|
|
100
101
|
// expects unique 32 byte buffers as inputs (no hex strings)
|
|
101
102
|
// if using web3.sha3, convert first -> Buffer(web3.sha3('a'), 'hex')
|
|
102
|
-
const merkleData = getMerkleAndProof(
|
|
103
|
+
const merkleData = await getMerkleAndProof(
|
|
103
104
|
[
|
|
104
105
|
[rep1, 1],
|
|
105
106
|
[rep2, 2],
|
|
@@ -213,7 +214,7 @@ describe("GReputation", () => {
|
|
|
213
214
|
});
|
|
214
215
|
|
|
215
216
|
it("should allow multiple delegates", async () => {
|
|
216
|
-
const { merkleRoot, proof } = getMerkleAndProof(
|
|
217
|
+
const { merkleRoot, proof } = await getMerkleAndProof(
|
|
217
218
|
[
|
|
218
219
|
[rep1, 1],
|
|
219
220
|
[rep2, 2],
|
|
@@ -396,7 +397,7 @@ describe("GReputation", () => {
|
|
|
396
397
|
|
|
397
398
|
describe("setting a blockchain merkle hash", async () => {
|
|
398
399
|
it("should set new merkle hash", async () => {
|
|
399
|
-
const { merkleRoot, proof } = getMerkleAndProof(
|
|
400
|
+
const { merkleRoot, proof } = await getMerkleAndProof(
|
|
400
401
|
[
|
|
401
402
|
[rep1, 100],
|
|
402
403
|
[rep2, 200],
|
|
@@ -436,7 +437,7 @@ describe("GReputation", () => {
|
|
|
436
437
|
it("should prove balance in new state", async () => {
|
|
437
438
|
const prevRep = await grep.balanceOfLocal(rep2);
|
|
438
439
|
const prevVotes = await grep.getVotes(rep2);
|
|
439
|
-
const { proof } = getMerkleAndProof(
|
|
440
|
+
const { proof } = await getMerkleAndProof(
|
|
440
441
|
[
|
|
441
442
|
[rep1, 100],
|
|
442
443
|
[rep2, 200],
|
|
@@ -474,7 +475,7 @@ describe("GReputation", () => {
|
|
|
474
475
|
|
|
475
476
|
it("should not effect delegate balance after new state hash", async () => {
|
|
476
477
|
const prevDelegated = await grep.getVotes(rep3);
|
|
477
|
-
const { merkleRoot, proof } = getMerkleAndProof(
|
|
478
|
+
const { merkleRoot, proof } = await getMerkleAndProof(
|
|
478
479
|
[
|
|
479
480
|
[rep1, 100],
|
|
480
481
|
[rep2, 200],
|
|
@@ -497,7 +498,7 @@ describe("GReputation", () => {
|
|
|
497
498
|
|
|
498
499
|
it("should not effect delegate balance after new blockchain proof", async () => {
|
|
499
500
|
const prevVotes = await grep.getVotes(rep3);
|
|
500
|
-
const { merkleRoot, proof } = getMerkleAndProof(
|
|
501
|
+
const { merkleRoot, proof } = await getMerkleAndProof(
|
|
501
502
|
[
|
|
502
503
|
[rep1, 100],
|
|
503
504
|
[rep2, 200],
|
|
@@ -512,7 +513,7 @@ describe("GReputation", () => {
|
|
|
512
513
|
|
|
513
514
|
it("should include own rep in votes balance after new state", async () => {
|
|
514
515
|
const prevVotes = await grep.getVotes(rep3);
|
|
515
|
-
const { merkleRoot, proof } = getMerkleAndProof(
|
|
516
|
+
const { merkleRoot, proof } = await getMerkleAndProof(
|
|
516
517
|
[
|
|
517
518
|
[rep1, 100],
|
|
518
519
|
[rep2, 200],
|
|
@@ -743,17 +744,21 @@ describe("GReputation", () => {
|
|
|
743
744
|
|
|
744
745
|
it("it should be able to get totalSupplyLocal for particular block", async () => {
|
|
745
746
|
let currentBlock = await ethers.provider.getBlockNumber();
|
|
746
|
-
const totalSupplyLocalBefore = await grep["totalSupplyLocal(uint256)"](
|
|
747
|
+
const totalSupplyLocalBefore = await grep["totalSupplyLocal(uint256)"](
|
|
748
|
+
currentBlock
|
|
749
|
+
);
|
|
747
750
|
await grepWithOwner["mint(address,uint256)"](
|
|
748
751
|
founder,
|
|
749
752
|
ethers.utils.parseEther("1")
|
|
750
753
|
);
|
|
751
754
|
currentBlock = await ethers.provider.getBlockNumber();
|
|
752
|
-
const totalSupplyLocalAfter = await grep["totalSupplyLocal(uint256)"](
|
|
755
|
+
const totalSupplyLocalAfter = await grep["totalSupplyLocal(uint256)"](
|
|
756
|
+
currentBlock
|
|
757
|
+
);
|
|
753
758
|
expect(totalSupplyLocalAfter).to.equal(
|
|
754
759
|
totalSupplyLocalBefore.add(ethers.utils.parseEther("1"))
|
|
755
760
|
);
|
|
756
|
-
|
|
761
|
+
|
|
757
762
|
await grepWithOwner["burn(address,uint256)"](
|
|
758
763
|
founder,
|
|
759
764
|
ethers.utils.parseEther("1")
|
|
@@ -870,7 +875,10 @@ describe("GReputation", () => {
|
|
|
870
875
|
await advanceBlocks(1);
|
|
871
876
|
await (await grepWithOwner["mint(address,uint256)"](rep2, 1)).wait();
|
|
872
877
|
await advanceBlocks(1);
|
|
873
|
-
const priorSelectedBlockVotes = await grep.getPriorVotes(
|
|
878
|
+
const priorSelectedBlockVotes = await grep.getPriorVotes(
|
|
879
|
+
rep2,
|
|
880
|
+
selectedBlock
|
|
881
|
+
);
|
|
874
882
|
const votesAfterAdvancing = await grep.getCurrentVotes(rep2);
|
|
875
883
|
expect(priorSelectedBlockVotes).to.eq(selectedBlockVotes);
|
|
876
884
|
expect(priorSelectedBlockVotes).to.be.not.eq(votesAfterAdvancing);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as hre, ethers, upgrades, waffle } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { Contract, Signer } from "ethers";
|
|
3
4
|
import { expect } from "chai";
|
|
4
5
|
import {
|
|
@@ -65,7 +66,7 @@ describe("GoodDollarStaking - check fixed APY G$ rewards", () => {
|
|
|
65
66
|
runAsAvatarOnly: ras,
|
|
66
67
|
setSchemes: ss,
|
|
67
68
|
genericCall: gc
|
|
68
|
-
} = await createDAO
|
|
69
|
+
} = await loadFixture(createDAO);
|
|
69
70
|
|
|
70
71
|
setSchemes = ss;
|
|
71
72
|
runAsAvatarOnly = ras;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as hre, ethers, waffle } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { BigNumber, Contract, Signer } from "ethers";
|
|
3
4
|
import { expect } from "chai";
|
|
4
5
|
import { GoodReserveCDai, GReputation, GoodDollarStaking } from "../../types";
|
|
@@ -43,7 +44,7 @@ describe("GoodDollarStaking - check GOOD rewards based on GovernanceStaking.test
|
|
|
43
44
|
cdaiAddress,
|
|
44
45
|
reserve,
|
|
45
46
|
reputation
|
|
46
|
-
} = await createDAO
|
|
47
|
+
} = await loadFixture(createDAO);
|
|
47
48
|
dai = await ethers.getContractAt("DAIMock", daiAddress);
|
|
48
49
|
cDAI = await ethers.getContractAt("cDAIMock", cdaiAddress);
|
|
49
50
|
avatar = av;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as hre, ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { BigNumber, Contract, Signer } from "ethers";
|
|
3
4
|
import { deployMockContract, MockContract } from "ethereum-waffle";
|
|
4
5
|
import { expect } from "chai";
|
|
@@ -66,7 +67,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
66
67
|
reserve,
|
|
67
68
|
reputation,
|
|
68
69
|
setReserveToken
|
|
69
|
-
} = await createDAO
|
|
70
|
+
} = await loadFixture(createDAO);
|
|
70
71
|
dai = await ethers.getContractAt("DAIMock", daiAddress);
|
|
71
72
|
cDAI = await ethers.getContractAt("cDAIMock", cdaiAddress);
|
|
72
73
|
avatar = av;
|
|
@@ -111,8 +112,8 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
111
112
|
nameService.address
|
|
112
113
|
);
|
|
113
114
|
|
|
114
|
-
setDAOAddress("CDAI", cDAI.address);
|
|
115
|
-
setDAOAddress("DAI", dai.address);
|
|
115
|
+
await setDAOAddress("CDAI", cDAI.address);
|
|
116
|
+
await setDAOAddress("DAI", dai.address);
|
|
116
117
|
|
|
117
118
|
//This set addresses should be another function because when we put this initialization of addresses in initializer then nameservice is not ready yet so no proper addresses
|
|
118
119
|
await goodReserve.setAddresses();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
2
3
|
import { expect } from "chai";
|
|
3
4
|
import { Reputation } from "../../types";
|
|
4
5
|
import { createDAO } from "../helpers";
|
|
@@ -10,7 +11,7 @@ describe("Reputation", () => {
|
|
|
10
11
|
before(async () => {
|
|
11
12
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
12
13
|
|
|
13
|
-
let { nameService: ns, genericCall: gn } = await createDAO
|
|
14
|
+
let { nameService: ns, genericCall: gn } = await loadFixture(createDAO);
|
|
14
15
|
nameService = ns;
|
|
15
16
|
genericCall = gn;
|
|
16
17
|
});
|