@gooddollar/goodprotocol 2.0.27 → 2.0.29-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/abis/SuperfluidFaucet.min.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.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/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.json +69 -35
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- 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/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- 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/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- 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/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- 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/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/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- 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/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- 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/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.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/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- 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/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
- package/contracts/fuseFaucet/SuperfluidFacuet.sol +31 -24
- package/package.json +2 -2
- package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +29 -2
- package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.ts +154 -70
- package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet__factory.ts +68 -34
|
@@ -17,9 +17,11 @@ contract SuperfluidFaucet is
|
|
|
17
17
|
using SafeMathUpgradeable for uint256;
|
|
18
18
|
|
|
19
19
|
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
|
|
20
|
+
uint public constant GAS_TOPPING_AMOUNT = 350000;
|
|
21
|
+
uint public constant FIRST_GAS_TOPPING_AMOUNT = 1e6;
|
|
20
22
|
|
|
21
|
-
uint256 public
|
|
22
|
-
uint256 public
|
|
23
|
+
uint256 public _deprecated;
|
|
24
|
+
uint256 public maxValuePerPeriod;
|
|
23
25
|
uint256 public toppingPeriod;
|
|
24
26
|
|
|
25
27
|
struct RecipientInfo {
|
|
@@ -30,11 +32,7 @@ contract SuperfluidFaucet is
|
|
|
30
32
|
mapping(address => RecipientInfo) public recipientInfo;
|
|
31
33
|
|
|
32
34
|
event WalletTopped(address recipient, uint256 amount);
|
|
33
|
-
event SettingsUpdated(
|
|
34
|
-
uint256 toppingAmount,
|
|
35
|
-
uint256 maxAmountPerPeriod,
|
|
36
|
-
uint256 toppingPeriod
|
|
37
|
-
);
|
|
35
|
+
event SettingsUpdated(uint256 maxValuePerPeriod, uint256 toppingPeriod);
|
|
38
36
|
|
|
39
37
|
/// @custom:oz-upgrades-unsafe-allow constructor
|
|
40
38
|
constructor() {
|
|
@@ -42,8 +40,7 @@ contract SuperfluidFaucet is
|
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
function initialize(
|
|
45
|
-
uint256
|
|
46
|
-
uint256 _maxAmountPerPeriod,
|
|
43
|
+
uint256 _maxValuePerPeriod,
|
|
47
44
|
uint256 _toppingPeriod,
|
|
48
45
|
address _admin
|
|
49
46
|
) public initializer {
|
|
@@ -53,54 +50,64 @@ contract SuperfluidFaucet is
|
|
|
53
50
|
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
|
54
51
|
_setupRole(ADMIN_ROLE, msg.sender);
|
|
55
52
|
_grantRole(ADMIN_ROLE, _admin);
|
|
56
|
-
|
|
57
|
-
maxAmountPerPeriod = _maxAmountPerPeriod;
|
|
53
|
+
maxValuePerPeriod = _maxValuePerPeriod;
|
|
58
54
|
toppingPeriod = _toppingPeriod;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
function updateSettings(
|
|
62
|
-
uint256
|
|
63
|
-
uint256 _maxAmountPerPeriod,
|
|
58
|
+
uint256 _maxValuePerPeriod,
|
|
64
59
|
uint256 _toppingPeriod
|
|
65
60
|
) external onlyRole(ADMIN_ROLE) {
|
|
66
|
-
|
|
67
|
-
maxAmountPerPeriod = _maxAmountPerPeriod;
|
|
61
|
+
maxValuePerPeriod = _maxValuePerPeriod;
|
|
68
62
|
toppingPeriod = _toppingPeriod;
|
|
69
|
-
emit SettingsUpdated(
|
|
63
|
+
emit SettingsUpdated(_maxValuePerPeriod, _toppingPeriod);
|
|
70
64
|
}
|
|
71
65
|
|
|
72
|
-
function canTop(address recipient) public view returns (bool) {
|
|
66
|
+
function canTop(address recipient, uint amount) public view returns (bool) {
|
|
73
67
|
if (recipient == address(0)) return false;
|
|
74
|
-
if (recipient.balance >=
|
|
68
|
+
if (recipient.balance >= amount / 2) return false;
|
|
75
69
|
|
|
76
|
-
uint256 amountToSend =
|
|
70
|
+
uint256 amountToSend = amount.sub(recipient.balance);
|
|
77
71
|
if (address(this).balance < amountToSend) return false;
|
|
78
72
|
|
|
79
73
|
uint256 currentPeriod = block.timestamp / toppingPeriod;
|
|
80
|
-
RecipientInfo
|
|
74
|
+
RecipientInfo memory info = recipientInfo[recipient];
|
|
81
75
|
|
|
82
76
|
if (currentPeriod > info.lastWithdrawalPeriod) {
|
|
83
77
|
return true; // New period, reset counters
|
|
84
78
|
}
|
|
85
79
|
|
|
86
|
-
if (info.totalWithdrawnThisPeriod.add(amountToSend) >
|
|
80
|
+
if (info.totalWithdrawnThisPeriod.add(amountToSend) > maxValuePerPeriod)
|
|
87
81
|
return false;
|
|
88
82
|
|
|
89
83
|
return true;
|
|
90
84
|
}
|
|
91
85
|
|
|
86
|
+
function getToppingValue(bool firstTime) public view returns (uint) {
|
|
87
|
+
//top wallet with current base fee + 10% for priority fee and l1 fees
|
|
88
|
+
return
|
|
89
|
+
((firstTime ? FIRST_GAS_TOPPING_AMOUNT : GAS_TOPPING_AMOUNT) *
|
|
90
|
+
block.basefee *
|
|
91
|
+
110) / 100;
|
|
92
|
+
}
|
|
93
|
+
|
|
92
94
|
function topWallet(address payable recipient) external onlyRole(ADMIN_ROLE) {
|
|
93
|
-
|
|
95
|
+
RecipientInfo storage info = recipientInfo[recipient];
|
|
96
|
+
bool firstTime = info.lastWithdrawalPeriod == 0;
|
|
97
|
+
uint amount = getToppingValue(firstTime);
|
|
98
|
+
//first time we always allow, no canTop check required
|
|
99
|
+
if (!firstTime) {
|
|
100
|
+
require(canTop(recipient, amount), "Recipient cannot be topped up");
|
|
101
|
+
}
|
|
94
102
|
|
|
95
103
|
uint256 currentPeriod = block.timestamp / toppingPeriod;
|
|
96
|
-
RecipientInfo storage info = recipientInfo[recipient];
|
|
97
104
|
|
|
98
105
|
if (currentPeriod > info.lastWithdrawalPeriod) {
|
|
99
106
|
info.totalWithdrawnThisPeriod = 0;
|
|
100
107
|
info.lastWithdrawalPeriod = currentPeriod;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
|
-
uint256 amountToSend =
|
|
110
|
+
uint256 amountToSend = amount.sub(recipient.balance);
|
|
104
111
|
require(
|
|
105
112
|
address(this).balance >= amountToSend,
|
|
106
113
|
"Insufficient contract balance for topping up"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddollar/goodprotocol",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29-beta.0",
|
|
4
4
|
"description": "GoodDollar Protocol",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.x"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@openzeppelin/contracts": "^4.8.0",
|
|
84
84
|
"@openzeppelin/contracts-upgradeable": "^4.8.0",
|
|
85
85
|
"@openzeppelin/hardhat-upgrades": "^1.22.1",
|
|
86
|
-
"@superfluid-finance/ethereum-contracts": "
|
|
86
|
+
"@superfluid-finance/ethereum-contracts": "1.8.1",
|
|
87
87
|
"@superfluid-finance/sdk-core": "^0.5.8",
|
|
88
88
|
"@swc/core": "1.3.96",
|
|
89
89
|
"@swc/helpers": "^0.3.16",
|
|
@@ -11,6 +11,7 @@ import releaser from "../releaser";
|
|
|
11
11
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
12
12
|
import dao from "../../releases/deployment.json";
|
|
13
13
|
import { TransactionResponse } from "@ethersproject/providers";
|
|
14
|
+
import { SuperfluidFaucet } from "../../types";
|
|
14
15
|
|
|
15
16
|
const { name } = network;
|
|
16
17
|
|
|
@@ -72,7 +73,7 @@ export const deployHelpers = async () => {
|
|
|
72
73
|
: ((await upgrades
|
|
73
74
|
.deployProxy(
|
|
74
75
|
await ethers.getContractFactory("SuperfluidFaucet"),
|
|
75
|
-
[ethers.utils.parseEther("0.
|
|
76
|
+
[ethers.utils.parseEther("0.0000035"), 30, AdminWallet.address],
|
|
76
77
|
{ kind: "uups" }
|
|
77
78
|
)
|
|
78
79
|
.then(printDeploy)) as Contract);
|
|
@@ -89,7 +90,33 @@ export const deployHelpers = async () => {
|
|
|
89
90
|
await verifyContract(impl, "contracts/fuseFaucet/SuperfluidFaucet.sol:SuperfluidFaucet", network.name);
|
|
90
91
|
};
|
|
91
92
|
|
|
93
|
+
const upgrade = async () => {
|
|
94
|
+
let [root] = await ethers.getSigners();
|
|
95
|
+
const isProduction = network.name.includes("production");
|
|
96
|
+
|
|
97
|
+
if (isProduction) verifyProductionSigner(root);
|
|
98
|
+
|
|
99
|
+
//generic call permissions
|
|
100
|
+
let schemeMock = root;
|
|
101
|
+
|
|
102
|
+
console.log("got signers:", {
|
|
103
|
+
network,
|
|
104
|
+
root: root.address,
|
|
105
|
+
schemeMock: schemeMock.address,
|
|
106
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
107
|
+
});
|
|
108
|
+
let release: { [key: string]: any } = dao[network.name] || {};
|
|
109
|
+
const proxy = (await ethers.getContractAt("SuperfluidFaucet", release.SuperfluidFaucet)) as SuperfluidFaucet;
|
|
110
|
+
const impl = await ethers.deployContract("SuperfluidFaucet");
|
|
111
|
+
console.log("impl:", impl.address);
|
|
112
|
+
const callData = proxy.interface.encodeFunctionData("updateSettings", [ethers.utils.parseEther("0.0000035"), 30]);
|
|
113
|
+
const tx = await proxy.upgradeToAndCall(impl.address, callData);
|
|
114
|
+
console.log(tx.hash);
|
|
115
|
+
const res = await tx.wait();
|
|
116
|
+
console.log(res.transactionHash);
|
|
117
|
+
};
|
|
92
118
|
export const main = async () => {
|
|
93
|
-
await
|
|
119
|
+
await upgrade();
|
|
120
|
+
// await deployHelpers();
|
|
94
121
|
};
|
|
95
122
|
if (process.argv[1].includes("7_superfluidfaucet")) main();
|