@gooddollar/goodprotocol 2.0.7-beta.2 → 2.0.7-beta.3
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/BuyGDClone.min.json +1 -0
- package/artifacts/abis/BuyGDCloneFactory.min.json +1 -0
- package/artifacts/abis/ISwapRouter.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/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- 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/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- 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/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
- 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/InvitesV2.sol/InvitesV2.json +2 -2
- 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/DistributionHelperTest.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
- package/artifacts/contracts/mocks/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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- 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/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
- 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/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- 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/DistributionHelper.sol/DistributionHelper.json +2 -2
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +2 -2
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +2 -2
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +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 +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/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +206 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +80 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.json +205 -0
- 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/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/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/invite/InvitesFuseV2.sol +5 -3
- package/contracts/invite/InvitesV2.sol +5 -3
- package/contracts/reserve/DistributionHelper.sol +12 -9
- package/contracts/utils/BuyGDClone.sol +171 -0
- package/package.json +1 -1
- package/scripts/upgrades/multichain-temp-fix.ts +126 -0
- package/types/BuyGDClone.ts +277 -0
- package/types/BuyGDCloneFactory.ts +143 -0
- package/types/ISwapRouter.ts +298 -0
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
- package/types/factories/BuyGDCloneFactory__factory.ts +142 -0
- package/types/factories/BuyGDClone__factory.ts +265 -0
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
- package/types/factories/DistributionHelperTest__factory.ts +1 -1
- package/types/factories/DistributionHelper__factory.ts +1 -1
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/GoodFundManagerTest__factory.ts +1 -1
- package/types/factories/GoodFundManager__factory.ts +1 -1
- package/types/factories/GoodReserveCDai__factory.ts +1 -1
- package/types/factories/ISwapRouter__factory.ts +217 -0
- package/types/factories/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +1 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/StakersDistribution__factory.ts +1 -1
- package/types/hardhat.d.ts +27 -0
- package/types/index.ts +6 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "ISwapRouter",
|
|
4
|
+
"sourceName": "contracts/utils/BuyGDClone.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"components": [
|
|
10
|
+
{
|
|
11
|
+
"internalType": "bytes",
|
|
12
|
+
"name": "path",
|
|
13
|
+
"type": "bytes"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"internalType": "address",
|
|
17
|
+
"name": "recipient",
|
|
18
|
+
"type": "address"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"internalType": "uint256",
|
|
22
|
+
"name": "amountIn",
|
|
23
|
+
"type": "uint256"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"internalType": "uint256",
|
|
27
|
+
"name": "amountOutMinimum",
|
|
28
|
+
"type": "uint256"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"internalType": "struct ISwapRouter.ExactInputParams",
|
|
32
|
+
"name": "params",
|
|
33
|
+
"type": "tuple"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"name": "exactInput",
|
|
37
|
+
"outputs": [
|
|
38
|
+
{
|
|
39
|
+
"internalType": "uint256",
|
|
40
|
+
"name": "amountOut",
|
|
41
|
+
"type": "uint256"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"stateMutability": "payable",
|
|
45
|
+
"type": "function"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"components": [
|
|
51
|
+
{
|
|
52
|
+
"internalType": "address",
|
|
53
|
+
"name": "tokenIn",
|
|
54
|
+
"type": "address"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"internalType": "address",
|
|
58
|
+
"name": "tokenOut",
|
|
59
|
+
"type": "address"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"internalType": "uint24",
|
|
63
|
+
"name": "fee",
|
|
64
|
+
"type": "uint24"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"internalType": "address",
|
|
68
|
+
"name": "recipient",
|
|
69
|
+
"type": "address"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"internalType": "uint256",
|
|
73
|
+
"name": "amountIn",
|
|
74
|
+
"type": "uint256"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"internalType": "uint256",
|
|
78
|
+
"name": "amountOutMinimum",
|
|
79
|
+
"type": "uint256"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"internalType": "uint160",
|
|
83
|
+
"name": "sqrtPriceLimitX96",
|
|
84
|
+
"type": "uint160"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"internalType": "struct ISwapRouter.ExactInputSingleParams",
|
|
88
|
+
"name": "params",
|
|
89
|
+
"type": "tuple"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"name": "exactInputSingle",
|
|
93
|
+
"outputs": [
|
|
94
|
+
{
|
|
95
|
+
"internalType": "uint256",
|
|
96
|
+
"name": "amountOut",
|
|
97
|
+
"type": "uint256"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"stateMutability": "payable",
|
|
101
|
+
"type": "function"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"inputs": [
|
|
105
|
+
{
|
|
106
|
+
"components": [
|
|
107
|
+
{
|
|
108
|
+
"internalType": "bytes",
|
|
109
|
+
"name": "path",
|
|
110
|
+
"type": "bytes"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"internalType": "address",
|
|
114
|
+
"name": "recipient",
|
|
115
|
+
"type": "address"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"internalType": "uint256",
|
|
119
|
+
"name": "amountOut",
|
|
120
|
+
"type": "uint256"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"internalType": "uint256",
|
|
124
|
+
"name": "amountInMaximum",
|
|
125
|
+
"type": "uint256"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"internalType": "struct ISwapRouter.ExactOutputParams",
|
|
129
|
+
"name": "params",
|
|
130
|
+
"type": "tuple"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"name": "exactOutput",
|
|
134
|
+
"outputs": [
|
|
135
|
+
{
|
|
136
|
+
"internalType": "uint256",
|
|
137
|
+
"name": "amountIn",
|
|
138
|
+
"type": "uint256"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"stateMutability": "payable",
|
|
142
|
+
"type": "function"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"inputs": [
|
|
146
|
+
{
|
|
147
|
+
"components": [
|
|
148
|
+
{
|
|
149
|
+
"internalType": "address",
|
|
150
|
+
"name": "tokenIn",
|
|
151
|
+
"type": "address"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"internalType": "address",
|
|
155
|
+
"name": "tokenOut",
|
|
156
|
+
"type": "address"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"internalType": "uint24",
|
|
160
|
+
"name": "fee",
|
|
161
|
+
"type": "uint24"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"internalType": "address",
|
|
165
|
+
"name": "recipient",
|
|
166
|
+
"type": "address"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"internalType": "uint256",
|
|
170
|
+
"name": "amountOut",
|
|
171
|
+
"type": "uint256"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"internalType": "uint256",
|
|
175
|
+
"name": "amountInMaximum",
|
|
176
|
+
"type": "uint256"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"internalType": "uint160",
|
|
180
|
+
"name": "sqrtPriceLimitX96",
|
|
181
|
+
"type": "uint160"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"internalType": "struct ISwapRouter.ExactOutputSingleParams",
|
|
185
|
+
"name": "params",
|
|
186
|
+
"type": "tuple"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"name": "exactOutputSingle",
|
|
190
|
+
"outputs": [
|
|
191
|
+
{
|
|
192
|
+
"internalType": "uint256",
|
|
193
|
+
"name": "amountIn",
|
|
194
|
+
"type": "uint256"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"stateMutability": "payable",
|
|
198
|
+
"type": "function"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"bytecode": "0x",
|
|
202
|
+
"deployedBytecode": "0x",
|
|
203
|
+
"linkReferences": {},
|
|
204
|
+
"deployedLinkReferences": {}
|
|
205
|
+
}
|
|
@@ -272,11 +272,13 @@ contract InvitesFuseV2 is Initializable {
|
|
|
272
272
|
function collectBounties() public isActive {
|
|
273
273
|
address[] storage pendings = users[msg.sender].pending;
|
|
274
274
|
uint256 totalBounties = 0;
|
|
275
|
-
for (
|
|
276
|
-
if (gasleft() <
|
|
277
|
-
address pending = pendings[
|
|
275
|
+
for (uint256 i = pendings.length; i > 0; i--) {
|
|
276
|
+
if (gasleft() < 120000) break; // leave enough gas for the inviter transfer around 120k
|
|
277
|
+
address pending = pendings[i - 1];
|
|
278
278
|
if (canCollectBountyFor(pending)) {
|
|
279
|
+
if (gasleft() < 240000) break; // leave enough gas for the invitee+inviter transfer around 120k
|
|
279
280
|
totalBounties += _bountyFor(pending, false);
|
|
281
|
+
pendings[i - 1] = pendings[pendings.length - 1];
|
|
280
282
|
pendings.pop();
|
|
281
283
|
}
|
|
282
284
|
}
|
|
@@ -278,11 +278,13 @@ contract InvitesV2 is DAOUpgradeableContract {
|
|
|
278
278
|
function collectBounties() public isActive {
|
|
279
279
|
address[] storage pendings = users[msg.sender].pending;
|
|
280
280
|
uint256 totalBounties = 0;
|
|
281
|
-
for (
|
|
282
|
-
if (gasleft() < 185000) break; // leave enough gas for the
|
|
283
|
-
address pending = pendings[
|
|
281
|
+
for (uint256 i = pendings.length; i > 0; i--) {
|
|
282
|
+
if (gasleft() < 185000) break; // leave enough gas for the inviter transfer around 150k each if we are using supertoken
|
|
283
|
+
address pending = pendings[i - 1];
|
|
284
284
|
if (canCollectBountyFor(pending)) {
|
|
285
|
+
if (gasleft() < 300000) break; // leave enough gas for the invitee+inviter transfer around 150k each if we are using supertoken
|
|
285
286
|
totalBounties += _bountyFor(pending, false);
|
|
287
|
+
pendings[i - 1] = pendings[pendings.length - 1];
|
|
286
288
|
pendings.pop();
|
|
287
289
|
}
|
|
288
290
|
}
|
|
@@ -22,7 +22,8 @@ contract DistributionHelper is
|
|
|
22
22
|
enum TransferType {
|
|
23
23
|
FuseBridge,
|
|
24
24
|
MultichainBridge,
|
|
25
|
-
|
|
25
|
+
TransferAndCall,
|
|
26
|
+
Transfer
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
struct DistributionRecipient {
|
|
@@ -94,10 +95,9 @@ contract DistributionHelper is
|
|
|
94
95
|
* @notice add or update a recipient details, if address exists it will update, otherwise add
|
|
95
96
|
* to "remove" set recipient bps to 0. only ADMIN_ROLE can call this.
|
|
96
97
|
*/
|
|
97
|
-
function addOrUpdateRecipient(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{
|
|
98
|
+
function addOrUpdateRecipient(
|
|
99
|
+
DistributionRecipient memory _recipient
|
|
100
|
+
) external onlyRole(DEFAULT_ADMIN_ROLE) {
|
|
101
101
|
// console.log("addOrUpdate addr: %s", _recipient.addr);
|
|
102
102
|
for (uint256 i = 0; i < distributionRecipients.length; i++) {
|
|
103
103
|
// console.log(
|
|
@@ -122,9 +122,10 @@ contract DistributionHelper is
|
|
|
122
122
|
* @param _recipient data about the recipient
|
|
123
123
|
* @param _amount how much to send
|
|
124
124
|
*/
|
|
125
|
-
function distribute(
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
function distribute(
|
|
126
|
+
DistributionRecipient storage _recipient,
|
|
127
|
+
uint256 _amount
|
|
128
|
+
) internal {
|
|
128
129
|
if (_recipient.transferType == TransferType.FuseBridge) {
|
|
129
130
|
nativeToken().transferAndCall(
|
|
130
131
|
fuseBridge,
|
|
@@ -139,8 +140,10 @@ contract DistributionHelper is
|
|
|
139
140
|
_amount,
|
|
140
141
|
_recipient.chainId
|
|
141
142
|
);
|
|
142
|
-
} else if (_recipient.transferType == TransferType.
|
|
143
|
+
} else if (_recipient.transferType == TransferType.TransferAndCall) {
|
|
143
144
|
nativeToken().transferAndCall(_recipient.addr, _amount, "");
|
|
145
|
+
} else if (_recipient.transferType == TransferType.Transfer) {
|
|
146
|
+
nativeToken().transfer(_recipient.addr, _amount);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8;
|
|
4
|
+
import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
|
|
5
|
+
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
6
|
+
import "../Interfaces.sol";
|
|
7
|
+
|
|
8
|
+
interface ISwapRouter {
|
|
9
|
+
struct ExactInputSingleParams {
|
|
10
|
+
address tokenIn;
|
|
11
|
+
address tokenOut;
|
|
12
|
+
uint24 fee;
|
|
13
|
+
address recipient;
|
|
14
|
+
uint256 amountIn;
|
|
15
|
+
uint256 amountOutMinimum;
|
|
16
|
+
uint160 sqrtPriceLimitX96;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// @notice Swaps `amountIn` of one token for as much as possible of another token
|
|
20
|
+
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
21
|
+
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
22
|
+
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
|
|
23
|
+
/// @return amountOut The amount of the received token
|
|
24
|
+
function exactInputSingle(
|
|
25
|
+
ExactInputSingleParams calldata params
|
|
26
|
+
) external payable returns (uint256 amountOut);
|
|
27
|
+
|
|
28
|
+
struct ExactInputParams {
|
|
29
|
+
bytes path;
|
|
30
|
+
address recipient;
|
|
31
|
+
uint256 amountIn;
|
|
32
|
+
uint256 amountOutMinimum;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
|
|
36
|
+
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
37
|
+
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
38
|
+
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
|
|
39
|
+
/// @return amountOut The amount of the received token
|
|
40
|
+
function exactInput(
|
|
41
|
+
ExactInputParams calldata params
|
|
42
|
+
) external payable returns (uint256 amountOut);
|
|
43
|
+
|
|
44
|
+
struct ExactOutputSingleParams {
|
|
45
|
+
address tokenIn;
|
|
46
|
+
address tokenOut;
|
|
47
|
+
uint24 fee;
|
|
48
|
+
address recipient;
|
|
49
|
+
uint256 amountOut;
|
|
50
|
+
uint256 amountInMaximum;
|
|
51
|
+
uint160 sqrtPriceLimitX96;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// @notice Swaps as little as possible of one token for `amountOut` of another token
|
|
55
|
+
/// that may remain in the router after the swap.
|
|
56
|
+
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
|
|
57
|
+
/// @return amountIn The amount of the input token
|
|
58
|
+
function exactOutputSingle(
|
|
59
|
+
ExactOutputSingleParams calldata params
|
|
60
|
+
) external payable returns (uint256 amountIn);
|
|
61
|
+
|
|
62
|
+
struct ExactOutputParams {
|
|
63
|
+
bytes path;
|
|
64
|
+
address recipient;
|
|
65
|
+
uint256 amountOut;
|
|
66
|
+
uint256 amountInMaximum;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
|
|
70
|
+
/// that may remain in the router after the swap.
|
|
71
|
+
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
|
|
72
|
+
/// @return amountIn The amount of the input token
|
|
73
|
+
function exactOutput(
|
|
74
|
+
ExactOutputParams calldata params
|
|
75
|
+
) external payable returns (uint256 amountIn);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
contract BuyGDClone is Initializable {
|
|
79
|
+
error NOT_ALLOWED(address);
|
|
80
|
+
error REFUND_FAILED(uint256);
|
|
81
|
+
|
|
82
|
+
ISwapRouter public immutable router;
|
|
83
|
+
address public constant celo = 0x471EcE3750Da237f93B8E339c536989b8978a438;
|
|
84
|
+
address public immutable cusd;
|
|
85
|
+
address public immutable gd;
|
|
86
|
+
|
|
87
|
+
address public owner;
|
|
88
|
+
address public executer;
|
|
89
|
+
|
|
90
|
+
receive() external payable {}
|
|
91
|
+
|
|
92
|
+
constructor(ISwapRouter _router, address _cusd, address _gd) {
|
|
93
|
+
router = _router;
|
|
94
|
+
cusd = _cusd;
|
|
95
|
+
gd = _gd;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function initialize(address _owner, address _executer) external initializer {
|
|
99
|
+
owner = _owner;
|
|
100
|
+
executer = _executer;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function swap(uint256 _minAmount) external {
|
|
104
|
+
uint256 gasCosts = msg.sender == owner ? 0 : (block.basefee + 1e9) * 400000;
|
|
105
|
+
if (msg.sender != owner && msg.sender != executer)
|
|
106
|
+
revert NOT_ALLOWED(msg.sender);
|
|
107
|
+
uint256 balance = address(this).balance;
|
|
108
|
+
ERC20(celo).approve(address(router), balance);
|
|
109
|
+
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
|
|
110
|
+
path: abi.encodePacked(celo, uint24(3000), cusd, uint24(10000), gd),
|
|
111
|
+
recipient: owner,
|
|
112
|
+
amountIn: balance - gasCosts,
|
|
113
|
+
amountOutMinimum: _minAmount
|
|
114
|
+
});
|
|
115
|
+
router.exactInput(params);
|
|
116
|
+
if (msg.sender != owner) {
|
|
117
|
+
(bool sent, ) = msg.sender.call{ value: gasCosts }("");
|
|
118
|
+
if (!sent) revert REFUND_FAILED(gasCosts);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function swapCusd(uint256 _minAmount) external {
|
|
123
|
+
uint256 gasCosts = msg.sender == executer ? 1e17 : 0;
|
|
124
|
+
if (msg.sender != owner && msg.sender != executer)
|
|
125
|
+
revert NOT_ALLOWED(msg.sender);
|
|
126
|
+
uint balance = ERC20(cusd).balanceOf(address(this));
|
|
127
|
+
ERC20(cusd).approve(address(router), balance);
|
|
128
|
+
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
|
|
129
|
+
path: abi.encodePacked(cusd, uint24(10000), gd),
|
|
130
|
+
recipient: owner,
|
|
131
|
+
amountIn: balance - gasCosts,
|
|
132
|
+
amountOutMinimum: _minAmount
|
|
133
|
+
});
|
|
134
|
+
router.exactInput(params);
|
|
135
|
+
if (msg.sender == executer) {
|
|
136
|
+
ERC20(cusd).transfer(msg.sender, gasCosts);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function recover(address token) external {
|
|
141
|
+
if (token == address(0)) {
|
|
142
|
+
(bool sent, ) = payable(owner).call{ value: address(this).balance }("");
|
|
143
|
+
if (!sent) revert REFUND_FAILED(address(this).balance);
|
|
144
|
+
} else ERC20(token).transfer(owner, ERC20(token).balanceOf(address(this)));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
contract BuyGDCloneFactory {
|
|
149
|
+
address immutable impl;
|
|
150
|
+
|
|
151
|
+
constructor(ISwapRouter _router, address _cusd, address _gd) {
|
|
152
|
+
impl = address(new BuyGDClone(_router, _cusd, _gd));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function create(address owner, address executer) external returns (address) {
|
|
156
|
+
bytes32 salt = keccak256(abi.encode(owner, executer));
|
|
157
|
+
address clone = ClonesUpgradeable.cloneDeterministic(impl, salt);
|
|
158
|
+
BuyGDClone(payable(clone)).initialize(owner, executer);
|
|
159
|
+
return clone;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function predict(
|
|
163
|
+
address owner,
|
|
164
|
+
address executer
|
|
165
|
+
) external view returns (address) {
|
|
166
|
+
bytes32 salt = keccak256(abi.encode(owner, executer));
|
|
167
|
+
|
|
168
|
+
return
|
|
169
|
+
ClonesUpgradeable.predictDeterministicAddress(impl, salt, address(this));
|
|
170
|
+
}
|
|
171
|
+
}
|