@harvest-finance/harvest-strategy-polygon 0.0.1-security → 1.0.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.
Potentially problematic release.
This version of @harvest-finance/harvest-strategy-polygon might be problematic. Click here for more details.
- package/README.md +110 -5
- package/contracts/base/Controller.sol +125 -0
- package/contracts/base/ControllerV2.sol +363 -0
- package/contracts/base/FeeRewardForwarder.sol +163 -0
- package/contracts/base/PotPool.sol +360 -0
- package/contracts/base/ProfitSharingReceiver.sol +39 -0
- package/contracts/base/RewardForwarderV2.sol +109 -0
- package/contracts/base/Vault.sol +344 -0
- package/contracts/base/VaultERC4626.sol +113 -0
- package/contracts/base/VaultProxy.sol +35 -0
- package/contracts/base/VaultStorage.sol +199 -0
- package/contracts/base/VaultStorageV2.sol +196 -0
- package/contracts/base/VaultV2.sol +369 -0
- package/contracts/base/ape-base/MiniApeV2Strategy.sol +322 -0
- package/contracts/base/ape-base/interface/IMiniChefV2.sol +31 -0
- package/contracts/base/ape-base/interface/IRewarder.sol +10 -0
- package/contracts/base/factory/MegaFactory.sol +120 -0
- package/contracts/base/factory/interface/IPoolFactory.sol +6 -0
- package/contracts/base/factory/interface/IStrategyFactory.sol +6 -0
- package/contracts/base/factory/interface/IVaultFactory.sol +7 -0
- package/contracts/base/factory/pool/PotPoolFactory.sol +43 -0
- package/contracts/base/factory/strategy/UpgradableStrategyFactory.sol +19 -0
- package/contracts/base/factory/vault/RegularVaultFactory.sol +34 -0
- package/contracts/base/incentives/GlobalIncentivesHelper.sol +167 -0
- package/contracts/base/incentives/NotifyHelperGeneric.sol +61 -0
- package/contracts/base/incentives/NotifyHelperStateful.sol +290 -0
- package/contracts/base/inheritance/Controllable.sol +26 -0
- package/contracts/base/inheritance/ControllableInit.sol +31 -0
- package/contracts/base/inheritance/Governable.sol +29 -0
- package/contracts/base/inheritance/GovernableInit.sol +51 -0
- package/contracts/base/inheritance/IUpgradeSource.sol +8 -0
- package/contracts/base/inheritance/OwnableWhitelist.sol +17 -0
- package/contracts/base/inheritance/RewardTokenProfitNotifier.sol +48 -0
- package/contracts/base/inheritance/Storage.sol +36 -0
- package/contracts/base/interface/IController.sol +30 -0
- package/contracts/base/interface/IControllerV2.sol +135 -0
- package/contracts/base/interface/IERC4626.sol +263 -0
- package/contracts/base/interface/IFeeRewardForwarder.sol +9 -0
- package/contracts/base/interface/IProfitSharingReceiver.sol +10 -0
- package/contracts/base/interface/IRewardForwarder.sol +58 -0
- package/contracts/base/interface/IRewardPool.sol +34 -0
- package/contracts/base/interface/IStrategy.sol +25 -0
- package/contracts/base/interface/IUniversalLiquidator.sol +21 -0
- package/contracts/base/interface/IUniversalLiquidatorRegistry.sol +20 -0
- package/contracts/base/interface/IUpgradeSource.sol +8 -0
- package/contracts/base/interface/IVault.sol +35 -0
- package/contracts/base/interface/aave/DataTypes.sol +266 -0
- package/contracts/base/interface/aave/IAToken.sol +37 -0
- package/contracts/base/interface/aave/IPool.sol +13 -0
- package/contracts/base/interface/balancer/Gauge.sol +22 -0
- package/contracts/base/interface/balancer/IBVault.sol +557 -0
- package/contracts/base/interface/balancer/IBalancerMinter.sol +114 -0
- package/contracts/base/interface/balancer/linearPool/ILinearPool.sol +185 -0
- package/contracts/base/interface/balancer/linearPool/ILinearPoolFactory.sol +16 -0
- package/contracts/base/interface/balancer/linearPool/ILinearPoolRebalancer.sol +8 -0
- package/contracts/base/interface/balancer/linearPool/IPoolSwapStructs.sol +57 -0
- package/contracts/base/interface/caviar/ICaviarChef.sol +16 -0
- package/contracts/base/interface/compound/IComet.sol +114 -0
- package/contracts/base/interface/compound/ICometRewards.sol +17 -0
- package/contracts/base/interface/curve/Gauge.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_2token.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_2token_underlying.sol +31 -0
- package/contracts/base/interface/curve/ICurveDeposit_3token.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_3token_meta.sol +20 -0
- package/contracts/base/interface/curve/ICurveDeposit_3token_underlying.sol +31 -0
- package/contracts/base/interface/curve/ICurveDeposit_4token.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_4token_meta.sol +20 -0
- package/contracts/base/interface/curve/ICurveDeposit_4token_underlying.sol +31 -0
- package/contracts/base/interface/curve/ICurveDeposit_5token.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_5token_meta.sol +20 -0
- package/contracts/base/interface/curve/ICurveDeposit_5token_underlying.sol +31 -0
- package/contracts/base/interface/curve/ICurveDeposit_6token.sol +25 -0
- package/contracts/base/interface/curve/ICurveDeposit_6token_meta.sol +20 -0
- package/contracts/base/interface/gamma/IClearing.sol +8 -0
- package/contracts/base/interface/gamma/IHypervisor.sol +17 -0
- package/contracts/base/interface/gamma/IStakingRewards.sol +35 -0
- package/contracts/base/interface/gamma/IUniProxy.sol +15 -0
- package/contracts/base/interface/kyber/IDMMExchangeRouter.sol +69 -0
- package/contracts/base/interface/kyber/IDMMFactory.sol +35 -0
- package/contracts/base/interface/kyber/IDMMLiquidityRouter.sol +204 -0
- package/contracts/base/interface/kyber/IDMMPool.sol +42 -0
- package/contracts/base/interface/kyber/IDMMRouter01.sol +12 -0
- package/contracts/base/interface/kyber/IDMMRouter02.sol +55 -0
- package/contracts/base/interface/kyber/IKyberZap.sol +7 -0
- package/contracts/base/interface/merkl/IDistributor.sol +6 -0
- package/contracts/base/interface/morpho/IMetaMorpho.sol +7 -0
- package/contracts/base/interface/pearl/IGauge.sol +13 -0
- package/contracts/base/interface/pearl/IPair.sol +44 -0
- package/contracts/base/interface/pearl/IRouter.sol +305 -0
- package/contracts/base/interface/quickswap/IDragonLair.sol +25 -0
- package/contracts/base/interface/quickswap/IMasterChef.sol +13 -0
- package/contracts/base/interface/uniswap/IUniswapV2Factory.sol +15 -0
- package/contracts/base/interface/uniswap/IUniswapV2Migrator.sol +6 -0
- package/contracts/base/interface/uniswap/IUniswapV2Pair.sol +59 -0
- package/contracts/base/interface/uniswap/IUniswapV2Router01.sol +96 -0
- package/contracts/base/interface/uniswap/IUniswapV2Router02.sol +137 -0
- package/contracts/base/interface/uniswap/IUniswapV3Pool.sol +24 -0
- package/contracts/base/interface/uniswap/IUniswapV3Router.sol +64 -0
- package/contracts/base/interface/uniswap/IWETH.sol +8 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolActions.sol +103 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolDerivedState.sol +40 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolEvents.sol +121 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolImmutables.sol +35 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolOwnerActions.sol +23 -0
- package/contracts/base/interface/uniswap/pool/IUniswapV3PoolState.sol +116 -0
- package/contracts/base/masterchef-base/MasterChefHodlStrategy.sol +240 -0
- package/contracts/base/masterchef-base/MasterChefStrategy.sol +364 -0
- package/contracts/base/masterchef-base/interfaces/IMasterChef.sol +12 -0
- package/contracts/base/migration/vaultMigratable_2JPYv2.sol +87 -0
- package/contracts/base/migration/vaultMigratable_bal2EUR_PAR.sol +121 -0
- package/contracts/base/migration/vaultMigratable_bal2EUR_agEUR.sol +121 -0
- package/contracts/base/migration/vaultMigratable_balMaticX.sol +153 -0
- package/contracts/base/migration/vaultMigratable_balStMatic.sol +153 -0
- package/contracts/base/noop/NoopStrategy.sol +89 -0
- package/contracts/base/noop/NoopStrategyUpgradeable.sol +92 -0
- package/contracts/base/sushi-base/MiniChefV2Strategy.sol +380 -0
- package/contracts/base/sushi-base/interface/IMiniChefV2.sol +31 -0
- package/contracts/base/sushi-base/interface/IRewarder.sol +9 -0
- package/contracts/base/sushi-base/lib/BoringERC20.sol +30 -0
- package/contracts/base/upgradability/Address.sol +33 -0
- package/contracts/base/upgradability/BaseUpgradeabilityProxy.sol +61 -0
- package/contracts/base/upgradability/BaseUpgradeableStrategy.sol +111 -0
- package/contracts/base/upgradability/BaseUpgradeableStrategyStorage.sol +176 -0
- package/contracts/base/upgradability/BaseUpgradeableStrategyStorageV2.sol +290 -0
- package/contracts/base/upgradability/BaseUpgradeableStrategyV2.sol +145 -0
- package/contracts/base/upgradability/IUpgradable.sol +7 -0
- package/contracts/base/upgradability/Proxy.sol +71 -0
- package/contracts/base/upgradability/ReentrancyGuard.sol +57 -0
- package/contracts/base/upgradability/ReentrancyGuardUpgradeable.sol +51 -0
- package/contracts/base/upgradability/StrategyProxy.sol +35 -0
- package/contracts/base/wmatic/WMATIC.sol +8 -0
- package/contracts/strategies/aave/AaveSupplyStrategy.sol +213 -0
- package/contracts/strategies/aave/AaveSupplyStrategyMainnet_DAI.sol +23 -0
- package/contracts/strategies/aave/AaveSupplyStrategyMainnet_EURS.sol +23 -0
- package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDC.sol +23 -0
- package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDCe.sol +23 -0
- package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDT.sol +23 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_BANANA_MATIC.sol +36 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_BNB_MATIC.sol +36 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_BTC_MATIC.sol +36 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_DAI_MATIC.sol +36 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_DAI_USDC.sol +37 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_ETH_MATIC.sol +36 -0
- package/contracts/strategies/ape/ApeStrategyMainnet_USDT_MATIC.sol +36 -0
- package/contracts/strategies/aura/AuraStrategy.sol +347 -0
- package/contracts/strategies/aura/AuraStrategyMainnet_jEUR_PAR.sol +30 -0
- package/contracts/strategies/aura/interface/IAuraBaseRewardPool.sol +25 -0
- package/contracts/strategies/aura/interface/IAuraBooster.sol +17 -0
- package/contracts/strategies/aura/interface/IAuraDepositor.sol +7 -0
- package/contracts/strategies/balancer/BalancerStrategyV3.sol +509 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2BRL.sol +39 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2BRLUSD.sol +38 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_PAR.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_PARv2.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_agEUR.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MATIC_USDC_ETH_BAL.sol +32 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MaticX.sol +37 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MaticX_amMatic.sol +38 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_SPHERE_MATIC.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_TNGBL_USDC.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_WBTC_ETH_USDC.sol +32 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_bbamusd.sol +36 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_frxETH.sol +32 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_frxETH_amWETH.sol +35 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stETH.sol +35 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stMatic.sol +36 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stMatic_amMatic.sol +39 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_tetuBal.sol +36 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_wUSDR_USDC.sol +34 -0
- package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_wstETH_amWETH.sol +37 -0
- package/contracts/strategies/balancer/interface/Gauge.sol +26 -0
- package/contracts/strategies/balancer/interface/IBVault.sol +557 -0
- package/contracts/strategies/balancer/interface/IBalanceMinter.sol +114 -0
- package/contracts/strategies/complifi/ComplifiDerivStrategy.sol +381 -0
- package/contracts/strategies/complifi/ComplifiDerivStrategyMainnet_ETH5x.sol +35 -0
- package/contracts/strategies/complifi/ComplifiStrategy.sol +362 -0
- package/contracts/strategies/complifi/ComplifiStrategyMainnet_COMFI_WETH.sol +34 -0
- package/contracts/strategies/complifi/interfaces/ILiquidityMining.sol +13 -0
- package/contracts/strategies/complifi/interfaces/ILiquidityPool.sol +63 -0
- package/contracts/strategies/complifi/interfaces/IProxyActions.sol +10 -0
- package/contracts/strategies/complifi/interfaces/IUSDCVault.sol +55 -0
- package/contracts/strategies/compound/CompoundStrategy.sol +296 -0
- package/contracts/strategies/compound/CompoundStrategyMainnet_USDC.sol +28 -0
- package/contracts/strategies/compound/CompoundStrategyMainnet_USDT.sol +28 -0
- package/contracts/strategies/compound-blue/CompoundBlueStrategy.sol +292 -0
- package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_ETH.sol +27 -0
- package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_USDC.sol +27 -0
- package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_USDT.sol +27 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_3CRV.sol +40 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_3CRYPTO.sol +37 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_CRV_3CRYPTO copy.sol +37 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_MATIC_3CRYPTO.sol +37 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_USDR.sol +40 -0
- package/contracts/strategies/convex/ConvexStrategyMainnet_aCRV.sol +38 -0
- package/contracts/strategies/convex/base/ConvexStrategy.sol +480 -0
- package/contracts/strategies/convex/interface/IBaseRewardPool.sol +13 -0
- package/contracts/strategies/convex/interface/IBooster.sol +10 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategy.sol +272 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_ETH_USDC.sol +25 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_ETH_USDT.sol +25 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_MATIC_USDT.sol +25 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_TBTC_ETH.sol +25 -0
- package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_WBTC_ETH_w.sol +25 -0
- package/contracts/strategies/genomes/NoopStrategy_GENE_ETH.sol +23 -0
- package/contracts/strategies/genomes/NoopStrategy_GNOME_ETH.sol +23 -0
- package/contracts/strategies/idle/IdleFinanceStrategy.sol +240 -0
- package/contracts/strategies/idle/IdleStrategyDAIMainnet.sol +33 -0
- package/contracts/strategies/idle/IdleStrategyUSDCMainnet.sol +33 -0
- package/contracts/strategies/idle/IdleStrategyWETHMainnet.sol +30 -0
- package/contracts/strategies/idle/interface/IdleToken.sol +58 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3.sol +351 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2CAD.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_EURT.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_EURe.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_PAR.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2JPY.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2JPYv2.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2NZD.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2SGD.sol +34 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jCHF_USDC.sol +35 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jCHF_WETH.sol +35 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jEUR_USDC.sol +35 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jEUR_WETH.sol +35 -0
- package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jGBP_USDC.sol +35 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3.sol +281 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_AUR3_USDC.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_AURJUL22_WETH.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN2_4EUR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN3_4EUR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN4_4EUR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTANGLENOV22_2EURagEUR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTANGLE_2EURagEUR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTJUL22_USDC.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMAY22_USDC.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMIMONOV22_2EURPAR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMIMO_2EURPAR.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTNOV22_USDC.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTSEP22_USDC.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_QUI_2CAD.sol +27 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_SES_2JPY.sol +28 -0
- package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_agDEN_2EUR.sol +27 -0
- package/contracts/strategies/jarvis/interface/IElysianFields.sol +11 -0
- package/contracts/strategies/jarvis/interface/IKyberFairLaunch.sol +13 -0
- package/contracts/strategies/jarvis/interface/IKyberRewardLocker.sol +9 -0
- package/contracts/strategies/meshswap/MeshswapStrategy.sol +304 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_MESH_oMOOI.sol +30 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_MESH_oZEMIT.sol +30 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_USDC_oUSDC.sol +31 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_USDT_oUSDT.sol +31 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_MESH.sol +27 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_USDC.sol +28 -0
- package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_USDT.sol +28 -0
- package/contracts/strategies/meshswap/interface/IExchange.sol +9 -0
- package/contracts/strategies/meshswap/interface/IRouter.sol +68 -0
- package/contracts/strategies/pearl/CaviarStrategy.sol +244 -0
- package/contracts/strategies/pearl/CaviarStrategyMainnet_CVR.sol +26 -0
- package/contracts/strategies/pearl/PearlHodlStrategy.sol +254 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_CVR_PEARL.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_DAI_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_ETH_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_MATIC_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_PEARL_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_STAR_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_TNGBL_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_USDC_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_USDT_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_WBTC_USDR.sol +27 -0
- package/contracts/strategies/pearl/PearlHodlStrategyMainnet_wUSDR_USDR.sol +27 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategy.sol +400 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_ETH_narrow.sol +31 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_ETH_wide.sol +31 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_USDC_narrow.sol +31 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_USDC_wide.sol +31 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_USDC_ETH_narrow.sol +34 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_USDC_ETH_wide.sol +34 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2.sol +348 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_USDC_DAI.sol +28 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_USDC_USDT.sol +29 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_WBTC_ETH_narrow.sol +28 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_WBTC_USDC_narrow.sol +28 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_cbETH_ETH.sol +28 -0
- package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_wstETH_ETH.sol +28 -0
- package/contracts/strategies/uniswap-gamma/UniswapGammaStrategy.sol +312 -0
- package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_DAI.sol +28 -0
- package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_USDT.sol +28 -0
- package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_WETH.sol +28 -0
- package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_WMATIC_USDC.sol +28 -0
- package/contracts/strategies/yel/YelStrategy.sol +350 -0
- package/contracts/strategies/yel/YelStrategyMainnet_YEL_WETH.sol +29 -0
- package/hardhat.config.js +58 -0
- package/index.js +42 -0
- package/package.json +56 -6
- package/scripts/01-deploy-vault-regular-with-upgradable-strategy.js +41 -0
- package/scripts/02-deploy-vault-regular.js +35 -0
- package/scripts/03-deploy-upgradable-strategy.js +34 -0
- package/scripts/04-deploy-new-implementation.js +24 -0
- package/scripts/README.md +55 -0
- package/scripts/utils.js +42 -0
- package/test/aave/dai.js +207 -0
- package/test/aave/eurs.js +207 -0
- package/test/aave/usdc.js +206 -0
- package/test/aave/usdce.js +206 -0
- package/test/aave/usdt.js +206 -0
- package/test/ape/banana-matic.js +157 -0
- package/test/ape/bnb-matic.js +159 -0
- package/test/ape/btc-matic.js +159 -0
- package/test/ape/dai-matic.js +159 -0
- package/test/ape/dai-usdc.js +163 -0
- package/test/ape/eth-matic.js +158 -0
- package/test/ape/usdt-matic.js +159 -0
- package/test/aura/jeur-par.js +135 -0
- package/test/balancer/2brl_v3.js +123 -0
- package/test/balancer/2brlusd_v3.js +123 -0
- package/test/balancer/2eur_ageur.js +141 -0
- package/test/balancer/2eur_par.js +141 -0
- package/test/balancer/2eur_par_v2.js +123 -0
- package/test/balancer/bbamusd_v3.js +124 -0
- package/test/balancer/btc.js +131 -0
- package/test/balancer/frxETH.js +123 -0
- package/test/balancer/frxeth_amweth.js +123 -0
- package/test/balancer/matic_usdc_eth_bal.js +123 -0
- package/test/balancer/maticx_ammatic.js +123 -0
- package/test/balancer/maticx_v2.js +120 -0
- package/test/balancer/maticx_v3.js +141 -0
- package/test/balancer/polybase.js +131 -0
- package/test/balancer/polybase_v2.js +121 -0
- package/test/balancer/polydefi.js +131 -0
- package/test/balancer/polydefi2.js +131 -0
- package/test/balancer/qipool.js +136 -0
- package/test/balancer/sphere_matic.js +123 -0
- package/test/balancer/stETH.js +123 -0
- package/test/balancer/stable.js +131 -0
- package/test/balancer/stable_v2.js +121 -0
- package/test/balancer/stmatic_ammatic.js +123 -0
- package/test/balancer/stmatic_v2.js +120 -0
- package/test/balancer/stmatic_v3.js +141 -0
- package/test/balancer/tetubal_v3.js +123 -0
- package/test/balancer/tngbl_usdc.js +123 -0
- package/test/balancer/tricrypto.js +131 -0
- package/test/balancer/tusd_stable.js +142 -0
- package/test/balancer/usdc_weth.js +136 -0
- package/test/balancer/usdc_weth_v2.js +123 -0
- package/test/balancer/wbtc_eth_usdc.js +123 -0
- package/test/balancer/wbtc_weth.js +136 -0
- package/test/balancer/wsteth_amweth.js +123 -0
- package/test/balancer/wusdr_usdc.js +123 -0
- package/test/compound/usdc.js +127 -0
- package/test/compound/usdt.js +129 -0
- package/test/compound-blue/eth.js +136 -0
- package/test/compound-blue/usdc.js +136 -0
- package/test/compound-blue/usdt.js +136 -0
- package/test/convex/3crv.js +123 -0
- package/test/convex/3crypto.js +123 -0
- package/test/convex/acrv.js +123 -0
- package/test/convex/crv_3crypto.js +123 -0
- package/test/convex/matic_3crypto.js +123 -0
- package/test/convex/usdr.js +123 -0
- package/test/core/emission-fork.js +197 -0
- package/test/core/emission.js +209 -0
- package/test/core/vault_upgrade.js +129 -0
- package/test/curve/aave.js +132 -0
- package/test/curve/atricrypto3.js +135 -0
- package/test/curve/eurtusd.js +135 -0
- package/test/gamma-merkl/qs-eth-usdc.js +212 -0
- package/test/gamma-merkl/qs-eth-usdt.js +213 -0
- package/test/gamma-merkl/qs-matic-usdt.js +213 -0
- package/test/gamma-merkl/qs-tbtc-eth.js +213 -0
- package/test/gamma-merkl/qs-wbtc-eth-w.js +213 -0
- package/test/genomes/gene-eth.js +115 -0
- package/test/genomes/gnome-eth.js +115 -0
- package/test/idle/dai.js +129 -0
- package/test/idle/usdc.js +128 -0
- package/test/idle/weth.js +128 -0
- package/test/jarvis/2cad-hodl.js +183 -0
- package/test/jarvis/2cad-update-nov22.js +182 -0
- package/test/jarvis/2cad-update.js +177 -0
- package/test/jarvis/2cad-update2.js +182 -0
- package/test/jarvis/2cad-update3.js +182 -0
- package/test/jarvis/2eur-ageur-update-nov22.js +182 -0
- package/test/jarvis/2eur-ageur-update.js +182 -0
- package/test/jarvis/2eur-eure-hodl.js +176 -0
- package/test/jarvis/2eur-eurt-hodl.js +176 -0
- package/test/jarvis/2eur-eurt-update-nov22.js +182 -0
- package/test/jarvis/2eur-hodl.js +176 -0
- package/test/jarvis/2eur-par-hodl.js +176 -0
- package/test/jarvis/2eur-par-update-nov22.js +182 -0
- package/test/jarvis/2jpy-hodl.js +244 -0
- package/test/jarvis/2jpy-update-nov22.js +182 -0
- package/test/jarvis/2jpy-update.js +177 -0
- package/test/jarvis/2jpy-update2.js +182 -0
- package/test/jarvis/2jpyv2-upgrade.js +184 -0
- package/test/jarvis/2nzd-hodl.js +176 -0
- package/test/jarvis/2nzd-update.js +182 -0
- package/test/jarvis/2sgd-hodl.js +176 -0
- package/test/jarvis/2sgd-update-nov22.js +182 -0
- package/test/jarvis/2sgd-update.js +182 -0
- package/test/jarvis/2sgd-update2.js +182 -0
- package/test/jarvis/4eur-hodl-upgrade.js +177 -0
- package/test/jarvis/4eur-hodl.js +183 -0
- package/test/jarvis/4eur-update.js +181 -0
- package/test/jarvis/4eur-update2.js +181 -0
- package/test/jarvis/agden-2eur.js +222 -0
- package/test/jarvis/aur-usdc-v2.js +115 -0
- package/test/jarvis/aur-usdc.js +127 -0
- package/test/jarvis/aur3-usdc.js +115 -0
- package/test/jarvis/aurjul22-weth.js +222 -0
- package/test/jarvis/den-4eur.js +115 -0
- package/test/jarvis/den2-4eur.js +220 -0
- package/test/jarvis/den3-4eur.js +220 -0
- package/test/jarvis/den4-4eur.js +220 -0
- package/test/jarvis/jchf-usdc-hodl-v2.js +184 -0
- package/test/jarvis/jchf-usdc-hodl-v3.js +178 -0
- package/test/jarvis/jchf-usdc-hodl.js +193 -0
- package/test/jarvis/jchf-weth-hodl.js +176 -0
- package/test/jarvis/jeur-usdc-hodl-v2.js +184 -0
- package/test/jarvis/jeur-usdc-hodl-v3.js +178 -0
- package/test/jarvis/jeur-usdc-hodl.js +193 -0
- package/test/jarvis/jeur-weth-hodl.js +176 -0
- package/test/jarvis/jgbp-usdc-hodl-v2.js +184 -0
- package/test/jarvis/jgbp-usdc-hodl-v3.js +178 -0
- package/test/jarvis/jgbp-usdc-hodl.js +193 -0
- package/test/jarvis/jrtangle-2eurageur.js +220 -0
- package/test/jarvis/jrtanglenov22-2eurageur.js +220 -0
- package/test/jarvis/jrtjul22-usdc.js +115 -0
- package/test/jarvis/jrtmay22-usdc.js +115 -0
- package/test/jarvis/jrtmimo-2eurpar.js +220 -0
- package/test/jarvis/jrtmimonov22-2eurpar.js +220 -0
- package/test/jarvis/jrtnov22-usdc.js +220 -0
- package/test/jarvis/jrtsep22-usdc.js +220 -0
- package/test/jarvis/qui-2cad.js +218 -0
- package/test/jarvis/ses-2jpy.js +222 -0
- package/test/meshswap/mesh-omooi.js +197 -0
- package/test/meshswap/mesh-ozemit.js +197 -0
- package/test/meshswap/usdc-ousdc.js +197 -0
- package/test/meshswap/usdt-ousdt.js +197 -0
- package/test/meshswap/wmatic-mesh.js +197 -0
- package/test/meshswap/wmatic-usdc.js +197 -0
- package/test/meshswap/wmatic-usdt.js +197 -0
- package/test/mstable/musd.js +123 -0
- package/test/pearl/cvr-pearl.js +198 -0
- package/test/pearl/cvr.js +133 -0
- package/test/pearl/dai-usdr.js +198 -0
- package/test/pearl/eth-usdr.js +198 -0
- package/test/pearl/matic-usdr.js +198 -0
- package/test/pearl/pearl-usdr.js +198 -0
- package/test/pearl/star-usdr.js +186 -0
- package/test/pearl/tngbl-usdr.js +198 -0
- package/test/pearl/usdc-usdr.js +198 -0
- package/test/pearl/usdt-usdr.js +198 -0
- package/test/pearl/wbtc-usdr.js +198 -0
- package/test/pearl/wusdr-usdr.js +198 -0
- package/test/popsicle/ice-weth.js +128 -0
- package/test/quick/eth-matic.js +132 -0
- package/test/quick/eth-usdt.js +140 -0
- package/test/quick/ifarm-quick.js +147 -0
- package/test/quick/matic-usdc.js +145 -0
- package/test/quick/psp-matic.js +124 -0
- package/test/quick/wbtc-eth.js +145 -0
- package/test/quick-gamma/cbeth-eth.js +207 -0
- package/test/quick-gamma/matic-eth-narrow.js +201 -0
- package/test/quick-gamma/matic-eth-wide.js +197 -0
- package/test/quick-gamma/matic-usdc-narrow.js +197 -0
- package/test/quick-gamma/matic-usdc-wide.js +197 -0
- package/test/quick-gamma/upgrade/matic-eth-narrow.js +204 -0
- package/test/quick-gamma/upgrade/matic-usdc-narrow.js +199 -0
- package/test/quick-gamma/usdc-dai.js +209 -0
- package/test/quick-gamma/usdc-eth-narrow.js +197 -0
- package/test/quick-gamma/usdc-eth-wide.js +197 -0
- package/test/quick-gamma/usdc-usdt.js +209 -0
- package/test/quick-gamma/wbtc-eth-narrow.js +207 -0
- package/test/quick-gamma/wbtc-usdc-narrow.js +209 -0
- package/test/quick-gamma/wsteth-eth.js +207 -0
- package/test/sushi/eth-usdt.js +153 -0
- package/test/sushi/matic-eth.js +138 -0
- package/test/sushi/usdc-eth.js +153 -0
- package/test/test-config.js +24 -0
- package/test/uniswap-gamma/usdc-dai.js +212 -0
- package/test/uniswap-gamma/usdc-usdt.js +212 -0
- package/test/uniswap-gamma/usdc-weth.js +212 -0
- package/test/uniswap-gamma/wmatic-usdc.js +210 -0
- package/test/utilities/Utils.js +96 -0
- package/test/utilities/hh-utils.js +242 -0
- package/test/utilities/make-vault.js +10 -0
- package/test/yel/yel-wmatic.js +129 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_5token {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[5] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
uint256[5] calldata amounts,
|
12
|
+
uint256 max_burn_amount
|
13
|
+
) external;
|
14
|
+
function remove_liquidity(
|
15
|
+
uint256 _amount,
|
16
|
+
uint256[5] calldata amounts
|
17
|
+
) external;
|
18
|
+
function exchange(
|
19
|
+
int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount
|
20
|
+
) external;
|
21
|
+
function calc_token_amount(
|
22
|
+
uint256[5] calldata amounts,
|
23
|
+
bool deposit
|
24
|
+
) external view returns(uint);
|
25
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_5token_meta {
|
5
|
+
function add_liquidity(
|
6
|
+
address pool,
|
7
|
+
uint256[5] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
address pool,
|
12
|
+
uint256[5] calldata amounts,
|
13
|
+
uint256 max_burn_amount
|
14
|
+
) external;
|
15
|
+
function remove_liquidity(
|
16
|
+
address pool,
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[5] calldata amounts
|
19
|
+
) external;
|
20
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_5token_underlying {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[5] calldata amounts,
|
8
|
+
uint256 min_mint_amount,
|
9
|
+
bool use_underlying
|
10
|
+
) external;
|
11
|
+
function remove_liquidity_imbalance(
|
12
|
+
uint256[5] calldata amounts,
|
13
|
+
uint256 max_burn_amount,
|
14
|
+
bool use_underlying
|
15
|
+
) external;
|
16
|
+
function remove_liquidity(
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[5] calldata amounts,
|
19
|
+
bool use_underlying
|
20
|
+
) external;
|
21
|
+
function exchange(
|
22
|
+
int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount
|
23
|
+
) external;
|
24
|
+
function exchange_underlying(
|
25
|
+
int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount
|
26
|
+
) external;
|
27
|
+
function calc_token_amount(
|
28
|
+
uint256[5] calldata amounts,
|
29
|
+
bool deposit
|
30
|
+
) external view returns(uint);
|
31
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_6token {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[6] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
uint256[6] calldata amounts,
|
12
|
+
uint256 max_burn_amount
|
13
|
+
) external;
|
14
|
+
function remove_liquidity(
|
15
|
+
uint256 _amount,
|
16
|
+
uint256[6] calldata amounts
|
17
|
+
) external;
|
18
|
+
function exchange(
|
19
|
+
int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount
|
20
|
+
) external;
|
21
|
+
function calc_token_amount(
|
22
|
+
uint256[6] calldata amounts,
|
23
|
+
bool deposit
|
24
|
+
) external view returns(uint);
|
25
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_6token_meta {
|
5
|
+
function add_liquidity(
|
6
|
+
address pool,
|
7
|
+
uint256[6] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
address pool,
|
12
|
+
uint256[6] calldata amounts,
|
13
|
+
uint256 max_burn_amount
|
14
|
+
) external;
|
15
|
+
function remove_liquidity(
|
16
|
+
address pool,
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[6] calldata amounts
|
19
|
+
) external;
|
20
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
|
3
|
+
pragma solidity 0.6.12;
|
4
|
+
|
5
|
+
interface IHypervisor {
|
6
|
+
function token0() external view returns (address);
|
7
|
+
function token1() external view returns (address);
|
8
|
+
function getTotalAmounts() external view returns(uint256, uint256);
|
9
|
+
function pool() external view returns (address);
|
10
|
+
function deposit(
|
11
|
+
uint256,
|
12
|
+
uint256,
|
13
|
+
address,
|
14
|
+
address,
|
15
|
+
uint256[4] memory minIn
|
16
|
+
) external returns (uint256);
|
17
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
|
3
|
+
pragma solidity 0.6.12;
|
4
|
+
|
5
|
+
interface IStakingRewards {
|
6
|
+
// Views
|
7
|
+
|
8
|
+
function balanceOf(address account) external view returns (uint256);
|
9
|
+
|
10
|
+
function earned(address account) external view returns (uint256);
|
11
|
+
|
12
|
+
function getRewardForDuration() external view returns (uint256);
|
13
|
+
|
14
|
+
function lastTimeRewardApplicable() external view returns (uint256);
|
15
|
+
|
16
|
+
function rewardPerToken() external view returns (uint256);
|
17
|
+
|
18
|
+
function stakingToken() external view returns (address);
|
19
|
+
|
20
|
+
//function rewardsDistribution() external view returns (address);
|
21
|
+
|
22
|
+
//function rewardsToken() external view returns (address);
|
23
|
+
|
24
|
+
function totalSupply() external view returns (uint256);
|
25
|
+
|
26
|
+
// Mutative
|
27
|
+
|
28
|
+
function exit() external;
|
29
|
+
|
30
|
+
function getReward() external;
|
31
|
+
|
32
|
+
function stake(uint256 amount) external;
|
33
|
+
|
34
|
+
function withdraw(uint256 amount) external;
|
35
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
|
3
|
+
pragma solidity 0.6.12;
|
4
|
+
|
5
|
+
interface IUniProxy {
|
6
|
+
function deposit(
|
7
|
+
uint256 deposit0,
|
8
|
+
uint256 deposit1,
|
9
|
+
address to,
|
10
|
+
address pos,
|
11
|
+
uint256[4] memory minIn
|
12
|
+
) external;
|
13
|
+
function getSqrtTwapX96(address, uint32) external view returns(uint160);
|
14
|
+
function clearance() external view returns(address);
|
15
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
/// @dev an simple interface for integration dApp to swap
|
5
|
+
interface IDMMExchangeRouter {
|
6
|
+
function swapExactTokensForTokens(
|
7
|
+
uint256 amountIn,
|
8
|
+
uint256 amountOutMin,
|
9
|
+
address[] calldata poolsPath,
|
10
|
+
address[] calldata path,
|
11
|
+
address to,
|
12
|
+
uint256 deadline
|
13
|
+
) external returns (uint256[] memory amounts);
|
14
|
+
|
15
|
+
function swapTokensForExactTokens(
|
16
|
+
uint256 amountOut,
|
17
|
+
uint256 amountInMax,
|
18
|
+
address[] calldata poolsPath,
|
19
|
+
address[] calldata path,
|
20
|
+
address to,
|
21
|
+
uint256 deadline
|
22
|
+
) external returns (uint256[] memory amounts);
|
23
|
+
|
24
|
+
function swapExactETHForTokens(
|
25
|
+
uint256 amountOutMin,
|
26
|
+
address[] calldata poolsPath,
|
27
|
+
address[] calldata path,
|
28
|
+
address to,
|
29
|
+
uint256 deadline
|
30
|
+
) external payable returns (uint256[] memory amounts);
|
31
|
+
|
32
|
+
function swapTokensForExactETH(
|
33
|
+
uint256 amountOut,
|
34
|
+
uint256 amountInMax,
|
35
|
+
address[] calldata poolsPath,
|
36
|
+
address[] calldata path,
|
37
|
+
address to,
|
38
|
+
uint256 deadline
|
39
|
+
) external returns (uint256[] memory amounts);
|
40
|
+
|
41
|
+
function swapExactTokensForETH(
|
42
|
+
uint256 amountIn,
|
43
|
+
uint256 amountOutMin,
|
44
|
+
address[] calldata poolsPath,
|
45
|
+
address[] calldata path,
|
46
|
+
address to,
|
47
|
+
uint256 deadline
|
48
|
+
) external returns (uint256[] memory amounts);
|
49
|
+
|
50
|
+
function swapETHForExactTokens(
|
51
|
+
uint256 amountOut,
|
52
|
+
address[] calldata poolsPath,
|
53
|
+
address[] calldata path,
|
54
|
+
address to,
|
55
|
+
uint256 deadline
|
56
|
+
) external payable returns (uint256[] memory amounts);
|
57
|
+
|
58
|
+
function getAmountsOut(
|
59
|
+
uint256 amountIn,
|
60
|
+
address[] calldata poolsPath,
|
61
|
+
address[] calldata path
|
62
|
+
) external view returns (uint256[] memory amounts);
|
63
|
+
|
64
|
+
function getAmountsIn(
|
65
|
+
uint256 amountOut,
|
66
|
+
address[] calldata poolsPath,
|
67
|
+
address[] calldata path
|
68
|
+
) external view returns (uint256[] memory amounts);
|
69
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface IDMMFactory {
|
5
|
+
function createPool(
|
6
|
+
address tokenA,
|
7
|
+
address tokenB,
|
8
|
+
uint32 ampBps
|
9
|
+
) external returns (address pool);
|
10
|
+
|
11
|
+
function setFeeConfiguration(address feeTo, uint16 governmentFeeBps) external;
|
12
|
+
|
13
|
+
function setFeeToSetter(address) external;
|
14
|
+
|
15
|
+
function getFeeConfiguration() external view returns (address feeTo, uint16 governmentFeeBps);
|
16
|
+
|
17
|
+
function feeToSetter() external view returns (address);
|
18
|
+
|
19
|
+
function allPools(uint256) external view returns (address pool);
|
20
|
+
|
21
|
+
function allPoolsLength() external view returns (uint256);
|
22
|
+
|
23
|
+
function getUnamplifiedPool(address token0, address token1) external view returns (address);
|
24
|
+
|
25
|
+
function getPools(address token0, address token1)
|
26
|
+
external
|
27
|
+
view
|
28
|
+
returns (address[] memory _tokenPools);
|
29
|
+
|
30
|
+
function isPool(
|
31
|
+
address token0,
|
32
|
+
address token1,
|
33
|
+
address pool
|
34
|
+
) external view returns (bool);
|
35
|
+
}
|
@@ -0,0 +1,204 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
/// @dev an simple interface for integration dApp to contribute liquidity
|
5
|
+
interface IDMMLiquidityRouter {
|
6
|
+
/**
|
7
|
+
* @param tokenA address of token in the pool
|
8
|
+
* @param tokenB address of token in the pool
|
9
|
+
* @param pool the address of the pool
|
10
|
+
* @param amountADesired the amount of tokenA users want to add to the pool
|
11
|
+
* @param amountBDesired the amount of tokenB users want to add to the pool
|
12
|
+
* @param amountAMin bounds to the extents to which amountB/amountA can go up
|
13
|
+
* @param amountBMin bounds to the extents to which amountB/amountA can go down
|
14
|
+
* @param vReserveRatioBounds bounds to the extents to which vReserveB/vReserveA can go (precision: 2 ** 112)
|
15
|
+
* @param to Recipient of the liquidity tokens.
|
16
|
+
* @param deadline Unix timestamp after which the transaction will revert.
|
17
|
+
*/
|
18
|
+
function addLiquidity(
|
19
|
+
address tokenA,
|
20
|
+
address tokenB,
|
21
|
+
address pool,
|
22
|
+
uint256 amountADesired,
|
23
|
+
uint256 amountBDesired,
|
24
|
+
uint256 amountAMin,
|
25
|
+
uint256 amountBMin,
|
26
|
+
uint256[2] calldata vReserveRatioBounds,
|
27
|
+
address to,
|
28
|
+
uint256 deadline
|
29
|
+
)
|
30
|
+
external
|
31
|
+
returns (
|
32
|
+
uint256 amountA,
|
33
|
+
uint256 amountB,
|
34
|
+
uint256 liquidity
|
35
|
+
);
|
36
|
+
|
37
|
+
function addLiquidityNewPool(
|
38
|
+
address tokenA,
|
39
|
+
address tokenB,
|
40
|
+
uint32 ampBps,
|
41
|
+
uint256 amountADesired,
|
42
|
+
uint256 amountBDesired,
|
43
|
+
uint256 amountAMin,
|
44
|
+
uint256 amountBMin,
|
45
|
+
address to,
|
46
|
+
uint256 deadline
|
47
|
+
)
|
48
|
+
external
|
49
|
+
returns (
|
50
|
+
uint256 amountA,
|
51
|
+
uint256 amountB,
|
52
|
+
uint256 liquidity
|
53
|
+
);
|
54
|
+
|
55
|
+
function addLiquidityNewPoolETH(
|
56
|
+
address token,
|
57
|
+
uint32 ampBps,
|
58
|
+
uint256 amountTokenDesired,
|
59
|
+
uint256 amountTokenMin,
|
60
|
+
uint256 amountETHMin,
|
61
|
+
address to,
|
62
|
+
uint256 deadline
|
63
|
+
)
|
64
|
+
external
|
65
|
+
payable
|
66
|
+
returns (
|
67
|
+
uint256 amountToken,
|
68
|
+
uint256 amountETH,
|
69
|
+
uint256 liquidity
|
70
|
+
);
|
71
|
+
|
72
|
+
/**
|
73
|
+
* @param token address of token in the pool
|
74
|
+
* @param pool the address of the pool
|
75
|
+
* @param amountTokenDesired the amount of token users want to add to the pool
|
76
|
+
* @dev msg.value equals to amountEthDesired
|
77
|
+
* @param amountTokenMin bounds to the extents to which WETH/token can go up
|
78
|
+
* @param amountETHMin bounds to the extents to which WETH/token can go down
|
79
|
+
* @param vReserveRatioBounds bounds to the extents to which vReserveB/vReserveA can go (precision: 2 ** 112)
|
80
|
+
* @param to Recipient of the liquidity tokens.
|
81
|
+
* @param deadline Unix timestamp after which the transaction will revert.
|
82
|
+
*/
|
83
|
+
function addLiquidityETH(
|
84
|
+
address token,
|
85
|
+
address pool,
|
86
|
+
uint256 amountTokenDesired,
|
87
|
+
uint256 amountTokenMin,
|
88
|
+
uint256 amountETHMin,
|
89
|
+
uint256[2] calldata vReserveRatioBounds,
|
90
|
+
address to,
|
91
|
+
uint256 deadline
|
92
|
+
)
|
93
|
+
external
|
94
|
+
payable
|
95
|
+
returns (
|
96
|
+
uint256 amountToken,
|
97
|
+
uint256 amountETH,
|
98
|
+
uint256 liquidity
|
99
|
+
);
|
100
|
+
|
101
|
+
/**
|
102
|
+
* @param tokenA address of token in the pool
|
103
|
+
* @param tokenB address of token in the pool
|
104
|
+
* @param pool the address of the pool
|
105
|
+
* @param liquidity the amount of lp token users want to burn
|
106
|
+
* @param amountAMin the minimum token retuned after burning
|
107
|
+
* @param amountBMin the minimum token retuned after burning
|
108
|
+
* @param to Recipient of the returned tokens.
|
109
|
+
* @param deadline Unix timestamp after which the transaction will revert.
|
110
|
+
*/
|
111
|
+
function removeLiquidity(
|
112
|
+
address tokenA,
|
113
|
+
address tokenB,
|
114
|
+
address pool,
|
115
|
+
uint256 liquidity,
|
116
|
+
uint256 amountAMin,
|
117
|
+
uint256 amountBMin,
|
118
|
+
address to,
|
119
|
+
uint256 deadline
|
120
|
+
) external returns (uint256 amountA, uint256 amountB);
|
121
|
+
|
122
|
+
/**
|
123
|
+
* @param tokenA address of token in the pool
|
124
|
+
* @param tokenB address of token in the pool
|
125
|
+
* @param pool the address of the pool
|
126
|
+
* @param liquidity the amount of lp token users want to burn
|
127
|
+
* @param amountAMin the minimum token retuned after burning
|
128
|
+
* @param amountBMin the minimum token retuned after burning
|
129
|
+
* @param to Recipient of the returned tokens.
|
130
|
+
* @param deadline Unix timestamp after which the transaction will revert.
|
131
|
+
* @param approveMax whether users permit the router spending max lp token or not.
|
132
|
+
* @param r s v Signature of user to permit the router spending lp token
|
133
|
+
*/
|
134
|
+
function removeLiquidityWithPermit(
|
135
|
+
address tokenA,
|
136
|
+
address tokenB,
|
137
|
+
address pool,
|
138
|
+
uint256 liquidity,
|
139
|
+
uint256 amountAMin,
|
140
|
+
uint256 amountBMin,
|
141
|
+
address to,
|
142
|
+
uint256 deadline,
|
143
|
+
bool approveMax,
|
144
|
+
uint8 v,
|
145
|
+
bytes32 r,
|
146
|
+
bytes32 s
|
147
|
+
) external returns (uint256 amountA, uint256 amountB);
|
148
|
+
|
149
|
+
/**
|
150
|
+
* @param token address of token in the pool
|
151
|
+
* @param pool the address of the pool
|
152
|
+
* @param liquidity the amount of lp token users want to burn
|
153
|
+
* @param amountTokenMin the minimum token retuned after burning
|
154
|
+
* @param amountETHMin the minimum eth in wei retuned after burning
|
155
|
+
* @param to Recipient of the returned tokens.
|
156
|
+
* @param deadline Unix timestamp after which the transaction will revert
|
157
|
+
*/
|
158
|
+
function removeLiquidityETH(
|
159
|
+
address token,
|
160
|
+
address pool,
|
161
|
+
uint256 liquidity,
|
162
|
+
uint256 amountTokenMin,
|
163
|
+
uint256 amountETHMin,
|
164
|
+
address to,
|
165
|
+
uint256 deadline
|
166
|
+
) external returns (uint256 amountToken, uint256 amountETH);
|
167
|
+
|
168
|
+
/**
|
169
|
+
* @param token address of token in the pool
|
170
|
+
* @param pool the address of the pool
|
171
|
+
* @param liquidity the amount of lp token users want to burn
|
172
|
+
* @param amountTokenMin the minimum token retuned after burning
|
173
|
+
* @param amountETHMin the minimum eth in wei retuned after burning
|
174
|
+
* @param to Recipient of the returned tokens.
|
175
|
+
* @param deadline Unix timestamp after which the transaction will revert
|
176
|
+
* @param approveMax whether users permit the router spending max lp token
|
177
|
+
* @param r s v signatures of user to permit the router spending lp token.
|
178
|
+
*/
|
179
|
+
function removeLiquidityETHWithPermit(
|
180
|
+
address token,
|
181
|
+
address pool,
|
182
|
+
uint256 liquidity,
|
183
|
+
uint256 amountTokenMin,
|
184
|
+
uint256 amountETHMin,
|
185
|
+
address to,
|
186
|
+
uint256 deadline,
|
187
|
+
bool approveMax,
|
188
|
+
uint8 v,
|
189
|
+
bytes32 r,
|
190
|
+
bytes32 s
|
191
|
+
) external returns (uint256 amountToken, uint256 amountETH);
|
192
|
+
|
193
|
+
/**
|
194
|
+
* @param amountA amount of 1 side token added to the pool
|
195
|
+
* @param reserveA current reserve of the pool
|
196
|
+
* @param reserveB current reserve of the pool
|
197
|
+
* @return amountB amount of the other token added to the pool
|
198
|
+
*/
|
199
|
+
function quote(
|
200
|
+
uint256 amountA,
|
201
|
+
uint256 reserveA,
|
202
|
+
uint256 reserveB
|
203
|
+
) external pure returns (uint256 amountB);
|
204
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface IDMMPool {
|
5
|
+
function totalSupply() external view returns (uint256);
|
6
|
+
|
7
|
+
function mint(address to) external returns (uint256 liquidity);
|
8
|
+
|
9
|
+
function burn(address to) external returns (uint256 amount0, uint256 amount1);
|
10
|
+
|
11
|
+
function swap(
|
12
|
+
uint256 amount0Out,
|
13
|
+
uint256 amount1Out,
|
14
|
+
address to,
|
15
|
+
bytes calldata data
|
16
|
+
) external;
|
17
|
+
|
18
|
+
function sync() external;
|
19
|
+
|
20
|
+
function getReserves() external view returns (uint112 reserve0, uint112 reserve1);
|
21
|
+
|
22
|
+
function getTradeInfo()
|
23
|
+
external
|
24
|
+
view
|
25
|
+
returns (
|
26
|
+
uint112 _vReserve0,
|
27
|
+
uint112 _vReserve1,
|
28
|
+
uint112 reserve0,
|
29
|
+
uint112 reserve1,
|
30
|
+
uint256 feeInPrecision
|
31
|
+
);
|
32
|
+
|
33
|
+
function token0() external view returns (address);
|
34
|
+
|
35
|
+
function token1() external view returns (address);
|
36
|
+
|
37
|
+
function ampBps() external view returns (uint32);
|
38
|
+
|
39
|
+
function factory() external view returns (address);
|
40
|
+
|
41
|
+
function kLast() external view returns (uint256);
|
42
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
import "./IDMMExchangeRouter.sol";
|
4
|
+
import "./IDMMLiquidityRouter.sol";
|
5
|
+
|
6
|
+
|
7
|
+
/// @dev full interface for router
|
8
|
+
interface IDMMRouter01 is IDMMExchangeRouter, IDMMLiquidityRouter {
|
9
|
+
function factory() external pure returns (address);
|
10
|
+
|
11
|
+
function weth() external pure returns (address);
|
12
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
import "./IDMMRouter01.sol";
|
4
|
+
|
5
|
+
interface IDMMRouter02 is IDMMRouter01 {
|
6
|
+
function removeLiquidityETHSupportingFeeOnTransferTokens(
|
7
|
+
address token,
|
8
|
+
address pool,
|
9
|
+
uint256 liquidity,
|
10
|
+
uint256 amountTokenMin,
|
11
|
+
uint256 amountETHMin,
|
12
|
+
address to,
|
13
|
+
uint256 deadline
|
14
|
+
) external returns (uint256 amountETH);
|
15
|
+
|
16
|
+
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
|
17
|
+
address token,
|
18
|
+
address pool,
|
19
|
+
uint256 liquidity,
|
20
|
+
uint256 amountTokenMin,
|
21
|
+
uint256 amountETHMin,
|
22
|
+
address to,
|
23
|
+
uint256 deadline,
|
24
|
+
bool approveMax,
|
25
|
+
uint8 v,
|
26
|
+
bytes32 r,
|
27
|
+
bytes32 s
|
28
|
+
) external returns (uint256 amountETH);
|
29
|
+
|
30
|
+
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
|
31
|
+
uint256 amountIn,
|
32
|
+
uint256 amountOutMin,
|
33
|
+
address[] calldata poolsPath,
|
34
|
+
address[] calldata path,
|
35
|
+
address to,
|
36
|
+
uint256 deadline
|
37
|
+
) external;
|
38
|
+
|
39
|
+
function swapExactETHForTokensSupportingFeeOnTransferTokens(
|
40
|
+
uint256 amountOutMin,
|
41
|
+
address[] calldata poolsPath,
|
42
|
+
address[] calldata path,
|
43
|
+
address to,
|
44
|
+
uint256 deadline
|
45
|
+
) external payable;
|
46
|
+
|
47
|
+
function swapExactTokensForETHSupportingFeeOnTransferTokens(
|
48
|
+
uint256 amountIn,
|
49
|
+
uint256 amountOutMin,
|
50
|
+
address[] calldata poolsPath,
|
51
|
+
address[] calldata path,
|
52
|
+
address to,
|
53
|
+
uint256 deadline
|
54
|
+
) external;
|
55
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface IGauge {
|
5
|
+
function TOKEN() external view returns (address);
|
6
|
+
function balanceOf(address account) external view returns (uint256);
|
7
|
+
function rewardToken() external view returns (address);
|
8
|
+
function deposit(uint256 amount) external;
|
9
|
+
function getReward() external;
|
10
|
+
function withdraw(uint256 amount) external;
|
11
|
+
function withdrawAll() external;
|
12
|
+
function withdrawAllAndHarvest() external;
|
13
|
+
}
|