@gooddollar/goodprotocol 1.0.31-beta.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/artifacts/abis/AaveMock.min.json +1 -1
- package/artifacts/abis/AaveStakingFactory.min.json +1 -1
- package/artifacts/abis/AdminWallet.min.json +1 -1
- package/artifacts/abis/AdminWalletFuse.min.json +1 -0
- package/artifacts/abis/BuyAndBridgeHelper.min.json +1 -0
- package/artifacts/abis/ClaimersDistribution.min.json +1 -1
- package/artifacts/abis/CompoundStakingFactory.min.json +1 -1
- package/artifacts/abis/CompoundVotingMachine.min.json +1 -1
- package/artifacts/abis/DAIMock.min.json +1 -1
- package/artifacts/abis/DAOUpgradeableContract.min.json +1 -1
- package/artifacts/abis/DecimalsMock.min.json +1 -1
- package/artifacts/abis/DistributionHelper.min.json +1 -1
- package/artifacts/abis/DistributionHelperTest.min.json +1 -1
- package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -1
- package/artifacts/abis/DonationsStaking.min.json +1 -1
- package/artifacts/abis/ERC20Permit.min.json +1 -0
- 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/ExchangeHelper.min.json +1 -1
- package/artifacts/abis/Faucet.min.json +1 -0
- package/artifacts/abis/FeesFormulaMock.min.json +1 -0
- package/artifacts/abis/FuseFaucet.min.json +1 -1
- package/artifacts/abis/FuseFaucetV2.min.json +1 -0
- package/artifacts/abis/FuseStakingV3.min.json +1 -1
- package/artifacts/abis/GReputation.min.json +1 -1
- package/artifacts/abis/GoodAaveStaking.min.json +1 -1
- package/artifacts/abis/GoodAaveStakingV2.min.json +1 -1
- package/artifacts/abis/GoodCompoundStaking.min.json +1 -1
- package/artifacts/abis/GoodCompoundStakingTest.min.json +1 -1
- package/artifacts/abis/GoodCompoundStakingV2.min.json +1 -1
- package/artifacts/abis/GoodDollar.min.json +1 -0
- 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/GoodFundManager.min.json +1 -1
- package/artifacts/abis/GoodFundManagerTest.min.json +1 -1
- package/artifacts/abis/GoodMarketMaker.min.json +1 -1
- package/artifacts/abis/GoodReserveCDai.min.json +1 -1
- package/artifacts/abis/GovernanceStaking.min.json +1 -1
- package/artifacts/abis/IFeesFormula.min.json +1 -0
- package/artifacts/abis/IGoodDollar.min.json +1 -1
- package/artifacts/abis/IGoodDollarCustom.min.json +1 -0
- package/artifacts/abis/IGovernanceStaking.min.json +1 -0
- package/artifacts/abis/IIdentity.min.json +1 -1
- package/artifacts/abis/IIdentityV2.min.json +1 -0
- package/artifacts/abis/IStakingUpgrade.min.json +1 -0
- package/artifacts/abis/ISuperGoodDollar.min.json +1 -0
- package/artifacts/abis/IdentityMock.min.json +1 -0
- package/artifacts/abis/IdentityV2.min.json +1 -0
- package/artifacts/abis/InvitesFuseV2.min.json +1 -0
- package/artifacts/abis/InvitesV1.min.json +1 -1
- package/artifacts/abis/InvitesV2.min.json +1 -0
- package/artifacts/abis/LendingPoolMock.min.json +1 -1
- package/artifacts/abis/NameService.min.json +1 -1
- package/artifacts/abis/PayableMock.min.json +1 -0
- package/artifacts/abis/Proxy.min.json +1 -0
- package/artifacts/abis/Reputation.min.json +1 -1
- package/artifacts/abis/SelfApprove.min.json +1 -0
- package/artifacts/abis/SimpleStaking.min.json +1 -1
- package/artifacts/abis/SimpleStakingV2.min.json +1 -1
- package/artifacts/abis/SixteenDecimalsTokenMock.min.json +1 -1
- package/artifacts/abis/StakersDistribution.min.json +1 -1
- package/artifacts/abis/SuperGoodDollar.min.json +1 -0
- package/artifacts/abis/SuperToken.min.json +1 -0
- package/artifacts/abis/SuperfluidToken.min.json +1 -0
- package/artifacts/abis/TwentyDecimalsTokenMock.min.json +1 -1
- package/artifacts/abis/UBIScheme.min.json +1 -1
- package/artifacts/abis/USDCMock.min.json +1 -1
- package/artifacts/abis/UUPSProxiable.min.json +1 -0
- package/artifacts/abis/UUPSProxy.min.json +1 -0
- package/artifacts/abis/UUPSUtils.min.json +1 -0
- package/artifacts/abis/UpgradableMock.min.json +1 -1
- package/artifacts/abis/UpgradableMock2.min.json +1 -1
- package/artifacts/abis/UpgradableMock3.min.json +1 -1
- package/artifacts/abis/UpgradableMock4.min.json +1 -1
- package/artifacts/abis/cBATMock.min.json +1 -1
- package/artifacts/abis/cDAILowWorthMock.min.json +1 -1
- package/artifacts/abis/cDAIMock.min.json +1 -1
- package/artifacts/abis/cDAINonMintableMock.min.json +1 -1
- package/artifacts/abis/cDecimalsMock.min.json +1 -1
- package/artifacts/abis/cSDTMock.min.json +1 -1
- package/artifacts/abis/cUSDCMock.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 +184 -0
- 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 +70 -0
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +4 -0
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +300 -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 +4 -0
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +736 -0
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +15 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +4 -0
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +480 -0
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +28 -2
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +28 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.json +78 -3
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +71 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +4 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.json +24 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +4 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.json +35 -0
- 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 +31 -5
- 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 +28 -2
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +28 -2
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +4 -0
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +1081 -0
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +4 -0
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +505 -0
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +15 -2
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +4 -0
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +635 -0
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.json +18 -5
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.json +18 -5
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.json +2 -2
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.json +18 -5
- 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 +28 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +28 -2
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.json +2 -2
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.json +69 -0
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.json +2 -2
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +22 -9
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +95 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +28 -2
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +277 -0
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.json +2 -2
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.json +18 -5
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.json +18 -0
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.json +18 -5
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.json +18 -5
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +28 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +28 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +28 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +28 -2
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.json +18 -5
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.json +18 -5
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.json +18 -5
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.json +18 -5
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.json +18 -5
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.json +18 -5
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.json +18 -5
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.json +18 -5
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +28 -2
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +28 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +28 -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 +31 -5
- 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 +32 -6
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +15 -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 +28 -2
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.json +16 -3
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.json +16 -3
- 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 +3 -3
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +20 -7
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +20 -7
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +4 -4
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +22 -9
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +22 -9
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.json +2 -2
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +4 -0
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.json +768 -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 +1206 -0
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.json +99 -0
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.json +34 -0
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.json +355 -0
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.json +2132 -0
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2627 -0
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +1759 -0
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.json +682 -0
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.json +89 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.json +19 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +32 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +4 -0
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.json +10 -0
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +41 -22
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +94 -48
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +4 -0
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +830 -0
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.json +2 -2
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +184 -0
- 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 +28 -2
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.json +2 -2
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.json +2 -2
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +35 -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/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.json +2 -2
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.json +28 -2
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.json +2 -2
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/contracts/Interfaces.sol +57 -3
- package/contracts/fuseFaucet/Faucet.sol +258 -0
- package/contracts/fuseFaucet/FuseFaucet.sol +1 -2
- package/contracts/fuseFaucet/FuseFaucetV2.sol +256 -0
- package/contracts/governance/GReputation.sol +104 -16
- package/contracts/governance/GoodDollarStaking.sol +139 -53
- package/contracts/governance/GovernanceStaking.sol +2 -2
- package/contracts/identity/IdentityV2.sol +559 -0
- package/contracts/invite/InvitesFuseV2.sol +337 -0
- package/contracts/invite/InvitesV1.sol +6 -24
- package/contracts/invite/InvitesV2.sol +345 -0
- package/contracts/mocks/AaveMock.sol +1 -1
- package/contracts/mocks/DAIMock.sol +1 -1
- package/contracts/mocks/DecimalsMock.sol +1 -1
- package/contracts/mocks/FeesFormularMock.sol +21 -0
- package/contracts/mocks/GoodDollarStakingMock.sol +16 -0
- package/contracts/mocks/GoodFundManagerTest.sol +1 -1
- package/contracts/mocks/IdentityMock.sol +58 -0
- package/contracts/mocks/LendingPoolMock.sol +1 -1
- package/contracts/mocks/PayableMock.sol +3 -0
- package/contracts/mocks/SixteenDecimalsTokenMock.sol +1 -6
- package/contracts/mocks/TwentyDecimalsTokenMock.sol +1 -6
- package/contracts/mocks/UpgradableMocks.sol +5 -3
- package/contracts/mocks/UsdcMock.sol +1 -6
- package/contracts/mocks/cBATMock.sol +7 -12
- package/contracts/mocks/cDAILowWorthMock.sol +8 -12
- package/contracts/mocks/cDAIMock.sol +1 -1
- package/contracts/mocks/cDAINonMintableMock.sol +7 -12
- package/contracts/mocks/cDecimalsMock.sol +1 -1
- package/contracts/mocks/cSDTMock.sol +3 -3
- package/contracts/mocks/cUSDCMock.sol +5 -5
- package/contracts/reserve/DistributionHelper.sol +1 -1
- package/contracts/reserve/GoodReserveCDai.sol +1 -1
- 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 +243 -0
- package/contracts/token/superfluid/ERC20Permit.sol +101 -0
- package/contracts/token/superfluid/ISuperGoodDollar.sol +84 -0
- package/contracts/token/superfluid/SuperGoodDollar.sol +401 -0
- package/contracts/token/superfluid/SuperToken.sol +714 -0
- package/contracts/token/superfluid/SuperfluidToken.sol +403 -0
- package/contracts/token/superfluid/UUPSProxiable.sol +55 -0
- package/contracts/token/superfluid/UUPSProxy.sol +153 -0
- package/contracts/ubi/UBIScheme.sol +88 -68
- package/contracts/utils/AdminWallet.sol +42 -11
- package/contracts/utils/AdminWalletFuse.sol +271 -0
- package/contracts/utils/BuyAndBridgeHelper.sol +108 -0
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +19 -1
- package/contracts/utils/ProxyFactory1967.sol +1 -1
- package/hardhat.config.ts +29 -6
- package/package.json +11 -7
- package/releases/deploy-settings.json +58 -4
- package/releases/deployment.json +65 -231
- package/scripts/deployFullDAO.ts +39 -19
- package/scripts/gdx/gdxAirdropCalculation.ts +10 -11
- package/scripts/governance/airdropCalculationRecover.ts +43 -33
- package/scripts/governance/airdropCalculationSorted.ts +438 -0
- package/scripts/governance/goodCheckpointSorted.ts +377 -0
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +100 -0
- package/scripts/multichain-deploy/{basicdao-deploy.ts → 1_basicdao-deploy.ts} +123 -93
- package/scripts/multichain-deploy/2_helpers-deploy.ts +151 -0
- package/scripts/multichain-deploy/{gdSavings-deploy.ts → 3_gdSavings-deploy.ts} +106 -76
- package/scripts/multichain-deploy/4_ubi-deploy.ts +147 -0
- package/scripts/multichain-deploy/5_gov-deploy.ts +147 -0
- package/scripts/multichain-deploy/fulldeploy.sh +26 -0
- package/scripts/multichain-deploy/helpers.ts +149 -111
- package/scripts/multichain-deploy/verifyEtherscan.ts +197 -0
- package/scripts/test/localOldDaoDeploy.ts +10 -3
- package/scripts/upgradeToV3/v3-fix.ts +120 -0
- package/scripts/upgradeToV3/v3-upgrade.ts +219 -0
- package/scripts/upgrades/celo-defi-ubi-deploy.ts +165 -0
- package/scripts/upgrades/identity-upgrade.ts +109 -0
- package/scripts/upgrades/transferDaoToGuardians.ts +80 -0
- package/test/faucet/Faucet.test.ts +157 -0
- package/test/{FuseFaucet.test.ts → faucet/FuseFaucet.test.ts} +26 -31
- package/test/governance/ClaimersDistribution.test.ts +58 -6
- package/test/governance/CompoundVotingMachine.castvote.test.ts +3 -3
- package/test/governance/CompoundVotingMachine.crossblockchain.ts +3 -2
- package/test/governance/CompoundVotingMachine.daoscheme.ts +8 -10
- package/test/governance/CompoundVotingMachine.delegate.test.ts +4 -5
- package/test/governance/CompoundVotingMachine.guardian.test.ts +5 -11
- package/test/governance/CompoundVotingMachine.propose.test.ts +3 -2
- package/test/governance/CompoundVotingMachine.state.test.ts +3 -2
- package/test/governance/GReputation.test.ts +78 -32
- package/test/governance/GReputation.v2merkle.test.ts +186 -0
- package/test/governance/GoodDollarStaking.gd.test.ts +83 -1
- package/test/governance/GoodDollarStaking.good.test.ts +2 -1
- package/test/governance/GovernanceStaking.test.ts +4 -4
- package/test/governance/Reputation.test.ts +2 -1
- package/test/governance/StakersDistribution.test.ts +26 -13
- package/test/helpers.ts +145 -52
- package/test/identity/IdentityV2.test.ts +539 -0
- package/test/{InvitesV1.test.ts → invite/InvitesV1.test.ts} +10 -5
- package/test/invite/InvitesV2.test.ts +328 -0
- package/test/reserve/DistributionHelper.test.ts +2 -1
- package/test/reserve/GoodMarketMaker.test.ts +20 -19
- 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 -2
- package/test/reserve/GoodReserveCDai.pause.test.ts +2 -1
- package/test/reserve/GoodReserveCDai.test.ts +14 -38
- package/test/reserve/GoodReserveCDai.uniswap.test.ts +21 -19
- package/test/staking/CompoundStakingFactory.test.ts +8 -5
- package/test/staking/DifferentStakingTokens.test.ts +3 -2
- package/test/staking/DonationsStaking.test.ts +33 -24
- package/test/staking/FuseStaking.test.ts +9 -9
- package/test/staking/GoodAaveStakingFactory.test.ts +36 -31
- package/test/staking/SimpleDAIStaking.test.ts +13 -19
- package/test/staking/StakingRewards.test.ts +19 -16
- 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 +445 -0
- package/test/token/SuperGoodDollar.test.ts +422 -0
- package/test/ubi/UBIScheme.e2e.test.ts +6 -5
- package/test/ubi/UBIScheme.test.ts +37 -36
- package/test/ubi/UBISchemeCycle.test.ts +11 -8
- package/test/utils/AdminWallet.test.ts +34 -11
- package/test/utils/BuyAndBridgeHelper.test.ts +249 -0
- package/test/utils/DAOUpgradeableContract.test.ts +3 -2
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +3 -2
- package/test/utils/NameService.test.ts +37 -21
- package/test/utils/ProtocolUpgrade.test.ts +1 -1
- package/test/utils/ProxyFactory.test.ts +12 -10
- package/truffle-config.js +18 -18
- package/types/AaveMock.ts +24 -15
- package/types/AccessControlEnumerableUpgradeable.ts +9 -0
- package/types/AccessControlUpgradeable.ts +9 -0
- package/types/AdminWallet.ts +149 -110
- package/types/AdminWalletFuse.ts +1268 -0
- package/types/BuyAndBridgeHelper.ts +279 -0
- package/types/CBATMock.ts +24 -15
- package/types/CDAILowWorthMock.ts +24 -15
- package/types/CDAIMock.ts +24 -15
- package/types/CDAINonMintableMock.ts +24 -15
- package/types/CDecimalsMock.ts +24 -15
- package/types/CSDTMock.ts +24 -15
- package/types/CUSDCMock.ts +24 -15
- package/types/ClaimersDistribution.ts +28 -0
- package/types/CompoundVotingMachine.ts +28 -0
- package/types/ContextUpgradeable.ts +77 -0
- package/types/DAIMock.ts +24 -15
- package/types/DAOUpgradeableContract.ts +28 -0
- package/types/DecimalsMock.ts +24 -15
- package/types/DistributionHelper.ts +28 -0
- package/types/DistributionHelperTest.ts +28 -0
- package/types/DistributionHelperTestHelper.ts +28 -0
- package/types/DonationsStaking.ts +28 -0
- package/types/EIP712Upgradeable.ts +77 -0
- package/types/ERC165Upgradeable.ts +13 -2
- package/types/ERC1967UpgradeUpgradeable.ts +9 -0
- package/types/ERC20BurnableUpgradeable.ts +24 -15
- package/types/ERC20PausableUpgradeable.ts +24 -15
- package/types/ERC20Permit.ts +186 -0
- package/types/ERC20PermitUpgradeable.ts +531 -0
- package/types/ERC20PresetMinterPauserUpgradeable.ts +129 -16
- package/types/ERC20Upgradeable.ts +24 -15
- package/types/ERC20WithTokenInfo.ts +339 -0
- package/types/ERC677.ts +131 -0
- package/types/ERC677Receiver.ts +115 -0
- package/types/EventsEmitter.ts +88 -0
- package/types/ExchangeHelper.ts +28 -0
- package/types/Faucet.ts +1107 -0
- package/types/FeesFormulaMock.ts +130 -0
- package/types/FuseFaucet.ts +9 -0
- package/types/FuseFaucetV2.ts +729 -0
- package/types/FuseStakingV3.ts +9 -0
- package/types/GReputation.ts +103 -4
- package/types/GoodAaveStaking.ts +24 -15
- package/types/GoodAaveStakingV2.ts +24 -15
- package/types/GoodCompoundStaking.ts +24 -15
- package/types/GoodCompoundStakingTest.ts +24 -15
- package/types/GoodCompoundStakingV2.ts +24 -15
- package/types/GoodDollar.ts +1733 -0
- package/types/GoodDollarMintBurnWrapper.ts +55 -0
- package/types/GoodDollarStaking.ts +92 -0
- package/types/GoodDollarStakingMock.ts +131 -0
- package/types/GoodFundManager.ts +28 -0
- package/types/GoodFundManagerTest.ts +28 -0
- package/types/GoodMarketMaker.ts +28 -0
- package/types/GoodReserveCDai.ts +43 -15
- package/types/GovernanceStaking.ts +43 -15
- package/types/IERC1271Upgradeable.ts +109 -0
- package/types/IERC1820Registry.ts +398 -0
- package/types/IERC1822ProxiableUpgradeable.ts +90 -0
- package/types/IERC20MetadataUpgradeable.ts +15 -15
- package/types/IERC20Permit.ts +175 -0
- package/types/IERC20PermitUpgradeable.ts +176 -0
- package/types/IERC20Upgradeable.ts +15 -15
- package/types/IERC777.ts +586 -0
- package/types/IERC777Recipient.ts +130 -0
- package/types/IERC777Sender.ts +130 -0
- package/types/IFeesFormula.ts +111 -0
- package/types/IGoodDollar.ts +304 -7
- package/types/IGoodDollarCustom.ts +618 -0
- package/types/IGovernanceStaking.ts +98 -0
- package/types/IIdentity.ts +106 -0
- package/types/IIdentityV2.ts +557 -0
- package/types/IStakingUpgrade.ts +110 -0
- package/types/ISuperAgreement.ts +151 -0
- package/types/ISuperApp.ts +410 -0
- package/types/ISuperGoodDollar.ts +3029 -0
- package/types/ISuperToken.ts +2326 -0
- package/types/ISuperTokenFactory.ts +415 -0
- package/types/ISuperfluid.ts +1565 -0
- package/types/ISuperfluidGovernance.ts +455 -0
- package/types/ISuperfluidToken.ts +951 -0
- package/types/IdentityMock.ts +493 -0
- package/types/IdentityV2.ts +1743 -0
- package/types/Initializable.ts +77 -0
- package/types/InvitesFuseV2.ts +806 -0
- package/types/InvitesV1.ts +9 -0
- package/types/InvitesV2.ts +1010 -0
- package/types/LendingPoolMock.ts +24 -15
- package/types/NameService.ts +28 -0
- package/types/OwnableUpgradeable.ts +9 -0
- package/types/PausableUpgradeable.ts +9 -0
- package/types/PayableMock.ts +92 -0
- package/types/ReentrancyGuardUpgradeable.ts +78 -0
- package/types/Reputation.ts +28 -0
- package/types/SelfApprove.ts +115 -0
- package/types/SimpleStaking.ts +24 -15
- package/types/SimpleStakingV2.ts +24 -15
- package/types/SixteenDecimalsTokenMock.ts +24 -15
- package/types/StakersDistribution.ts +28 -0
- package/types/SuperGoodDollar.ts +3662 -0
- package/types/SuperToken.ts +2434 -0
- package/types/SuperfluidToken.ts +951 -0
- package/types/TokenInfo.ts +109 -0
- package/types/TwentyDecimalsTokenMock.ts +24 -15
- package/types/UBIScheme.ts +47 -40
- package/types/USDCMock.ts +24 -15
- package/types/UUPSProxiable.ts +183 -0
- package/types/UUPSProxy.ts +105 -0
- package/types/UUPSUpgradeable.ts +28 -0
- package/types/UpgradableMock.ts +28 -0
- package/types/UpgradableMock2.ts +28 -0
- package/types/UpgradableMock3.ts +28 -0
- package/types/UpgradableMock4.ts +28 -0
- package/types/factories/AaveMock__factory.ts +17 -4
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AaveUSDMockOracle__factory.ts +1 -1
- package/types/factories/AccessControlEnumerableUpgradeable__factory.ts +13 -0
- package/types/factories/AccessControlUpgradeable__factory.ts +13 -0
- package/types/factories/AdminWalletFuse__factory.ts +881 -0
- package/types/factories/AdminWallet__factory.ts +93 -47
- package/types/factories/BancorFormula__factory.ts +1 -1
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__factory.ts +1 -1
- package/types/factories/BatUSDMockOracle__factory.ts +1 -1
- package/types/factories/BuyAndBridgeHelper__factory.ts +237 -0
- package/types/factories/CBATMock__factory.ts +17 -4
- package/types/factories/CDAILowWorthMock__factory.ts +17 -4
- package/types/factories/CDAIMock__factory.ts +17 -4
- package/types/factories/CDAINonMintableMock__factory.ts +17 -4
- package/types/factories/CDecimalsMock__factory.ts +17 -4
- package/types/factories/CSDTMock__factory.ts +17 -4
- package/types/factories/CUSDCMock__factory.ts +17 -4
- package/types/factories/ClaimersDistribution__factory.ts +27 -1
- package/types/factories/CompUSDMockOracle__factory.ts +1 -1
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/CompoundVotingMachine__factory.ts +27 -1
- package/types/factories/ContextUpgradeable__factory.ts +39 -0
- package/types/factories/DAIMock__factory.ts +17 -4
- package/types/factories/DAOContract__factory.ts +1 -1
- package/types/factories/DAOUpgradeableContract__factory.ts +27 -1
- package/types/factories/DaiEthPriceMockOracle__factory.ts +1 -1
- package/types/factories/DecimalsMock__factory.ts +17 -4
- package/types/factories/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/DistributionHelperTestHelper__factory.ts +27 -1
- package/types/factories/DistributionHelperTest__factory.ts +27 -1
- package/types/factories/DistributionHelper__factory.ts +27 -1
- package/types/factories/DonationsStaking__factory.ts +27 -1
- package/types/factories/EIP712Upgradeable__factory.ts +39 -0
- package/types/factories/ERC165Upgradeable__factory.ts +13 -0
- package/types/factories/ERC1967Proxy__factory.ts +1 -1
- package/types/factories/ERC1967UpgradeUpgradeable__factory.ts +13 -0
- package/types/factories/ERC20BurnableUpgradeable__factory.ts +16 -3
- package/types/factories/ERC20PausableUpgradeable__factory.ts +16 -3
- package/types/factories/ERC20PermitUpgradeable__factory.ts +388 -0
- package/types/factories/ERC20Permit__factory.ts +111 -0
- package/types/factories/ERC20PresetMinterPauserUpgradeable__factory.ts +99 -5
- package/types/factories/ERC20Upgradeable__factory.ts +17 -4
- package/types/factories/ERC20WithTokenInfo__factory.ts +248 -0
- package/types/factories/ERC677Receiver__factory.ts +55 -0
- package/types/factories/ERC677__factory.ts +75 -0
- package/types/factories/EthUSDMockOracle__factory.ts +1 -1
- package/types/factories/EventsEmitter__factory.ts +84 -0
- package/types/factories/ExchangeHelper__factory.ts +27 -1
- package/types/factories/Faucet__factory.ts +781 -0
- package/types/factories/FeesFormulaMock__factory.ts +132 -0
- package/types/factories/FuseFaucetV2__factory.ts +528 -0
- package/types/factories/FuseFaucet__factory.ts +14 -1
- package/types/factories/FuseStakingV3__factory.ts +14 -1
- package/types/factories/GReputation__factory.ts +77 -2
- package/types/factories/GasPriceMockOracle__factory.ts +1 -1
- package/types/factories/GoodAaveStakingV2__factory.ts +17 -4
- package/types/factories/GoodAaveStaking__factory.ts +17 -4
- package/types/factories/GoodCompoundStakingTest__factory.ts +17 -4
- package/types/factories/GoodCompoundStakingV2__factory.ts +17 -4
- package/types/factories/GoodCompoundStaking__factory.ts +17 -4
- package/types/factories/GoodDollarMintBurnWrapper__factory.ts +34 -1
- package/types/factories/GoodDollarStakingMock__factory.ts +94 -1
- package/types/factories/GoodDollarStaking__factory.ts +70 -1
- package/types/factories/GoodDollar__factory.ts +1254 -0
- package/types/factories/GoodFundManagerTest__factory.ts +27 -1
- package/types/factories/GoodFundManager__factory.ts +27 -1
- package/types/factories/GoodMarketMaker__factory.ts +27 -1
- package/types/factories/GoodReserveCDai__factory.ts +30 -4
- package/types/factories/GovernanceStaking__factory.ts +30 -4
- package/types/factories/IERC1271Upgradeable__factory.ts +50 -0
- package/types/factories/IERC1820Registry__factory.ts +239 -0
- package/types/factories/IERC1822ProxiableUpgradeable__factory.ts +43 -0
- package/types/factories/IERC20MetadataUpgradeable__factory.ts +3 -3
- package/types/factories/IERC20PermitUpgradeable__factory.ts +105 -0
- package/types/factories/IERC20Permit__factory.ts +98 -0
- package/types/factories/IERC20Upgradeable__factory.ts +3 -3
- package/types/factories/IERC777Recipient__factory.ts +64 -0
- package/types/factories/IERC777Sender__factory.ts +61 -0
- package/types/factories/IERC777__factory.ts +414 -0
- package/types/factories/IFeesFormula__factory.ts +57 -0
- package/types/factories/IGoodDollarCustom__factory.ts +370 -0
- package/types/factories/IGoodDollar__factory.ts +184 -0
- package/types/factories/IGovernanceStaking__factory.ts +39 -0
- package/types/factories/IIdentityV2__factory.ts +312 -0
- package/types/factories/IIdentity__factory.ts +70 -0
- package/types/factories/IStakingUpgrade__factory.ts +50 -0
- package/types/factories/ISuperAgreement__factory.ts +78 -0
- package/types/factories/ISuperApp__factory.ts +272 -0
- package/types/factories/ISuperGoodDollar__factory.ts +2147 -0
- package/types/factories/ISuperTokenFactory__factory.ts +271 -0
- package/types/factories/ISuperToken__factory.ts +1682 -0
- package/types/factories/ISuperfluidGovernance__factory.ts +264 -0
- package/types/factories/ISuperfluidToken__factory.ts +697 -0
- package/types/factories/ISuperfluid__factory.ts +1143 -0
- package/types/factories/IdentityMock__factory.ts +327 -0
- package/types/factories/IdentityV2__factory.ts +1129 -0
- package/types/factories/IncentiveControllerMock__factory.ts +1 -1
- package/types/factories/Initializable__factory.ts +36 -0
- package/types/factories/InvitesFuseV2__factory.ts +553 -0
- package/types/factories/InvitesV1__factory.ts +14 -1
- package/types/factories/InvitesV2__factory.ts +683 -0
- package/types/factories/LendingPoolMock__factory.ts +17 -4
- package/types/factories/Multicall__factory.ts +1 -1
- package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/NameService__factory.ts +27 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/OverMintTester__factory.ts +1 -1
- package/types/factories/OwnableUpgradeable__factory.ts +13 -0
- package/types/factories/PausableUpgradeable__factory.ts +13 -0
- package/types/factories/PayableMock__factory.ts +66 -0
- package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgrade__factory.ts +1 -1
- package/types/factories/ProxyFactory1967__factory.ts +1 -1
- package/types/factories/ReentrancyGuardUpgradeable__factory.ts +43 -0
- package/types/factories/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/Reputation__factory.ts +27 -1
- package/types/factories/SelfApprove__factory.ts +46 -0
- package/types/factories/SimpleStakingV2__factory.ts +16 -3
- package/types/factories/SimpleStaking__factory.ts +16 -3
- package/types/factories/SixteenDecimalsTokenMock__factory.ts +17 -4
- package/types/factories/StakersDistribution__factory.ts +27 -1
- package/types/factories/StakingMockFixedAPY__factory.ts +1 -1
- package/types/factories/SuperGoodDollar__factory.ts +2680 -0
- package/types/factories/SuperToken__factory.ts +1809 -0
- package/types/factories/SuperfluidToken__factory.ts +697 -0
- package/types/factories/SwapHelperTest__factory.ts +1 -1
- package/types/factories/TokenInfo__factory.ts +62 -0
- package/types/factories/TwentyDecimalsTokenMock__factory.ts +17 -4
- package/types/factories/UBIScheme__factory.ts +40 -21
- package/types/factories/USDCMock__factory.ts +17 -4
- package/types/factories/UUPSProxiable__factory.ts +101 -0
- package/types/factories/UUPSProxy__factory.ts +80 -0
- package/types/factories/UUPSUpgradeable__factory.ts +26 -0
- package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/UpgradableMock2__factory.ts +27 -1
- package/types/factories/UpgradableMock3__factory.ts +27 -1
- package/types/factories/UpgradableMock4__factory.ts +27 -1
- package/types/factories/UpgradableMock__factory.ts +27 -1
- package/types/hardhat.d.ts +459 -0
- package/types/index.ts +98 -0
- package/yarn.lock +1251 -306
- package/scripts/multichain-deploy/nonubiDistribution-deploy.ts +0 -170
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import hre, { ethers } from "hardhat";
|
|
2
|
+
import { assert, expect } from "chai";
|
|
3
|
+
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
4
|
+
import { Framework } from "@superfluid-finance/sdk-core";
|
|
5
|
+
import TransferAndCallMockABI from "@gooddollar/goodcontracts/build/contracts/TransferAndCallMock.json";
|
|
6
|
+
import { createDAO, deploySuperGoodDollar } from "../helpers";
|
|
7
|
+
import { ISuperGoodDollar } from "../../types";
|
|
8
|
+
|
|
9
|
+
let sf,
|
|
10
|
+
sfHost,
|
|
11
|
+
founder,
|
|
12
|
+
alice,
|
|
13
|
+
bob,
|
|
14
|
+
eve,
|
|
15
|
+
newHost,
|
|
16
|
+
identityMock,
|
|
17
|
+
receiverMock,
|
|
18
|
+
sgd, // stands for "SuperGoodDollar"
|
|
19
|
+
feesFormula10PctMock;
|
|
20
|
+
|
|
21
|
+
const alotOfDollars = ethers.utils.parseEther("100000");
|
|
22
|
+
const tenDollars = ethers.utils.parseEther("10");
|
|
23
|
+
const oneDollar = ethers.utils.parseEther("1");
|
|
24
|
+
const tenDollarsPerDay = "124378109452730"; // flowrate per second
|
|
25
|
+
|
|
26
|
+
const initialState = async () => {};
|
|
27
|
+
|
|
28
|
+
before(async function () {
|
|
29
|
+
//get accounts from hardhat
|
|
30
|
+
[founder, alice, bob, eve, newHost] = await ethers.getSigners();
|
|
31
|
+
|
|
32
|
+
let { sfContracts } = await createDAO();
|
|
33
|
+
|
|
34
|
+
sfHost = sfContracts.host;
|
|
35
|
+
// initialize sdk-core to get a framework handle for more convenient access to Superfluid functionality
|
|
36
|
+
sf = await Framework.create({
|
|
37
|
+
chainId: 4447,
|
|
38
|
+
provider: ethers.provider,
|
|
39
|
+
resolverAddress: sfContracts.resolver,
|
|
40
|
+
protocolReleaseVersion: "test"
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// GoodDollar specific init
|
|
44
|
+
const FeesFormulaMockFactory = await ethers.getContractFactory(
|
|
45
|
+
"FeesFormulaMock",
|
|
46
|
+
founder
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const feesFormula0PctMock = await FeesFormulaMockFactory.deploy(0);
|
|
50
|
+
|
|
51
|
+
feesFormula10PctMock = await FeesFormulaMockFactory.deploy(100000);
|
|
52
|
+
|
|
53
|
+
// the zero address is a placeholder for the dao contract
|
|
54
|
+
const IdentityMockFactory = await ethers.getContractFactory(
|
|
55
|
+
"IdentityMock",
|
|
56
|
+
founder
|
|
57
|
+
);
|
|
58
|
+
identityMock = await IdentityMockFactory.deploy(
|
|
59
|
+
"0x0000000000000000000000000000000000000000"
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
receiverMock = await new ethers.ContractFactory(
|
|
63
|
+
TransferAndCallMockABI.abi,
|
|
64
|
+
TransferAndCallMockABI.bytecode,
|
|
65
|
+
founder
|
|
66
|
+
).deploy();
|
|
67
|
+
|
|
68
|
+
sgd = await deploySuperGoodDollar(sfContracts, [
|
|
69
|
+
"SuperGoodDollar",
|
|
70
|
+
"SGD",
|
|
71
|
+
0, // cap
|
|
72
|
+
feesFormula0PctMock.address,
|
|
73
|
+
identityMock.address,
|
|
74
|
+
receiverMock.address,
|
|
75
|
+
founder.address
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
await sgd.mint(founder.address, alotOfDollars);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe("SuperGoodDollar", async function () {
|
|
82
|
+
it("check superfluid host", async () => {
|
|
83
|
+
expect(await sgd.getHost()).equal(sfHost);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("check ERC20 metadata", async function () {
|
|
87
|
+
await loadFixture(initialState);
|
|
88
|
+
const symbol = await sgd.symbol();
|
|
89
|
+
const name = await sgd.name();
|
|
90
|
+
assert.equal(symbol, "SGD", "symbol mismatch");
|
|
91
|
+
assert.equal(name, "SuperGoodDollar", "name mismatch");
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("mint to alice", async function () {
|
|
95
|
+
await loadFixture(initialState);
|
|
96
|
+
await sgd.mint(alice.address, alotOfDollars);
|
|
97
|
+
const balAfter = await sgd.balanceOf(alice.address);
|
|
98
|
+
|
|
99
|
+
assert.equal(
|
|
100
|
+
balAfter.toString(),
|
|
101
|
+
alotOfDollars.toString(),
|
|
102
|
+
"wrong balance after mint"
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("do ERC20 transfer", async function () {
|
|
107
|
+
await loadFixture(initialState);
|
|
108
|
+
await sgd.mint(alice.address, tenDollars);
|
|
109
|
+
await sgd.connect(alice).transfer(bob.address, tenDollars);
|
|
110
|
+
const balAfter = await sgd.balanceOf(bob.address);
|
|
111
|
+
|
|
112
|
+
assert.equal(
|
|
113
|
+
balAfter.toString(),
|
|
114
|
+
tenDollars.toString(),
|
|
115
|
+
"wrong balance after transfer"
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("do ERC20 transferFrom", async function () {
|
|
120
|
+
await loadFixture(initialState);
|
|
121
|
+
await sgd.approve(alice.address, tenDollars);
|
|
122
|
+
await sgd
|
|
123
|
+
.connect(alice)
|
|
124
|
+
.transferFrom(founder.address, bob.address, tenDollars);
|
|
125
|
+
assert.equal(
|
|
126
|
+
(await sgd.balanceOf(bob.address)).toString(),
|
|
127
|
+
tenDollars.toString(),
|
|
128
|
+
"wrong balance after transferFrom"
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("start stream", async function () {
|
|
133
|
+
await loadFixture(initialState);
|
|
134
|
+
await sgd.mint(alice.address, alotOfDollars);
|
|
135
|
+
|
|
136
|
+
await sf.cfaV1
|
|
137
|
+
.createFlow({
|
|
138
|
+
superToken: sgd.address,
|
|
139
|
+
sender: alice.address,
|
|
140
|
+
receiver: bob.address,
|
|
141
|
+
flowRate: tenDollarsPerDay
|
|
142
|
+
})
|
|
143
|
+
.exec(alice);
|
|
144
|
+
|
|
145
|
+
const bobNetFlow = await sf.cfaV1.getNetFlow({
|
|
146
|
+
superToken: sgd.address,
|
|
147
|
+
account: bob.address,
|
|
148
|
+
providerOrSigner: ethers.provider
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
assert.equal(
|
|
152
|
+
bobNetFlow,
|
|
153
|
+
tenDollarsPerDay,
|
|
154
|
+
"bob net flowrate not as expected"
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("pauseable", async function () {
|
|
159
|
+
await loadFixture(initialState);
|
|
160
|
+
await sgd.connect(founder).pause();
|
|
161
|
+
await expect(sgd.transfer(bob.address, tenDollars)).revertedWith(
|
|
162
|
+
"Pausable: token transfer while paused"
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
await expect(
|
|
166
|
+
sf.cfaV1
|
|
167
|
+
.createFlow({
|
|
168
|
+
superToken: sgd.address,
|
|
169
|
+
sender: alice.address,
|
|
170
|
+
receiver: bob.address,
|
|
171
|
+
flowRate: tenDollarsPerDay
|
|
172
|
+
})
|
|
173
|
+
.exec(alice)
|
|
174
|
+
).reverted;
|
|
175
|
+
|
|
176
|
+
await sgd.connect(founder).unpause();
|
|
177
|
+
await sgd.transfer(bob.address, tenDollars);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("non-zero fees are applied", async function () {
|
|
181
|
+
await loadFixture(initialState);
|
|
182
|
+
|
|
183
|
+
await sgd.connect(founder).mint(alice.address, tenDollars);
|
|
184
|
+
await sgd.setFormula(feesFormula10PctMock.address);
|
|
185
|
+
|
|
186
|
+
await expect(
|
|
187
|
+
sgd.connect(alice).transfer(bob.address, tenDollars)
|
|
188
|
+
).revertedWith("Not enough balance to pay TX fee");
|
|
189
|
+
|
|
190
|
+
// mint the extra amount needed for 10% fees
|
|
191
|
+
await sgd.mint(alice.address, oneDollar);
|
|
192
|
+
await sgd.connect(alice).transfer(bob.address, tenDollars);
|
|
193
|
+
|
|
194
|
+
// since the sender pays the fee, alice should have spent 11$ and bob received 10$
|
|
195
|
+
assert.equal(
|
|
196
|
+
(await sgd.balanceOf(alice.address)).toString(),
|
|
197
|
+
"0",
|
|
198
|
+
"alice: wrong balance after transfer"
|
|
199
|
+
);
|
|
200
|
+
assert.equal(
|
|
201
|
+
(await sgd.balanceOf(bob.address)).toString(),
|
|
202
|
+
tenDollars.toString(),
|
|
203
|
+
"bob: wrong balance after transfer"
|
|
204
|
+
);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("non-zero fees are applied for transferFrom (verify override of _transferForm)", async function () {
|
|
208
|
+
await loadFixture(initialState);
|
|
209
|
+
|
|
210
|
+
await sgd.connect(founder).mint(alice.address, tenDollars);
|
|
211
|
+
await sgd.setFormula(feesFormula10PctMock.address);
|
|
212
|
+
|
|
213
|
+
await sgd.connect(alice).approve(founder.address, tenDollars.mul(2));
|
|
214
|
+
|
|
215
|
+
await expect(
|
|
216
|
+
sgd.connect(founder).transferFrom(alice.address, bob.address, tenDollars)
|
|
217
|
+
).revertedWith("Not enough balance to pay TX fee");
|
|
218
|
+
|
|
219
|
+
// mint the extra amount needed for 10% fees
|
|
220
|
+
await sgd.connect(founder).mint(alice.address, oneDollar);
|
|
221
|
+
assert.equal(
|
|
222
|
+
(await sgd.balanceOf(alice.address)).toString(),
|
|
223
|
+
tenDollars.add(oneDollar).toString(),
|
|
224
|
+
"alice: wrong balance after mint"
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
await sgd
|
|
228
|
+
.connect(founder)
|
|
229
|
+
.transferFrom(alice.address, bob.address, tenDollars);
|
|
230
|
+
|
|
231
|
+
// since the sender pays the fee, alice should have spent 11$ and bob received 10$
|
|
232
|
+
assert.equal(
|
|
233
|
+
(await sgd.balanceOf(alice.address)).toString(),
|
|
234
|
+
"0",
|
|
235
|
+
"alice: wrong balance after transfer"
|
|
236
|
+
);
|
|
237
|
+
assert.equal(
|
|
238
|
+
(await sgd.balanceOf(bob.address)).toString(),
|
|
239
|
+
tenDollars.toString(),
|
|
240
|
+
"bob: wrong balance after transfer"
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("should not be able to initialize again", async () => {
|
|
245
|
+
await loadFixture(initialState);
|
|
246
|
+
await expect(
|
|
247
|
+
sgd["initialize(string,string,uint256,address,address,address,address)"](
|
|
248
|
+
"x",
|
|
249
|
+
"y",
|
|
250
|
+
1,
|
|
251
|
+
ethers.constants.AddressZero,
|
|
252
|
+
ethers.constants.AddressZero,
|
|
253
|
+
ethers.constants.AddressZero,
|
|
254
|
+
ethers.constants.AddressZero
|
|
255
|
+
)
|
|
256
|
+
).revertedWith("Initializable: contract is already initialized");
|
|
257
|
+
|
|
258
|
+
await expect(
|
|
259
|
+
sgd["initialize(address,uint8,string,string)"](
|
|
260
|
+
ethers.constants.AddressZero,
|
|
261
|
+
2,
|
|
262
|
+
"GD",
|
|
263
|
+
"GD"
|
|
264
|
+
)
|
|
265
|
+
).revertedWith("Initializable: contract is not initializing");
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it("update the GoodDollar logic", async function () {
|
|
269
|
+
await loadFixture(initialState);
|
|
270
|
+
const sgdProxiable = await ethers.getContractAt(
|
|
271
|
+
"UUPSProxiable",
|
|
272
|
+
sgd.address,
|
|
273
|
+
founder.signer
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
const auxCodeAddrBefore = await sgdProxiable.getCodeAddress();
|
|
277
|
+
|
|
278
|
+
const newLogic = await (
|
|
279
|
+
await ethers.getContractFactory("SuperGoodDollar", founder)
|
|
280
|
+
).deploy(newHost.address);
|
|
281
|
+
|
|
282
|
+
await expect(
|
|
283
|
+
sgdProxiable.connect(eve).updateCode(newLogic.address)
|
|
284
|
+
).revertedWith("not owner");
|
|
285
|
+
|
|
286
|
+
await sgdProxiable.connect(founder).updateCode(newLogic.address);
|
|
287
|
+
|
|
288
|
+
const auxCodeAddrAfter = await sgdProxiable.getCodeAddress();
|
|
289
|
+
|
|
290
|
+
assert.notEqual(
|
|
291
|
+
auxCodeAddrBefore,
|
|
292
|
+
auxCodeAddrAfter,
|
|
293
|
+
"code address unchanged"
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
expect(await sgd.getHost()).equal(newHost.address);
|
|
297
|
+
await expect(
|
|
298
|
+
sgd["initialize(string,string,uint256,address,address,address,address)"](
|
|
299
|
+
"x",
|
|
300
|
+
"y",
|
|
301
|
+
1,
|
|
302
|
+
ethers.constants.AddressZero,
|
|
303
|
+
ethers.constants.AddressZero,
|
|
304
|
+
ethers.constants.AddressZero,
|
|
305
|
+
ethers.constants.AddressZero
|
|
306
|
+
)
|
|
307
|
+
).revertedWith("Initializable: contract is already initialized");
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
describe("ERC20Permit", () => {
|
|
311
|
+
const name = "SuperGoodDollar";
|
|
312
|
+
const version = "1";
|
|
313
|
+
|
|
314
|
+
const Permit = [
|
|
315
|
+
{ name: "owner", type: "address" },
|
|
316
|
+
{ name: "spender", type: "address" },
|
|
317
|
+
{ name: "value", type: "uint256" },
|
|
318
|
+
{ name: "nonce", type: "uint256" },
|
|
319
|
+
{ name: "deadline", type: "uint256" }
|
|
320
|
+
];
|
|
321
|
+
|
|
322
|
+
it("initial nonce is 0", async function () {
|
|
323
|
+
expect(await sgd.nonces(alice.address)).to.equal(0);
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it("domain separator", async function () {
|
|
327
|
+
const hashedDomain = await ethers.utils._TypedDataEncoder.hashDomain({
|
|
328
|
+
name,
|
|
329
|
+
version,
|
|
330
|
+
chainId: 4447,
|
|
331
|
+
verifyingContract: sgd.address
|
|
332
|
+
});
|
|
333
|
+
expect(await sgd.DOMAIN_SEPARATOR()).to.equal(hashedDomain);
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
describe("permit", function () {
|
|
337
|
+
const wallet = ethers.Wallet.createRandom();
|
|
338
|
+
|
|
339
|
+
const chainId = 4447;
|
|
340
|
+
const owner = wallet.address;
|
|
341
|
+
const value = 42;
|
|
342
|
+
const nonce = 0;
|
|
343
|
+
const maxDeadline = ethers.constants.MaxUint256;
|
|
344
|
+
|
|
345
|
+
const buildData = (
|
|
346
|
+
chainId,
|
|
347
|
+
verifyingContract,
|
|
348
|
+
deadline = maxDeadline
|
|
349
|
+
) => ({
|
|
350
|
+
primaryType: "Permit",
|
|
351
|
+
types: { Permit },
|
|
352
|
+
domain: { name, version, chainId, verifyingContract },
|
|
353
|
+
message: { owner, spender: bob.address, value, nonce, deadline }
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it("accepts owner signature", async function () {
|
|
357
|
+
const data = buildData(chainId, sgd.address);
|
|
358
|
+
const signature = await wallet._signTypedData(
|
|
359
|
+
data.domain,
|
|
360
|
+
data.types,
|
|
361
|
+
data.message
|
|
362
|
+
);
|
|
363
|
+
const { v, r, s } = ethers.utils.splitSignature(signature);
|
|
364
|
+
|
|
365
|
+
await sgd.permit(owner, bob.address, value, maxDeadline, v, r, s);
|
|
366
|
+
|
|
367
|
+
expect(await sgd.nonces(owner)).to.equal(1);
|
|
368
|
+
expect(await sgd.allowance(owner, bob.address)).to.equal(value);
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
it("rejects reused signature", async function () {
|
|
372
|
+
await loadFixture(initialState);
|
|
373
|
+
|
|
374
|
+
const data = buildData(chainId, sgd.address);
|
|
375
|
+
const signature = await wallet._signTypedData(
|
|
376
|
+
data.domain,
|
|
377
|
+
data.types,
|
|
378
|
+
data.message
|
|
379
|
+
);
|
|
380
|
+
const { v, r, s } = ethers.utils.splitSignature(signature);
|
|
381
|
+
|
|
382
|
+
await sgd.permit(owner, bob.address, value, maxDeadline, v, r, s);
|
|
383
|
+
|
|
384
|
+
await expect(
|
|
385
|
+
sgd.permit(owner, bob.address, value, maxDeadline, v, r, s)
|
|
386
|
+
).revertedWith("ERC20Permit: invalid signature");
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it("rejects other signature", async function () {
|
|
390
|
+
const otherWallet = ethers.Wallet.createRandom();
|
|
391
|
+
const data = buildData(chainId, sgd.address);
|
|
392
|
+
const signature = await otherWallet._signTypedData(
|
|
393
|
+
data.domain,
|
|
394
|
+
data.types,
|
|
395
|
+
data.message
|
|
396
|
+
);
|
|
397
|
+
const { v, r, s } = ethers.utils.splitSignature(signature);
|
|
398
|
+
|
|
399
|
+
await expect(
|
|
400
|
+
sgd.permit(owner, bob.address, value, maxDeadline, v, r, s)
|
|
401
|
+
).revertedWith("ERC20Permit: invalid signature");
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it("rejects expired permit", async function () {
|
|
405
|
+
const block = await ethers.provider.getBlock("latest");
|
|
406
|
+
const deadline = ethers.BigNumber.from(block.timestamp.toFixed(0));
|
|
407
|
+
|
|
408
|
+
const data = buildData(chainId, sgd.address, deadline);
|
|
409
|
+
const signature = await wallet._signTypedData(
|
|
410
|
+
data.domain,
|
|
411
|
+
data.types,
|
|
412
|
+
data.message
|
|
413
|
+
);
|
|
414
|
+
const { v, r, s } = ethers.utils.splitSignature(signature);
|
|
415
|
+
|
|
416
|
+
await expect(
|
|
417
|
+
sgd.permit(owner, bob.address, value, deadline, v, r, s)
|
|
418
|
+
).revertedWith("ERC20Permit: expired deadline");
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
});
|
|
@@ -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 {
|
|
4
5
|
UBIScheme,
|
|
@@ -85,7 +86,7 @@ describe("UBIScheme - network e2e tests", () => {
|
|
|
85
86
|
const goodCompoundStakingFactory = await getStakingFactory(
|
|
86
87
|
"GoodCompoundStakingV2"
|
|
87
88
|
);
|
|
88
|
-
const deployedDAO = await createDAO
|
|
89
|
+
const deployedDAO = await loadFixture(createDAO);
|
|
89
90
|
let {
|
|
90
91
|
controller: ctrl,
|
|
91
92
|
avatar: av,
|
|
@@ -160,8 +161,8 @@ describe("UBIScheme - network e2e tests", () => {
|
|
|
160
161
|
const ubiScheme = await deployUBI(deployedDAO);
|
|
161
162
|
ubi = ubiScheme.ubiScheme;
|
|
162
163
|
firstClaimPool = ubiScheme.firstClaim;
|
|
163
|
-
setDAOAddress("CDAI", cDAI.address);
|
|
164
|
-
setDAOAddress("DAI", dai.address);
|
|
164
|
+
await setDAOAddress("CDAI", cDAI.address);
|
|
165
|
+
await setDAOAddress("DAI", dai.address);
|
|
165
166
|
await goodReserve.setAddresses();
|
|
166
167
|
const ictrl = await ethers.getContractAt(
|
|
167
168
|
"Controller",
|
|
@@ -240,7 +241,7 @@ describe("UBIScheme - network e2e tests", () => {
|
|
|
240
241
|
.fish(claimer.address)
|
|
241
242
|
.catch(e => e);
|
|
242
243
|
await goodDollar.balanceOf(fisherman.address);
|
|
243
|
-
expect(error.message).to.have.string("
|
|
244
|
+
expect(error.message).to.have.string("can't fish");
|
|
244
245
|
});
|
|
245
246
|
|
|
246
247
|
it("should be able to fish inactive user", async () => {
|
|
@@ -261,7 +262,7 @@ describe("UBIScheme - network e2e tests", () => {
|
|
|
261
262
|
.connect(fisherman)
|
|
262
263
|
.fish(claimer.address)
|
|
263
264
|
.catch(e => e);
|
|
264
|
-
expect(error.message).to.have.string("
|
|
265
|
+
expect(error.message).to.have.string("can't fish");
|
|
265
266
|
});
|
|
266
267
|
|
|
267
268
|
it("should recieves a claim reward when call claim after being fished", async () => {
|
|
@@ -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 { UBIScheme } from "../../types";
|
|
4
5
|
import { createDAO, deployUBI, advanceBlocks, increaseTime } from "../helpers";
|
|
@@ -55,7 +56,7 @@ describe("UBIScheme", () => {
|
|
|
55
56
|
FirstClaimPool.bytecode,
|
|
56
57
|
(await ethers.getSigners())[0]
|
|
57
58
|
);
|
|
58
|
-
const deployedDAO = await createDAO
|
|
59
|
+
const deployedDAO = await loadFixture(createDAO);
|
|
59
60
|
let {
|
|
60
61
|
nameService: ns,
|
|
61
62
|
genericCall: gn,
|
|
@@ -127,13 +128,11 @@ describe("UBIScheme", () => {
|
|
|
127
128
|
|
|
128
129
|
it("should return zero entitlement before UBI started", async () => {
|
|
129
130
|
let blockTimestamp = (await ethers.provider.getBlock("latest")).timestamp;
|
|
130
|
-
const timeInDay =
|
|
131
|
+
const timeInDay = blockTimestamp % ONE_DAY;
|
|
131
132
|
// Move to before 12pm of the current day
|
|
132
133
|
if (timeInDay > 12 * ONE_HOUR) {
|
|
133
134
|
blockTimestamp += 12 * ONE_HOUR;
|
|
134
|
-
await ethers.provider.send("evm_setNextBlockTimestamp", [
|
|
135
|
-
blockTimestamp
|
|
136
|
-
]);
|
|
135
|
+
await ethers.provider.send("evm_setNextBlockTimestamp", [blockTimestamp]);
|
|
137
136
|
await ethers.provider.send("evm_mine", []);
|
|
138
137
|
}
|
|
139
138
|
const ubiNew = await deployNewUbi();
|
|
@@ -200,24 +199,26 @@ describe("UBIScheme", () => {
|
|
|
200
199
|
expect(error.message).to.have.string("Only UBIScheme can call this method");
|
|
201
200
|
});
|
|
202
201
|
|
|
203
|
-
it("should estimate next daily UBI to
|
|
202
|
+
it("should estimate next daily UBI to according to min value when no claimers and not using first claim pool", async () => {
|
|
204
203
|
const nextDailyUBIBefore = await ubi.estimateNextDailyUBI();
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
);
|
|
204
|
+
const minActiveUsers = await ubi.minActiveUsers();
|
|
205
|
+
const cycleLength = await ubi.cycleLength();
|
|
206
|
+
const pool = await goodDollar.balanceOf(ubi.address);
|
|
207
|
+
const dailyPool = pool.div(cycleLength);
|
|
208
|
+
const defaultDailyClaim = dailyPool.div(minActiveUsers);
|
|
209
|
+
let encodedCall = ubi.interface.encodeFunctionData("setUseFirstClaimPool", [
|
|
210
|
+
false
|
|
211
|
+
]);
|
|
210
212
|
await genericCall(ubi.address, encodedCall);
|
|
211
213
|
const nextDailyUBIAfter = await ubi.estimateNextDailyUBI();
|
|
212
214
|
|
|
213
215
|
expect(nextDailyUBIBefore.eq(0));
|
|
214
216
|
expect(nextDailyUBIAfter.gt(nextDailyUBIBefore));
|
|
215
|
-
expect(nextDailyUBIAfter.eq(
|
|
217
|
+
expect(nextDailyUBIAfter.eq(defaultDailyClaim));
|
|
216
218
|
|
|
217
|
-
encodedCall = ubi.interface.encodeFunctionData(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
);
|
|
219
|
+
encodedCall = ubi.interface.encodeFunctionData("setUseFirstClaimPool", [
|
|
220
|
+
true
|
|
221
|
+
]);
|
|
221
222
|
await genericCall(ubi.address, encodedCall);
|
|
222
223
|
});
|
|
223
224
|
|
|
@@ -270,7 +271,7 @@ describe("UBIScheme", () => {
|
|
|
270
271
|
.connect(fisherman)
|
|
271
272
|
.fish(claimer1.address)
|
|
272
273
|
.catch(e => e);
|
|
273
|
-
expect(error.message).to.have.string("
|
|
274
|
+
expect(error.message).to.have.string("can't fish");
|
|
274
275
|
});
|
|
275
276
|
|
|
276
277
|
it("should not initiate the scheme balance and distribution formula when a new user execute claim", async () => {
|
|
@@ -315,8 +316,8 @@ describe("UBIScheme", () => {
|
|
|
315
316
|
await genericCall(ubi.address, encodedCall); // we should set cyclelength to one cause this tests was implemented according to it
|
|
316
317
|
const currentDay = await ubi.currentDayInCycle().then(_ => _.toNumber());
|
|
317
318
|
await increaseTime(ONE_DAY);
|
|
318
|
-
await goodDollar.mint(avatar, "
|
|
319
|
-
//ubi will have 902GD in pool so daily ubi is now
|
|
319
|
+
await goodDollar.mint(avatar, "300002");
|
|
320
|
+
//ubi will have 902GD in pool so daily ubi is now 300002/1(cycle)/1000(min claimers) = 300
|
|
320
321
|
await ubi.connect(claimer1).claim();
|
|
321
322
|
await increaseTime(ONE_DAY);
|
|
322
323
|
await goodDollar.mint(avatar, "1");
|
|
@@ -326,8 +327,8 @@ describe("UBIScheme", () => {
|
|
|
326
327
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
327
328
|
let claimer1Balance = await goodDollar.balanceOf(claimer1.address);
|
|
328
329
|
expect(avatarBalance.toString()).to.be.equal("0");
|
|
329
|
-
// 300 GD from first day and
|
|
330
|
-
expect(claimer1Balance.toString()).to.be.equal("
|
|
330
|
+
// 300 GD from first day and 299 (30002 - 300 /1 / 1000) from the second day claimed in this test
|
|
331
|
+
expect(claimer1Balance.toString()).to.be.equal("599");
|
|
331
332
|
});
|
|
332
333
|
|
|
333
334
|
it("should return the reward value for entitlement user", async () => {
|
|
@@ -351,7 +352,7 @@ describe("UBIScheme", () => {
|
|
|
351
352
|
.fish(claimer4.address)
|
|
352
353
|
.catch(e => e);
|
|
353
354
|
expect(isActiveUser).to.be.true;
|
|
354
|
-
expect(error.message).to.have.string("
|
|
355
|
+
expect(error.message).to.have.string("can't fish");
|
|
355
356
|
});
|
|
356
357
|
|
|
357
358
|
it("should not be able to execute claim twice a day", async () => {
|
|
@@ -413,7 +414,7 @@ describe("UBIScheme", () => {
|
|
|
413
414
|
.catch(e => e);
|
|
414
415
|
let isFishedAfter = await ubi.fishedUsersAddresses(claimer1.address);
|
|
415
416
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer4.address);
|
|
416
|
-
expect(error.message).to.have.string("
|
|
417
|
+
expect(error.message).to.have.string("can't fish");
|
|
417
418
|
expect(isFishedBefore).to.be.true;
|
|
418
419
|
expect(isFishedAfter).to.be.true;
|
|
419
420
|
expect(claimer4BalanceAfter.toNumber()).to.be.equal(
|
|
@@ -452,7 +453,7 @@ describe("UBIScheme", () => {
|
|
|
452
453
|
.catch(e => e);
|
|
453
454
|
let isFishedAfter = await ubi.fishedUsersAddresses(claimer2.address);
|
|
454
455
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer4.address);
|
|
455
|
-
expect(error.message).to.have.string("
|
|
456
|
+
expect(error.message).to.have.string("can't fish");
|
|
456
457
|
expect(isFishedBefore).to.be.false;
|
|
457
458
|
expect(isFishedAfter).to.be.false;
|
|
458
459
|
expect(claimer4BalanceAfter.toNumber()).to.be.equal(
|
|
@@ -519,11 +520,11 @@ describe("UBIScheme", () => {
|
|
|
519
520
|
});
|
|
520
521
|
|
|
521
522
|
it("distribute formula should return correct value", async () => {
|
|
522
|
-
await goodDollar.mint(avatar, "
|
|
523
|
+
await goodDollar.mint(avatar, "20000");
|
|
523
524
|
await increaseTime(ONE_DAY);
|
|
524
525
|
let ubiBalance = await goodDollar.balanceOf(ubi.address);
|
|
525
526
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
526
|
-
let activeUsersCount = await ubi.activeUsersCount();
|
|
527
|
+
let activeUsersCount = await ubi.minActiveUsers(); // await ubi.activeUsersCount();
|
|
527
528
|
let claimer4BalanceBefore = await goodDollar.balanceOf(claimer2.address);
|
|
528
529
|
await ubi.connect(claimer2).claim();
|
|
529
530
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
@@ -539,7 +540,7 @@ describe("UBIScheme", () => {
|
|
|
539
540
|
await increaseTime(ONE_DAY);
|
|
540
541
|
let ubiBalance = await goodDollar.balanceOf(ubi.address);
|
|
541
542
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
542
|
-
let activeUsersCount = await ubi.activeUsersCount();
|
|
543
|
+
let activeUsersCount = await ubi.minActiveUsers(); // await ubi.activeUsersCount();
|
|
543
544
|
let claimer4BalanceBefore = await goodDollar.balanceOf(claimer2.address);
|
|
544
545
|
await ubi.connect(claimer2).claim();
|
|
545
546
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
@@ -565,12 +566,12 @@ describe("UBIScheme", () => {
|
|
|
565
566
|
let claimer1Balance1 = await goodDollar.balanceOf(claimer1.address);
|
|
566
567
|
// regular claim
|
|
567
568
|
await ubi.connect(claimer1).claim();
|
|
568
|
-
const ubiGdBalance = await goodDollar.balanceOf(ubi.address);
|
|
569
569
|
let claimer1Balance2 = await goodDollar.balanceOf(claimer1.address);
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
let dailyCyclePool = await ubi.dailyCyclePool();
|
|
571
|
+
let activeUsersCount = await ubi.minActiveUsers(); // await ubi.activeUsersCount();
|
|
572
|
+
// the dailyCyclePool divided by max(activeUser,minActiveUsers) should give the daily claim (diff between ubipool balances)
|
|
572
573
|
expect(claimer1Balance2.sub(claimer1Balance1).toString()).to.be.equal(
|
|
573
|
-
|
|
574
|
+
dailyCyclePool.div(activeUsersCount)
|
|
574
575
|
);
|
|
575
576
|
});
|
|
576
577
|
|
|
@@ -610,7 +611,7 @@ describe("UBIScheme", () => {
|
|
|
610
611
|
[200]
|
|
611
612
|
);
|
|
612
613
|
|
|
613
|
-
genericCall(firstClaimPool.address, encodedCall);
|
|
614
|
+
await genericCall(firstClaimPool.address, encodedCall);
|
|
614
615
|
const claimAmount = await firstClaimPool.claimAmount();
|
|
615
616
|
expect(claimAmount.toString()).to.be.equal("200");
|
|
616
617
|
});
|
|
@@ -627,8 +628,8 @@ describe("UBIScheme", () => {
|
|
|
627
628
|
|
|
628
629
|
it("should award first claimer with default value when not using first claim pool", async () => {
|
|
629
630
|
const ubiNew = await deployNewUbi();
|
|
630
|
-
|
|
631
|
-
|
|
631
|
+
await goodDollar.mint(ubiNew.address, 1000);
|
|
632
|
+
const expectedDailyUbi = 1; // 1000 divided by minActiveUsers which is also 1000 by default
|
|
632
633
|
await addWhitelisted(claimer8.address, "claimer8");
|
|
633
634
|
const encodedCall = ubiNew.interface.encodeFunctionData(
|
|
634
635
|
"setUseFirstClaimPool",
|
|
@@ -638,8 +639,8 @@ describe("UBIScheme", () => {
|
|
|
638
639
|
const claimerBalanceBefore = await goodDollar.balanceOf(claimer8.address);
|
|
639
640
|
await (await ubiNew.connect(claimer8).claim()).wait();
|
|
640
641
|
const claimerBalanceAfter = await goodDollar.balanceOf(claimer8.address);
|
|
641
|
-
|
|
642
|
+
|
|
642
643
|
expect(claimerBalanceAfter.gt(claimerBalanceBefore));
|
|
643
|
-
expect(claimerBalanceAfter.sub(claimerBalanceBefore).eq(
|
|
644
|
+
expect(claimerBalanceAfter.sub(claimerBalanceBefore).eq(expectedDailyUbi));
|
|
644
645
|
});
|
|
645
646
|
});
|