@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.

Files changed (485) hide show
  1. package/README.md +110 -5
  2. package/contracts/base/Controller.sol +125 -0
  3. package/contracts/base/ControllerV2.sol +363 -0
  4. package/contracts/base/FeeRewardForwarder.sol +163 -0
  5. package/contracts/base/PotPool.sol +360 -0
  6. package/contracts/base/ProfitSharingReceiver.sol +39 -0
  7. package/contracts/base/RewardForwarderV2.sol +109 -0
  8. package/contracts/base/Vault.sol +344 -0
  9. package/contracts/base/VaultERC4626.sol +113 -0
  10. package/contracts/base/VaultProxy.sol +35 -0
  11. package/contracts/base/VaultStorage.sol +199 -0
  12. package/contracts/base/VaultStorageV2.sol +196 -0
  13. package/contracts/base/VaultV2.sol +369 -0
  14. package/contracts/base/ape-base/MiniApeV2Strategy.sol +322 -0
  15. package/contracts/base/ape-base/interface/IMiniChefV2.sol +31 -0
  16. package/contracts/base/ape-base/interface/IRewarder.sol +10 -0
  17. package/contracts/base/factory/MegaFactory.sol +120 -0
  18. package/contracts/base/factory/interface/IPoolFactory.sol +6 -0
  19. package/contracts/base/factory/interface/IStrategyFactory.sol +6 -0
  20. package/contracts/base/factory/interface/IVaultFactory.sol +7 -0
  21. package/contracts/base/factory/pool/PotPoolFactory.sol +43 -0
  22. package/contracts/base/factory/strategy/UpgradableStrategyFactory.sol +19 -0
  23. package/contracts/base/factory/vault/RegularVaultFactory.sol +34 -0
  24. package/contracts/base/incentives/GlobalIncentivesHelper.sol +167 -0
  25. package/contracts/base/incentives/NotifyHelperGeneric.sol +61 -0
  26. package/contracts/base/incentives/NotifyHelperStateful.sol +290 -0
  27. package/contracts/base/inheritance/Controllable.sol +26 -0
  28. package/contracts/base/inheritance/ControllableInit.sol +31 -0
  29. package/contracts/base/inheritance/Governable.sol +29 -0
  30. package/contracts/base/inheritance/GovernableInit.sol +51 -0
  31. package/contracts/base/inheritance/IUpgradeSource.sol +8 -0
  32. package/contracts/base/inheritance/OwnableWhitelist.sol +17 -0
  33. package/contracts/base/inheritance/RewardTokenProfitNotifier.sol +48 -0
  34. package/contracts/base/inheritance/Storage.sol +36 -0
  35. package/contracts/base/interface/IController.sol +30 -0
  36. package/contracts/base/interface/IControllerV2.sol +135 -0
  37. package/contracts/base/interface/IERC4626.sol +263 -0
  38. package/contracts/base/interface/IFeeRewardForwarder.sol +9 -0
  39. package/contracts/base/interface/IProfitSharingReceiver.sol +10 -0
  40. package/contracts/base/interface/IRewardForwarder.sol +58 -0
  41. package/contracts/base/interface/IRewardPool.sol +34 -0
  42. package/contracts/base/interface/IStrategy.sol +25 -0
  43. package/contracts/base/interface/IUniversalLiquidator.sol +21 -0
  44. package/contracts/base/interface/IUniversalLiquidatorRegistry.sol +20 -0
  45. package/contracts/base/interface/IUpgradeSource.sol +8 -0
  46. package/contracts/base/interface/IVault.sol +35 -0
  47. package/contracts/base/interface/aave/DataTypes.sol +266 -0
  48. package/contracts/base/interface/aave/IAToken.sol +37 -0
  49. package/contracts/base/interface/aave/IPool.sol +13 -0
  50. package/contracts/base/interface/balancer/Gauge.sol +22 -0
  51. package/contracts/base/interface/balancer/IBVault.sol +557 -0
  52. package/contracts/base/interface/balancer/IBalancerMinter.sol +114 -0
  53. package/contracts/base/interface/balancer/linearPool/ILinearPool.sol +185 -0
  54. package/contracts/base/interface/balancer/linearPool/ILinearPoolFactory.sol +16 -0
  55. package/contracts/base/interface/balancer/linearPool/ILinearPoolRebalancer.sol +8 -0
  56. package/contracts/base/interface/balancer/linearPool/IPoolSwapStructs.sol +57 -0
  57. package/contracts/base/interface/caviar/ICaviarChef.sol +16 -0
  58. package/contracts/base/interface/compound/IComet.sol +114 -0
  59. package/contracts/base/interface/compound/ICometRewards.sol +17 -0
  60. package/contracts/base/interface/curve/Gauge.sol +25 -0
  61. package/contracts/base/interface/curve/ICurveDeposit_2token.sol +25 -0
  62. package/contracts/base/interface/curve/ICurveDeposit_2token_underlying.sol +31 -0
  63. package/contracts/base/interface/curve/ICurveDeposit_3token.sol +25 -0
  64. package/contracts/base/interface/curve/ICurveDeposit_3token_meta.sol +20 -0
  65. package/contracts/base/interface/curve/ICurveDeposit_3token_underlying.sol +31 -0
  66. package/contracts/base/interface/curve/ICurveDeposit_4token.sol +25 -0
  67. package/contracts/base/interface/curve/ICurveDeposit_4token_meta.sol +20 -0
  68. package/contracts/base/interface/curve/ICurveDeposit_4token_underlying.sol +31 -0
  69. package/contracts/base/interface/curve/ICurveDeposit_5token.sol +25 -0
  70. package/contracts/base/interface/curve/ICurveDeposit_5token_meta.sol +20 -0
  71. package/contracts/base/interface/curve/ICurveDeposit_5token_underlying.sol +31 -0
  72. package/contracts/base/interface/curve/ICurveDeposit_6token.sol +25 -0
  73. package/contracts/base/interface/curve/ICurveDeposit_6token_meta.sol +20 -0
  74. package/contracts/base/interface/gamma/IClearing.sol +8 -0
  75. package/contracts/base/interface/gamma/IHypervisor.sol +17 -0
  76. package/contracts/base/interface/gamma/IStakingRewards.sol +35 -0
  77. package/contracts/base/interface/gamma/IUniProxy.sol +15 -0
  78. package/contracts/base/interface/kyber/IDMMExchangeRouter.sol +69 -0
  79. package/contracts/base/interface/kyber/IDMMFactory.sol +35 -0
  80. package/contracts/base/interface/kyber/IDMMLiquidityRouter.sol +204 -0
  81. package/contracts/base/interface/kyber/IDMMPool.sol +42 -0
  82. package/contracts/base/interface/kyber/IDMMRouter01.sol +12 -0
  83. package/contracts/base/interface/kyber/IDMMRouter02.sol +55 -0
  84. package/contracts/base/interface/kyber/IKyberZap.sol +7 -0
  85. package/contracts/base/interface/merkl/IDistributor.sol +6 -0
  86. package/contracts/base/interface/morpho/IMetaMorpho.sol +7 -0
  87. package/contracts/base/interface/pearl/IGauge.sol +13 -0
  88. package/contracts/base/interface/pearl/IPair.sol +44 -0
  89. package/contracts/base/interface/pearl/IRouter.sol +305 -0
  90. package/contracts/base/interface/quickswap/IDragonLair.sol +25 -0
  91. package/contracts/base/interface/quickswap/IMasterChef.sol +13 -0
  92. package/contracts/base/interface/uniswap/IUniswapV2Factory.sol +15 -0
  93. package/contracts/base/interface/uniswap/IUniswapV2Migrator.sol +6 -0
  94. package/contracts/base/interface/uniswap/IUniswapV2Pair.sol +59 -0
  95. package/contracts/base/interface/uniswap/IUniswapV2Router01.sol +96 -0
  96. package/contracts/base/interface/uniswap/IUniswapV2Router02.sol +137 -0
  97. package/contracts/base/interface/uniswap/IUniswapV3Pool.sol +24 -0
  98. package/contracts/base/interface/uniswap/IUniswapV3Router.sol +64 -0
  99. package/contracts/base/interface/uniswap/IWETH.sol +8 -0
  100. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolActions.sol +103 -0
  101. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolDerivedState.sol +40 -0
  102. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolEvents.sol +121 -0
  103. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolImmutables.sol +35 -0
  104. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolOwnerActions.sol +23 -0
  105. package/contracts/base/interface/uniswap/pool/IUniswapV3PoolState.sol +116 -0
  106. package/contracts/base/masterchef-base/MasterChefHodlStrategy.sol +240 -0
  107. package/contracts/base/masterchef-base/MasterChefStrategy.sol +364 -0
  108. package/contracts/base/masterchef-base/interfaces/IMasterChef.sol +12 -0
  109. package/contracts/base/migration/vaultMigratable_2JPYv2.sol +87 -0
  110. package/contracts/base/migration/vaultMigratable_bal2EUR_PAR.sol +121 -0
  111. package/contracts/base/migration/vaultMigratable_bal2EUR_agEUR.sol +121 -0
  112. package/contracts/base/migration/vaultMigratable_balMaticX.sol +153 -0
  113. package/contracts/base/migration/vaultMigratable_balStMatic.sol +153 -0
  114. package/contracts/base/noop/NoopStrategy.sol +89 -0
  115. package/contracts/base/noop/NoopStrategyUpgradeable.sol +92 -0
  116. package/contracts/base/sushi-base/MiniChefV2Strategy.sol +380 -0
  117. package/contracts/base/sushi-base/interface/IMiniChefV2.sol +31 -0
  118. package/contracts/base/sushi-base/interface/IRewarder.sol +9 -0
  119. package/contracts/base/sushi-base/lib/BoringERC20.sol +30 -0
  120. package/contracts/base/upgradability/Address.sol +33 -0
  121. package/contracts/base/upgradability/BaseUpgradeabilityProxy.sol +61 -0
  122. package/contracts/base/upgradability/BaseUpgradeableStrategy.sol +111 -0
  123. package/contracts/base/upgradability/BaseUpgradeableStrategyStorage.sol +176 -0
  124. package/contracts/base/upgradability/BaseUpgradeableStrategyStorageV2.sol +290 -0
  125. package/contracts/base/upgradability/BaseUpgradeableStrategyV2.sol +145 -0
  126. package/contracts/base/upgradability/IUpgradable.sol +7 -0
  127. package/contracts/base/upgradability/Proxy.sol +71 -0
  128. package/contracts/base/upgradability/ReentrancyGuard.sol +57 -0
  129. package/contracts/base/upgradability/ReentrancyGuardUpgradeable.sol +51 -0
  130. package/contracts/base/upgradability/StrategyProxy.sol +35 -0
  131. package/contracts/base/wmatic/WMATIC.sol +8 -0
  132. package/contracts/strategies/aave/AaveSupplyStrategy.sol +213 -0
  133. package/contracts/strategies/aave/AaveSupplyStrategyMainnet_DAI.sol +23 -0
  134. package/contracts/strategies/aave/AaveSupplyStrategyMainnet_EURS.sol +23 -0
  135. package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDC.sol +23 -0
  136. package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDCe.sol +23 -0
  137. package/contracts/strategies/aave/AaveSupplyStrategyMainnet_USDT.sol +23 -0
  138. package/contracts/strategies/ape/ApeStrategyMainnet_BANANA_MATIC.sol +36 -0
  139. package/contracts/strategies/ape/ApeStrategyMainnet_BNB_MATIC.sol +36 -0
  140. package/contracts/strategies/ape/ApeStrategyMainnet_BTC_MATIC.sol +36 -0
  141. package/contracts/strategies/ape/ApeStrategyMainnet_DAI_MATIC.sol +36 -0
  142. package/contracts/strategies/ape/ApeStrategyMainnet_DAI_USDC.sol +37 -0
  143. package/contracts/strategies/ape/ApeStrategyMainnet_ETH_MATIC.sol +36 -0
  144. package/contracts/strategies/ape/ApeStrategyMainnet_USDT_MATIC.sol +36 -0
  145. package/contracts/strategies/aura/AuraStrategy.sol +347 -0
  146. package/contracts/strategies/aura/AuraStrategyMainnet_jEUR_PAR.sol +30 -0
  147. package/contracts/strategies/aura/interface/IAuraBaseRewardPool.sol +25 -0
  148. package/contracts/strategies/aura/interface/IAuraBooster.sol +17 -0
  149. package/contracts/strategies/aura/interface/IAuraDepositor.sol +7 -0
  150. package/contracts/strategies/balancer/BalancerStrategyV3.sol +509 -0
  151. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2BRL.sol +39 -0
  152. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2BRLUSD.sol +38 -0
  153. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_PAR.sol +34 -0
  154. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_PARv2.sol +34 -0
  155. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_2EUR_agEUR.sol +34 -0
  156. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MATIC_USDC_ETH_BAL.sol +32 -0
  157. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MaticX.sol +37 -0
  158. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_MaticX_amMatic.sol +38 -0
  159. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_SPHERE_MATIC.sol +34 -0
  160. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_TNGBL_USDC.sol +34 -0
  161. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_WBTC_ETH_USDC.sol +32 -0
  162. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_bbamusd.sol +36 -0
  163. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_frxETH.sol +32 -0
  164. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_frxETH_amWETH.sol +35 -0
  165. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stETH.sol +35 -0
  166. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stMatic.sol +36 -0
  167. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_stMatic_amMatic.sol +39 -0
  168. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_tetuBal.sol +36 -0
  169. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_wUSDR_USDC.sol +34 -0
  170. package/contracts/strategies/balancer/BalancerStrategyV3Mainnet_wstETH_amWETH.sol +37 -0
  171. package/contracts/strategies/balancer/interface/Gauge.sol +26 -0
  172. package/contracts/strategies/balancer/interface/IBVault.sol +557 -0
  173. package/contracts/strategies/balancer/interface/IBalanceMinter.sol +114 -0
  174. package/contracts/strategies/complifi/ComplifiDerivStrategy.sol +381 -0
  175. package/contracts/strategies/complifi/ComplifiDerivStrategyMainnet_ETH5x.sol +35 -0
  176. package/contracts/strategies/complifi/ComplifiStrategy.sol +362 -0
  177. package/contracts/strategies/complifi/ComplifiStrategyMainnet_COMFI_WETH.sol +34 -0
  178. package/contracts/strategies/complifi/interfaces/ILiquidityMining.sol +13 -0
  179. package/contracts/strategies/complifi/interfaces/ILiquidityPool.sol +63 -0
  180. package/contracts/strategies/complifi/interfaces/IProxyActions.sol +10 -0
  181. package/contracts/strategies/complifi/interfaces/IUSDCVault.sol +55 -0
  182. package/contracts/strategies/compound/CompoundStrategy.sol +296 -0
  183. package/contracts/strategies/compound/CompoundStrategyMainnet_USDC.sol +28 -0
  184. package/contracts/strategies/compound/CompoundStrategyMainnet_USDT.sol +28 -0
  185. package/contracts/strategies/compound-blue/CompoundBlueStrategy.sol +292 -0
  186. package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_ETH.sol +27 -0
  187. package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_USDC.sol +27 -0
  188. package/contracts/strategies/compound-blue/CompoundBlueStrategyMainnet_USDT.sol +27 -0
  189. package/contracts/strategies/convex/ConvexStrategyMainnet_3CRV.sol +40 -0
  190. package/contracts/strategies/convex/ConvexStrategyMainnet_3CRYPTO.sol +37 -0
  191. package/contracts/strategies/convex/ConvexStrategyMainnet_CRV_3CRYPTO copy.sol +37 -0
  192. package/contracts/strategies/convex/ConvexStrategyMainnet_MATIC_3CRYPTO.sol +37 -0
  193. package/contracts/strategies/convex/ConvexStrategyMainnet_USDR.sol +40 -0
  194. package/contracts/strategies/convex/ConvexStrategyMainnet_aCRV.sol +38 -0
  195. package/contracts/strategies/convex/base/ConvexStrategy.sol +480 -0
  196. package/contracts/strategies/convex/interface/IBaseRewardPool.sol +13 -0
  197. package/contracts/strategies/convex/interface/IBooster.sol +10 -0
  198. package/contracts/strategies/gamma-merkl/GammaMerklStrategy.sol +272 -0
  199. package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_ETH_USDC.sol +25 -0
  200. package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_ETH_USDT.sol +25 -0
  201. package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_MATIC_USDT.sol +25 -0
  202. package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_TBTC_ETH.sol +25 -0
  203. package/contracts/strategies/gamma-merkl/GammaMerklStrategyMainnet_QS_WBTC_ETH_w.sol +25 -0
  204. package/contracts/strategies/genomes/NoopStrategy_GENE_ETH.sol +23 -0
  205. package/contracts/strategies/genomes/NoopStrategy_GNOME_ETH.sol +23 -0
  206. package/contracts/strategies/idle/IdleFinanceStrategy.sol +240 -0
  207. package/contracts/strategies/idle/IdleStrategyDAIMainnet.sol +33 -0
  208. package/contracts/strategies/idle/IdleStrategyUSDCMainnet.sol +33 -0
  209. package/contracts/strategies/idle/IdleStrategyWETHMainnet.sol +30 -0
  210. package/contracts/strategies/idle/interface/IdleToken.sol +58 -0
  211. package/contracts/strategies/jarvis/JarvisHodlStrategyV3.sol +351 -0
  212. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2CAD.sol +34 -0
  213. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR.sol +34 -0
  214. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_EURT.sol +34 -0
  215. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_EURe.sol +34 -0
  216. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2EUR_PAR.sol +34 -0
  217. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2JPY.sol +34 -0
  218. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2JPYv2.sol +34 -0
  219. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2NZD.sol +34 -0
  220. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_2SGD.sol +34 -0
  221. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jCHF_USDC.sol +35 -0
  222. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jCHF_WETH.sol +35 -0
  223. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jEUR_USDC.sol +35 -0
  224. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jEUR_WETH.sol +35 -0
  225. package/contracts/strategies/jarvis/JarvisHodlStrategyV3Mainnet_jGBP_USDC.sol +35 -0
  226. package/contracts/strategies/jarvis/JarvisStrategyV3.sol +281 -0
  227. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_AUR3_USDC.sol +27 -0
  228. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_AURJUL22_WETH.sol +27 -0
  229. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN2_4EUR.sol +27 -0
  230. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN3_4EUR.sol +27 -0
  231. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_DEN4_4EUR.sol +27 -0
  232. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTANGLENOV22_2EURagEUR.sol +27 -0
  233. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTANGLE_2EURagEUR.sol +27 -0
  234. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTJUL22_USDC.sol +27 -0
  235. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMAY22_USDC.sol +27 -0
  236. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMIMONOV22_2EURPAR.sol +27 -0
  237. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTMIMO_2EURPAR.sol +27 -0
  238. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTNOV22_USDC.sol +27 -0
  239. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_JRTSEP22_USDC.sol +27 -0
  240. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_QUI_2CAD.sol +27 -0
  241. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_SES_2JPY.sol +28 -0
  242. package/contracts/strategies/jarvis/JarvisStrategyV3Mainnet_agDEN_2EUR.sol +27 -0
  243. package/contracts/strategies/jarvis/interface/IElysianFields.sol +11 -0
  244. package/contracts/strategies/jarvis/interface/IKyberFairLaunch.sol +13 -0
  245. package/contracts/strategies/jarvis/interface/IKyberRewardLocker.sol +9 -0
  246. package/contracts/strategies/meshswap/MeshswapStrategy.sol +304 -0
  247. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_MESH_oMOOI.sol +30 -0
  248. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_MESH_oZEMIT.sol +30 -0
  249. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_USDC_oUSDC.sol +31 -0
  250. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_USDT_oUSDT.sol +31 -0
  251. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_MESH.sol +27 -0
  252. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_USDC.sol +28 -0
  253. package/contracts/strategies/meshswap/MeshswapStrategyMainnet_WMATIC_USDT.sol +28 -0
  254. package/contracts/strategies/meshswap/interface/IExchange.sol +9 -0
  255. package/contracts/strategies/meshswap/interface/IRouter.sol +68 -0
  256. package/contracts/strategies/pearl/CaviarStrategy.sol +244 -0
  257. package/contracts/strategies/pearl/CaviarStrategyMainnet_CVR.sol +26 -0
  258. package/contracts/strategies/pearl/PearlHodlStrategy.sol +254 -0
  259. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_CVR_PEARL.sol +27 -0
  260. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_DAI_USDR.sol +27 -0
  261. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_ETH_USDR.sol +27 -0
  262. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_MATIC_USDR.sol +27 -0
  263. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_PEARL_USDR.sol +27 -0
  264. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_STAR_USDR.sol +27 -0
  265. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_TNGBL_USDR.sol +27 -0
  266. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_USDC_USDR.sol +27 -0
  267. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_USDT_USDR.sol +27 -0
  268. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_WBTC_USDR.sol +27 -0
  269. package/contracts/strategies/pearl/PearlHodlStrategyMainnet_wUSDR_USDR.sol +27 -0
  270. package/contracts/strategies/quick-gamma/QuickGammaStrategy.sol +400 -0
  271. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_ETH_narrow.sol +31 -0
  272. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_ETH_wide.sol +31 -0
  273. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_USDC_narrow.sol +31 -0
  274. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_MATIC_USDC_wide.sol +31 -0
  275. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_USDC_ETH_narrow.sol +34 -0
  276. package/contracts/strategies/quick-gamma/QuickGammaStrategyMainnet_USDC_ETH_wide.sol +34 -0
  277. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2.sol +348 -0
  278. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_USDC_DAI.sol +28 -0
  279. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_USDC_USDT.sol +29 -0
  280. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_WBTC_ETH_narrow.sol +28 -0
  281. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_WBTC_USDC_narrow.sol +28 -0
  282. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_cbETH_ETH.sol +28 -0
  283. package/contracts/strategies/quick-gamma/QuickGammaStrategyV2Mainnet_wstETH_ETH.sol +28 -0
  284. package/contracts/strategies/uniswap-gamma/UniswapGammaStrategy.sol +312 -0
  285. package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_DAI.sol +28 -0
  286. package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_USDT.sol +28 -0
  287. package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_USDC_WETH.sol +28 -0
  288. package/contracts/strategies/uniswap-gamma/UniswapGammaStrategyMainnet_WMATIC_USDC.sol +28 -0
  289. package/contracts/strategies/yel/YelStrategy.sol +350 -0
  290. package/contracts/strategies/yel/YelStrategyMainnet_YEL_WETH.sol +29 -0
  291. package/hardhat.config.js +58 -0
  292. package/index.js +42 -0
  293. package/package.json +56 -6
  294. package/scripts/01-deploy-vault-regular-with-upgradable-strategy.js +41 -0
  295. package/scripts/02-deploy-vault-regular.js +35 -0
  296. package/scripts/03-deploy-upgradable-strategy.js +34 -0
  297. package/scripts/04-deploy-new-implementation.js +24 -0
  298. package/scripts/README.md +55 -0
  299. package/scripts/utils.js +42 -0
  300. package/test/aave/dai.js +207 -0
  301. package/test/aave/eurs.js +207 -0
  302. package/test/aave/usdc.js +206 -0
  303. package/test/aave/usdce.js +206 -0
  304. package/test/aave/usdt.js +206 -0
  305. package/test/ape/banana-matic.js +157 -0
  306. package/test/ape/bnb-matic.js +159 -0
  307. package/test/ape/btc-matic.js +159 -0
  308. package/test/ape/dai-matic.js +159 -0
  309. package/test/ape/dai-usdc.js +163 -0
  310. package/test/ape/eth-matic.js +158 -0
  311. package/test/ape/usdt-matic.js +159 -0
  312. package/test/aura/jeur-par.js +135 -0
  313. package/test/balancer/2brl_v3.js +123 -0
  314. package/test/balancer/2brlusd_v3.js +123 -0
  315. package/test/balancer/2eur_ageur.js +141 -0
  316. package/test/balancer/2eur_par.js +141 -0
  317. package/test/balancer/2eur_par_v2.js +123 -0
  318. package/test/balancer/bbamusd_v3.js +124 -0
  319. package/test/balancer/btc.js +131 -0
  320. package/test/balancer/frxETH.js +123 -0
  321. package/test/balancer/frxeth_amweth.js +123 -0
  322. package/test/balancer/matic_usdc_eth_bal.js +123 -0
  323. package/test/balancer/maticx_ammatic.js +123 -0
  324. package/test/balancer/maticx_v2.js +120 -0
  325. package/test/balancer/maticx_v3.js +141 -0
  326. package/test/balancer/polybase.js +131 -0
  327. package/test/balancer/polybase_v2.js +121 -0
  328. package/test/balancer/polydefi.js +131 -0
  329. package/test/balancer/polydefi2.js +131 -0
  330. package/test/balancer/qipool.js +136 -0
  331. package/test/balancer/sphere_matic.js +123 -0
  332. package/test/balancer/stETH.js +123 -0
  333. package/test/balancer/stable.js +131 -0
  334. package/test/balancer/stable_v2.js +121 -0
  335. package/test/balancer/stmatic_ammatic.js +123 -0
  336. package/test/balancer/stmatic_v2.js +120 -0
  337. package/test/balancer/stmatic_v3.js +141 -0
  338. package/test/balancer/tetubal_v3.js +123 -0
  339. package/test/balancer/tngbl_usdc.js +123 -0
  340. package/test/balancer/tricrypto.js +131 -0
  341. package/test/balancer/tusd_stable.js +142 -0
  342. package/test/balancer/usdc_weth.js +136 -0
  343. package/test/balancer/usdc_weth_v2.js +123 -0
  344. package/test/balancer/wbtc_eth_usdc.js +123 -0
  345. package/test/balancer/wbtc_weth.js +136 -0
  346. package/test/balancer/wsteth_amweth.js +123 -0
  347. package/test/balancer/wusdr_usdc.js +123 -0
  348. package/test/compound/usdc.js +127 -0
  349. package/test/compound/usdt.js +129 -0
  350. package/test/compound-blue/eth.js +136 -0
  351. package/test/compound-blue/usdc.js +136 -0
  352. package/test/compound-blue/usdt.js +136 -0
  353. package/test/convex/3crv.js +123 -0
  354. package/test/convex/3crypto.js +123 -0
  355. package/test/convex/acrv.js +123 -0
  356. package/test/convex/crv_3crypto.js +123 -0
  357. package/test/convex/matic_3crypto.js +123 -0
  358. package/test/convex/usdr.js +123 -0
  359. package/test/core/emission-fork.js +197 -0
  360. package/test/core/emission.js +209 -0
  361. package/test/core/vault_upgrade.js +129 -0
  362. package/test/curve/aave.js +132 -0
  363. package/test/curve/atricrypto3.js +135 -0
  364. package/test/curve/eurtusd.js +135 -0
  365. package/test/gamma-merkl/qs-eth-usdc.js +212 -0
  366. package/test/gamma-merkl/qs-eth-usdt.js +213 -0
  367. package/test/gamma-merkl/qs-matic-usdt.js +213 -0
  368. package/test/gamma-merkl/qs-tbtc-eth.js +213 -0
  369. package/test/gamma-merkl/qs-wbtc-eth-w.js +213 -0
  370. package/test/genomes/gene-eth.js +115 -0
  371. package/test/genomes/gnome-eth.js +115 -0
  372. package/test/idle/dai.js +129 -0
  373. package/test/idle/usdc.js +128 -0
  374. package/test/idle/weth.js +128 -0
  375. package/test/jarvis/2cad-hodl.js +183 -0
  376. package/test/jarvis/2cad-update-nov22.js +182 -0
  377. package/test/jarvis/2cad-update.js +177 -0
  378. package/test/jarvis/2cad-update2.js +182 -0
  379. package/test/jarvis/2cad-update3.js +182 -0
  380. package/test/jarvis/2eur-ageur-update-nov22.js +182 -0
  381. package/test/jarvis/2eur-ageur-update.js +182 -0
  382. package/test/jarvis/2eur-eure-hodl.js +176 -0
  383. package/test/jarvis/2eur-eurt-hodl.js +176 -0
  384. package/test/jarvis/2eur-eurt-update-nov22.js +182 -0
  385. package/test/jarvis/2eur-hodl.js +176 -0
  386. package/test/jarvis/2eur-par-hodl.js +176 -0
  387. package/test/jarvis/2eur-par-update-nov22.js +182 -0
  388. package/test/jarvis/2jpy-hodl.js +244 -0
  389. package/test/jarvis/2jpy-update-nov22.js +182 -0
  390. package/test/jarvis/2jpy-update.js +177 -0
  391. package/test/jarvis/2jpy-update2.js +182 -0
  392. package/test/jarvis/2jpyv2-upgrade.js +184 -0
  393. package/test/jarvis/2nzd-hodl.js +176 -0
  394. package/test/jarvis/2nzd-update.js +182 -0
  395. package/test/jarvis/2sgd-hodl.js +176 -0
  396. package/test/jarvis/2sgd-update-nov22.js +182 -0
  397. package/test/jarvis/2sgd-update.js +182 -0
  398. package/test/jarvis/2sgd-update2.js +182 -0
  399. package/test/jarvis/4eur-hodl-upgrade.js +177 -0
  400. package/test/jarvis/4eur-hodl.js +183 -0
  401. package/test/jarvis/4eur-update.js +181 -0
  402. package/test/jarvis/4eur-update2.js +181 -0
  403. package/test/jarvis/agden-2eur.js +222 -0
  404. package/test/jarvis/aur-usdc-v2.js +115 -0
  405. package/test/jarvis/aur-usdc.js +127 -0
  406. package/test/jarvis/aur3-usdc.js +115 -0
  407. package/test/jarvis/aurjul22-weth.js +222 -0
  408. package/test/jarvis/den-4eur.js +115 -0
  409. package/test/jarvis/den2-4eur.js +220 -0
  410. package/test/jarvis/den3-4eur.js +220 -0
  411. package/test/jarvis/den4-4eur.js +220 -0
  412. package/test/jarvis/jchf-usdc-hodl-v2.js +184 -0
  413. package/test/jarvis/jchf-usdc-hodl-v3.js +178 -0
  414. package/test/jarvis/jchf-usdc-hodl.js +193 -0
  415. package/test/jarvis/jchf-weth-hodl.js +176 -0
  416. package/test/jarvis/jeur-usdc-hodl-v2.js +184 -0
  417. package/test/jarvis/jeur-usdc-hodl-v3.js +178 -0
  418. package/test/jarvis/jeur-usdc-hodl.js +193 -0
  419. package/test/jarvis/jeur-weth-hodl.js +176 -0
  420. package/test/jarvis/jgbp-usdc-hodl-v2.js +184 -0
  421. package/test/jarvis/jgbp-usdc-hodl-v3.js +178 -0
  422. package/test/jarvis/jgbp-usdc-hodl.js +193 -0
  423. package/test/jarvis/jrtangle-2eurageur.js +220 -0
  424. package/test/jarvis/jrtanglenov22-2eurageur.js +220 -0
  425. package/test/jarvis/jrtjul22-usdc.js +115 -0
  426. package/test/jarvis/jrtmay22-usdc.js +115 -0
  427. package/test/jarvis/jrtmimo-2eurpar.js +220 -0
  428. package/test/jarvis/jrtmimonov22-2eurpar.js +220 -0
  429. package/test/jarvis/jrtnov22-usdc.js +220 -0
  430. package/test/jarvis/jrtsep22-usdc.js +220 -0
  431. package/test/jarvis/qui-2cad.js +218 -0
  432. package/test/jarvis/ses-2jpy.js +222 -0
  433. package/test/meshswap/mesh-omooi.js +197 -0
  434. package/test/meshswap/mesh-ozemit.js +197 -0
  435. package/test/meshswap/usdc-ousdc.js +197 -0
  436. package/test/meshswap/usdt-ousdt.js +197 -0
  437. package/test/meshswap/wmatic-mesh.js +197 -0
  438. package/test/meshswap/wmatic-usdc.js +197 -0
  439. package/test/meshswap/wmatic-usdt.js +197 -0
  440. package/test/mstable/musd.js +123 -0
  441. package/test/pearl/cvr-pearl.js +198 -0
  442. package/test/pearl/cvr.js +133 -0
  443. package/test/pearl/dai-usdr.js +198 -0
  444. package/test/pearl/eth-usdr.js +198 -0
  445. package/test/pearl/matic-usdr.js +198 -0
  446. package/test/pearl/pearl-usdr.js +198 -0
  447. package/test/pearl/star-usdr.js +186 -0
  448. package/test/pearl/tngbl-usdr.js +198 -0
  449. package/test/pearl/usdc-usdr.js +198 -0
  450. package/test/pearl/usdt-usdr.js +198 -0
  451. package/test/pearl/wbtc-usdr.js +198 -0
  452. package/test/pearl/wusdr-usdr.js +198 -0
  453. package/test/popsicle/ice-weth.js +128 -0
  454. package/test/quick/eth-matic.js +132 -0
  455. package/test/quick/eth-usdt.js +140 -0
  456. package/test/quick/ifarm-quick.js +147 -0
  457. package/test/quick/matic-usdc.js +145 -0
  458. package/test/quick/psp-matic.js +124 -0
  459. package/test/quick/wbtc-eth.js +145 -0
  460. package/test/quick-gamma/cbeth-eth.js +207 -0
  461. package/test/quick-gamma/matic-eth-narrow.js +201 -0
  462. package/test/quick-gamma/matic-eth-wide.js +197 -0
  463. package/test/quick-gamma/matic-usdc-narrow.js +197 -0
  464. package/test/quick-gamma/matic-usdc-wide.js +197 -0
  465. package/test/quick-gamma/upgrade/matic-eth-narrow.js +204 -0
  466. package/test/quick-gamma/upgrade/matic-usdc-narrow.js +199 -0
  467. package/test/quick-gamma/usdc-dai.js +209 -0
  468. package/test/quick-gamma/usdc-eth-narrow.js +197 -0
  469. package/test/quick-gamma/usdc-eth-wide.js +197 -0
  470. package/test/quick-gamma/usdc-usdt.js +209 -0
  471. package/test/quick-gamma/wbtc-eth-narrow.js +207 -0
  472. package/test/quick-gamma/wbtc-usdc-narrow.js +209 -0
  473. package/test/quick-gamma/wsteth-eth.js +207 -0
  474. package/test/sushi/eth-usdt.js +153 -0
  475. package/test/sushi/matic-eth.js +138 -0
  476. package/test/sushi/usdc-eth.js +153 -0
  477. package/test/test-config.js +24 -0
  478. package/test/uniswap-gamma/usdc-dai.js +212 -0
  479. package/test/uniswap-gamma/usdc-usdt.js +212 -0
  480. package/test/uniswap-gamma/usdc-weth.js +212 -0
  481. package/test/uniswap-gamma/wmatic-usdc.js +210 -0
  482. package/test/utilities/Utils.js +96 -0
  483. package/test/utilities/hh-utils.js +242 -0
  484. package/test/utilities/make-vault.js +10 -0
  485. package/test/yel/yel-wmatic.js +129 -0
