@gooddollar/goodprotocol 2.0.5-beta.6 → 2.0.5-beta.8
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/Faucet.min.json +1 -1
- package/artifacts/abis/FuseFaucetV2.min.json +1 -1
- package/artifacts/abis/IdentityFix.min.json +1 -0
- package/artifacts/abis/IdentityV2.min.json +1 -1
- package/artifacts/abis/UBISchemeV2.min.json +1 -0
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +28 -9
- 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/FuseFaucetV2.sol/FuseFaucetV2.json +28 -2
- 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/identity/IdentityV2.sol/IdentityV2.json +20 -2
- 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/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/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.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/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 +4 -0
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +789 -0
- 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/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.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/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 +4 -0
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +60 -0
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/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/contracts/fuseFaucet/Faucet.sol +9 -8
- package/contracts/fuseFaucet/FuseFaucetV2.sol +16 -9
- package/contracts/identity/IdentityV2.sol +52 -61
- package/contracts/ubi/UBISchemeV2.sol +470 -0
- package/contracts/utils/IdentityFix.sol +31 -0
- package/package.json +1 -1
- package/scripts/analytics/activeUsersCount.ts +56 -18
- package/scripts/analytics/whitelistsyncIssue.ts +87 -0
- package/scripts/multichain-deploy/helpers.ts +8 -6
- package/scripts/proposals/gip-14_1.ts +5 -9
- package/test/faucet/Faucet.test.ts +166 -130
- package/types/Faucet.ts +50 -21
- package/types/FuseFaucetV2.ts +50 -0
- package/types/IdentityFix.ts +141 -0
- package/types/IdentityV2.ts +39 -0
- package/types/UBISchemeV2.ts +1192 -0
- package/types/factories/Faucet__factory.ts +27 -8
- package/types/factories/FuseFaucetV2__factory.ts +27 -1
- package/types/factories/IdentityFix__factory.ts +110 -0
- package/types/factories/IdentityV2__factory.ts +19 -1
- package/types/factories/UBISchemeV2__factory.ts +837 -0
- package/types/hardhat.d.ts +18 -0
- package/types/index.ts +4 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "IdentityFix",
|
|
4
|
+
"sourceName": "contracts/utils/IdentityFix.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "contract IdentityV2",
|
|
10
|
+
"name": "_identity",
|
|
11
|
+
"type": "address"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"stateMutability": "nonpayable",
|
|
15
|
+
"type": "constructor"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"inputs": [],
|
|
19
|
+
"name": "end",
|
|
20
|
+
"outputs": [],
|
|
21
|
+
"stateMutability": "nonpayable",
|
|
22
|
+
"type": "function"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"inputs": [
|
|
26
|
+
{
|
|
27
|
+
"internalType": "address[]",
|
|
28
|
+
"name": "addrs",
|
|
29
|
+
"type": "address[]"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"internalType": "uint256[]",
|
|
33
|
+
"name": "timestamps",
|
|
34
|
+
"type": "uint256[]"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"name": "fix",
|
|
38
|
+
"outputs": [],
|
|
39
|
+
"stateMutability": "nonpayable",
|
|
40
|
+
"type": "function"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"inputs": [],
|
|
44
|
+
"name": "identity",
|
|
45
|
+
"outputs": [
|
|
46
|
+
{
|
|
47
|
+
"internalType": "contract IdentityV2",
|
|
48
|
+
"name": "",
|
|
49
|
+
"type": "address"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"stateMutability": "view",
|
|
53
|
+
"type": "function"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"bytecode": "0x608060405234801561001057600080fd5b5060405161073d38038061073d83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6106aa806100936000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806329fae3d0146100465780632c159a1a1461005b578063efbe1c1c1461008a575b600080fd5b6100596100543660046104ed565b610092565b005b60005461006e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61005961025e565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916391d14854918391631aaff63c916004808201926020929091908290030181865afa1580156100e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010891906105bb565b336040518363ffffffff1660e01b81526004016101269291906105d4565b602060405180830381865afa158015610143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016791906105eb565b61018c5760405162461bcd60e51b815260040161018390610614565b60405180910390fd5b60005b82518110156102595760005483516001600160a01b03909116906396a1ef79908590849081106101c1576101c1610637565b60200260200101518484815181106101db576101db610637565b60200260200101516040518363ffffffff1660e01b81526004016102149291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561022e57600080fd5b505af1158015610242573d6000803e3d6000fd5b5050505080806102519061064d565b91505061018f565b505050565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916391d14854918391631aaff63c916004808201926020929091908290030181865afa1580156102b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d491906105bb565b336040518363ffffffff1660e01b81526004016102f29291906105d4565b602060405180830381865afa15801561030f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033391906105eb565b61034f5760405162461bcd60e51b815260040161018390610614565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916336568abe918391631aaff63c916004808201926020929091908290030181865afa1580156103a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c591906105bb565b306040518363ffffffff1660e01b81526004016103e39291906105d4565b600060405180830381600087803b1580156103fd57600080fd5b505af1158015610411573d6000803e3d6000fd5b503392505050ff5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561045757610457610419565b604052919050565b60006001600160401b0382111561047857610478610419565b5060051b60200190565b600082601f83011261049357600080fd5b813560206104a86104a38361045f565b61042f565b82815260059290921b840181019181810190868411156104c757600080fd5b8286015b848110156104e257803583529183019183016104cb565b509695505050505050565b6000806040838503121561050057600080fd5b82356001600160401b038082111561051757600080fd5b818501915085601f83011261052b57600080fd5b8135602061053b6104a38361045f565b82815260059290921b8401810191818101908984111561055a57600080fd5b948201945b8386101561058e5785356001600160a01b038116811461057f5760008081fd5b8252948201949082019061055f565b965050860135925050808211156105a457600080fd5b506105b185828601610482565b9150509250929050565b6000602082840312156105cd57600080fd5b5051919050565b9182526001600160a01b0316602082015260400190565b6000602082840312156105fd57600080fd5b8151801515811461060d57600080fd5b9392505050565b6020808252600990820152683737ba1030b236b4b760b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161066d57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212204c995a27d0c67f0032088a13fe46b5d6da56b59dad80c97861520bc6ef69293064736f6c63430008100033",
|
|
57
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806329fae3d0146100465780632c159a1a1461005b578063efbe1c1c1461008a575b600080fd5b6100596100543660046104ed565b610092565b005b60005461006e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61005961025e565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916391d14854918391631aaff63c916004808201926020929091908290030181865afa1580156100e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010891906105bb565b336040518363ffffffff1660e01b81526004016101269291906105d4565b602060405180830381865afa158015610143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016791906105eb565b61018c5760405162461bcd60e51b815260040161018390610614565b60405180910390fd5b60005b82518110156102595760005483516001600160a01b03909116906396a1ef79908590849081106101c1576101c1610637565b60200260200101518484815181106101db576101db610637565b60200260200101516040518363ffffffff1660e01b81526004016102149291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561022e57600080fd5b505af1158015610242573d6000803e3d6000fd5b5050505080806102519061064d565b91505061018f565b505050565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916391d14854918391631aaff63c916004808201926020929091908290030181865afa1580156102b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d491906105bb565b336040518363ffffffff1660e01b81526004016102f29291906105d4565b602060405180830381865afa15801561030f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033391906105eb565b61034f5760405162461bcd60e51b815260040161018390610614565b600054604080516306abfd8f60e21b815290516001600160a01b03909216916336568abe918391631aaff63c916004808201926020929091908290030181865afa1580156103a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c591906105bb565b306040518363ffffffff1660e01b81526004016103e39291906105d4565b600060405180830381600087803b1580156103fd57600080fd5b505af1158015610411573d6000803e3d6000fd5b503392505050ff5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561045757610457610419565b604052919050565b60006001600160401b0382111561047857610478610419565b5060051b60200190565b600082601f83011261049357600080fd5b813560206104a86104a38361045f565b61042f565b82815260059290921b840181019181810190868411156104c757600080fd5b8286015b848110156104e257803583529183019183016104cb565b509695505050505050565b6000806040838503121561050057600080fd5b82356001600160401b038082111561051757600080fd5b818501915085601f83011261052b57600080fd5b8135602061053b6104a38361045f565b82815260059290921b8401810191818101908984111561055a57600080fd5b948201945b8386101561058e5785356001600160a01b038116811461057f5760008081fd5b8252948201949082019061055f565b965050860135925050808211156105a457600080fd5b506105b185828601610482565b9150509250929050565b6000602082840312156105cd57600080fd5b5051919050565b9182526001600160a01b0316602082015260400190565b6000602082840312156105fd57600080fd5b8151801515811461060d57600080fd5b9392505050565b6020808252600990820152683737ba1030b236b4b760b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161066d57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212204c995a27d0c67f0032088a13fe46b5d6da56b59dad80c97861520bc6ef69293064736f6c63430008100033",
|
|
58
|
+
"linkReferences": {},
|
|
59
|
+
"deployedLinkReferences": {}
|
|
60
|
+
}
|
|
@@ -47,6 +47,7 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
47
47
|
uint64 public maxDailyNewWallets;
|
|
48
48
|
uint64 public dailyNewWalletsCount;
|
|
49
49
|
uint32 public version;
|
|
50
|
+
uint8 public minTopping; //percentage of topping amount, that user can request to top
|
|
50
51
|
|
|
51
52
|
function initialize(
|
|
52
53
|
NameService _ns,
|
|
@@ -65,6 +66,7 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
65
66
|
nameService = _ns;
|
|
66
67
|
maxPerWeekMultiplier = 2;
|
|
67
68
|
maxDailyNewWallets = 5000;
|
|
69
|
+
minTopping = 15;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
function _authorizeUpgrade(
|
|
@@ -75,13 +77,6 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
75
77
|
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
function upgrade() public {
|
|
79
|
-
require(version == 0, "already upgraded");
|
|
80
|
-
if (maxDailyNewWallets == 0) maxDailyNewWallets = 5000;
|
|
81
|
-
version++;
|
|
82
|
-
setGasTopping(gasTopping / gasPrice);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
80
|
modifier reimburseGas() {
|
|
86
81
|
uint256 _gasRefund = gasleft();
|
|
87
82
|
_;
|
|
@@ -157,6 +152,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
157
152
|
|
|
158
153
|
function canTop(address _user) external view returns (bool) {
|
|
159
154
|
if (getToppingAmount() < address(_user).balance) return false;
|
|
155
|
+
uint256 toTop = getToppingAmount() - address(_user).balance;
|
|
156
|
+
if ((toTop * 100) / getToppingAmount() < minTopping) return false;
|
|
160
157
|
|
|
161
158
|
address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
|
|
162
159
|
_user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
|
|
@@ -206,8 +203,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
206
203
|
? _wallet
|
|
207
204
|
: payable(whitelistedRoot);
|
|
208
205
|
|
|
209
|
-
require(getToppingAmount() > address(_wallet).balance);
|
|
210
206
|
uint256 toTop = getToppingAmount() - address(_wallet).balance;
|
|
207
|
+
require((toTop * 100) / getToppingAmount() >= minTopping, "low toTop");
|
|
211
208
|
|
|
212
209
|
uint256 dayOfWeek = currentDay % 7;
|
|
213
210
|
|
|
@@ -259,4 +256,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
|
|
|
259
256
|
function setGasPrice(uint64 _price) external onlyRole(DEFAULT_ADMIN_ROLE) {
|
|
260
257
|
gasPrice = _price;
|
|
261
258
|
}
|
|
259
|
+
|
|
260
|
+
function setMinTopping(uint8 _minTop) external onlyRole(DEFAULT_ADMIN_ROLE) {
|
|
261
|
+
minTopping = _minTop;
|
|
262
|
+
}
|
|
262
263
|
}
|
|
@@ -46,6 +46,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
46
46
|
address public relayer;
|
|
47
47
|
address public owner;
|
|
48
48
|
uint32 public version;
|
|
49
|
+
uint8 public minTopping;
|
|
49
50
|
|
|
50
51
|
function initialize(
|
|
51
52
|
NameService _ns,
|
|
@@ -53,15 +54,17 @@ contract FuseFaucetV2 is Initializable {
|
|
|
53
54
|
address _relayer,
|
|
54
55
|
uint64 gweiTopping
|
|
55
56
|
) public initializer {
|
|
56
|
-
|
|
57
|
+
relayer = _relayer;
|
|
57
58
|
gasPrice = _gasPrice;
|
|
58
|
-
|
|
59
|
+
gasTopping = gweiTopping; //1m gwei
|
|
60
|
+
perDayRoughLimit = 2 * gasTopping;
|
|
59
61
|
maxDailyToppings = 3;
|
|
60
62
|
startTime = block.timestamp;
|
|
61
63
|
nameService = _ns;
|
|
62
64
|
maxPerWeekMultiplier = 2;
|
|
63
65
|
maxSwapAmount = 1000;
|
|
64
66
|
maxDailyNewWallets = 5000;
|
|
67
|
+
minTopping = 15;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
modifier upgrader(uint32 _newversion) {
|
|
@@ -175,6 +178,8 @@ contract FuseFaucetV2 is Initializable {
|
|
|
175
178
|
|
|
176
179
|
function canTop(address _user) external view returns (bool) {
|
|
177
180
|
if (getToppingAmount() < address(_user).balance) return false;
|
|
181
|
+
uint256 toTop = getToppingAmount() - address(_user).balance;
|
|
182
|
+
if ((toTop * 100) / getToppingAmount() < minTopping) return false;
|
|
178
183
|
|
|
179
184
|
address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
|
|
180
185
|
_user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
|
|
@@ -209,12 +214,9 @@ contract FuseFaucetV2 is Initializable {
|
|
|
209
214
|
* can only be done by admin the amount of times specified in constructor per day
|
|
210
215
|
* @param _user The address to transfer to
|
|
211
216
|
*/
|
|
212
|
-
function topWallet(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
toppingLimit(_user)
|
|
216
|
-
onlyAuthorized(_user)
|
|
217
|
-
{
|
|
217
|
+
function topWallet(
|
|
218
|
+
address payable _user
|
|
219
|
+
) public reimburseGas toppingLimit(_user) onlyAuthorized(_user) {
|
|
218
220
|
_topWallet(_user);
|
|
219
221
|
}
|
|
220
222
|
|
|
@@ -227,8 +229,9 @@ contract FuseFaucetV2 is Initializable {
|
|
|
227
229
|
? _wallet
|
|
228
230
|
: payable(whitelistedRoot);
|
|
229
231
|
|
|
230
|
-
require(getToppingAmount() > address(_wallet).balance);
|
|
232
|
+
// require(getToppingAmount() > address(_wallet).balance);
|
|
231
233
|
uint256 toTop = getToppingAmount() - address(_wallet).balance;
|
|
234
|
+
require((toTop * 100) / getToppingAmount() >= minTopping, "low toTop");
|
|
232
235
|
|
|
233
236
|
uint256 dayOfWeek = currentDay % 7;
|
|
234
237
|
|
|
@@ -276,4 +279,8 @@ contract FuseFaucetV2 is Initializable {
|
|
|
276
279
|
function setGasPrice(uint64 _price) external onlyOwner {
|
|
277
280
|
gasPrice = _price;
|
|
278
281
|
}
|
|
282
|
+
|
|
283
|
+
function setMinTopping(uint8 _minTop) external onlyOwner {
|
|
284
|
+
minTopping = _minTop;
|
|
285
|
+
}
|
|
279
286
|
}
|
|
@@ -57,10 +57,10 @@ contract IdentityV2 is
|
|
|
57
57
|
event ContractAdded(address indexed account);
|
|
58
58
|
event ContractRemoved(address indexed account);
|
|
59
59
|
|
|
60
|
-
function initialize(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
60
|
+
function initialize(
|
|
61
|
+
address _owner,
|
|
62
|
+
IIdentity _oldIdentity
|
|
63
|
+
) public initializer {
|
|
64
64
|
__AccessControl_init_unchained();
|
|
65
65
|
__Pausable_init_unchained();
|
|
66
66
|
__EIP712_init_unchained("Identity", "1.0.0");
|
|
@@ -107,14 +107,24 @@ contract IdentityV2 is
|
|
|
107
107
|
* Can only be called by Identity Administrators.
|
|
108
108
|
* @param account address to change its auth date
|
|
109
109
|
*/
|
|
110
|
-
function authenticate(address account)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
function authenticate(address account) public {
|
|
111
|
+
return authenticateWithTimestamp(account, block.timestamp);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @dev Sets the authentication date of `account`
|
|
116
|
+
* to the current time.
|
|
117
|
+
* Can only be called by Identity Administrators.
|
|
118
|
+
* @param account address to change its auth date
|
|
119
|
+
* @param timestamp the authentication timestamp
|
|
120
|
+
*/
|
|
121
|
+
function authenticateWithTimestamp(
|
|
122
|
+
address account,
|
|
123
|
+
uint256 timestamp
|
|
124
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
115
125
|
require(identities[account].status == 1, "not whitelisted");
|
|
116
|
-
identities[account].dateAuthenticated =
|
|
117
|
-
emit WhitelistedAuthenticated(account,
|
|
126
|
+
identities[account].dateAuthenticated = timestamp;
|
|
127
|
+
emit WhitelistedAuthenticated(account, timestamp);
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
/**
|
|
@@ -122,11 +132,9 @@ contract IdentityV2 is
|
|
|
122
132
|
* Can only be called by Identity Administrators.
|
|
123
133
|
* @param account address to add as whitelisted
|
|
124
134
|
*/
|
|
125
|
-
function addWhitelisted(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
whenNotPaused
|
|
129
|
-
{
|
|
135
|
+
function addWhitelisted(
|
|
136
|
+
address account
|
|
137
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
130
138
|
_addWhitelisted(account, _chainId());
|
|
131
139
|
}
|
|
132
140
|
|
|
@@ -154,11 +162,10 @@ contract IdentityV2 is
|
|
|
154
162
|
* @param account The address to add
|
|
155
163
|
* @param did the ID to add account under
|
|
156
164
|
*/
|
|
157
|
-
function addWhitelistedWithDID(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{
|
|
165
|
+
function addWhitelistedWithDID(
|
|
166
|
+
address account,
|
|
167
|
+
string memory did
|
|
168
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
162
169
|
_addWhitelistedWithDID(account, did, _chainId());
|
|
163
170
|
}
|
|
164
171
|
|
|
@@ -167,11 +174,9 @@ contract IdentityV2 is
|
|
|
167
174
|
* Can only be called by Identity Administrators.
|
|
168
175
|
* @param account address to remove as whitelisted
|
|
169
176
|
*/
|
|
170
|
-
function removeWhitelisted(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
whenNotPaused
|
|
174
|
-
{
|
|
177
|
+
function removeWhitelisted(
|
|
178
|
+
address account
|
|
179
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
175
180
|
_removeWhitelisted(account);
|
|
176
181
|
}
|
|
177
182
|
|
|
@@ -228,11 +233,9 @@ contract IdentityV2 is
|
|
|
228
233
|
* Can only be called by Identity Administrators.
|
|
229
234
|
* @param account address to add as blacklisted
|
|
230
235
|
*/
|
|
231
|
-
function addBlacklisted(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
whenNotPaused
|
|
235
|
-
{
|
|
236
|
+
function addBlacklisted(
|
|
237
|
+
address account
|
|
238
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
236
239
|
identities[account].status = 255;
|
|
237
240
|
emit BlacklistAdded(account);
|
|
238
241
|
}
|
|
@@ -242,11 +245,9 @@ contract IdentityV2 is
|
|
|
242
245
|
* Can only be called by Identity Administrators.
|
|
243
246
|
* @param account address to remove as blacklisted
|
|
244
247
|
*/
|
|
245
|
-
function removeBlacklisted(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
whenNotPaused
|
|
249
|
-
{
|
|
248
|
+
function removeBlacklisted(
|
|
249
|
+
address account
|
|
250
|
+
) external onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
250
251
|
if (
|
|
251
252
|
address(oldIdentity) != address(0) && oldIdentity.isBlacklisted(account)
|
|
252
253
|
) oldIdentity.removeBlacklisted(account);
|
|
@@ -259,11 +260,9 @@ contract IdentityV2 is
|
|
|
259
260
|
* @dev Function to add a Contract to list of contracts
|
|
260
261
|
* @param account The address to add
|
|
261
262
|
*/
|
|
262
|
-
function addContract(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
whenNotPaused
|
|
266
|
-
{
|
|
263
|
+
function addContract(
|
|
264
|
+
address account
|
|
265
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
267
266
|
require(isContract(account), "Given address is not a contract");
|
|
268
267
|
_addWhitelisted(account, _chainId());
|
|
269
268
|
identities[account].status = 2; //this must come after _addWhitelisted
|
|
@@ -275,11 +274,9 @@ contract IdentityV2 is
|
|
|
275
274
|
* @dev Function to remove a Contract from list of contracts
|
|
276
275
|
* @param account The address to add
|
|
277
276
|
*/
|
|
278
|
-
function removeContract(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
whenNotPaused
|
|
282
|
-
{
|
|
277
|
+
function removeContract(
|
|
278
|
+
address account
|
|
279
|
+
) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
|
|
283
280
|
if (
|
|
284
281
|
address(oldIdentity) != address(0) && oldIdentity.isDAOContract(account)
|
|
285
282
|
) {
|
|
@@ -472,11 +469,9 @@ contract IdentityV2 is
|
|
|
472
469
|
@param account address to get its identity
|
|
473
470
|
@return whitelisted the identity or address 0 if _account not connected or not identity
|
|
474
471
|
**/
|
|
475
|
-
function getWhitelistedRoot(
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
returns (address whitelisted)
|
|
479
|
-
{
|
|
472
|
+
function getWhitelistedRoot(
|
|
473
|
+
address account
|
|
474
|
+
) external view returns (address whitelisted) {
|
|
480
475
|
if (isWhitelisted(account)) return account;
|
|
481
476
|
if (isWhitelisted(connectedAccounts[account]))
|
|
482
477
|
return connectedAccounts[account];
|
|
@@ -533,11 +528,9 @@ contract IdentityV2 is
|
|
|
533
528
|
@param account to get DID for
|
|
534
529
|
@return did of the account
|
|
535
530
|
*/
|
|
536
|
-
function addrToDID(
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
returns (string memory did)
|
|
540
|
-
{
|
|
531
|
+
function addrToDID(
|
|
532
|
+
address account
|
|
533
|
+
) external view returns (string memory did) {
|
|
541
534
|
did = identities[account].did;
|
|
542
535
|
bytes32 pHash = keccak256(bytes(did));
|
|
543
536
|
|
|
@@ -555,11 +548,9 @@ contract IdentityV2 is
|
|
|
555
548
|
return "";
|
|
556
549
|
}
|
|
557
550
|
|
|
558
|
-
function getWhitelistedOnChainId(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
returns (uint256 chainId)
|
|
562
|
-
{
|
|
551
|
+
function getWhitelistedOnChainId(
|
|
552
|
+
address account
|
|
553
|
+
) external view returns (uint256 chainId) {
|
|
563
554
|
chainId = identities[account].whitelistedOnChainId;
|
|
564
555
|
return chainId > 0 ? chainId : _chainId();
|
|
565
556
|
}
|