@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,185 @@
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
2
|
+
// This program is free software: you can redistribute it and/or modify
|
3
|
+
// it under the terms of the GNU General Public License as published by
|
4
|
+
// the Free Software Foundation, either version 3 of the License, or
|
5
|
+
// (at your option) any later version.
|
6
|
+
|
7
|
+
// This program is distributed in the hope that it will be useful,
|
8
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
// GNU General Public License for more details.
|
11
|
+
|
12
|
+
// You should have received a copy of the GNU General Public License
|
13
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
14
|
+
|
15
|
+
pragma solidity 0.6.12;
|
16
|
+
pragma experimental ABIEncoderV2;
|
17
|
+
|
18
|
+
import "./IPoolSwapStructs.sol";
|
19
|
+
|
20
|
+
interface IBasePool is IPoolSwapStructs {
|
21
|
+
/**
|
22
|
+
* @dev Called by the Vault when a user calls `IVault.joinPool` to add liquidity to this Pool. Returns how many of
|
23
|
+
* each registered token the user should provide, as well as the amount of protocol fees the Pool owes to the Vault.
|
24
|
+
* The Vault will then take tokens from `sender` and add them to the Pool's balances, as well as collect
|
25
|
+
* the reported amount in protocol fees, which the pool should calculate based on `protocolSwapFeePercentage`.
|
26
|
+
*
|
27
|
+
* Protocol fees are reported and charged on join events so that the Pool is free of debt whenever new users join.
|
28
|
+
*
|
29
|
+
* `sender` is the account performing the join (from which tokens will be withdrawn), and `recipient` is the account
|
30
|
+
* designated to receive any benefits (typically pool shares). `balances` contains the total balances
|
31
|
+
* for each token the Pool registered in the Vault, in the same order that `IVault.getPoolTokens` would return.
|
32
|
+
*
|
33
|
+
* `lastChangeBlock` is the last block in which *any* of the Pool's registered tokens last changed its total
|
34
|
+
* balance.
|
35
|
+
*
|
36
|
+
* `userData` contains any pool-specific instructions needed to perform the calculations, such as the type of
|
37
|
+
* join (e.g., proportional given an amount of pool shares, single-asset, multi-asset, etc.)
|
38
|
+
*
|
39
|
+
* Contracts implementing this function should check that the caller is indeed the Vault before performing any
|
40
|
+
* state-changing operations, such as minting pool shares.
|
41
|
+
*/
|
42
|
+
function onJoinPool(
|
43
|
+
bytes32 poolId,
|
44
|
+
address sender,
|
45
|
+
address recipient,
|
46
|
+
uint256[] memory balances,
|
47
|
+
uint256 lastChangeBlock,
|
48
|
+
uint256 protocolSwapFeePercentage,
|
49
|
+
bytes memory userData
|
50
|
+
) external returns (uint256[] memory amountsIn, uint256[] memory dueProtocolFeeAmounts);
|
51
|
+
|
52
|
+
/**
|
53
|
+
* @dev Called by the Vault when a user calls `IVault.exitPool` to remove liquidity from this Pool. Returns how many
|
54
|
+
* tokens the Vault should deduct from the Pool's balances, as well as the amount of protocol fees the Pool owes
|
55
|
+
* to the Vault. The Vault will then take tokens from the Pool's balances and send them to `recipient`,
|
56
|
+
* as well as collect the reported amount in protocol fees, which the Pool should calculate based on
|
57
|
+
* `protocolSwapFeePercentage`.
|
58
|
+
*
|
59
|
+
* Protocol fees are charged on exit events to guarantee that users exiting the Pool have paid their share.
|
60
|
+
*
|
61
|
+
* `sender` is the account performing the exit (typically the pool shareholder), and `recipient` is the account
|
62
|
+
* to which the Vault will send the proceeds. `balances` contains the total token balances for each token
|
63
|
+
* the Pool registered in the Vault, in the same order that `IVault.getPoolTokens` would return.
|
64
|
+
*
|
65
|
+
* `lastChangeBlock` is the last block in which *any* of the Pool's registered tokens last changed its total
|
66
|
+
* balance.
|
67
|
+
*
|
68
|
+
* `userData` contains any pool-specific instructions needed to perform the calculations, such as the type of
|
69
|
+
* exit (e.g., proportional given an amount of pool shares, single-asset, multi-asset, etc.)
|
70
|
+
*
|
71
|
+
* Contracts implementing this function should check that the caller is indeed the Vault before performing any
|
72
|
+
* state-changing operations, such as burning pool shares.
|
73
|
+
*/
|
74
|
+
function onExitPool(
|
75
|
+
bytes32 poolId,
|
76
|
+
address sender,
|
77
|
+
address recipient,
|
78
|
+
uint256[] memory balances,
|
79
|
+
uint256 lastChangeBlock,
|
80
|
+
uint256 protocolSwapFeePercentage,
|
81
|
+
bytes memory userData
|
82
|
+
) external returns (uint256[] memory amountsOut, uint256[] memory dueProtocolFeeAmounts);
|
83
|
+
|
84
|
+
/**
|
85
|
+
* @dev Returns this Pool's ID, used when interacting with the Vault (to e.g. join the Pool or swap with it).
|
86
|
+
*/
|
87
|
+
function getPoolId() external view returns (bytes32);
|
88
|
+
|
89
|
+
/**
|
90
|
+
* @dev Returns the current swap fee percentage as a 18 decimal fixed point number, so e.g. 1e17 corresponds to a
|
91
|
+
* 10% swap fee.
|
92
|
+
*/
|
93
|
+
function getSwapFeePercentage() external view returns (uint256);
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @dev Returns the scaling factors of each of the Pool's tokens. This is an implementation detail that is typically
|
97
|
+
* not relevant for outside parties, but which might be useful for some types of Pools.
|
98
|
+
*/
|
99
|
+
function getScalingFactors() external view returns (uint256[] memory);
|
100
|
+
|
101
|
+
function queryJoin(
|
102
|
+
bytes32 poolId,
|
103
|
+
address sender,
|
104
|
+
address recipient,
|
105
|
+
uint256[] memory balances,
|
106
|
+
uint256 lastChangeBlock,
|
107
|
+
uint256 protocolSwapFeePercentage,
|
108
|
+
bytes memory userData
|
109
|
+
) external returns (uint256 bptOut, uint256[] memory amountsIn);
|
110
|
+
|
111
|
+
function queryExit(
|
112
|
+
bytes32 poolId,
|
113
|
+
address sender,
|
114
|
+
address recipient,
|
115
|
+
uint256[] memory balances,
|
116
|
+
uint256 lastChangeBlock,
|
117
|
+
uint256 protocolSwapFeePercentage,
|
118
|
+
bytes memory userData
|
119
|
+
) external returns (uint256 bptIn, uint256[] memory amountsOut);
|
120
|
+
}
|
121
|
+
|
122
|
+
interface ILinearPool is IBasePool {
|
123
|
+
/**
|
124
|
+
* @dev Returns the Pool's main token.
|
125
|
+
*/
|
126
|
+
function getMainToken() external view returns (address);
|
127
|
+
|
128
|
+
/**
|
129
|
+
* @dev Returns the Pool's wrapped token.
|
130
|
+
*/
|
131
|
+
function getWrappedToken() external view returns (address);
|
132
|
+
|
133
|
+
/**
|
134
|
+
* @dev Returns the index of the Pool's BPT in the Pool tokens array (as returned by IVault.getPoolTokens).
|
135
|
+
*/
|
136
|
+
function getBptIndex() external view returns (uint256);
|
137
|
+
|
138
|
+
/**
|
139
|
+
* @dev Returns the index of the Pool's main token in the Pool tokens array (as returned by IVault.getPoolTokens).
|
140
|
+
*/
|
141
|
+
function getMainIndex() external view returns (uint256);
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @dev Returns the index of the Pool's wrapped token in the Pool tokens array (as returned by
|
145
|
+
* IVault.getPoolTokens).
|
146
|
+
*/
|
147
|
+
function getWrappedIndex() external view returns (uint256);
|
148
|
+
|
149
|
+
/**
|
150
|
+
* @dev Returns the Pool's targets for the main token balance. These values have had the main token's scaling
|
151
|
+
* factor applied to them.
|
152
|
+
*/
|
153
|
+
function getTargets() external view returns (uint256 lowerTarget, uint256 upperTarget);
|
154
|
+
|
155
|
+
/**
|
156
|
+
* @notice Set the lower and upper bounds of the zero-fee trading range for the main token balance.
|
157
|
+
* @dev For a new target range to be valid:
|
158
|
+
* - the current balance must be between the current targets (meaning no fees are currently pending)
|
159
|
+
* - the current balance must be between the new targets (meaning setting them does not create pending fees)
|
160
|
+
*
|
161
|
+
* The first requirement could be relaxed, as the LPs actually benefit from the pending fees not being paid out,
|
162
|
+
* but being stricter makes analysis easier at little expense.
|
163
|
+
*
|
164
|
+
* This is a permissioned function, reserved for the pool owner. It will revert when called within a Vault context
|
165
|
+
* (i.e. in the middle of a join or an exit).
|
166
|
+
*
|
167
|
+
* Correct behavior depends on the token balances from the Vault, which may be out of sync with the state of
|
168
|
+
* the pool during execution of a Vault hook.
|
169
|
+
*
|
170
|
+
* See https://forum.balancer.fi/t/reentrancy-vulnerability-scope-expanded/4345 for reference.
|
171
|
+
*/
|
172
|
+
function setTargets(uint256 newLowerTarget, uint256 newUpperTarget) external;
|
173
|
+
|
174
|
+
/**
|
175
|
+
* @notice Set the swap fee percentage.
|
176
|
+
* @dev This is a permissioned function, reserved for the pool owner. It will revert when called within a Vault
|
177
|
+
* context (i.e. in the middle of a join or an exit).
|
178
|
+
*
|
179
|
+
* Correct behavior depends on the token balances from the Vault, which may be out of sync with the state of
|
180
|
+
* the pool during execution of a Vault hook.
|
181
|
+
*
|
182
|
+
* See https://forum.balancer.fi/t/reentrancy-vulnerability-scope-expanded/4345 for reference.
|
183
|
+
*/
|
184
|
+
function setSwapFeePercentage(uint256 swapFeePercentage) external;
|
185
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// SPDX-License-Identifier: Unlicense
|
2
|
+
|
3
|
+
pragma solidity 0.6.12;
|
4
|
+
|
5
|
+
interface ILinearPoolFactory {
|
6
|
+
function create(
|
7
|
+
string memory name,
|
8
|
+
string memory symbol,
|
9
|
+
address mainToken,
|
10
|
+
address wrappedToken,
|
11
|
+
uint256 upperTarget,
|
12
|
+
uint256 swapFeePercentage,
|
13
|
+
address owner,
|
14
|
+
uint256 protocolId
|
15
|
+
) external returns (address);
|
16
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
2
|
+
// This program is free software: you can redistribute it and/or modify
|
3
|
+
// it under the terms of the GNU General Public License as published by
|
4
|
+
// the Free Software Foundation, either version 3 of the License, or
|
5
|
+
// (at your option) any later version.
|
6
|
+
|
7
|
+
// This program is distributed in the hope that it will be useful,
|
8
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
+
// GNU General Public License for more details.
|
11
|
+
|
12
|
+
// You should have received a copy of the GNU General Public License
|
13
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
14
|
+
|
15
|
+
pragma solidity 0.6.12;
|
16
|
+
pragma experimental ABIEncoderV2;
|
17
|
+
|
18
|
+
import "../IBVault.sol";
|
19
|
+
|
20
|
+
interface IPoolSwapStructs {
|
21
|
+
// This is not really an interface - it just defines common structs used by other interfaces: IGeneralPool and
|
22
|
+
// IMinimalSwapInfoPool.
|
23
|
+
//
|
24
|
+
// This data structure represents a request for a token swap, where `kind` indicates the swap type ('given in' or
|
25
|
+
// 'given out') which indicates whether or not the amount sent by the pool is known.
|
26
|
+
//
|
27
|
+
// The pool receives `tokenIn` and sends `tokenOut`. `amount` is the number of `tokenIn` tokens the pool will take
|
28
|
+
// in, or the number of `tokenOut` tokens the Pool will send out, depending on the given swap `kind`.
|
29
|
+
//
|
30
|
+
// All other fields are not strictly necessary for most swaps, but are provided to support advanced scenarios in
|
31
|
+
// some Pools.
|
32
|
+
//
|
33
|
+
// `poolId` is the ID of the Pool involved in the swap - this is useful for Pool contracts that implement more than
|
34
|
+
// one Pool.
|
35
|
+
//
|
36
|
+
// The meaning of `lastChangeBlock` depends on the Pool specialization:
|
37
|
+
// - Two Token or Minimal Swap Info: the last block in which either `tokenIn` or `tokenOut` changed its total
|
38
|
+
// balance.
|
39
|
+
// - General: the last block in which *any* of the Pool's registered tokens changed its total balance.
|
40
|
+
//
|
41
|
+
// `from` is the origin address for the funds the Pool receives, and `to` is the destination address
|
42
|
+
// where the Pool sends the outgoing tokens.
|
43
|
+
//
|
44
|
+
// `userData` is extra data provided by the caller - typically a signature from a trusted party.
|
45
|
+
struct SwapRequest {
|
46
|
+
IBVault.SwapKind kind;
|
47
|
+
address tokenIn;
|
48
|
+
address tokenOut;
|
49
|
+
uint256 amount;
|
50
|
+
// Misc data
|
51
|
+
bytes32 poolId;
|
52
|
+
uint256 lastChangeBlock;
|
53
|
+
address from;
|
54
|
+
address to;
|
55
|
+
bytes userData;
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICaviarChef {
|
5
|
+
function balanceOf() external view returns(uint256);
|
6
|
+
function userInfo(address _user) external view returns (uint256, uint256);
|
7
|
+
function update(address from, address to) external;
|
8
|
+
function harvestRebase(address from, address to) external;
|
9
|
+
function underlying() external view returns (address);
|
10
|
+
function seedRewards(uint256 _amount) external;
|
11
|
+
function claimEmissions() external returns (uint256);
|
12
|
+
function harvest(address to) external;
|
13
|
+
function deposit(uint256 amount, address to) external;
|
14
|
+
function withdraw(uint256 amount, address to) external;
|
15
|
+
function withdrawAndHarvest(uint256 amount, address to) external;
|
16
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
pragma experimental ABIEncoderV2;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @title Compound's Comet Main Interface (without Ext)
|
7
|
+
* @notice An efficient monolithic money market protocol
|
8
|
+
* @author Compound
|
9
|
+
*/
|
10
|
+
interface IComet {
|
11
|
+
struct AssetInfo {
|
12
|
+
uint8 offset;
|
13
|
+
address asset;
|
14
|
+
address priceFeed;
|
15
|
+
uint64 scale;
|
16
|
+
uint64 borrowCollateralFactor;
|
17
|
+
uint64 liquidateCollateralFactor;
|
18
|
+
uint64 liquidationFactor;
|
19
|
+
uint128 supplyCap;
|
20
|
+
}
|
21
|
+
|
22
|
+
function supply(address asset, uint amount) external;
|
23
|
+
function supplyTo(address dst, address asset, uint amount) external;
|
24
|
+
function supplyFrom(address from, address dst, address asset, uint amount) external;
|
25
|
+
|
26
|
+
function transfer(address dst, uint amount) external returns (bool);
|
27
|
+
function transferFrom(address src, address dst, uint amount) external returns (bool);
|
28
|
+
|
29
|
+
function transferAsset(address dst, address asset, uint amount) external;
|
30
|
+
function transferAssetFrom(address src, address dst, address asset, uint amount) external;
|
31
|
+
|
32
|
+
function withdraw(address asset, uint amount) external;
|
33
|
+
function withdrawTo(address to, address asset, uint amount) external;
|
34
|
+
function withdrawFrom(address src, address to, address asset, uint amount) external;
|
35
|
+
|
36
|
+
function approveThis(address manager, address asset, uint amount) external;
|
37
|
+
function withdrawReserves(address to, uint amount) external;
|
38
|
+
|
39
|
+
function absorb(address absorber, address[] calldata accounts) external;
|
40
|
+
function buyCollateral(address asset, uint minAmount, uint baseAmount, address recipient) external;
|
41
|
+
function quoteCollateral(address asset, uint baseAmount) external view returns (uint);
|
42
|
+
|
43
|
+
function getAssetInfo(uint8 i) external view returns (AssetInfo memory);
|
44
|
+
function getAssetInfoByAddress(address asset) external view returns (AssetInfo memory);
|
45
|
+
function getCollateralReserves(address asset) external view returns (uint);
|
46
|
+
function getReserves() external view returns (int);
|
47
|
+
function getPrice(address priceFeed) external view returns (uint);
|
48
|
+
|
49
|
+
function isBorrowCollateralized(address account) external view returns (bool);
|
50
|
+
function isLiquidatable(address account) external view returns (bool);
|
51
|
+
|
52
|
+
function totalSupply() external view returns (uint256);
|
53
|
+
function totalBorrow() external view returns (uint256);
|
54
|
+
function balanceOf(address owner) external view returns (uint256);
|
55
|
+
function borrowBalanceOf(address account) external view returns (uint256);
|
56
|
+
|
57
|
+
function pause(bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused) external;
|
58
|
+
function isSupplyPaused() external view returns (bool);
|
59
|
+
function isTransferPaused() external view returns (bool);
|
60
|
+
function isWithdrawPaused() external view returns (bool);
|
61
|
+
function isAbsorbPaused() external view returns (bool);
|
62
|
+
function isBuyPaused() external view returns (bool);
|
63
|
+
|
64
|
+
function accrueAccount(address account) external;
|
65
|
+
function getSupplyRate(uint utilization) external view returns (uint64);
|
66
|
+
function getBorrowRate(uint utilization) external view returns (uint64);
|
67
|
+
function getUtilization() external view returns (uint);
|
68
|
+
|
69
|
+
function governor() external view returns (address);
|
70
|
+
function pauseGuardian() external view returns (address);
|
71
|
+
function baseToken() external view returns (address);
|
72
|
+
function baseTokenPriceFeed() external view returns (address);
|
73
|
+
function extensionDelegate() external view returns (address);
|
74
|
+
|
75
|
+
/// @dev uint64
|
76
|
+
function supplyKink() external view returns (uint);
|
77
|
+
/// @dev uint64
|
78
|
+
function supplyPerSecondInterestRateSlopeLow() external view returns (uint);
|
79
|
+
/// @dev uint64
|
80
|
+
function supplyPerSecondInterestRateSlopeHigh() external view returns (uint);
|
81
|
+
/// @dev uint64
|
82
|
+
function supplyPerSecondInterestRateBase() external view returns (uint);
|
83
|
+
/// @dev uint64
|
84
|
+
function borrowKink() external view returns (uint);
|
85
|
+
/// @dev uint64
|
86
|
+
function borrowPerSecondInterestRateSlopeLow() external view returns (uint);
|
87
|
+
/// @dev uint64
|
88
|
+
function borrowPerSecondInterestRateSlopeHigh() external view returns (uint);
|
89
|
+
/// @dev uint64
|
90
|
+
function borrowPerSecondInterestRateBase() external view returns (uint);
|
91
|
+
/// @dev uint64
|
92
|
+
function storeFrontPriceFactor() external view returns (uint);
|
93
|
+
|
94
|
+
/// @dev uint64
|
95
|
+
function baseScale() external view returns (uint);
|
96
|
+
/// @dev uint64
|
97
|
+
function trackingIndexScale() external view returns (uint);
|
98
|
+
|
99
|
+
/// @dev uint64
|
100
|
+
function baseTrackingSupplySpeed() external view returns (uint);
|
101
|
+
/// @dev uint64
|
102
|
+
function baseTrackingBorrowSpeed() external view returns (uint);
|
103
|
+
/// @dev uint104
|
104
|
+
function baseMinForRewards() external view returns (uint);
|
105
|
+
/// @dev uint104
|
106
|
+
function baseBorrowMin() external view returns (uint);
|
107
|
+
/// @dev uint104
|
108
|
+
function targetReserves() external view returns (uint);
|
109
|
+
|
110
|
+
function numAssets() external view returns (uint8);
|
111
|
+
function decimals() external view returns (uint8);
|
112
|
+
|
113
|
+
function initializeStorage() external;
|
114
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
pragma experimental ABIEncoderV2;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @title Compound's CometRewards Contract
|
7
|
+
* @notice Hold and claim token rewards
|
8
|
+
* @author Compound
|
9
|
+
*/
|
10
|
+
interface ICometRewards {
|
11
|
+
struct RewardOwed {
|
12
|
+
address token;
|
13
|
+
uint owed;
|
14
|
+
}
|
15
|
+
function claim(address comet, address src, bool accrue) external;
|
16
|
+
function getRewardOwed(address comet, address account) external returns (RewardOwed memory);
|
17
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface Gauge {
|
5
|
+
function deposit(uint) external;
|
6
|
+
function balanceOf(address) external view returns (uint);
|
7
|
+
function withdraw(uint) external;
|
8
|
+
function user_checkpoint(address) external;
|
9
|
+
function claim_rewards() external;
|
10
|
+
}
|
11
|
+
|
12
|
+
interface VotingEscrow {
|
13
|
+
function create_lock(uint256 v, uint256 time) external;
|
14
|
+
function increase_amount(uint256 _value) external;
|
15
|
+
function increase_unlock_time(uint256 _unlock_time) external;
|
16
|
+
function withdraw() external;
|
17
|
+
}
|
18
|
+
|
19
|
+
interface Mintr {
|
20
|
+
function mint(address) external;
|
21
|
+
}
|
22
|
+
|
23
|
+
interface ICurveLP {
|
24
|
+
function minter() external view returns(address);
|
25
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_2token {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[2] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external payable;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
uint256[2] calldata amounts,
|
12
|
+
uint256 max_burn_amount
|
13
|
+
) external;
|
14
|
+
function remove_liquidity(
|
15
|
+
uint256 _amount,
|
16
|
+
uint256[2] calldata amounts
|
17
|
+
) external;
|
18
|
+
function exchange(
|
19
|
+
int128 from, int128 to, uint256 _from_amount, uint256 _min_to_amount
|
20
|
+
) external payable;
|
21
|
+
function calc_token_amount(
|
22
|
+
uint256[2] calldata amounts,
|
23
|
+
bool deposit
|
24
|
+
) external view returns(uint);
|
25
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_2token_underlying {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[2] calldata amounts,
|
8
|
+
uint256 min_mint_amount,
|
9
|
+
bool use_underlying
|
10
|
+
) external;
|
11
|
+
function remove_liquidity_imbalance(
|
12
|
+
uint256[2] calldata amounts,
|
13
|
+
uint256 max_burn_amount,
|
14
|
+
bool use_underlying
|
15
|
+
) external;
|
16
|
+
function remove_liquidity(
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[2] 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[2] 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_3token {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[3] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
uint256[3] calldata amounts,
|
12
|
+
uint256 max_burn_amount
|
13
|
+
) external;
|
14
|
+
function remove_liquidity(
|
15
|
+
uint256 _amount,
|
16
|
+
uint256[3] 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[3] 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_3token_meta {
|
5
|
+
function add_liquidity(
|
6
|
+
address pool,
|
7
|
+
uint256[3] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
address pool,
|
12
|
+
uint256[3] calldata amounts,
|
13
|
+
uint256 max_burn_amount
|
14
|
+
) external;
|
15
|
+
function remove_liquidity(
|
16
|
+
address pool,
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[3] calldata amounts
|
19
|
+
) external;
|
20
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_3token_underlying {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[3] calldata amounts,
|
8
|
+
uint256 min_mint_amount,
|
9
|
+
bool use_underlying
|
10
|
+
) external;
|
11
|
+
function remove_liquidity_imbalance(
|
12
|
+
uint256[3] calldata amounts,
|
13
|
+
uint256 max_burn_amount,
|
14
|
+
bool use_underlying
|
15
|
+
) external;
|
16
|
+
function remove_liquidity(
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[3] 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[3] 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_4token {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[4] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
uint256[4] calldata amounts,
|
12
|
+
uint256 max_burn_amount
|
13
|
+
) external;
|
14
|
+
function remove_liquidity(
|
15
|
+
uint256 _amount,
|
16
|
+
uint256[4] 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[4] 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_4token_meta {
|
5
|
+
function add_liquidity(
|
6
|
+
address pool,
|
7
|
+
uint256[4] calldata amounts,
|
8
|
+
uint256 min_mint_amount
|
9
|
+
) external;
|
10
|
+
function remove_liquidity_imbalance(
|
11
|
+
address pool,
|
12
|
+
uint256[4] calldata amounts,
|
13
|
+
uint256 max_burn_amount
|
14
|
+
) external;
|
15
|
+
function remove_liquidity(
|
16
|
+
address pool,
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[4] calldata amounts
|
19
|
+
) external;
|
20
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
//SPDX-License-Identifier: Unlicense
|
2
|
+
pragma solidity 0.6.12;
|
3
|
+
|
4
|
+
interface ICurveDeposit_4token_underlying {
|
5
|
+
function get_virtual_price() external view returns (uint);
|
6
|
+
function add_liquidity(
|
7
|
+
uint256[4] calldata amounts,
|
8
|
+
uint256 min_mint_amount,
|
9
|
+
bool use_underlying
|
10
|
+
) external;
|
11
|
+
function remove_liquidity_imbalance(
|
12
|
+
uint256[4] calldata amounts,
|
13
|
+
uint256 max_burn_amount,
|
14
|
+
bool use_underlying
|
15
|
+
) external;
|
16
|
+
function remove_liquidity(
|
17
|
+
uint256 _amount,
|
18
|
+
uint256[4] 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[4] calldata amounts,
|
29
|
+
bool deposit
|
30
|
+
) external view returns(uint);
|
31
|
+
}
|