@@ -0,0 +1,557 @@
1
+ // SPDX-License-Identifier: Unlicense
2
+ pragma solidity 0.6.12;
3
+ pragma experimental ABIEncoderV2;
4
+
5
+ interface IAsset {
6
+ }
7
+
8
+ interface IBVault {
9
+ // Internal Balance
10
+ //
11
+ // Users can deposit tokens into the Vault, where they are allocated to their Internal Balance, and later
12
+ // transferred or withdrawn. It can also be used as a source of tokens when joining Pools, as a destination
13
+ // when exiting them, and as either when performing swaps. This usage of Internal Balance results in greatly reduced
14
+ // gas costs when compared to relying on plain ERC20 transfers, leading to large savings for frequent users.
15
+ //
16
+ // Internal Balance management features batching, which means a single contract call can be used to perform multiple
17
+ // operations of different kinds, with different senders and recipients, at once.
18
+
19
+ /**
20
+ * @dev Returns `user`'s Internal Balance for a set of tokens.
21
+ */
22
+ function getInternalBalance(address user, address[] calldata tokens) external view returns (uint256[] memory);
23
+
24
+ /**
25
+ * @dev Performs a set of user balance operations, which involve Internal Balance (deposit, withdraw or transfer)
26
+ * and plain ERC20 transfers using the Vault's allowance. This last feature is particularly useful for relayers, as
27
+ * it lets integrators reuse a user's Vault allowance.
28
+ *
29
+ * For each operation, if the caller is not `sender`, it must be an authorized relayer for them.
30
+ */
31
+ function manageUserBalance(UserBalanceOp[] calldata ops) external payable;
32
+
33
+ /**
34
+ * @dev Data for `manageUserBalance` operations, which include the possibility for ETH to be sent and received
35
+ without manual WETH wrapping or unwrapping.
36
+ */
37
+ struct UserBalanceOp {
38
+ UserBalanceOpKind kind;
39
+ IAsset asset;
40
+ uint256 amount;
41
+ address sender;
42
+ address payable recipient;
43
+ }
44
+
45
+ // There are four possible operations in `manageUserBalance`:
46
+ //
47
+ // - DEPOSIT_INTERNAL
48
+ // Increases the Internal Balance of the `recipient` account by transferring tokens from the corresponding
49
+ // `sender`. The sender must have allowed the Vault to use their tokens via `IERC20.approve()`.
50
+ //
51
+ // ETH can be used by passing the ETH sentinel value as the asset and forwarding ETH in the call: it will be wrapped
52
+ // and deposited as WETH. Any ETH amount remaining will be sent back to the caller (not the sender, which is
53
+ // relevant for relayers).
54
+ //
55
+ // Emits an `InternalBalanceChanged` event.
56
+ //
57
+ //
58
+ // - WITHDRAW_INTERNAL
59
+ // Decreases the Internal Balance of the `sender` account by transferring tokens to the `recipient`.
60
+ //
61
+ // ETH can be used by passing the ETH sentinel value as the asset. This will deduct WETH instead, unwrap it and send
62
+ // it to the recipient as ETH.
63
+ //
64
+ // Emits an `InternalBalanceChanged` event.
65
+ //
66
+ //
67
+ // - TRANSFER_INTERNAL
68
+ // Transfers tokens from the Internal Balance of the `sender` account to the Internal Balance of `recipient`.
69
+ //
70
+ // Reverts if the ETH sentinel value is passed.
71
+ //
72
+ // Emits an `InternalBalanceChanged` event.
73
+ //
74
+ //
75
+ // - TRANSFER_EXTERNAL
76
+ // Transfers tokens from `sender` to `recipient`, using the Vault's ERC20 allowance. This is typically used by
77
+ // relayers, as it lets them reuse a user's Vault allowance.
78
+ //
79
+ // Reverts if the ETH sentinel value is passed.
80
+ //
81
+ // Emits an `ExternalBalanceTransfer` event.
82
+
83
+ enum UserBalanceOpKind { DEPOSIT_INTERNAL, WITHDRAW_INTERNAL, TRANSFER_INTERNAL, TRANSFER_EXTERNAL }
84
+
85
+ /**
86
+ * @dev Emitted when a user's Internal Balance changes, either from calls to `manageUserBalance`, or through
87
+ * interacting with Pools using Internal Balance.
88
+ *
89
+ * Because Internal Balance works exclusively with ERC20 tokens, ETH deposits and withdrawals will use the WETH
90
+ * address.
91
+ */
92
+ event InternalBalanceChanged(address indexed user, address indexed token, int256 delta);
93
+
94
+ /**
95
+ * @dev Emitted when a user's Vault ERC20 allowance is used by the Vault to transfer tokens to an external account.
96
+ */
97
+ event ExternalBalanceTransfer(address indexed token, address indexed sender, address recipient, uint256 amount);
98
+
99
+ // Pools
100
+ //
101
+ // There are three specialization settings for Pools, which allow for cheaper swaps at the cost of reduced
102
+ // functionality:
103
+ //
104
+ // - General: no specialization, suited for all Pools. IGeneralPool is used for swap request callbacks, passing the
105
+ // balance of all tokens in the Pool. These Pools have the largest swap costs (because of the extra storage reads),
106
+ // which increase with the number of registered tokens.
107
+ //
108
+ // - Minimal Swap Info: IMinimalSwapInfoPool is used instead of IGeneralPool, which saves gas by only passing the
109
+ // balance of the two tokens involved in the swap. This is suitable for some pricing algorithms, like the weighted
110
+ // constant product one popularized by Balancer V1. Swap costs are smaller compared to general Pools, and are
111
+ // independent of the number of registered tokens.
112
+ //
113
+ // - Two Token: only allows two tokens to be registered. This achieves the lowest possible swap gas cost. Like
114
+ // minimal swap info Pools, these are called via IMinimalSwapInfoPool.
115
+
116
+ enum PoolSpecialization { GENERAL, MINIMAL_SWAP_INFO, TWO_TOKEN }
117
+
118
+ /**
119
+ * @dev Registers the caller account as a Pool with a given specialization setting. Returns the Pool's ID, which
120
+ * is used in all Pool-related functions. Pools cannot be deregistered, nor can the Pool's specialization be
121
+ * changed.
122
+ *
123
+ * The caller is expected to be a smart contract that implements either `IGeneralPool` or `IMinimalSwapInfoPool`,
124
+ * depending on the chosen specialization setting. This contract is known as the Pool's contract.
125
+ *
126
+ * Note that the same contract may register itself as multiple Pools with unique Pool IDs, or in other words,
127
+ * multiple Pools may share the same contract.
128
+ *
129
+ * Emits a `PoolRegistered` event.
130
+ */
131
+ function registerPool(PoolSpecialization specialization) external returns (bytes32);
132
+
133
+ /**
134
+ * @dev Emitted when a Pool is registered by calling `registerPool`.
135
+ */
136
+ event PoolRegistered(bytes32 indexed poolId, address indexed poolAddress, PoolSpecialization specialization);
137
+
138
+ /**
139
+ * @dev Returns a Pool's contract address and specialization setting.
140
+ */
141
+ function getPool(bytes32 poolId) external view returns (address, PoolSpecialization);
142
+
143
+ /**
144
+ * @dev Registers `tokens` for the `poolId` Pool. Must be called by the Pool's contract.
145
+ *
146
+ * Pools can only interact with tokens they have registered. Users join a Pool by transferring registered tokens,
147
+ * exit by receiving registered tokens, and can only swap registered tokens.
148
+ *
149
+ * Each token can only be registered once. For Pools with the Two Token specialization, `tokens` must have a length
150
+ * of two, that is, both tokens must be registered in the same `registerTokens` call, and they must be sorted in
151
+ * ascending order.
152
+ *
153
+ * The `tokens` and `assetManagers` arrays must have the same length, and each entry in these indicates the Asset
154
+ * Manager for the corresponding token. Asset Managers can manage a Pool's tokens via `managePoolBalance`,
155
+ * depositing and withdrawing them directly, and can even set their balance to arbitrary amounts. They are therefore
156
+ * expected to be highly secured smart contracts with sound design principles, and the decision to register an
157
+ * Asset Manager should not be made lightly.
158
+ *
159
+ * Pools can choose not to assign an Asset Manager to a given token by passing in the zero address. Once an Asset
160
+ * Manager is set, it cannot be changed except by deregistering the associated token and registering again with a
161
+ * different Asset Manager.
162
+ *
163
+ * Emits a `TokensRegistered` event.
164
+ */
165
+ function registerTokens(
166
+ bytes32 poolId,
167
+ address[] calldata tokens,
168
+ address[] calldata assetManagers
169
+ ) external;
170
+
171
+ /**
172
+ * @dev Emitted when a Pool registers tokens by calling `registerTokens`.
173
+ */
174
+ event TokensRegistered(bytes32 indexed poolId, address[] tokens, address[] assetManagers);
175
+
176
+ /**
177
+ * @dev Deregisters `tokens` for the `poolId` Pool. Must be called by the Pool's contract.
178
+ *
179
+ * Only registered tokens (via `registerTokens`) can be deregistered. Additionally, they must have zero total
180
+ * balance. For Pools with the Two Token specialization, `tokens` must have a length of two, that is, both tokens
181
+ * must be deregistered in the same `deregisterTokens` call.
182
+ *
183
+ * A deregistered token can be re-registered later on, possibly with a different Asset Manager.
184
+ *
185
+ * Emits a `TokensDeregistered` event.
186
+ */
187
+ function deregisterTokens(bytes32 poolId, address[] calldata tokens) external;
188
+
189
+ /**
190
+ * @dev Emitted when a Pool deregisters tokens by calling `deregisterTokens`.
191
+ */
192
+ event TokensDeregistered(bytes32 indexed poolId, address[] tokens);
193
+
194
+ /**
195
+ * @dev Returns detailed information for a Pool's registered token.
196
+ *
197
+ * `cash` is the number of tokens the Vault currently holds for the Pool. `managed` is the number of tokens
198
+ * withdrawn and held outside the Vault by the Pool's token Asset Manager. The Pool's total balance for `token`
199
+ * equals the sum of `cash` and `managed`.
200
+ *
201
+ * Internally, `cash` and `managed` are stored using 112 bits. No action can ever cause a Pool's token `cash`,
202
+ * `managed` or `total` balance to be greater than 2^112 - 1.
203
+ *
204
+ * `lastChangeBlock` is the number of the block in which `token`'s total balance was last modified (via either a
205
+ * join, exit, swap, or Asset Manager update). This value is useful to avoid so-called 'sandwich attacks', for
206
+ * example when developing price oracles. A change of zero (e.g. caused by a swap with amount zero) is considered a
207
+ * change for this purpose, and will update `lastChangeBlock`.
208
+ *
209
+ * `assetManager` is the Pool's token Asset Manager.
210
+ */
211
+ function getPoolTokenInfo(bytes32 poolId, address token)
212
+ external
213
+ view
214
+ returns (
215
+ uint256 cash,
216
+ uint256 managed,
217
+ uint256 lastChangeBlock,
218
+ address assetManager
219
+ );
220
+
221
+ /**
222
+ * @dev Returns a Pool's registered tokens, the total balance for each, and the latest block when *any* of
223
+ * the tokens' `balances` changed.
224
+ *
225
+ * The order of the `tokens` array is the same order that will be used in `joinPool`, `exitPool`, as well as in all
226
+ * Pool hooks (where applicable). Calls to `registerTokens` and `deregisterTokens` may change this order.
227
+ *
228
+ * If a Pool only registers tokens once, and these are sorted in ascending order, they will be stored in the same
229
+ * order as passed to `registerTokens`.
230
+ *
231
+ * Total balances include both tokens held by the Vault and those withdrawn by the Pool's Asset Managers. These are
232
+ * the amounts used by joins, exits and swaps. For a detailed breakdown of token balances, use `getPoolTokenInfo`
233
+ * instead.
234
+ */
235
+ function getPoolTokens(bytes32 poolId)
236
+ external
237
+ view
238
+ returns (
239
+ address[] memory tokens,
240
+ uint256[] memory balances,
241
+ uint256 lastChangeBlock
242
+ );
243
+
244
+ /**
245
+ * @dev Called by users to join a Pool, which transfers tokens from `sender` into the Pool's balance. This will
246
+ * trigger custom Pool behavior, which will typically grant something in return to `recipient` - often tokenized
247
+ * Pool shares.
248
+ *
249
+ * If the caller is not `sender`, it must be an authorized relayer for them.
250
+ *
251
+ * The `assets` and `maxAmountsIn` arrays must have the same length, and each entry indicates the maximum amount
252
+ * to send for each asset. The amounts to send are decided by the Pool and not the Vault: it just enforces
253
+ * these maximums.
254
+ *
255
+ * If joining a Pool that holds WETH, it is possible to send ETH directly: the Vault will do the wrapping. To enable
256
+ * this mechanism, the IAsset sentinel value (the zero address) must be passed in the `assets` array instead of the
257
+ * WETH address. Note that it is not possible to combine ETH and WETH in the same join. Any excess ETH will be sent
258
+ * back to the caller (not the sender, which is important for relayers).
259
+ *
260
+ * `assets` must have the same length and order as the array returned by `getPoolTokens`. This prevents issues when
261
+ * interacting with Pools that register and deregister tokens frequently. If sending ETH however, the array must be
262
+ * sorted *before* replacing the WETH address with the ETH sentinel value (the zero address), which means the final
263
+ * `assets` array might not be sorted. Pools with no registered tokens cannot be joined.
264
+ *
265
+ * If `fromInternalBalance` is true, the caller's Internal Balance will be preferred: ERC20 transfers will only
266
+ * be made for the difference between the requested amount and Internal Balance (if any). Note that ETH cannot be
267
+ * withdrawn from Internal Balance: attempting to do so will trigger a revert.
268
+ *
269
+ * This causes the Vault to call the `IBasePool.onJoinPool` hook on the Pool's contract, where Pools implement
270
+ * their own custom logic. This typically requires additional information from the user (such as the expected number
271
+ * of Pool shares). This can be encoded in the `userData` argument, which is ignored by the Vault and passed
272
+ * directly to the Pool's contract, as is `recipient`.
273
+ *
274
+ * Emits a `PoolBalanceChanged` event.
275
+ */
276
+ function joinPool(
277
+ bytes32 poolId,
278
+ address sender,
279
+ address recipient,
280
+ JoinPoolRequest calldata request
281
+ ) external payable;
282
+
283
+ enum JoinKind { INIT, EXACT_TOKENS_IN_FOR_BPT_OUT, TOKEN_IN_FOR_EXACT_BPT_OUT }
284
+ enum ExitKind { EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, EXACT_BPT_IN_FOR_TOKENS_OUT, BPT_IN_FOR_EXACT_TOKENS_OUT }
285
+
286
+ struct JoinPoolRequest {
287
+ IAsset[] assets;
288
+ uint256[] maxAmountsIn;
289
+ bytes userData;
290
+ bool fromInternalBalance;
291
+ }
292
+
293
+ /**
294
+ * @dev Called by users to exit a Pool, which transfers tokens from the Pool's balance to `recipient`. This will
295
+ * trigger custom Pool behavior, which will typically ask for something in return from `sender` - often tokenized
296
+ * Pool shares. The amount of tokens that can be withdrawn is limited by the Pool's `cash` balance (see
297
+ * `getPoolTokenInfo`).
298
+ *
299
+ * If the caller is not `sender`, it must be an authorized relayer for them.
300
+ *
301
+ * The `tokens` and `minAmountsOut` arrays must have the same length, and each entry in these indicates the minimum
302
+ * token amount to receive for each token contract. The amounts to send are decided by the Pool and not the Vault:
303
+ * it just enforces these minimums.
304
+ *
305
+ * If exiting a Pool that holds WETH, it is possible to receive ETH directly: the Vault will do the unwrapping. To
306
+ * enable this mechanism, the IAsset sentinel value (the zero address) must be passed in the `assets` array instead
307
+ * of the WETH address. Note that it is not possible to combine ETH and WETH in the same exit.
308
+ *
309
+ * `assets` must have the same length and order as the array returned by `getPoolTokens`. This prevents issues when
310
+ * interacting with Pools that register and deregister tokens frequently. If receiving ETH however, the array must
311
+ * be sorted *before* replacing the WETH address with the ETH sentinel value (the zero address), which means the
312
+ * final `assets` array might not be sorted. Pools with no registered tokens cannot be exited.
313
+ *
314
+ * If `toInternalBalance` is true, the tokens will be deposited to `recipient`'s Internal Balance. Otherwise,
315
+ * an ERC20 transfer will be performed. Note that ETH cannot be deposited to Internal Balance: attempting to
316
+ * do so will trigger a revert.
317
+ *
318
+ * `minAmountsOut` is the minimum amount of tokens the user expects to get out of the Pool, for each token in the
319
+ * `tokens` array. This array must match the Pool's registered tokens.
320
+ *
321
+ * This causes the Vault to call the `IBasePool.onExitPool` hook on the Pool's contract, where Pools implement
322
+ * their own custom logic. This typically requires additional information from the user (such as the expected number
323
+ * of Pool shares to return). This can be encoded in the `userData` argument, which is ignored by the Vault and
324
+ * passed directly to the Pool's contract.
325
+ *
326
+ * Emits a `PoolBalanceChanged` event.
327
+ */
328
+ function exitPool(
329
+ bytes32 poolId,
330
+ address sender,
331
+ address payable recipient,
332
+ ExitPoolRequest calldata request
333
+ ) external;
334
+
335
+ struct ExitPoolRequest {
336
+ IAsset[] assets;
337
+ uint256[] minAmountsOut;
338
+ bytes userData;
339
+ bool toInternalBalance;
340
+ }
341
+
342
+ /**
343
+ * @dev Emitted when a user joins or exits a Pool by calling `joinPool` or `exitPool`, respectively.
344
+ */
345
+ event PoolBalanceChanged(
346
+ bytes32 indexed poolId,
347
+ address indexed liquidityProvider,
348
+ address[] tokens,
349
+ int256[] deltas,
350
+ uint256[] protocolFeeAmounts
351
+ );
352
+
353
+ enum PoolBalanceChangeKind { JOIN, EXIT }
354
+
355
+ // Swaps
356
+ //
357
+ // Users can swap tokens with Pools by calling the `swap` and `batchSwap` functions. To do this,
358
+ // they need not trust Pool contracts in any way: all security checks are made by the Vault. They must however be
359
+ // aware of the Pools' pricing algorithms in order to estimate the prices Pools will quote.
360
+ //
361
+ // The `swap` function executes a single swap, while `batchSwap` can perform multiple swaps in sequence.
362
+ // In each individual swap, tokens of one kind are sent from the sender to the Pool (this is the 'token in'),
363
+ // and tokens of another kind are sent from the Pool to the recipient in exchange (this is the 'token out').
364
+ // More complex swaps, such as one token in to multiple tokens out can be achieved by batching together
365
+ // individual swaps.
366
+ //
367
+ // There are two swap kinds:
368
+ // - 'given in' swaps, where the amount of tokens in (sent to the Pool) is known, and the Pool determines (via the
369
+ // `onSwap` hook) the amount of tokens out (to send to the recipient).
370
+ // - 'given out' swaps, where the amount of tokens out (received from the Pool) is known, and the Pool determines
371
+ // (via the `onSwap` hook) the amount of tokens in (to receive from the sender).
372
+ //
373
+ // Additionally, it is possible to chain swaps using a placeholder input amount, which the Vault replaces with
374
+ // the calculated output of the previous swap. If the previous swap was 'given in', this will be the calculated
375
+ // tokenOut amount. If the previous swap was 'given out', it will use the calculated tokenIn amount. These extended
376
+ // swaps are known as 'multihop' swaps, since they 'hop' through a number of intermediate tokens before arriving at
377
+ // the final intended token.
378
+ //
379
+ // In all cases, tokens are only transferred in and out of the Vault (or withdrawn from and deposited into Internal
380
+ // Balance) after all individual swaps have been completed, and the net token balance change computed. This makes
381
+ // certain swap patterns, such as multihops, or swaps that interact with the same token pair in multiple Pools, cost
382
+ // much less gas than they would otherwise.
383
+ //
384
+ // It also means that under certain conditions it is possible to perform arbitrage by swapping with multiple
385
+ // Pools in a way that results in net token movement out of the Vault (profit), with no tokens being sent in (only
386
+ // updating the Pool's internal accounting).
387
+ //
388
+ // To protect users from front-running or the market changing rapidly, they supply a list of 'limits' for each token
389
+ // involved in the swap, where either the maximum number of tokens to send (by passing a positive value) or the
390
+ // minimum amount of tokens to receive (by passing a negative value) is specified.
391
+ //
392
+ // Additionally, a 'deadline' timestamp can also be provided, forcing the swap to fail if it occurs after
393
+ // this point in time (e.g. if the transaction failed to be included in a block promptly).
394
+ //
395
+ // If interacting with Pools that hold WETH, it is possible to both send and receive ETH directly: the Vault will do
396
+ // the wrapping and unwrapping. To enable this mechanism, the IAsset sentinel value (the zero address) must be
397
+ // passed in the `assets` array instead of the WETH address. Note that it is possible to combine ETH and WETH in the
398
+ // same swap. Any excess ETH will be sent back to the caller (not the sender, which is relevant for relayers).
399
+ //
400
+ // Finally, Internal Balance can be used when either sending or receiving tokens.
401
+
402
+ enum SwapKind { GIVEN_IN, GIVEN_OUT }
403
+
404
+ /**
405
+ * @dev Performs a swap with a single Pool.
406
+ *
407
+ * If the swap is 'given in' (the number of tokens to send to the Pool is known), it returns the amount of tokens
408
+ * taken from the Pool, which must be greater than or equal to `limit`.
409
+ *
410
+ * If the swap is 'given out' (the number of tokens to take from the Pool is known), it returns the amount of tokens
411
+ * sent to the Pool, which must be less than or equal to `limit`.
412
+ *
413
+ * Internal Balance usage and the recipient are determined by the `funds` struct.
414
+ *
415
+ * Emits a `Swap` event.
416
+ */
417
+ function swap(
418
+ SingleSwap calldata singleSwap,
419
+ FundManagement calldata funds,
420
+ uint256 limit,
421
+ uint256 deadline
422
+ ) external payable returns (uint256);
423
+
424
+ /**
425
+ * @dev Data for a single swap executed by `swap`. `amount` is either `amountIn` or `amountOut` depending on
426
+ * the `kind` value.
427
+ *
428
+ * `assetIn` and `assetOut` are either token addresses, or the IAsset sentinel value for ETH (the zero address).
429
+ * Note that Pools never interact with ETH directly: it will be wrapped to or unwrapped from WETH by the Vault.
430
+ *
431
+ * The `userData` field is ignored by the Vault, but forwarded to the Pool in the `onSwap` hook, and may be
432
+ * used to extend swap behavior.
433
+ */
434
+ struct SingleSwap {
435
+ bytes32 poolId;
436
+ SwapKind kind;
437
+ IAsset assetIn;
438
+ IAsset assetOut;
439
+ uint256 amount;
440
+ bytes userData;
441
+ }
442
+
443
+ /**
444
+ * @dev Performs a series of swaps with one or multiple Pools. In each individual swap, the caller determines either
445
+ * the amount of tokens sent to or received from the Pool, depending on the `kind` value.
446
+ *
447
+ * Returns an array with the net Vault asset balance deltas. Positive amounts represent tokens (or ETH) sent to the
448
+ * Vault, and negative amounts represent tokens (or ETH) sent by the Vault. Each delta corresponds to the asset at
449
+ * the same index in the `assets` array.
450
+ *
451
+ * Swaps are executed sequentially, in the order specified by the `swaps` array. Each array element describes a
452
+ * Pool, the token to be sent to this Pool, the token to receive from it, and an amount that is either `amountIn` or
453
+ * `amountOut` depending on the swap kind.
454
+ *
455
+ * Multihop swaps can be executed by passing an `amount` value of zero for a swap. This will cause the amount in/out
456
+ * of the previous swap to be used as the amount in for the current one. In a 'given in' swap, 'tokenIn' must equal
457
+ * the previous swap's `tokenOut`. For a 'given out' swap, `tokenOut` must equal the previous swap's `tokenIn`.
458
+ *
459
+ * The `assets` array contains the addresses of all assets involved in the swaps. These are either token addresses,
460
+ * or the IAsset sentinel value for ETH (the zero address). Each entry in the `swaps` array specifies tokens in and
461
+ * out by referencing an index in `assets`. Note that Pools never interact with ETH directly: it will be wrapped to
462
+ * or unwrapped from WETH by the Vault.
463
+ *
464
+ * Internal Balance usage, sender, and recipient are determined by the `funds` struct. The `limits` array specifies
465
+ * the minimum or maximum amount of each token the vault is allowed to transfer.
466
+ *
467
+ * `batchSwap` can be used to make a single swap, like `swap` does, but doing so requires more gas than the
468
+ * equivalent `swap` call.
469
+ *
470
+ * Emits `Swap` events.
471
+ */
472
+ function batchSwap(
473
+ SwapKind kind,
474
+ BatchSwapStep[] calldata swaps,
475
+ IAsset[] calldata assets,
476
+ FundManagement calldata funds,
477
+ int256[] calldata limits,
478
+ uint256 deadline
479
+ ) external payable returns (int256[] memory);
480
+
481
+ /**
482
+ * @dev Data for each individual swap executed by `batchSwap`. The asset in and out fields are indexes into the
483
+ * `assets` array passed to that function, and ETH assets are converted to WETH.
484
+ *
485
+ * If `amount` is zero, the multihop mechanism is used to determine the actual amount based on the amount in/out
486
+ * from the previous swap, depending on the swap kind.
487
+ *
488
+ * The `userData` field is ignored by the Vault, but forwarded to the Pool in the `onSwap` hook, and may be
489
+ * used to extend swap behavior.
490
+ */
491
+ struct BatchSwapStep {
492
+ bytes32 poolId;
493
+ uint256 assetInIndex;
494
+ uint256 assetOutIndex;
495
+ uint256 amount;
496
+ bytes userData;
497
+ }
498
+
499
+ /**
500
+ * @dev Emitted for each individual swap performed by `swap` or `batchSwap`.
501
+ */
502
+ event Swap(
503
+ bytes32 indexed poolId,
504
+ address indexed tokenIn,
505
+ address indexed tokenOut,
506
+ uint256 amountIn,
507
+ uint256 amountOut
508
+ );
509
+
510
+ /**
511
+ * @dev All tokens in a swap are either sent from the `sender` account to the Vault, or from the Vault to the
512
+ * `recipient` account.
513
+ *
514
+ * If the caller is not `sender`, it must be an authorized relayer for them.
515
+ *
516
+ * If `fromInternalBalance` is true, the `sender`'s Internal Balance will be preferred, performing an ERC20
517
+ * transfer for the difference between the requested amount and the User's Internal Balance (if any). The `sender`
518
+ * must have allowed the Vault to use their tokens via `IERC20.approve()`. This matches the behavior of
519
+ * `joinPool`.
520
+ *
521
+ * If `toInternalBalance` is true, tokens will be deposited to `recipient`'s internal balance instead of
522
+ * transferred. This matches the behavior of `exitPool`.
523
+ *
524
+ * Note that ETH cannot be deposited to or withdrawn from Internal Balance: attempting to do so will trigger a
525
+ * revert.
526
+ */
527
+ struct FundManagement {
528
+ address sender;
529
+ bool fromInternalBalance;
530
+ address payable recipient;
531
+ bool toInternalBalance;
532
+ }
533
+
534
+ /**
535
+ * @dev Simulates a call to `batchSwap`, returning an array of Vault asset deltas. Calls to `swap` cannot be
536
+ * simulated directly, but an equivalent `batchSwap` call can and will yield the exact same result.
537
+ *
538
+ * Each element in the array corresponds to the asset at the same index, and indicates the number of tokens (or ETH)
539
+ * the Vault would take from the sender (if positive) or send to the recipient (if negative). The arguments it
540
+ * receives are the same that an equivalent `batchSwap` call would receive.
541
+ *
542
+ * Unlike `batchSwap`, this function performs no checks on the sender or recipient field in the `funds` struct.
543
+ * This makes it suitable to be called by off-chain applications via eth_call without needing to hold tokens,
544
+ * approve them for the Vault, or even know a user's address.
545
+ *
546
+ * Note that this function is not 'view' (due to implementation details): the client code must explicitly execute
547
+ * eth_call instead of eth_sendTransaction.
548
+ */
549
+ function queryBatchSwap(
550
+ SwapKind kind,
551
+ BatchSwapStep[] calldata swaps,
552
+ IAsset[] calldata assets,
553
+ FundManagement calldata funds
554
+ ) external returns (int256[] memory assetDeltas);
555
+
556
+ function getProtocolFeesCollector() external view returns(address);
557
+ }
@@ -0,0 +1,114 @@
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
+
17
+
18
+ /**
19
+ * @dev Base minter interface, applicable to Mainnet minter or L2 pseudo minters.
20
+ */
21
+ interface IBalancerMinter {
22
+ event Minted(address indexed recipient, address gauge, uint256 minted);
23
+
24
+ /**
25
+ * @notice Returns the address of the Balancer Governance Token
26
+ */
27
+ function getBalancerToken() external view returns (address);
28
+
29
+ /**
30
+ * @notice Mint everything which belongs to `msg.sender` and send to them
31
+ * @param gauge `LiquidityGauge` address to get mintable amount from
32
+ */
33
+ function mint(address gauge) external returns (uint256);
34
+
35
+ /**
36
+ * @notice Mint everything which belongs to `msg.sender` across multiple gauges
37
+ * @param gauges List of `LiquidityGauge` addresses
38
+ */
39
+ function mintMany(address[] calldata gauges) external returns (uint256);
40
+
41
+ /**
42
+ * @notice Mint tokens for `user`
43
+ * @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
44
+ * @param gauge `LiquidityGauge` address to get mintable amount from
45
+ * @param user Address to mint to
46
+ */
47
+ function mintFor(address gauge, address user) external returns (uint256);
48
+
49
+ /**
50
+ * @notice Mint tokens for `user` across multiple gauges
51
+ * @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
52
+ * @param gauges List of `LiquidityGauge` addresses
53
+ * @param user Address to mint to
54
+ */
55
+ function mintManyFor(address[] calldata gauges, address user) external returns (uint256);
56
+
57
+ /**
58
+ * @notice The total number of tokens minted for `user` from `gauge`
59
+ */
60
+ function minted(address user, address gauge) external view returns (uint256);
61
+
62
+ /**
63
+ * @notice Whether `minter` is approved to mint tokens for `user`
64
+ */
65
+ function getMinterApproval(address minter, address user) external view returns (bool);
66
+
67
+ /**
68
+ * @notice Set whether `minter` is approved to mint tokens on your behalf
69
+ */
70
+ function setMinterApproval(address minter, bool approval) external;
71
+
72
+ /**
73
+ * @notice Set whether `minter` is approved to mint tokens on behalf of `user`, who has signed a message authorizing
74
+ * them.
75
+ */
76
+ function setMinterApprovalWithSignature(
77
+ address minter,
78
+ bool approval,
79
+ address user,
80
+ uint256 deadline,
81
+ uint8 v,
82
+ bytes32 r,
83
+ bytes32 s
84
+ ) external;
85
+
86
+ // The below functions are near-duplicates of functions available above.
87
+ // They are included for ABI compatibility with snake_casing as used in vyper contracts.
88
+ // solhint-disable func-name-mixedcase
89
+
90
+ /**
91
+ * @notice Whether `minter` is approved to mint tokens for `user`
92
+ */
93
+ function allowed_to_mint_for(address minter, address user) external view returns (bool);
94
+
95
+ /**
96
+ * @notice Mint everything which belongs to `msg.sender` across multiple gauges
97
+ * @dev This function is not recommended as `mintMany()` is more flexible and gas efficient
98
+ * @param gauges List of `LiquidityGauge` addresses
99
+ */
100
+ function mint_many(address[8] calldata gauges) external;
101
+
102
+ /**
103
+ * @notice Mint tokens for `user`
104
+ * @dev Only possible when `msg.sender` has been approved by `user` to mint on their behalf
105
+ * @param gauge `LiquidityGauge` address to get mintable amount from
106
+ * @param user Address to mint to
107
+ */
108
+ function mint_for(address gauge, address user) external;
109
+
110
+ /**
111
+ * @notice Toggle whether `minter` is approved to mint tokens for `user`
112
+ */
113
+ function toggle_approve_mint(address minter) external;
114
+ }