├── .editorconfig ├── .env.example ├── .envrc ├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── workflows │ └── ci.yaml ├── .gitignore ├── .gitmodules ├── .solhint.json ├── .solhintignore ├── .vscode ├── extensions.json └── settings.json ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── audits ├── 2021-01-CS-protocol-v2.pdf ├── 2021-09-CS-protocol-v4.pdf ├── 2021-10-OZ-protocol-v4.pdf ├── 2021-12-CS-fund-value-calculator-address-list-registry-paraswap-pool-together-uniswap.pdf ├── 2022-01-CS-protocol-v4-revisions-curve-synthetix-olympus-compound.pdf ├── 2022-02-CS-protocol-v4-revisions-performance-fee-convex.pdf ├── 2022-03-CS-aave-borrowing-fuse-lending-uniswap-v3-lp-rev-usdeth-simulated-aggregator.pdf ├── 2022-05-CS-curve-fixes-maple-shares-splitter-convex-voting-paraswap-fee-liquity-graph-delegation.pdf ├── 2022-08-CS-arbitrary-loans-solv-convertibles-fidu-unit-lists-manager-policies-deposit-wrapper-fix.pdf ├── 2022-10-CS--compound-cdp-fix--protocol-fee-reserve-arbitrary-call--balancer-lp--balancer-weighted-pool-feed--notional-lending-and-borrowing.pdf ├── 2022-11-CS--balancer-and-aura-staking--balancer-stable-pool-feed--kiln-staking--paraswap-multi-order--arbitrary-deposit-token-shares-wrapper.pdf ├── 2022-12-CS--maple-v2-migration--aave-v3-lending--compound-v3-lending--wsteth-price-feed.pdf ├── 2023-02-CS--gated-redemption-shares-wrapper--balancer-v2-batch-swap--uniswap-v2-fee-on-transfer-tokens--solv-v2-bonds.pdf ├── 2023-03-CS--gsn-fix.pdf ├── 2023-05-CS--zero-ex-v4--1inch-v5--paraswap-v5-updates--gated-shares-wrapper-updates.pdf ├── 2023-07-CS--erc4626--kiln-exits--balancer-stable-pool-price-feed-fix--convex-aura-wrappers-fix.pdf ├── 2023-09-CS--convex-aura-wrappers-v2--no-depeg-policy--arrakis-v2--erc20-deposit-wrapper--lido-withdrawals--aave-v3-debt.pdf ├── 2023-10-CS--deposit-wrapper-fix.pdf ├── 2023-12-CS--stakewise-v3.pdf ├── 2023-12-CS--term-finance-lending--zero-ex-v4-otc--maple-fix.pdf ├── 2024-04-CS--morpho-blue.pdf ├── 2024-05-CS--lmax-alice.pdf ├── 2024-07-CS--pendle-v2--swell--gsn-updates--etherfi-eth-price--redemption-queue--share-price-throttled-asset-manager--allowed-redeemers-for-specific-assets-policy--non-standard-precision-simulated-aggregator.pdf ├── 2024-08-CS--chainlink-like-wsteth-feed.pdf ├── 2024-09-CS--chainlink-like-yneth-feed--stader-SD-feed.pdf ├── 2024-10-CS--aave-v3-flash-loan-asset-manager.pdf ├── 2024-12-CS--stader-withdrawals.pdf ├── 2025-02-CS--gmx-v2--disallowed-adapter-incoming-assets-policy.pdf ├── 2025-02-CS--price-feed-utils.pdf ├── 2025-03-CS--single-asset-deposit-queue.pdf ├── 2025-04-CS--myso-v3.pdf ├── 2025-05-CS--stakewise-v3.pdf ├── README.md └── external-teams │ └── 2024-04-CS--31third.pdf ├── contracts ├── external-interfaces │ ├── IAaveAToken.sol │ ├── IAaveV2IncentivesController.sol │ ├── IAaveV2LendingPool.sol │ ├── IAaveV2LendingPoolAddressProvider.sol │ ├── IAaveV2ProtocolDataProvider.sol │ ├── IAaveV3FlashLoanReceiver.sol │ ├── IAaveV3Pool.sol │ ├── IAaveV3PoolAddressProvider.sol │ ├── IAaveV3ProtocolDataProvider.sol │ ├── IAaveV3RewardsController.sol │ ├── IAliceOrderManager.sol │ ├── IBalancerV2LiquidityGauge.sol │ ├── IBalancerV2PoolFactory.sol │ ├── IBalancerV2StablePool.sol │ ├── IBalancerV2Vault.sol │ ├── IBalancerV2WeightedPool.sol │ ├── IChainlinkAggregator.sol │ ├── ICompoundComptroller.sol │ ├── ICompoundV2CERC20.sol │ ├── ICompoundV2CEther.sol │ ├── ICompoundV3Comet.sol │ ├── ICompoundV3CometRewards.sol │ ├── ICompoundV3Configurator.sol │ ├── IConvexBaseRewardPool.sol │ ├── IConvexCvxLockerV2.sol │ ├── IConvexVlCvxExtraRewardDistribution.sol │ ├── ICurveAddressProvider.sol │ ├── ICurveLiquidityGaugeV2.sol │ ├── ICurveLiquidityPool.sol │ ├── ICurveMinter.sol │ ├── ICurvePoolOwner.sol │ ├── ICurveRegistryMain.sol │ ├── ICurveRegistryMetapoolFactory.sol │ ├── ICurveV2TwocryptoPool.sol │ ├── IDivaEther.sol │ ├── IERC20.sol │ ├── IERC20Burnable.sol │ ├── IERC4626.sol │ ├── IEtherFiWrappedEth.sol │ ├── IGMXV2ChainlinkPriceFeedProvider.sol │ ├── IGMXV2DataStore.sol │ ├── IGMXV2Event.sol │ ├── IGMXV2ExchangeRouter.sol │ ├── IGMXV2Market.sol │ ├── IGMXV2Order.sol │ ├── IGMXV2OrderHandler.sol │ ├── IGMXV2Position.sol │ ├── IGMXV2Price.sol │ ├── IGMXV2Reader.sol │ ├── IGMXV2RoleStore.sol │ ├── IGsnForwarder.sol │ ├── IGsnPaymaster.sol │ ├── IGsnRelayHub.sol │ ├── IGsnTypes.sol │ ├── IKilnStakingContract.sol │ ├── ILidoSteth.sol │ ├── ILidoWithdrawalQueue.sol │ ├── IMapleV2Globals.sol │ ├── IMapleV2Pool.sol │ ├── IMapleV2PoolManager.sol │ ├── IMapleV2ProxyFactory.sol │ ├── IMapleV2WithdrawalManager.sol │ ├── IMerklDistributor.sol │ ├── IMorphoBlue.sol │ ├── IMorphoBlueFlashLoanCallback.sol │ ├── IMysoV3DataTypes.sol │ ├── IMysoV3Escrow.sol │ ├── IMysoV3Router.sol │ ├── IOneInchV5AggregationRouter.sol │ ├── IParaSwapV5AugustusSwapper.sol │ ├── IParaSwapV6AugustusSwapper.sol │ ├── IPendleV2Market.sol │ ├── IPendleV2PrincipalToken.sol │ ├── IPendleV2Router.sol │ ├── IPendleV2StandardizedYield.sol │ ├── ISmarDexOracleMiddleware.sol │ ├── ISmarDexUsdnProtocol.sol │ ├── ISnapshotDelegateRegistry.sol │ ├── ISolvBTCYieldToken.sol │ ├── IStaderOracle.sol │ ├── IStaderStakePoolsManager.sol │ ├── IStaderUserWithdrawalManager.sol │ ├── IStakeWiseV3EthVault.sol │ ├── IStakeWiseV3VaultsRegistry.sol │ ├── ISwellSweth.sol │ ├── ITermFinanceV1Auction.sol │ ├── ITermFinanceV1AuctionOfferLocker.sol │ ├── ITermFinanceV1Controller.sol │ ├── ITermFinanceV1RepoCollateralManager.sol │ ├── ITermFinanceV1RepoServicer.sol │ ├── ITermFinanceV1RepoToken.sol │ ├── ITheGraphStaking.sol │ ├── IUniswapV2Factory.sol │ ├── IUniswapV2Pair.sol │ ├── IUniswapV2Router2.sol │ ├── IUniswapV3SwapRouter.sol │ ├── IVotiumMultiMerkleStash.sol │ ├── IWETH.sol │ ├── IYearnVaultV2.sol │ ├── IYearnVaultV2Registry.sol │ └── IZeroExV4.sol ├── persistent │ ├── address-list-registry │ │ ├── AddressListRegistry.sol │ │ ├── IAddressListRegistry.sol │ │ └── address-list-owners │ │ │ ├── AaveV2ATokenListOwner.sol │ │ │ ├── AaveV3ATokenListOwner.sol │ │ │ ├── CompoundV3CTokenListOwner.sol │ │ │ └── utils │ │ │ ├── 0.6.12 │ │ │ ├── AddOnlyAddressListOwnerBase.sol │ │ │ └── AddOnlyAddressListOwnerConsumerMixin.sol │ │ │ ├── 0.8.19 │ │ │ ├── AddOnlyAddressListOwnerBase.sol │ │ │ └── AddOnlyAddressListOwnerConsumerMixin.sol │ │ │ └── IAddOnlyAddressListOwner.sol │ ├── arbitrary-value-oracles │ │ ├── IArbitraryValueOracle.sol │ │ └── manual-value │ │ │ ├── ManualValueOracleFactory.sol │ │ │ ├── ManualValueOracleLib.sol │ │ │ └── ManualValueOracleProxy.sol │ ├── dispatcher │ │ ├── Dispatcher.sol │ │ ├── IDispatcher.sol │ │ └── IMigrationHookHandler.sol │ ├── external-positions │ │ ├── ExternalPositionFactory.sol │ │ ├── ExternalPositionProxy.sol │ │ ├── IExternalPositionFactory.sol │ │ ├── IExternalPositionLibCore.sol │ │ └── IExternalPositionProxy.sol │ ├── fund-value-calculator │ │ ├── FundValueCalculatorRouter.sol │ │ ├── IFundValueCalculator.sol │ │ └── IFundValueCalculatorRouter.sol │ ├── global-config │ │ ├── GlobalConfigLib.sol │ │ ├── GlobalConfigProxy.sol │ │ ├── bases │ │ │ ├── GlobalConfigLibBase1.sol │ │ │ └── GlobalConfigLibBaseCore.sol │ │ ├── interfaces │ │ │ ├── IGlobalConfig1.sol │ │ │ ├── IGlobalConfig2.sol │ │ │ └── IGlobalConfigLibComptrollerV4.sol │ │ └── utils │ │ │ ├── GlobalConfigProxyConstants.sol │ │ │ └── ProxiableGlobalConfigLib.sol │ ├── off-chain │ │ ├── README.md │ │ ├── fund-data-provider │ │ │ ├── FundDataProviderRouter.sol │ │ │ └── interfaces │ │ │ │ └── IValueInterpreterGetter.sol │ │ ├── fund-value-calculator-usd-wrapper │ │ │ └── FundValueCalculatorUsdWrapper.sol │ │ └── helper-data-reader │ │ │ ├── HelperDataReaderRouter.sol │ │ │ └── IHelperDataReader.sol │ ├── protocol-fee-reserve │ │ ├── ProtocolFeeReserveLib.sol │ │ ├── ProtocolFeeReserveProxy.sol │ │ ├── bases │ │ │ ├── ProtocolFeeReserveLibBase1.sol │ │ │ └── ProtocolFeeReserveLibBaseCore.sol │ │ ├── interfaces │ │ │ └── IProtocolFeeReserve1.sol │ │ └── utils │ │ │ ├── ProtocolFeeProxyConstants.sol │ │ │ └── ProxiableProtocolFeeReserveLib.sol │ ├── shares-splitter │ │ ├── SharesSplitterFactory.sol │ │ ├── SharesSplitterLib.sol │ │ ├── SharesSplitterProxy.sol │ │ └── TreasurySplitterMixin.sol │ ├── shares-wrappers │ │ └── gated-redemption-queue │ │ │ ├── GatedRedemptionQueueSharesWrapperFactory.sol │ │ │ ├── GatedRedemptionQueueSharesWrapperLib.sol │ │ │ ├── IGatedRedemptionQueueSharesWrapper.sol │ │ │ └── bases │ │ │ └── GatedRedemptionQueueSharesWrapperLibBase1.sol │ ├── single-asset-deposit-queue │ │ ├── ISingleAssetDepositQueue.sol │ │ └── SingleAssetDepositQueueLib.sol │ ├── single-asset-redemption-queue │ │ ├── ISingleAssetRedemptionQueue.sol │ │ ├── SingleAssetRedemptionQueueFactory.sol │ │ └── SingleAssetRedemptionQueueLib.sol │ ├── smart-accounts │ │ ├── aave-v3-flash-loan-asset-manager │ │ │ ├── AaveV3FlashLoanAssetManagerLib.sol │ │ │ └── IAaveV3FlashLoanAssetManager.sol │ │ ├── morpho-blue-flash-loan-asset-manager │ │ │ ├── IMorphoBlueFlashLoanAssetManager.sol │ │ │ └── MorphoBlueFlashLoanAssetManagerLib.sol │ │ ├── share-price-throttled-asset-manager │ │ │ ├── ISharePriceThrottledAssetManagerLib.sol │ │ │ ├── SharePriceThrottledAssetManagerFactory.sol │ │ │ └── SharePriceThrottledAssetManagerLib.sol │ │ └── utils │ │ │ ├── MultiCallAccountMixin.sol │ │ │ └── interfaces │ │ │ └── IMultiCallAccountMixin.sol │ ├── uint-list-registry │ │ ├── IUintListRegistry.sol │ │ └── UintListRegistry.sol │ └── vault │ │ ├── VaultLibBase1.sol │ │ ├── VaultLibBase2.sol │ │ ├── VaultLibBaseCore.sol │ │ ├── VaultProxy.sol │ │ ├── interfaces │ │ ├── IExternalPositionVault.sol │ │ ├── IFreelyTransferableSharesVault.sol │ │ ├── IMigratableVault.sol │ │ └── IVaultCore.sol │ │ └── utils │ │ ├── IProxiableVaultLib.sol │ │ ├── ProxiableVaultLib.sol │ │ └── SharesTokenBase.sol ├── release │ ├── core │ │ ├── fund-deployer │ │ │ ├── FundDeployer.sol │ │ │ └── IFundDeployer.sol │ │ └── fund │ │ │ ├── comptroller │ │ │ ├── ComptrollerLib.sol │ │ │ ├── ComptrollerProxy.sol │ │ │ └── IComptroller.sol │ │ │ └── vault │ │ │ ├── IVault.sol │ │ │ └── VaultLib.sol │ ├── extensions │ │ ├── IExtension.sol │ │ ├── external-position-manager │ │ │ ├── ExternalPositionManager.sol │ │ │ ├── IExternalPosition.sol │ │ │ ├── IExternalPositionManager.sol │ │ │ ├── IExternalPositionParser.sol │ │ │ └── external-positions │ │ │ │ ├── aave-v2-debt │ │ │ │ ├── AaveDebtPositionDataDecoder.sol │ │ │ │ ├── AaveDebtPositionLib.sol │ │ │ │ ├── AaveDebtPositionParser.sol │ │ │ │ ├── IAaveDebtPosition.sol │ │ │ │ └── bases │ │ │ │ │ └── AaveDebtPositionLibBase1.sol │ │ │ │ ├── aave-v3-debt │ │ │ │ ├── AaveV3DebtPositionDataDecoder.sol │ │ │ │ ├── AaveV3DebtPositionLib.sol │ │ │ │ ├── AaveV3DebtPositionParser.sol │ │ │ │ ├── IAaveV3DebtPosition.sol │ │ │ │ └── bases │ │ │ │ │ └── AaveV3DebtPositionLibBase1.sol │ │ │ │ ├── alice │ │ │ │ ├── AlicePositionLib.sol │ │ │ │ ├── AlicePositionParser.sol │ │ │ │ ├── IAlicePosition.sol │ │ │ │ └── bases │ │ │ │ │ └── AlicePositionLibBase1.sol │ │ │ │ ├── arbitrary-loan │ │ │ │ ├── ArbitraryLoanPositionDataDecoder.sol │ │ │ │ ├── ArbitraryLoanPositionLib.sol │ │ │ │ ├── ArbitraryLoanPositionParser.sol │ │ │ │ ├── IArbitraryLoanPosition.sol │ │ │ │ ├── bases │ │ │ │ │ └── ArbitraryLoanPositionLibBase1.sol │ │ │ │ └── modules │ │ │ │ │ ├── ArbitraryLoanTotalNominalDeltaOracleModule.sol │ │ │ │ │ └── IArbitraryLoanAccountingModule.sol │ │ │ │ ├── compound-debt │ │ │ │ ├── CompoundDebtPositionLib.sol │ │ │ │ ├── CompoundDebtPositionParser.sol │ │ │ │ ├── ICompoundDebtPosition.sol │ │ │ │ └── bases │ │ │ │ │ └── CompoundDebtPositionLibBase1.sol │ │ │ │ ├── convex-voting │ │ │ │ ├── ConvexVotingPositionDataDecoder.sol │ │ │ │ ├── ConvexVotingPositionLib.sol │ │ │ │ ├── ConvexVotingPositionParser.sol │ │ │ │ └── IConvexVotingPosition.sol │ │ │ │ ├── gmx-v2-leverage-trading │ │ │ │ ├── GMXV2LeverageTradingPositionLib.sol │ │ │ │ ├── GMXV2LeverageTradingPositionLibManagedAssets.sol │ │ │ │ ├── GMXV2LeverageTradingPositionMixin.sol │ │ │ │ ├── GMXV2LeverageTradingPositionParser.sol │ │ │ │ ├── IGMXV2LeverageTradingPosition.sol │ │ │ │ └── bases │ │ │ │ │ └── GMXV2LeverageTradingPositionLibBase1.sol │ │ │ │ ├── kiln-staking │ │ │ │ ├── IKilnStakingPosition.sol │ │ │ │ ├── KilnStakingPositionDataDecoder.sol │ │ │ │ ├── KilnStakingPositionLib.sol │ │ │ │ ├── KilnStakingPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ ├── KilnStakingPositionLibBase1.sol │ │ │ │ │ └── KilnStakingPositionLibBase2.sol │ │ │ │ ├── lido-withdrawals │ │ │ │ ├── ILidoWithdrawalsPosition.sol │ │ │ │ ├── LidoWithdrawalsPositionDataDecoder.sol │ │ │ │ ├── LidoWithdrawalsPositionLib.sol │ │ │ │ ├── LidoWithdrawalsPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── LidoWithdrawalsPositionLibBase1.sol │ │ │ │ ├── maple-liquidity │ │ │ │ ├── IMapleLiquidityPosition.sol │ │ │ │ ├── MapleLiquidityPositionDataDecoder.sol │ │ │ │ ├── MapleLiquidityPositionLib.sol │ │ │ │ ├── MapleLiquidityPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ ├── MapleLiquidityPositionLibBase1.sol │ │ │ │ │ └── MapleLiquidityPositionLibBase2.sol │ │ │ │ ├── morpho-blue │ │ │ │ ├── IMorphoBluePosition.sol │ │ │ │ ├── MorphoBluePositionDataDecoder.sol │ │ │ │ ├── MorphoBluePositionLib.sol │ │ │ │ ├── MorphoBluePositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── MorphoBluePositionLibBase1.sol │ │ │ │ ├── myso-v3 │ │ │ │ ├── IMysoV3OptionWritingPosition.sol │ │ │ │ ├── MysoV3OptionWritingPositionLib.sol │ │ │ │ ├── MysoV3OptionWritingPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── MysoV3OptionWritingPositionLibBase1.sol │ │ │ │ ├── stader-withdrawals │ │ │ │ ├── IStaderWithdrawalsPosition.sol │ │ │ │ ├── StaderWithdrawalsPositionLib.sol │ │ │ │ └── StaderWithdrawalsPositionParser.sol │ │ │ │ ├── stakewise-v3-staking │ │ │ │ ├── IStakeWiseV3StakingPosition.sol │ │ │ │ ├── StakeWiseV3StakingPositionDataDecoder.sol │ │ │ │ ├── StakeWiseV3StakingPositionLib.sol │ │ │ │ ├── StakeWiseV3StakingPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── StakeWiseV3StakingPositionLibBase1.sol │ │ │ │ ├── term-finance-v1-lending │ │ │ │ ├── ITermFinanceV1LendingPosition.sol │ │ │ │ ├── TermFinanceV1LendingPositionDataDecoder.sol │ │ │ │ ├── TermFinanceV1LendingPositionLib.sol │ │ │ │ ├── TermFinanceV1LendingPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── TermFinanceV1LendingPositionLibBase1.sol │ │ │ │ ├── the-graph-delegation │ │ │ │ ├── ITheGraphDelegationPosition.sol │ │ │ │ ├── TheGraphDelegationPositionDataDecoder.sol │ │ │ │ ├── TheGraphDelegationPositionLib.sol │ │ │ │ ├── TheGraphDelegationPositionParser.sol │ │ │ │ └── bases │ │ │ │ │ └── TheGraphDelegationPositionLibBase1.sol │ │ │ │ └── uniswap-v3-liquidity │ │ │ │ ├── IUniswapV3LiquidityPosition.sol │ │ │ │ ├── UniswapV3LiquidityPositionDataDecoder.sol │ │ │ │ ├── UniswapV3LiquidityPositionLib.sol │ │ │ │ ├── UniswapV3LiquidityPositionParser.sol │ │ │ │ └── bases │ │ │ │ └── UniswapV3LiquidityPositionLibBase1.sol │ │ ├── fee-manager │ │ │ ├── FeeManager.sol │ │ │ ├── IFee.sol │ │ │ ├── IFeeManager.sol │ │ │ └── fees │ │ │ │ ├── EntranceRateBurnFee.sol │ │ │ │ ├── EntranceRateDirectFee.sol │ │ │ │ ├── ExitRateBurnFee.sol │ │ │ │ ├── ExitRateDirectFee.sol │ │ │ │ ├── ManagementFee.sol │ │ │ │ ├── MinSharesSupplyFee.sol │ │ │ │ ├── PerformanceFee.sol │ │ │ │ ├── interfaces │ │ │ │ ├── IManagementFee.sol │ │ │ │ └── IPerformanceFee.sol │ │ │ │ └── utils │ │ │ │ ├── EntranceRateFeeBase.sol │ │ │ │ ├── ExitRateFeeBase.sol │ │ │ │ ├── FeeBase.sol │ │ │ │ ├── SettableFeeRecipientBase.sol │ │ │ │ ├── UpdatableFeeRecipientBase.sol │ │ │ │ └── interfaces │ │ │ │ └── IExitRateFeeBase.sol │ │ ├── integration-manager │ │ │ ├── IIntegrationAdapter.sol │ │ │ ├── IIntegrationManager.sol │ │ │ ├── IntegrationManager.sol │ │ │ └── integrations │ │ │ │ ├── adapters │ │ │ │ ├── AaveV2Adapter.sol │ │ │ │ ├── AaveV3Adapter.sol │ │ │ │ ├── BalancerV2LiquidityAdapter.sol │ │ │ │ ├── CompoundAdapter.sol │ │ │ │ ├── CompoundV3Adapter.sol │ │ │ │ ├── CurveLiquidityAdapter.sol │ │ │ │ ├── DivaStakingAdapter.sol │ │ │ │ ├── ERC4626Adapter.sol │ │ │ │ ├── EnzymeV4VaultAdapter.sol │ │ │ │ ├── OneInchV5Adapter.sol │ │ │ │ ├── ParaSwapV5Adapter.sol │ │ │ │ ├── ParaSwapV6Adapter.sol │ │ │ │ ├── PendleV2Adapter.sol │ │ │ │ ├── StaderStakingAdapter.sol │ │ │ │ ├── SwellStakingAdapter.sol │ │ │ │ ├── TransferAssetsAdapter.sol │ │ │ │ ├── UniswapV2ExchangeAdapter.sol │ │ │ │ ├── UniswapV2LiquidityAdapter.sol │ │ │ │ ├── UniswapV3Adapter.sol │ │ │ │ ├── YearnVaultV2Adapter.sol │ │ │ │ ├── ZeroExV4Adapter.sol │ │ │ │ └── interfaces │ │ │ │ │ ├── IEnzymeV4VaultAdapter.sol │ │ │ │ │ ├── IParaSwapV5Adapter.sol │ │ │ │ │ ├── IParaSwapV6Adapter.sol │ │ │ │ │ ├── IPendleV2Adapter.sol │ │ │ │ │ ├── ITransferAssetsAdapter.sol │ │ │ │ │ └── IZeroExV4Adapter.sol │ │ │ │ └── utils │ │ │ │ ├── 0.6.12 │ │ │ │ ├── AdapterBase.sol │ │ │ │ ├── actions │ │ │ │ │ ├── AaveV2ActionsMixin.sol │ │ │ │ │ ├── AaveV3ActionsMixin.sol │ │ │ │ │ ├── BalancerV2ActionsMixin.sol │ │ │ │ │ ├── CompoundActionsMixin.sol │ │ │ │ │ ├── CompoundV3ActionsMixin.sol │ │ │ │ │ ├── CurveGaugeV2ActionsMixin.sol │ │ │ │ │ ├── CurveGaugeV2RewardsHandlerMixin.sol │ │ │ │ │ ├── CurveLiquidityActionsMixin.sol │ │ │ │ │ ├── OneInchV5ActionsMixin.sol │ │ │ │ │ ├── ParaSwapV5ActionsMixin.sol │ │ │ │ │ ├── UniswapV2ActionsMixin.sol │ │ │ │ │ ├── UniswapV3ActionsMixin.sol │ │ │ │ │ ├── YearnVaultV2ActionsMixin.sol │ │ │ │ │ └── ZeroExV4ActionsMixin.sol │ │ │ │ └── bases │ │ │ │ │ ├── AaveAdapterBase.sol │ │ │ │ │ ├── BalancerV2LiquidityAdapterBase.sol │ │ │ │ │ ├── CompoundAdapterBase.sol │ │ │ │ │ └── CurveLiquidityAdapterBase.sol │ │ │ │ ├── 0.8.19 │ │ │ │ ├── AdapterBase.sol │ │ │ │ └── bases │ │ │ │ │ └── GenericWrappingAdapterBase.sol │ │ │ │ ├── IntegrationSelectors.sol │ │ │ │ └── interfaces │ │ │ │ └── ICurveLiquidityAdapterBase.sol │ │ ├── policy-manager │ │ │ ├── IPolicy.sol │ │ │ ├── IPolicyManager.sol │ │ │ ├── PolicyManager.sol │ │ │ └── policies │ │ │ │ ├── asset-managers │ │ │ │ ├── AllowedAdapterIncomingAssetsPolicy.sol │ │ │ │ ├── AllowedAdaptersPerManagerPolicy.sol │ │ │ │ ├── AllowedAdaptersPolicy.sol │ │ │ │ ├── AllowedExternalPositionTypesPerManagerPolicy.sol │ │ │ │ ├── AllowedExternalPositionTypesPolicy.sol │ │ │ │ ├── CumulativeSlippageTolerancePolicy.sol │ │ │ │ ├── DisallowedAdapterIncomingAssetsPolicy.sol │ │ │ │ ├── OnlyRemoveDustExternalPositionPolicy.sol │ │ │ │ └── OnlyUntrackDustOrPricelessAssetsPolicy.sol │ │ │ │ ├── current-shareholders │ │ │ │ ├── AllowedAssetsForRedemptionPolicy.sol │ │ │ │ ├── AllowedRedeemersForSpecificAssetsPolicy.sol │ │ │ │ ├── MinAssetBalancesPostRedemptionPolicy.sol │ │ │ │ └── NoDepegOnRedeemSharesForSpecificAssetsPolicy.sol │ │ │ │ ├── interfaces │ │ │ │ ├── ICumulativeSlippageTolerancePolicy.sol │ │ │ │ └── IMinMaxInvestmentPolicy.sol │ │ │ │ ├── new-shareholders │ │ │ │ ├── AllowedDepositRecipientsPolicy.sol │ │ │ │ ├── AllowedSharesTransferRecipientsPolicy.sol │ │ │ │ └── MinMaxInvestmentPolicy.sol │ │ │ │ └── utils │ │ │ │ ├── 0.6.12 │ │ │ │ ├── AddressListRegistryPerUserPolicyBase.sol │ │ │ │ ├── AddressListRegistryPolicyBase.sol │ │ │ │ ├── DustEvaluatorMixin.sol │ │ │ │ ├── PolicyBase.sol │ │ │ │ ├── PricelessAssetBypassMixin.sol │ │ │ │ └── UintListRegistryPerUserPolicyBase.sol │ │ │ │ ├── 0.8.19 │ │ │ │ ├── AddressListRegistryPolicyBase.sol │ │ │ │ ├── NoDepegPolicyBase.sol │ │ │ │ └── PolicyBase.sol │ │ │ │ └── interfaces │ │ │ │ └── INoDepegPolicyBase.sol │ │ └── utils │ │ │ ├── ExtensionBase.sol │ │ │ └── PermissionedVaultActionMixin.sol │ ├── infrastructure │ │ ├── FundValueCalculator.sol │ │ ├── gas-relayer │ │ │ ├── GasRelayPaymasterFactory.sol │ │ │ ├── GasRelayPaymasterLib.sol │ │ │ ├── GasRelayRecipientMixin.sol │ │ │ ├── IGasRelayPaymaster.sol │ │ │ ├── IGasRelayPaymasterDepositor.sol │ │ │ └── bases │ │ │ │ ├── GasRelayPaymasterLibBase1.sol │ │ │ │ └── GasRelayPaymasterLibBase2.sol │ │ ├── price-feeds │ │ │ ├── derivatives │ │ │ │ ├── AggregatedDerivativePriceFeedMixin.sol │ │ │ │ ├── IAggregatedDerivativePriceFeedMixin.sol │ │ │ │ ├── IDerivativePriceFeed.sol │ │ │ │ └── feeds │ │ │ │ │ ├── BalancerV2GaugeTokenPriceFeed.sol │ │ │ │ │ ├── BalancerV2StablePoolPriceFeed.sol │ │ │ │ │ ├── BalancerV2WeightedPoolPriceFeed.sol │ │ │ │ │ ├── CompoundPriceFeed.sol │ │ │ │ │ ├── CurvePriceFeed.sol │ │ │ │ │ ├── ERC4626PriceFeed.sol │ │ │ │ │ ├── EnzymeVaultPriceFeed.sol │ │ │ │ │ ├── EtherFiEthPriceFeed.sol │ │ │ │ │ ├── PeggedDerivativesPriceFeed.sol │ │ │ │ │ ├── RevertingPriceFeed.sol │ │ │ │ │ ├── StaderSDPriceFeed.sol │ │ │ │ │ ├── UniswapV2PoolPriceFeed.sol │ │ │ │ │ ├── YearnVaultV2PriceFeed.sol │ │ │ │ │ ├── interfaces │ │ │ │ │ ├── IBalancerV2StablePoolPriceFeed.sol │ │ │ │ │ ├── ICurvePriceFeed.sol │ │ │ │ │ └── IUniswapV2PoolPriceFeed.sol │ │ │ │ │ └── utils │ │ │ │ │ ├── PeggedDerivativesPriceFeedBase.sol │ │ │ │ │ ├── SinglePeggedDerivativePriceFeedBase.sol │ │ │ │ │ └── SingleUnderlyingDerivativeRegistryMixin.sol │ │ │ ├── primitives │ │ │ │ ├── BtcToEthQuotedSimulatedAggregator.sol │ │ │ │ ├── ChainlinkLikeWstethPriceFeed.sol │ │ │ │ ├── ChainlinkLikeYnEthPriceFeed.sol │ │ │ │ ├── ChainlinkPriceFeedMixin.sol │ │ │ │ ├── ConvertedQuoteAggregator.sol │ │ │ │ ├── ERC4626RateAggregator.sol │ │ │ │ ├── IChainlinkPriceFeedMixin.sol │ │ │ │ ├── NonStandardPrecisionSimulatedAggregator.sol │ │ │ │ ├── PeggedRateDeviationAggregator.sol │ │ │ │ ├── SmarDexUsdnNativeRateUsdAggregator.sol │ │ │ │ ├── SolvBtcYieldTokenRateUsdAggregator.sol │ │ │ │ ├── StaderEthXRateEthAggregator.sol │ │ │ │ ├── UsdEthSimulatedAggregator.sol │ │ │ │ ├── factories │ │ │ │ │ ├── ConvertedQuoteAggregatorFactory.sol │ │ │ │ │ ├── ERC4626RateAggregatorFactory.sol │ │ │ │ │ ├── PeggedRateDeviationAggregatorFactory.sol │ │ │ │ │ └── SolvBtcYieldTokenRateUsdAggregatorFactory.sol │ │ │ │ └── utils │ │ │ │ │ ├── AggregatorRateDeviationBase.sol │ │ │ │ │ ├── RateAggregatorBase.sol │ │ │ │ │ ├── RateEthAggregatorBase.sol │ │ │ │ │ ├── RateUsdAggregatorBase.sol │ │ │ │ │ └── TwoAggregatorsWithCommonQuoteSimulatedAggregator.sol │ │ │ └── utils │ │ │ │ ├── PriceFeedHelpersLib.sol │ │ │ │ └── UniswapV2PoolTokenValueCalculator.sol │ │ ├── protocol-fees │ │ │ ├── IProtocolFeeTracker.sol │ │ │ └── ProtocolFeeTracker.sol │ │ └── value-interpreter │ │ │ ├── IValueInterpreter.sol │ │ │ └── ValueInterpreter.sol │ ├── off-chain │ │ ├── AssetValueCalculator.sol │ │ ├── HelperDataReader.sol │ │ ├── README.md │ │ └── interfaces │ │ │ └── IHelperDataReader.sol │ ├── peripheral │ │ ├── DepositWrapper.sol │ │ └── UnpermissionedActionsWrapper.sol │ └── utils │ │ ├── 0.6.12 │ │ └── FundDeployerOwnerMixin.sol │ │ └── 0.8.19 │ │ └── FundDeployerOwnerMixin.sol ├── test │ ├── AggregatorRateDeviationBaseHarness.sol │ ├── GSNRecipientMixinHarness.sol │ ├── MultiCallAccountMixinHarness.sol │ ├── PriceFeedHelpersLibHarness.sol │ └── RateAggregatorBaseHarness.sol └── utils │ ├── 0.6.12 │ ├── AddressArrayLib.sol │ ├── AssetHelpers.sol │ ├── BalancerV2FixedPoint.sol │ ├── BalancerV2LogExpMath.sol │ ├── MakerDaoMath.sol │ ├── MathHelpers.sol │ ├── NominatedOwnerMixin.sol │ ├── NonUpgradableProxy.sol │ ├── Uint256ArrayLib.sol │ ├── beacon-proxy │ │ ├── BeaconProxy.sol │ │ ├── BeaconProxyFactory.sol │ │ ├── IBeacon.sol │ │ └── IBeaconProxyFactory.sol │ └── open-zeppelin │ │ └── WrappedSafeERC20.sol │ └── 0.8.19 │ ├── AddressArrayLib.sol │ ├── AssetHelpers.sol │ ├── Bytes32ArrayLib.sol │ ├── Int256ArrayLib.sol │ ├── MathHelpersLib.sol │ ├── NonUpgradableProxy.sol │ ├── Uint256ArrayLib.sol │ ├── deprecated │ └── beacon-proxy │ │ ├── BeaconProxy.sol │ │ ├── BeaconProxyFactory.sol │ │ ├── IBeacon.sol │ │ └── IBeaconProxyFactory.sol │ ├── dispatcher-owned-beacon │ ├── DispatcherOwnedBeacon.sol │ ├── DispatcherOwnedBeaconFactory.sol │ ├── IDispatcherOwnedBeacon.sol │ └── IDispatcherOwnedBeaconFactory.sol │ ├── gas-station-network │ └── GSNRecipientMixin.sol │ └── open-zeppelin │ └── WrappedSafeERC20.sol ├── flake.lock ├── flake.nix ├── foundry.toml ├── remappings.txt └── tests ├── README.md ├── bases ├── IntegrationTest.sol └── UnitTest.sol ├── interfaces ├── external │ ├── IAaveAToken.sol │ ├── IAaveV2IncentivesController.sol │ ├── IAaveV2LendingPool.sol │ ├── IAaveV2LendingPoolAddressProvider.sol │ ├── IAaveV2ProtocolDataProvider.sol │ ├── IAaveV3Pool.sol │ ├── IAaveV3PoolAddressProvider.sol │ ├── IAaveV3PriceOracle.sol │ ├── IAaveV3ProtocolDataProvider.sol │ ├── IAaveV3RewardsController.sol │ ├── IAliceOrderManager.sol │ ├── IAliceWhitelistManager.sol │ ├── IBalancerV2LiquidityGauge.sol │ ├── IBalancerV2Vault.sol │ ├── IChainlinkAggregator.sol │ ├── ICompoundV2CERC20.sol │ ├── ICompoundV2CEther.sol │ ├── ICompoundV2Comptroller.sol │ ├── ICompoundV3Comet.sol │ ├── ICompoundV3CometRewards.sol │ ├── ICompoundV3Configurator.sol │ ├── IConvexBaseRewardPool.sol │ ├── IConvexCvxLockerV2.sol │ ├── IConvexVlCvxExtraRewardDistribution.sol │ ├── ICurveAddressProvider.sol │ ├── ICurveGaugeController.sol │ ├── ICurveLiquidityPool.sol │ ├── ICurveMinter.sol │ ├── ICurveSwapRouter.sol │ ├── IDivaEther.sol │ ├── IERC20.sol │ ├── IERC4626.sol │ ├── IEtherFiLiquidityPool.sol │ ├── IEtherFiWrappedEth.sol │ ├── IGMXV2ChainlinkPriceFeedProvider.sol │ ├── IGMXV2DataStore.sol │ ├── IGMXV2ExchangeRouter.sol │ ├── IGMXV2LiquidationHandler.sol │ ├── IGMXV2Market.sol │ ├── IGMXV2Order.sol │ ├── IGMXV2OrderHandler.sol │ ├── IGMXV2Position.sol │ ├── IGMXV2Prices.sol │ ├── IGMXV2Reader.sol │ ├── IGMXV2RoleStore.sol │ ├── IKilnStakingContract.sol │ ├── ILidoSteth.sol │ ├── ILidoWithdrawalQueue.sol │ ├── IMapleV2Globals.sol │ ├── IMapleV2Pool.sol │ ├── IMapleV2PoolManager.sol │ ├── IMapleV2ProxyFactory.sol │ ├── IMapleV2WithdrawalManager.sol │ ├── IMerklCore.sol │ ├── IMerklDistributor.sol │ ├── IMorphoBlue.sol │ ├── IMorphoMorpho.sol │ ├── IMorphoSupplyVault.sol │ ├── IMysoV3DataTypes.sol │ ├── IMysoV3Escrow.sol │ ├── IMysoV3Router.sol │ ├── INonfungiblePositionManager.sol │ ├── IOneInchV5AggregationRouter.sol │ ├── IParaSwapV5AugustusSwapper.sol │ ├── IParaSwapV6FeeVault.sol │ ├── IPendleV2Market.sol │ ├── IPendleV2PrincipalToken.sol │ ├── IPendleV2PyYtLpOracle.sol │ ├── IPendleV2Router.sol │ ├── IPendleV2StandardizedYield.sol │ ├── ISnapshotDelegateRegistry.sol │ ├── IStaderConfig.sol │ ├── IStaderStakePoolsManager.sol │ ├── IStaderUserWithdrawalManager.sol │ ├── IStakeWiseV3EthVault.sol │ ├── IStakeWiseV3KeeperRewards.sol │ ├── IStakeWiseV3OsTokenController.sol │ ├── ISwellSweth.sol │ ├── ITermFinanceV1Auction.sol │ ├── ITermFinanceV1BidLocker.sol │ ├── ITermFinanceV1OfferLocker.sol │ ├── ITermFinanceV1RepoCollateralManager.sol │ ├── ITermFinanceV1RepoServicer.sol │ ├── ITermFinanceV1RepoToken.sol │ ├── ITheGraphController.sol │ ├── ITheGraphEpochManager.sol │ ├── ITheGraphStaking.sol │ ├── IUniswapV2Pair.sol │ ├── IUniswapV3SwapRouter.sol │ ├── IVotiumMultiMerkleStash.sol │ ├── IYearnVaultV2Vault.sol │ └── IZeroExV4.sol ├── interfaces.txt └── internal │ └── v4 │ ├── IComptrollerLib.sol │ ├── IExternalPositionManager.sol │ ├── IFeeManager.sol │ ├── IFundDeployer.sol │ ├── IGasRelayPaymasterFactory.sol │ ├── IIntegrationManager.sol │ ├── IPolicyManager.sol │ ├── IProtocolFeeTracker.sol │ ├── IUsdEthSimulatedAggregator.sol │ ├── IValueInterpreter.sol │ └── IVaultLib.sol ├── tests ├── core │ ├── fund-deployer │ │ ├── FundDeployer.t.sol │ │ └── FundDeployerMigrationIn.t.sol │ └── fund │ │ └── Comptroller.t.sol ├── extensions │ └── FeeManager.t.sol ├── fees │ └── performance │ │ ├── PerformanceFeeIntegration.t.sol │ │ └── PerformanceFeeUnit.t.sol ├── infrastracture │ ├── PeggedDerivativesPriceFeed.t.sol │ └── ValueInterpreter.t.sol ├── misc-adapters │ └── TransferAssetsAdapter.t.sol ├── misc-price-feeds │ └── ConvertedQuoteAggregator.t.sol ├── off-chain │ └── HelperDataReader.t.sol ├── peripheral │ ├── DepositWrapper.t.sol │ ├── NonStandardPrecisionSimulatedAggregator.t.sol │ └── TwoAggregatorsWithCommonQuoteSimulatedAggregator.t.sol ├── persistent │ ├── FundDataProviderRouter.t.sol │ ├── SingleAssetDepositQueue.t.sol │ ├── SingleAssetRedemptionQueue.t.sol │ └── smart-accounts │ │ ├── AaveV3FlashLoanAssetManagerLib.t.sol │ │ ├── MorphoBlueFlashLoanAssetManagerLib.t.sol │ │ ├── MultiCallAccount.t.sol │ │ └── SharePriceThrottledAssetManager.t.sol ├── policies │ ├── AllowedRedeemersForSpecificAssetsPolicy.t.sol │ ├── CumulativeSlippageTolerancePolicy.t.sol │ └── NoDepegOnRedeemSharesForSpecificAssetsPolicy.t.sol ├── protocols │ ├── aave │ │ ├── AaveAdapterTest.sol │ │ ├── AaveV2Adapter.t.sol │ │ ├── AaveV2Constants.sol │ │ ├── AaveV2DebtPosition.t.sol │ │ ├── AaveV2Utils.sol │ │ ├── AaveV3Adapter.t.sol │ │ ├── AaveV3AdapterTest.sol │ │ ├── AaveV3Constants.sol │ │ ├── AaveV3DebtPosition.t.sol │ │ ├── AaveV3DebtPositionTest.sol │ │ └── AaveV3Utils.sol │ ├── alice │ │ └── AlicePosition.t.sol │ ├── balancer │ │ ├── BalancerV2GaugeTokenPriceFeed.t.sol │ │ ├── BalancerV2LiquidityAdapter.t.sol │ │ ├── BalancerV2StablePoolPriceFeed.t.sol │ │ ├── BalancerV2Utils.sol │ │ └── BalancerV2WeightedPoolPriceFeed.t.sol │ ├── compound │ │ ├── CompoundV2Adapter.t.sol │ │ ├── CompoundV2Constants.sol │ │ ├── CompoundV2DebtPosition.t.sol │ │ ├── CompoundV2PriceFeed.t.sol │ │ ├── CompoundV3Adapter.t.sol │ │ └── CompoundV3Constants.sol │ ├── convex-voting │ │ └── ConvexVotingPosition.t.sol │ ├── curve │ │ ├── CurveLiquidityAdapter.t.sol │ │ ├── CurvePriceFeed.t.sol │ │ └── CurveUtils.sol │ ├── diva │ │ └── DivaStakingAdapter.t.sol │ ├── enzyme │ │ ├── EnzymeV4VaultAdapter.t.sol │ │ └── EnzymeVaultPriceFeed.t.sol │ ├── erc4626 │ │ ├── ERC4626Adapter.t.sol │ │ ├── ERC4626PriceFeed.t.sol │ │ └── ERC4626Utils.sol │ ├── etherfi │ │ └── EtherFiEthPriceFeed.t.sol │ ├── gmx-v2 │ │ └── GMXV2LeverageTradingPosition.t.sol │ ├── kiln │ │ └── KilnStakingPosition.t.sol │ ├── lido │ │ ├── ChainlinkLikeWstethPriceFeed.t.sol │ │ └── LidoWithdrawalsPosition.t.sol │ ├── maple │ │ ├── MapleLiquidityConstants.sol │ │ └── MapleLiquidityPosition.t.sol │ ├── morpho-blue │ │ └── MorphoBluePosition.t.sol │ ├── myso-v3 │ │ ├── MockOracle.sol │ │ └── MysoV3OptionWritingPosition.t.sol │ ├── one-inch │ │ └── OneInchV5Adapter.t.sol │ ├── paraswap-v5 │ │ └── ParaSwapV5Adapter.t.sol │ ├── paraswap-v6 │ │ └── ParaSwapV6Adapter.t.sol │ ├── pendle │ │ └── PendleV2Adapter.t.sol │ ├── smar-dex │ │ └── SmarDexUsdnNativeRateUsdAggregator.t.sol │ ├── solv-protocol │ │ └── SolvBtcYieldTokenRateUsdAggregator.t.sol │ ├── stader │ │ ├── StaderEthXRateEthAggregatorTest.t.sol │ │ ├── StaderSDPriceFeed.t.sol │ │ ├── StaderStakingAdapter.t.sol │ │ └── StaderWithdrawalsPosition.t.sol │ ├── stakewise │ │ └── StakeWiseV3StakingPosition.t.sol │ ├── swell │ │ └── SwellStakingAdapter.t.sol │ ├── term-finance │ │ └── TermFinanceV1LendingPosition.t.sol │ ├── the-graph │ │ └── TheGraphDelegationPosition.t.sol │ ├── uniswap │ │ ├── UniswapV2LiquidityAdapter.t.sol │ │ ├── UniswapV2PoolPriceFeed.t.sol │ │ ├── UniswapV2Utils.sol │ │ ├── UniswapV3Adapter.t.sol │ │ ├── UniswapV3LiquidityPosition.t.sol │ │ └── UniswapV3Utils.sol │ ├── utils │ │ └── GenericWrappingAdapterBase.sol │ ├── yearn │ │ ├── YearnVaultV2Adapter.t.sol │ │ ├── YearnVaultV2Contants.sol │ │ └── YearnVaultV2PriceFeed.t.sol │ ├── yield-nest │ │ └── ChainlinkLikeYnEthPriceFeed.t.sol │ ├── zero-lend │ │ ├── ZeroLendAaveV3Adapter.t.sol │ │ ├── ZeroLendAaveV3DebtPosition.t.sol │ │ └── ZeroLendConstants.sol │ └── zeroex │ │ └── ZeroExV4Adapter.t.sol └── utils │ ├── AggregatorRateDeviationBase.t.sol │ ├── GSNRecipientMixin.t.sol │ ├── PriceFeedHelpersLib.t.sol │ ├── RateAggregatorBase.t.sol │ └── dispatcher-owned-beacon │ └── DispatcherOwnedBeaconFactory.t.sol └── utils ├── CommonUtils.sol ├── Constants.sol ├── CoreUtils.sol ├── Mocks.sol ├── bases ├── AddOnUtilsBase.sol ├── CommonUtilsBase.sol └── CoreUtilsBase.sol ├── common ├── AccountUtils.sol ├── AssetBalanceUtils.sol ├── ErrorUtils.sol ├── EventUtils.sol ├── StorageUtils.sol ├── TokenUtils.sol └── TypeUtils.sol ├── core ├── AdapterUtils.sol ├── AssetUniverseUtils.sol ├── ExternalPositionUtils.sol ├── FeeUtils.sol ├── FundUtils.sol ├── ListRegistryUtils.sol ├── PolicyUtils.sol └── deployment │ ├── DeploymentUtils.sol │ ├── PersistentContracts.sol │ ├── V4ReleaseContracts.sol │ └── V5ReleaseContracts.sol ├── fees └── PerformanceFeeUtils.sol ├── libs ├── AddressArrayLib.sol ├── AddressLib.sol ├── Bytes32Lib.sol ├── BytesArrayLib.sol ├── GasLib.sol └── Uint256ArrayLib.sol └── policies └── CumulativeSlippageTolerancePolicyUtils.sol /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.sol] 12 | indent_size = 4 13 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | ETHEREUM_NODE_MAINNET= 2 | ETHEREUM_NODE_POLYGON= 3 | ETHEREUM_NODE_ARBITRUM= 4 | ETHEREUM_NODE_BASE= 5 | 6 | ETHERSCAN_API_KEY_MAINNET= 7 | ETHERSCAN_API_KEY_POLYGON= 8 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | use flake; 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | lib/** linguist-vendored 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore log output. 2 | *.log 3 | 4 | # Ignore all dotfiles except the whitelisted ones. 5 | .* 6 | !.env.example 7 | !.envrc 8 | !.github 9 | !.gitignore 10 | !.gitattributes 11 | !.solhint.json 12 | !.solhintignore 13 | !.vscode 14 | !.editorconfig 15 | 16 | # Ignore foundry artifacts & cache. 17 | artifacts/ 18 | cache/ 19 | 20 | # Ignore internal interfaces. 21 | tests/interfaces/internal/*.sol 22 | tests/interfaces/internal/*.abi.json 23 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/morpho-blue"] 5 | path = lib/morpho-blue 6 | url = https://github.com/morpho-org/morpho-blue 7 | [submodule "lib/openzeppelin-solc-0.6"] 8 | path = lib/openzeppelin-solc-0.6 9 | url = https://github.com/openzeppelin/openzeppelin-contracts 10 | [submodule "lib/openzeppelin-solc-0.7"] 11 | path = lib/openzeppelin-solc-0.7 12 | url = https://github.com/openzeppelin/openzeppelin-contracts 13 | [submodule "lib/openzeppelin-solc-0.8"] 14 | path = lib/openzeppelin-solc-0.8 15 | url = https://github.com/openzeppelin/openzeppelin-contracts 16 | [submodule "lib/uniswap-v3-periphery"] 17 | path = lib/uniswap-v3-periphery 18 | url = https://github.com/uniswap/v3-periphery 19 | [submodule "lib/uniswap-v3-core"] 20 | path = lib/uniswap-v3-core 21 | url = https://github.com/uniswap/v3-core 22 | [submodule "lib/uniswap-v3-core-0.8"] 23 | path = lib/uniswap-v3-core-0.8 24 | url = https://github.com/Uniswap/v3-core.git 25 | branch = 0.8 26 | -------------------------------------------------------------------------------- /.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "rules": { 4 | "compiler-version": ["error", ">=0.6.0 <0.9.0"], 5 | "func-visibility": ["error", { "ignoreConstructors": true }], 6 | "no-empty-blocks": "off", 7 | "not-rely-on-time": "off", 8 | "avoid-low-level-calls": "off", 9 | "no-inline-assembly": "off", 10 | "var-name-mixedcase": "off", 11 | "func-name-mixedcase": "off", 12 | "reason-string": "off", 13 | "no-global-import": "off" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.solhintignore: -------------------------------------------------------------------------------- 1 | # Ignore third party contracts. 2 | contracts/release/utils/BalancerV2FixedPoint.sol 3 | contracts/release/utils/BalancerV2LogExpMath.sol 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["NomicFoundation.hardhat-solidity"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "editor.codeActionsOnSave": { 4 | "source.fixAll": "explicit" 5 | }, 6 | "solidity.formatter": "forge", 7 | "[solidity]": { 8 | "editor.defaultFormatter": "NomicFoundation.hardhat-solidity" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Issues and Bug Bounty 2 | 3 | If you find a vulnerability that may affect live deployments, you can submit a report via: 4 | 5 | A. Immunefi (https://immunefi.com/bounty/enzymefinance/), or 6 | 7 | B. Direct email to [security@enzyme.finance](mailto:security@enzyme.finance) 8 | 9 | Please **DO NOT** open a public issue. 10 | -------------------------------------------------------------------------------- /audits/2021-01-CS-protocol-v2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2021-01-CS-protocol-v2.pdf -------------------------------------------------------------------------------- /audits/2021-09-CS-protocol-v4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2021-09-CS-protocol-v4.pdf -------------------------------------------------------------------------------- /audits/2021-10-OZ-protocol-v4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2021-10-OZ-protocol-v4.pdf -------------------------------------------------------------------------------- /audits/2021-12-CS-fund-value-calculator-address-list-registry-paraswap-pool-together-uniswap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2021-12-CS-fund-value-calculator-address-list-registry-paraswap-pool-together-uniswap.pdf -------------------------------------------------------------------------------- /audits/2022-01-CS-protocol-v4-revisions-curve-synthetix-olympus-compound.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-01-CS-protocol-v4-revisions-curve-synthetix-olympus-compound.pdf -------------------------------------------------------------------------------- /audits/2022-02-CS-protocol-v4-revisions-performance-fee-convex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-02-CS-protocol-v4-revisions-performance-fee-convex.pdf -------------------------------------------------------------------------------- /audits/2022-03-CS-aave-borrowing-fuse-lending-uniswap-v3-lp-rev-usdeth-simulated-aggregator.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-03-CS-aave-borrowing-fuse-lending-uniswap-v3-lp-rev-usdeth-simulated-aggregator.pdf -------------------------------------------------------------------------------- /audits/2022-05-CS-curve-fixes-maple-shares-splitter-convex-voting-paraswap-fee-liquity-graph-delegation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-05-CS-curve-fixes-maple-shares-splitter-convex-voting-paraswap-fee-liquity-graph-delegation.pdf -------------------------------------------------------------------------------- /audits/2022-08-CS-arbitrary-loans-solv-convertibles-fidu-unit-lists-manager-policies-deposit-wrapper-fix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-08-CS-arbitrary-loans-solv-convertibles-fidu-unit-lists-manager-policies-deposit-wrapper-fix.pdf -------------------------------------------------------------------------------- /audits/2022-10-CS--compound-cdp-fix--protocol-fee-reserve-arbitrary-call--balancer-lp--balancer-weighted-pool-feed--notional-lending-and-borrowing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-10-CS--compound-cdp-fix--protocol-fee-reserve-arbitrary-call--balancer-lp--balancer-weighted-pool-feed--notional-lending-and-borrowing.pdf -------------------------------------------------------------------------------- /audits/2022-11-CS--balancer-and-aura-staking--balancer-stable-pool-feed--kiln-staking--paraswap-multi-order--arbitrary-deposit-token-shares-wrapper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-11-CS--balancer-and-aura-staking--balancer-stable-pool-feed--kiln-staking--paraswap-multi-order--arbitrary-deposit-token-shares-wrapper.pdf -------------------------------------------------------------------------------- /audits/2022-12-CS--maple-v2-migration--aave-v3-lending--compound-v3-lending--wsteth-price-feed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2022-12-CS--maple-v2-migration--aave-v3-lending--compound-v3-lending--wsteth-price-feed.pdf -------------------------------------------------------------------------------- /audits/2023-02-CS--gated-redemption-shares-wrapper--balancer-v2-batch-swap--uniswap-v2-fee-on-transfer-tokens--solv-v2-bonds.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-02-CS--gated-redemption-shares-wrapper--balancer-v2-batch-swap--uniswap-v2-fee-on-transfer-tokens--solv-v2-bonds.pdf -------------------------------------------------------------------------------- /audits/2023-03-CS--gsn-fix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-03-CS--gsn-fix.pdf -------------------------------------------------------------------------------- /audits/2023-05-CS--zero-ex-v4--1inch-v5--paraswap-v5-updates--gated-shares-wrapper-updates.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-05-CS--zero-ex-v4--1inch-v5--paraswap-v5-updates--gated-shares-wrapper-updates.pdf -------------------------------------------------------------------------------- /audits/2023-07-CS--erc4626--kiln-exits--balancer-stable-pool-price-feed-fix--convex-aura-wrappers-fix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-07-CS--erc4626--kiln-exits--balancer-stable-pool-price-feed-fix--convex-aura-wrappers-fix.pdf -------------------------------------------------------------------------------- /audits/2023-09-CS--convex-aura-wrappers-v2--no-depeg-policy--arrakis-v2--erc20-deposit-wrapper--lido-withdrawals--aave-v3-debt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-09-CS--convex-aura-wrappers-v2--no-depeg-policy--arrakis-v2--erc20-deposit-wrapper--lido-withdrawals--aave-v3-debt.pdf -------------------------------------------------------------------------------- /audits/2023-10-CS--deposit-wrapper-fix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-10-CS--deposit-wrapper-fix.pdf -------------------------------------------------------------------------------- /audits/2023-12-CS--stakewise-v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-12-CS--stakewise-v3.pdf -------------------------------------------------------------------------------- /audits/2023-12-CS--term-finance-lending--zero-ex-v4-otc--maple-fix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2023-12-CS--term-finance-lending--zero-ex-v4-otc--maple-fix.pdf -------------------------------------------------------------------------------- /audits/2024-04-CS--morpho-blue.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-04-CS--morpho-blue.pdf -------------------------------------------------------------------------------- /audits/2024-05-CS--lmax-alice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-05-CS--lmax-alice.pdf -------------------------------------------------------------------------------- /audits/2024-07-CS--pendle-v2--swell--gsn-updates--etherfi-eth-price--redemption-queue--share-price-throttled-asset-manager--allowed-redeemers-for-specific-assets-policy--non-standard-precision-simulated-aggregator.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-07-CS--pendle-v2--swell--gsn-updates--etherfi-eth-price--redemption-queue--share-price-throttled-asset-manager--allowed-redeemers-for-specific-assets-policy--non-standard-precision-simulated-aggregator.pdf -------------------------------------------------------------------------------- /audits/2024-08-CS--chainlink-like-wsteth-feed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-08-CS--chainlink-like-wsteth-feed.pdf -------------------------------------------------------------------------------- /audits/2024-09-CS--chainlink-like-yneth-feed--stader-SD-feed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-09-CS--chainlink-like-yneth-feed--stader-SD-feed.pdf -------------------------------------------------------------------------------- /audits/2024-10-CS--aave-v3-flash-loan-asset-manager.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-10-CS--aave-v3-flash-loan-asset-manager.pdf -------------------------------------------------------------------------------- /audits/2024-12-CS--stader-withdrawals.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2024-12-CS--stader-withdrawals.pdf -------------------------------------------------------------------------------- /audits/2025-02-CS--gmx-v2--disallowed-adapter-incoming-assets-policy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2025-02-CS--gmx-v2--disallowed-adapter-incoming-assets-policy.pdf -------------------------------------------------------------------------------- /audits/2025-02-CS--price-feed-utils.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2025-02-CS--price-feed-utils.pdf -------------------------------------------------------------------------------- /audits/2025-03-CS--single-asset-deposit-queue.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2025-03-CS--single-asset-deposit-queue.pdf -------------------------------------------------------------------------------- /audits/2025-04-CS--myso-v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2025-04-CS--myso-v3.pdf -------------------------------------------------------------------------------- /audits/2025-05-CS--stakewise-v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/2025-05-CS--stakewise-v3.pdf -------------------------------------------------------------------------------- /audits/README.md: -------------------------------------------------------------------------------- 1 | # Audit Reports 2 | 3 | This directory contains audit reports relevant to Enzyme. 4 | 5 | The main directory contains audits of contracts within this repo, beginning with the core protocol work for v2. 6 | 7 | `/external-teams` contains reports on plugin contracts built by external teams, with code hosted elsewhere, as noted in the report. 8 | -------------------------------------------------------------------------------- /audits/external-teams/2024-04-CS--31third.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzymefinance/protocol/21877d255118444afc147c1fcb81005e2f27883c/audits/external-teams/2024-04-CS--31third.pdf -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveAToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveAToken interface 15 | /// @author Enzyme Foundation 16 | /// @notice Common Aave aToken interface for V2 and V3 17 | interface IAaveAToken { 18 | function UNDERLYING_ASSET_ADDRESS() external view returns (address underlying_); 19 | } 20 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV2IncentivesController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV2IncentivesController interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV2IncentivesController { 17 | function claimRewards(address[] memory _assets, uint256 _amount, address _to) external; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV2LendingPoolAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV2LendingPoolAddressProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV2LendingPoolAddressProvider { 17 | function getLendingPool() external view returns (address pool_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV2ProtocolDataProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV2ProtocolDataProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV2ProtocolDataProvider { 17 | function getReserveTokensAddresses(address _underlying) 18 | external 19 | view 20 | returns (address aToken_, address stableDebtToken_, address variableDebtToken_); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV3FlashLoanReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3FlashLoanReceiver interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3FlashLoanReceiver { 17 | function executeOperation( 18 | address[] calldata assets, 19 | uint256[] calldata amounts, 20 | uint256[] calldata premiums, 21 | address initiator, 22 | bytes calldata params 23 | ) external returns (bool success_); 24 | 25 | function ADDRESSES_PROVIDER() external view returns (address poolAddressProviderAddress_); 26 | 27 | function POOL() external view returns (address poolAddress_); 28 | } 29 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV3PoolAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3PoolAddressProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3PoolAddressProvider { 17 | function getPool() external view returns (address pool_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV3ProtocolDataProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3ProtocolDataProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3ProtocolDataProvider { 17 | function getReserveTokensAddresses(address _underlying) 18 | external 19 | view 20 | returns (address aToken_, address stableDebtToken_, address variableDebtToken_); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IAaveV3RewardsController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3RewardsController interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3RewardsController { 17 | function claimRewards(address[] calldata _assets, uint256 _amount, address _to, address _rewardToken) 18 | external 19 | returns (uint256 amountClaimed_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IBalancerV2LiquidityGauge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IBalancerV2LiquidityGauge interface 13 | /// @author Enzyme Foundation 14 | /// @dev Applies to both LiquidityGauge (L1) and ChildChainLiquidityGauge (L2/sidechains) 15 | interface IBalancerV2LiquidityGauge { 16 | function lp_token() external view returns (address lpToken_); 17 | } 18 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IBalancerV2PoolFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IBalancerV2PoolFactory interface 13 | /// @author Enzyme Foundation 14 | interface IBalancerV2PoolFactory { 15 | function isPoolFromFactory(address _pool) external view returns (bool success_); 16 | } 17 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IBalancerV2StablePool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IBalancerV2StablePool interface 13 | /// @author Enzyme Foundation 14 | interface IBalancerV2StablePool { 15 | function getPoolId() external view returns (bytes32 poolId_); 16 | 17 | function getRate() external view returns (uint256 rate_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IBalancerV2WeightedPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IBalancerV2WeightedPool interface 13 | /// @author Enzyme Foundation 14 | interface IBalancerV2WeightedPool { 15 | function getInvariant() external view returns (uint256 invariant_); 16 | 17 | function getNormalizedWeights() external view returns (uint256[] memory weights_); 18 | 19 | function getPoolId() external view returns (bytes32 poolId_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IChainlinkAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IChainlinkAggregator Interface 15 | /// @author Enzyme Foundation 16 | interface IChainlinkAggregator { 17 | function decimals() external view returns (uint8); 18 | 19 | function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICompoundComptroller.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title ICompoundComptroller Interface 13 | /// @author Enzyme Foundation 14 | /// @notice Minimal interface for interactions with Compound Comptroller 15 | interface ICompoundComptroller { 16 | function claimComp(address) external; 17 | 18 | function claimComp(address, address[] memory) external; 19 | 20 | function enterMarkets(address[] calldata) external returns (uint256[] memory); 21 | 22 | function exitMarket(address) external returns (uint256); 23 | } 24 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICompoundV2CEther.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IERC20} from "./IERC20.sol"; 15 | 16 | /// @title ICompoundV2CEther Interface 17 | /// @author Enzyme Foundation 18 | interface ICompoundV2CEther is IERC20 { 19 | function mint() external payable; 20 | 21 | function repayBorrow() external payable; 22 | } 23 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICompoundV3Comet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICompoundV3Comet Interface 15 | /// @author Enzyme Foundation 16 | interface ICompoundV3Comet { 17 | function baseToken() external view returns (address baseToken_); 18 | 19 | function supplyTo(address _dst, address _asset, uint256 _amount) external; 20 | 21 | function withdrawTo(address _dst, address _asset, uint256 _amount) external; 22 | } 23 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICompoundV3CometRewards.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | pragma experimental ABIEncoderV2; 14 | 15 | /// @title ICompoundV3CometRewards Interface 16 | /// @author Enzyme Foundation 17 | /// @dev Source: https://github.com/compound-finance/comet/blob/main/contracts/CometRewards.sol 18 | interface ICompoundV3CometRewards { 19 | struct RewardConfig { 20 | address token; 21 | uint64 rescaleFactor; 22 | bool shouldUpscale; 23 | } 24 | 25 | function claim(address _cToken, address _src, bool _shouldAccrue) external; 26 | 27 | function rewardConfig(address _cToken) external view returns (RewardConfig memory rewardConfig_); 28 | } 29 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IConvexBaseRewardPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IConvexBaseRewardPool Interface 13 | /// @author Enzyme Foundation 14 | interface IConvexBaseRewardPool { 15 | function balanceOf(address _account) external view returns (uint256 balance_); 16 | 17 | function extraRewards(uint256 _index) external view returns (address rewardPool_); 18 | 19 | function extraRewardsLength() external view returns (uint256 length_); 20 | 21 | function getReward() external returns (bool success_); 22 | 23 | function withdraw(uint256 _amount, bool _claim) external returns (bool success_); 24 | 25 | function withdrawAndUnwrap(uint256 _amount, bool _claim) external returns (bool success_); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IConvexCvxLockerV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IConvexCvxLockerV2 Interface 13 | /// @author Enzyme Foundation 14 | interface IConvexCvxLockerV2 { 15 | function getReward(address) external; 16 | 17 | function lock(address, uint256, uint256) external; 18 | 19 | function lockedBalanceOf(address) external view returns (uint256); 20 | 21 | function processExpiredLocks(bool) external; 22 | 23 | function withdrawExpiredLocksTo(address) external; 24 | } 25 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IConvexVlCvxExtraRewardDistribution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IConvexVlCvxExtraRewardDistribution Interface 13 | /// @author Enzyme Foundation 14 | interface IConvexVlCvxExtraRewardDistribution { 15 | function getReward(address, address) external; 16 | } 17 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveAddressProvider interface 15 | /// @author Enzyme Foundation 16 | interface ICurveAddressProvider { 17 | function get_address(uint256) external view returns (address); 18 | 19 | function get_registry() external view returns (address); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveLiquidityGaugeV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveLiquidityGaugeV2 interface 15 | /// @author Enzyme Foundation 16 | interface ICurveLiquidityGaugeV2 { 17 | function claim_rewards(address) external; 18 | 19 | function deposit(uint256, address) external; 20 | 21 | function reward_tokens(uint256) external view returns (address); 22 | 23 | function withdraw(uint256) external; 24 | } 25 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveLiquidityPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveLiquidityPool interface 15 | /// @author Enzyme Foundation 16 | interface ICurveLiquidityPool { 17 | function coins(int128) external view returns (address); 18 | 19 | function coins(uint256) external view returns (address); 20 | 21 | function get_virtual_price() external view returns (uint256); 22 | 23 | function underlying_coins(int128) external view returns (address); 24 | 25 | function underlying_coins(uint256) external view returns (address); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveMinter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveMinter interface 15 | /// @author Enzyme Foundation 16 | interface ICurveMinter { 17 | function mint_for(address, address) external; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurvePoolOwner.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurvePoolOwner interface 15 | /// @author Enzyme Foundation 16 | interface ICurvePoolOwner { 17 | function withdraw_admin_fees(address) external; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveRegistryMain.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveRegistryMain interface 15 | /// @author Enzyme Foundation 16 | /// @notice Limited interface for the Curve Registry contract at ICurveAddressProvider.get_address(0) 17 | interface ICurveRegistryMain { 18 | function get_gauges(address) external view returns (address[10] memory, int128[10] memory); 19 | 20 | function get_lp_token(address) external view returns (address); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveRegistryMetapoolFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveRegistryMetapoolFactory interface 15 | /// @author Enzyme Foundation 16 | /// @notice Limited interface for the Curve Registry contract at ICurveAddressProvider.get_address(3) 17 | interface ICurveRegistryMetapoolFactory { 18 | function get_gauge(address) external view returns (address); 19 | 20 | function get_n_coins(address) external view returns (uint256); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ICurveV2TwocryptoPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveV2TwocryptoPool interface 15 | /// @author Enzyme Foundation 16 | interface ICurveV2TwocryptoPool { 17 | function price_oracle() external view returns (uint256 token0PerToken1_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IDivaEther.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IDivaEther Interface 15 | /// @author Enzyme Foundation 16 | interface IDivaEther { 17 | function deposit() external payable returns (uint256 shares_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title IERC20 Interface 5 | /// @author Enzyme Foundation 6 | interface IERC20 { 7 | // IERC20 - strict 8 | 9 | function allowance(address _owner, address _spender) external view returns (uint256 allowance_); 10 | 11 | function approve(address _spender, uint256 _value) external returns (bool approve_); 12 | 13 | function balanceOf(address _account) external view returns (uint256 balanceOf_); 14 | 15 | function totalSupply() external view returns (uint256 totalSupply_); 16 | 17 | function transfer(address _to, uint256 _value) external returns (bool transfer_); 18 | 19 | function transferFrom(address _from, address _to, uint256 _value) external returns (bool transferFrom_); 20 | 21 | // IERC20 - typical 22 | 23 | function decimals() external view returns (uint8 decimals_); 24 | 25 | function name() external view returns (string memory name_); 26 | 27 | function symbol() external view returns (string memory symbol_); 28 | } 29 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IERC20Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | import {IERC20} from "./IERC20.sol"; 5 | 6 | /// @title IERC20Burnable Interface 7 | /// @author Enzyme Foundation 8 | interface IERC20Burnable is IERC20 { 9 | function burn(uint256 _amount) external; 10 | 11 | function burnFrom(address _account, uint256 _amount) external; 12 | } 13 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IEtherFiWrappedEth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IEtherFiWrappedEth Interface 15 | /// @author Enzyme Foundation 16 | interface IEtherFiWrappedEth { 17 | function getWeETHByeETH(uint256 _eETHAmount) external view returns (uint256 weETHAmount_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2ChainlinkPriceFeedProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2ChainlinkPriceFeedProvider Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2ChainlinkPriceFeedProvider { 17 | struct ValidatedPrice { 18 | address token; 19 | uint256 min; 20 | uint256 max; 21 | uint256 timestamp; 22 | address provider; 23 | } 24 | 25 | function getOraclePrice(address _token, bytes memory _data) 26 | external 27 | view 28 | returns (ValidatedPrice memory validatedPrice_); 29 | } 30 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2DataStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2DataStore Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2DataStore { 17 | function getUint(bytes32 _key) external view returns (uint256 value_); 18 | 19 | function getBytes32ValuesAt(bytes32 _setKey, uint256 _start, uint256 _end) 20 | external 21 | view 22 | returns (bytes32[] memory values_); 23 | } 24 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2Market.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IGMXV2Price} from "./IGMXV2Price.sol"; 15 | 16 | /// @title IGMXV2Market interface 17 | /// @author Enzyme Foundation 18 | interface IGMXV2Market { 19 | struct Props { 20 | address marketToken; 21 | address indexToken; 22 | address longToken; 23 | address shortToken; 24 | } 25 | 26 | struct MarketPrices { 27 | IGMXV2Price.Price indexTokenPrice; 28 | IGMXV2Price.Price longTokenPrice; 29 | IGMXV2Price.Price shortTokenPrice; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2OrderHandler.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2OrderHandler Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2OrderHandler { 17 | function orderVault() external view returns (address orderVault_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2Price.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2Price Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2Price { 17 | struct Price { 18 | uint256 min; 19 | uint256 max; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGMXV2RoleStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2RoleStore Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2RoleStore { 17 | function hasRole(address _account, bytes32 _roleKey) external view returns (bool hasRole_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGsnForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGsnForwarder interface 15 | /// @author Enzyme Foundation 16 | interface IGsnForwarder { 17 | struct ForwardRequest { 18 | address from; 19 | address to; 20 | uint256 value; 21 | uint256 gas; 22 | uint256 nonce; 23 | bytes data; 24 | uint256 validUntil; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IGsnTypes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | pragma experimental ABIEncoderV2; 14 | 15 | import "./IGsnForwarder.sol"; 16 | 17 | /// @title IGsnTypes Interface 18 | /// @author Enzyme Foundation 19 | interface IGsnTypes { 20 | struct RelayData { 21 | uint256 gasPrice; 22 | uint256 pctRelayFee; 23 | uint256 baseRelayFee; 24 | address relayWorker; 25 | address paymaster; 26 | address forwarder; 27 | bytes paymasterData; 28 | uint256 clientId; 29 | } 30 | 31 | struct RelayRequest { 32 | IGsnForwarder.ForwardRequest request; 33 | RelayData relayData; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IKilnStakingContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IKilnStakingContract Interface 15 | /// @author Enzyme Foundation 16 | interface IKilnStakingContract { 17 | function deposit() external payable; 18 | 19 | function getCLFeeRecipient(bytes calldata _publicKey) external view returns (address feeRecipient_); 20 | 21 | function getWithdrawnFromPublicKeyRoot(bytes32 _publicKeyRoot) external view returns (bool withdrawn_); 22 | 23 | function requestValidatorsExit(bytes calldata _publicKeys) external; 24 | 25 | function withdrawCLFee(bytes calldata _publicKey) external; 26 | 27 | function withdrawELFee(bytes calldata _publicKey) external; 28 | } 29 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ILidoSteth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ILidoSteth Interface 15 | /// @author Enzyme Foundation 16 | interface ILidoSteth { 17 | function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256 ethAmount_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ILidoWithdrawalQueue.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ILidoWithdrawalQueue Interface 15 | /// @author Enzyme Foundation 16 | interface ILidoWithdrawalQueue { 17 | function claimWithdrawalsTo(uint256[] calldata _requestIds, uint256[] calldata _hints, address _recipient) 18 | external; 19 | 20 | function requestWithdrawals(uint256[] calldata _amounts, address _owner) 21 | external 22 | returns (uint256[] memory requestIds_); 23 | } 24 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMapleV2Globals.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMapleV2Globals Interface 15 | /// @author Enzyme Foundation 16 | interface IMapleV2Globals { 17 | function isInstanceOf(bytes32 _key, address _who) external view returns (bool isInstanceOf_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMapleV2Pool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | import "./IERC4626.sol"; 12 | 13 | pragma solidity >=0.6.0 <0.9.0; 14 | 15 | /// @title IMapleV2Pool Interface 16 | /// @author Enzyme Foundation 17 | interface IMapleV2Pool is IERC4626 { 18 | function convertToExitAssets(uint256 _shares) external view returns (uint256 assets_); 19 | 20 | function removeShares(uint256 _shares, address _owner) external; 21 | 22 | function requestRedeem(uint256 _shares, address _owner) external; 23 | 24 | function manager() external view returns (address poolManager_); 25 | } 26 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMapleV2PoolManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMapleV2PoolManager Interface 15 | /// @author Enzyme Foundation 16 | interface IMapleV2PoolManager { 17 | function factory() external view returns (address factory_); 18 | 19 | function pool() external view returns (address pool_); 20 | 21 | function withdrawalManager() external view returns (address withdrawalManager_); 22 | } 23 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMapleV2ProxyFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMapleV2ProxyFactory Interface 15 | /// @author Enzyme Foundation 16 | interface IMapleV2ProxyFactory { 17 | function isInstance(address instance_) external view returns (bool isInstance_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMapleV2WithdrawalManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMapleV2WithdrawalManager Interface 15 | /// @author Enzyme Foundation 16 | interface IMapleV2WithdrawalManager { 17 | function lockedShares(address _account) external view returns (uint256); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMerklDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMerklDistributor interface 15 | /// @author Enzyme Foundation 16 | interface IMerklDistributor { 17 | function claim( 18 | address[] calldata _users, 19 | address[] calldata _tokens, 20 | uint256[] calldata _amounts, 21 | bytes32[][] calldata _proofs 22 | ) external; 23 | 24 | function claimed(address _user, address _token) external view returns (uint256 amount_); 25 | } 26 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMorphoBlueFlashLoanCallback.sol: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Enzyme Protocol. 3 | 4 | (c) Enzyme Foundation 5 | 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | // SPDX-License-Identifier: GPL-3.0 11 | pragma solidity >=0.6.0 <0.9.0; 12 | 13 | /// @title IMorphoBlueFlashLoanCallback Interface 14 | /// @author Enzyme Foundation 15 | interface IMorphoBlueFlashLoanCallback { 16 | function onMorphoFlashLoan(uint256 _assets, bytes calldata _data) external; 17 | } 18 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IMysoV3Escrow.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | import {IMysoV3DataTypes} from "./IMysoV3DataTypes.sol"; 13 | 14 | /// @title IMysoV3Escrow Interface 15 | /// @author Enzyme Foundation 16 | interface IMysoV3Escrow { 17 | function totalBorrowed() external view returns (uint128 totalBorrowed_); 18 | 19 | function optionMinted() external view returns (bool isOptionMinted_); 20 | 21 | function optionInfo() external view returns (IMysoV3DataTypes.OptionInfo memory optionInfo_); 22 | 23 | function owner() external view returns (address owner_); 24 | } 25 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IOneInchV5AggregationRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | pragma experimental ABIEncoderV2; 14 | 15 | /// @title IOneInchV5AggregationRouter Interface 16 | /// @author Enzyme Foundation 17 | interface IOneInchV5AggregationRouter { 18 | struct SwapDescription { 19 | address srcToken; 20 | address dstToken; 21 | address payable srcReceiver; 22 | address payable dstReceiver; 23 | uint256 amount; 24 | uint256 minReturnAmount; 25 | uint256 flags; 26 | } 27 | 28 | function swap(address _executor, SwapDescription calldata _desc, bytes calldata _permit, bytes calldata _data) 29 | external 30 | payable 31 | returns (uint256 returnAmount_, uint256 spentAmount_); 32 | } 33 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IPendleV2PrincipalToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IPendleV2PrincipalToken Interface 15 | /// @author Enzyme Foundation 16 | interface IPendleV2PrincipalToken { 17 | function SY() external view returns (address syTokenAddress_); 18 | 19 | function isExpired() external view returns (bool isExpired_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IPendleV2StandardizedYield.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IPendleV2StandardizedYield Interface 15 | /// @author Enzyme Foundation 16 | interface IPendleV2StandardizedYield { 17 | function deposit(address _receiver, address _tokenIn, uint256 _amountTokenToDeposit, uint256 _minSharesOut) 18 | external 19 | payable 20 | returns (uint256 amountSharesOut_); 21 | 22 | function redeem( 23 | address _receiver, 24 | uint256 _amountSharesToRedeem, 25 | address _tokenOut, 26 | uint256 _minTokenOut, 27 | bool _burnFromInternalBalance 28 | ) external returns (uint256 amountTokenOut_); 29 | 30 | function yieldToken() external view returns (address yieldTokenAddress_); 31 | } 32 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ISmarDexOracleMiddleware.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {ISmarDexUsdnProtocol} from "./ISmarDexUsdnProtocol.sol"; 15 | 16 | /// @title ISmarDexOracleMiddleware Interface 17 | /// @author Enzyme Foundation 18 | interface ISmarDexOracleMiddleware { 19 | struct PriceInfo { 20 | uint256 price; 21 | uint256 neutralPrice; 22 | uint256 timestamp; 23 | } 24 | 25 | /// @dev non-view function, but we can type it as view for the interface 26 | function parseAndValidatePrice( 27 | bytes32 _actionId, 28 | uint128 _targetTimestamp, 29 | ISmarDexUsdnProtocol.ProtocolAction _action, 30 | bytes calldata _data 31 | ) external view returns (PriceInfo memory priceInfo_); 32 | } 33 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ISmarDexUsdnProtocol.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ISmarDexUsdnProtocol Interface 15 | /// @author Enzyme Foundation 16 | interface ISmarDexUsdnProtocol { 17 | enum ProtocolAction { 18 | None, 19 | Initialize, 20 | InitiateDeposit, 21 | ValidateDeposit, 22 | InitiateWithdrawal, 23 | ValidateWithdrawal, 24 | InitiateOpenPosition, 25 | ValidateOpenPosition, 26 | InitiateClosePosition, 27 | ValidateClosePosition, 28 | Liquidation 29 | } 30 | 31 | function getOracleMiddleware() external view returns (address oracleMiddleware_); 32 | 33 | function usdnPrice(uint128 _currentPrice) external view returns (uint256 price_); 34 | } 35 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ISnapshotDelegateRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title ISnapshotDelegateRegistry Interface 13 | /// @author Enzyme Foundation 14 | interface ISnapshotDelegateRegistry { 15 | function setDelegate(bytes32, address) external; 16 | } 17 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ISolvBTCYieldToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ISolvBTCYieldToken Interface 15 | /// @author Enzyme Foundation 16 | interface ISolvBTCYieldToken { 17 | function decimals() external view returns (uint8 decimals_); 18 | 19 | function getValueByShares(uint256 _shares) external view returns (uint256 value_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IStaderOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IStaderOracle Interface 15 | /// @author Enzyme Foundation 16 | interface IStaderOracle { 17 | function getSDPriceInETH() external view returns (uint256 sdPriceInEth_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IStaderStakePoolsManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IStaderStakePoolsManager Interface 15 | /// @author Enzyme Foundation 16 | interface IStaderStakePoolsManager { 17 | function deposit(address _receiver) external payable returns (uint256 shares_); 18 | 19 | function getExchangeRate() external view returns (uint256 rate_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IStakeWiseV3VaultsRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IStakeWiseV3VaultsRegistry Interface 15 | /// @author Enzyme Foundation 16 | interface IStakeWiseV3VaultsRegistry { 17 | function vaults(address _vault) external view returns (bool isRegistered_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ISwellSweth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ISwellSweth Interface 15 | /// @author Enzyme Foundation 16 | interface ISwellSweth { 17 | function depositWithReferral(address _referral) external payable; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ITermFinanceV1Controller.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITermFinanceV1Controller Interface 15 | /// @author Enzyme Foundation 16 | interface ITermFinanceV1Controller { 17 | function isTermDeployed(address _contractAddress) external view returns (bool isDeployed_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ITermFinanceV1RepoCollateralManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITermFinanceV1RepoCollateralManager Interface 15 | /// @author Enzyme Foundation 16 | interface ITermFinanceV1RepoCollateralManager { 17 | function encumberedCollateralRemaining() external view returns (bool encumberedCollateralRemaining_); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ITermFinanceV1RepoToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITermFinanceV1RepoToken Interface 15 | /// @author Enzyme Foundation 16 | interface ITermFinanceV1RepoToken { 17 | function redemptionValue() external view returns (uint256 redemptionValue_); 18 | 19 | function totalRedemptionValue() external view returns (uint256 totalRedemptionValue); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/ITheGraphStaking.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title ITheGraphStaking Interface 13 | /// @author Enzyme Foundation 14 | interface ITheGraphStaking { 15 | function delegate(address, uint256) external returns (uint256); 16 | 17 | function delegationPools(address) external view returns (uint32, uint32, uint32, uint256, uint256, uint256); 18 | 19 | function getDelegation(address, address) external view returns (uint256, uint256, uint256); 20 | 21 | function undelegate(address, uint256) external returns (uint256); 22 | 23 | function withdrawDelegated(address, address) external returns (uint256); 24 | } 25 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IUniswapV2Factory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IUniswapV2Factory Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Minimal interface for our interactions with the Uniswap V2's Factory contract 17 | interface IUniswapV2Factory { 18 | function feeTo() external view returns (address); 19 | 20 | function getPair(address, address) external view returns (address); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IUniswapV2Pair.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IUniswapV2Pair Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Minimal interface for our interactions with the Uniswap V2's Pair contract 17 | interface IUniswapV2Pair { 18 | function getReserves() external view returns (uint112, uint112, uint32); 19 | 20 | function kLast() external view returns (uint256); 21 | 22 | function token0() external view returns (address); 23 | 24 | function token1() external view returns (address); 25 | 26 | function totalSupply() external view returns (uint256); 27 | } 28 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IUniswapV3SwapRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | pragma experimental ABIEncoderV2; 14 | 15 | /// @title IUniswapV3Router Interface 16 | /// @author Enzyme Foundation 17 | /// @dev Minimal interface for our interactions with Uniswap V3's Router 18 | interface IUniswapV3SwapRouter { 19 | struct ExactInputParams { 20 | bytes path; 21 | address recipient; 22 | uint256 deadline; 23 | uint256 amountIn; 24 | uint256 amountOutMinimum; 25 | } 26 | 27 | function exactInput(ExactInputParams calldata) external payable returns (uint256); 28 | } 29 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IVotiumMultiMerkleStash.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | pragma experimental ABIEncoderV2; 12 | 13 | /// @title IVotiumMultiMerkleStash Interface 14 | /// @author Enzyme Foundation 15 | interface IVotiumMultiMerkleStash { 16 | struct ClaimParam { 17 | address token; 18 | uint256 index; 19 | uint256 amount; 20 | bytes32[] merkleProof; 21 | } 22 | 23 | function claimMulti(address, ClaimParam[] calldata) external; 24 | } 25 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IWETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IWETH Interface 15 | /// @author Enzyme Foundation 16 | interface IWETH { 17 | function deposit() external payable; 18 | 19 | function withdraw(uint256) external; 20 | } 21 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IYearnVaultV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IYearnVaultV2 Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Minimal interface for our interactions with Yearn Vault V2 contracts 17 | interface IYearnVaultV2 { 18 | function deposit(uint256, address) external returns (uint256); 19 | 20 | function pricePerShare() external view returns (uint256); 21 | 22 | function token() external view returns (address); 23 | 24 | function withdraw(uint256, address, uint256) external returns (uint256); 25 | } 26 | -------------------------------------------------------------------------------- /contracts/external-interfaces/IYearnVaultV2Registry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IYearnVaultV2Registry Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Minimal interface for our interactions with the Yearn Vault V2 registry 17 | interface IYearnVaultV2Registry { 18 | function numVaults(address) external view returns (uint256); 19 | 20 | function vaults(address, uint256) external view returns (address); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/persistent/address-list-registry/address-list-owners/utils/IAddOnlyAddressListOwner.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAddOnlyAddressListOwner Interface 15 | /// @author Enzyme Foundation 16 | interface IAddOnlyAddressListOwner { 17 | function addValidatedItemsToList(address[] calldata _items) external; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/persistent/arbitrary-value-oracles/IArbitraryValueOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IArbitraryValueOracle Interface 13 | /// @author Enzyme Foundation 14 | interface IArbitraryValueOracle { 15 | function getLastUpdated() external view returns (uint256 lastUpdated_); 16 | 17 | function getValue() external view returns (int256 value_); 18 | 19 | function getValueWithTimestamp() external view returns (int256 value_, uint256 lastUpdated_); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/persistent/arbitrary-value-oracles/manual-value/ManualValueOracleProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import "../../../utils/0.6.12/NonUpgradableProxy.sol"; 15 | 16 | /// @title ManualValueOracleProxy Contract 17 | /// @author Enzyme Foundation 18 | /// @notice Proxy contract for all ManualValueOracle instances 19 | contract ManualValueOracleProxy is NonUpgradableProxy { 20 | constructor(bytes memory _constructData, address _lib) public NonUpgradableProxy(_constructData, _lib) {} 21 | } 22 | -------------------------------------------------------------------------------- /contracts/persistent/external-positions/IExternalPositionLibCore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IExternalPositionLibCore interface 13 | /// @author Enzyme Foundation 14 | /// @notice An interface for core required functions of an IExternalPositionLib instance 15 | interface IExternalPositionLibCore { 16 | function receiveCallFromVault(bytes memory _data) external; 17 | } 18 | -------------------------------------------------------------------------------- /contracts/persistent/external-positions/IExternalPositionProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IExternalPositionProxy interface 13 | /// @author Enzyme Foundation 14 | /// @notice An interface for publicly accessible functions on the ExternalPositionProxy 15 | interface IExternalPositionProxy { 16 | function getExternalPositionType() external view returns (uint256 typeId_); 17 | 18 | function getVaultProxy() external view returns (address vaultProxy_); 19 | 20 | function receiveCallFromVault(bytes memory _data) external; 21 | } 22 | -------------------------------------------------------------------------------- /contracts/persistent/global-config/bases/GlobalConfigLibBase1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import "./GlobalConfigLibBaseCore.sol"; 15 | 16 | /// @title GlobalConfigLibBase1 Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A base implementation for GlobalConfigLib 19 | /// @dev Each next base implementation inherits the previous base implementation, 20 | /// e.g., `GlobalConfigLibBase2 is GlobalConfigLibBase1` 21 | /// DO NOT EDIT CONTRACT. 22 | abstract contract GlobalConfigLibBase1 is GlobalConfigLibBaseCore { 23 | address internal constant NO_VALIDATION_DUMMY_ADDRESS = 0x000000000000000000000000000000000000aaaa; 24 | // Don't use max, since a max value can be valid 25 | uint256 internal constant NO_VALIDATION_DUMMY_AMOUNT = type(uint256).max - 1; 26 | } 27 | -------------------------------------------------------------------------------- /contracts/persistent/global-config/interfaces/IGlobalConfig1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGlobalConfig1 Interface 15 | /// @author Enzyme Foundation 16 | /// @dev Each interface should inherit the previous interface, 17 | /// e.g., `IGlobalConfig2 is IGlobalConfig1` 18 | interface IGlobalConfig1 { 19 | function isValidRedeemSharesCall( 20 | address _vaultProxy, 21 | address _recipientToValidate, 22 | uint256 _sharesAmountToValidate, 23 | address _redeemContract, 24 | bytes4 _redeemSelector, 25 | bytes calldata _redeemData 26 | ) external view returns (bool isValid_); 27 | } 28 | -------------------------------------------------------------------------------- /contracts/persistent/global-config/utils/GlobalConfigProxyConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | /// @title GlobalConfigProxyConstants Contract 15 | /// @author Enzyme Foundation 16 | /// @notice Constant values used in GlobalConfig proxy-related contracts 17 | abstract contract GlobalConfigProxyConstants { 18 | // `bytes32(keccak256('mln.proxiable.globalConfigLib'))` 19 | bytes32 internal constant EIP_1822_PROXIABLE_UUID = 20 | 0xf25d88d51901d7fabc9924b03f4c2fe4300e6fe1aae4b5134c0a90b68cd8e81c; 21 | // `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)` 22 | bytes32 internal constant EIP_1967_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; 23 | } 24 | -------------------------------------------------------------------------------- /contracts/persistent/off-chain/README.md: -------------------------------------------------------------------------------- 1 | # Contracts primarily for off-chain consumption 2 | 3 | This directory contains data aggregation contracts that are primarily intended to be consumed off-chain. 4 | 5 | Prior to using any of these contracts for on-chain purposes, confirm that: 6 | 7 | 1. it has been audited 8 | 2. the logic is suitable for on-chain use (gas, state changes, etc) 9 | -------------------------------------------------------------------------------- /contracts/persistent/off-chain/fund-data-provider/interfaces/IValueInterpreterGetter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.6.12; 3 | 4 | /// @notice This interface is used to cast an address into an interface containing a getValueInterpreter getter 5 | interface IValueInterpreterGetter { 6 | function getValueInterpreter() external view returns (address valueInterpreterAddress_); 7 | } 8 | -------------------------------------------------------------------------------- /contracts/persistent/off-chain/helper-data-reader/IHelperDataReader.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | interface IHelperDataReader { 6 | function getVaultDetailsExtended(address _vaultProxy) external returns (bytes memory); 7 | 8 | function getVaultDetails(address _vaultProxy) external returns (bytes memory); 9 | 10 | function getVaultActiveExternalPositionsDetails(address _vaultProxy) external returns (bytes memory); 11 | 12 | function getVaultPoliciesDetails(address _vaultProxy) external returns (bytes memory); 13 | 14 | function getVaultFeesDetails(address _vaultProxy) external returns (bytes memory); 15 | 16 | function getVaultTrackedAssetsAmounts(address _vaultProxy) external returns (bytes memory); 17 | } 18 | -------------------------------------------------------------------------------- /contracts/persistent/protocol-fee-reserve/bases/ProtocolFeeReserveLibBase1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import "./ProtocolFeeReserveLibBaseCore.sol"; 15 | 16 | /// @title ProtocolFeeReserveLibBase1 Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A base implementation for ProtocolFeeReserveLib 19 | /// @dev Each next base implementation inherits the previous base implementation, 20 | /// e.g., `ProtocolFeeReserveLibBase2 is ProtocolFeeReserveLibBase1` 21 | /// DO NOT EDIT CONTRACT. 22 | abstract contract ProtocolFeeReserveLibBase1 is ProtocolFeeReserveLibBaseCore { 23 | event MlnTokenBalanceWithdrawn(address indexed to, uint256 amount); 24 | 25 | event SharesBoughtBack(address indexed vaultProxy, uint256 sharesAmount, uint256 mlnValue, uint256 mlnBurned); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/persistent/protocol-fee-reserve/interfaces/IProtocolFeeReserve1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IProtocolFeeReserve1 Interface 15 | /// @author Enzyme Foundation 16 | /// @dev Each interface should inherit the previous interface, 17 | /// e.g., `IProtocolFeeReserve2 is IProtocolFeeReserve1` 18 | interface IProtocolFeeReserve1 { 19 | function buyBackSharesViaTrustedVaultProxy(uint256 _sharesAmount, uint256 _mlnValue, uint256 _gav) 20 | external 21 | returns (uint256 mlnAmountToBurn_); 22 | } 23 | -------------------------------------------------------------------------------- /contracts/persistent/protocol-fee-reserve/utils/ProtocolFeeProxyConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | /// @title ProtocolFeeProxyConstants Contract 15 | /// @author Enzyme Foundation 16 | /// @notice Constant values used in ProtocolFee proxy-related contracts 17 | abstract contract ProtocolFeeProxyConstants { 18 | // `bytes32(keccak256('mln.proxiable.protocolFeeReserveLib'))` 19 | bytes32 internal constant EIP_1822_PROXIABLE_UUID = 20 | 0xbc966524590ce702cc9340e80d86ea9095afa6b8eecbb5d6213f576332239181; 21 | // `bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)` 22 | bytes32 internal constant EIP_1967_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; 23 | } 24 | -------------------------------------------------------------------------------- /contracts/persistent/shares-splitter/SharesSplitterProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import {NonUpgradableProxy} from "../../utils/0.6.12/NonUpgradableProxy.sol"; 15 | 16 | /// @title SharesSplitterProxy Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A proxy contract for all SharesSplitterProxy instances 19 | contract SharesSplitterProxy is NonUpgradableProxy { 20 | constructor(bytes memory _constructData, address _sharesSplitterLib) 21 | public 22 | NonUpgradableProxy(_constructData, _sharesSplitterLib) 23 | {} 24 | } 25 | -------------------------------------------------------------------------------- /contracts/persistent/single-asset-deposit-queue/ISingleAssetDepositQueue.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ISingleAssetDepositQueue Interface 15 | /// @author Enzyme Foundation 16 | interface ISingleAssetDepositQueue { 17 | /// @dev Request struct to store request info 18 | /// @param user The user who made the request 19 | /// @param canCancelTime The time when the request can be canceled 20 | /// @param depositAssetAmount The amount of asset to deposit 21 | struct Request { 22 | address user; 23 | uint96 canCancelTime; 24 | uint256 depositAssetAmount; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /contracts/persistent/smart-accounts/aave-v3-flash-loan-asset-manager/IAaveV3FlashLoanAssetManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3FlashLoanAssetManager Interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3FlashLoanAssetManager { 17 | struct Call { 18 | address target; 19 | bytes data; 20 | } 21 | 22 | function flashLoan(address[] calldata _assets, uint256[] calldata _amounts, bytes calldata _encodedCalls) 23 | external; 24 | 25 | function init(address _owner, address _vaultProxyAddress) external; 26 | } 27 | -------------------------------------------------------------------------------- /contracts/persistent/smart-accounts/morpho-blue-flash-loan-asset-manager/IMorphoBlueFlashLoanAssetManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMorphoBlueFlashLoanAssetManager Interface 15 | /// @author Enzyme Foundation 16 | interface IMorphoBlueFlashLoanAssetManager { 17 | struct Call { 18 | address target; 19 | bytes data; 20 | } 21 | 22 | struct ForwardData { 23 | address borrowedAssetAddress; 24 | Call[] calls; 25 | } 26 | 27 | function flashLoan(address _assetAddress, uint256 _amount, Call[] calldata _calls) external; 28 | 29 | function init(address _owner, address _borrowedAssetsRecipient) external; 30 | } 31 | -------------------------------------------------------------------------------- /contracts/persistent/smart-accounts/utils/interfaces/IMultiCallAccountMixin.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMultiCallAccountMixin Interface 15 | /// @author Enzyme Foundation 16 | interface IMultiCallAccountMixin { 17 | struct Call { 18 | address target; 19 | bytes data; 20 | } 21 | 22 | function executeCalls(Call[] calldata _calls) external; 23 | } 24 | -------------------------------------------------------------------------------- /contracts/persistent/vault/interfaces/IExternalPositionVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IExternalPositionVault interface 15 | /// @author Enzyme Foundation 16 | /// Provides an interface to get the externalPositionLib for a given type from the Vault 17 | interface IExternalPositionVault { 18 | function getExternalPositionLibForType(uint256) external view returns (address); 19 | } 20 | -------------------------------------------------------------------------------- /contracts/persistent/vault/interfaces/IFreelyTransferableSharesVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IFreelyTransferableSharesVault Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Provides the interface for determining whether a vault's shares 17 | /// are guaranteed to be freely transferable. 18 | /// @dev DO NOT EDIT CONTRACT 19 | interface IFreelyTransferableSharesVault { 20 | function sharesAreFreelyTransferable() external view returns (bool sharesAreFreelyTransferable_); 21 | } 22 | -------------------------------------------------------------------------------- /contracts/persistent/vault/interfaces/IMigratableVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMigratableVault Interface 15 | /// @author Enzyme Foundation 16 | /// @dev DO NOT EDIT CONTRACT 17 | interface IMigratableVault { 18 | function canMigrate(address _who) external view returns (bool canMigrate_); 19 | 20 | function init(address _owner, address _accessor, string calldata _fundName) external; 21 | 22 | function setAccessor(address _nextAccessor) external; 23 | 24 | function setVaultLib(address _nextVaultLib) external; 25 | } 26 | -------------------------------------------------------------------------------- /contracts/persistent/vault/interfaces/IVaultCore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IVaultCore interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for getters of core vault storage 17 | /// @dev DO NOT EDIT CONTRACT 18 | interface IVaultCore { 19 | function getAccessor() external view returns (address accessor_); 20 | 21 | function getCreator() external view returns (address creator_); 22 | 23 | function getMigrator() external view returns (address migrator_); 24 | 25 | function getOwner() external view returns (address owner_); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/persistent/vault/utils/IProxiableVaultLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IProxiableVaultLib interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for ProxiableVaultLib 17 | interface IProxiableVaultLib { 18 | function proxiableUUID() external pure returns (bytes32 uuid_); 19 | } 20 | -------------------------------------------------------------------------------- /contracts/release/core/fund/comptroller/ComptrollerProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {NonUpgradableProxy} from "../../../../utils/0.8.19/NonUpgradableProxy.sol"; 15 | 16 | /// @title ComptrollerProxy Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A proxy contract for all ComptrollerProxy instances 19 | contract ComptrollerProxy is NonUpgradableProxy { 20 | constructor(bytes memory _constructData, address _comptrollerLib) 21 | NonUpgradableProxy(_constructData, _comptrollerLib) 22 | {} 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/extensions/IExtension.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IExtension Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for all extensions 17 | interface IExtension { 18 | function activateForFund() external; 19 | 20 | function deactivateForFund() external; 21 | 22 | function receiveCallFromComptroller(address _caller, uint256 _actionId, bytes calldata _callArgs) external; 23 | 24 | function setConfigForFund(bytes calldata _configData) external; 25 | } 26 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/IExternalPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | import {IExternalPositionLibCore} from "../../../persistent/external-positions/IExternalPositionLibCore.sol"; 13 | 14 | /// @title IExternalPosition Contract 15 | /// @author Enzyme Foundation 16 | interface IExternalPosition is IExternalPositionLibCore { 17 | function getDebtAssets() external returns (address[] memory assets_, uint256[] memory amounts_); 18 | 19 | function getManagedAssets() external returns (address[] memory assets_, uint256[] memory amounts_); 20 | 21 | function init(bytes memory _data) external; 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/IExternalPositionParser.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IExternalPositionParser Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for all external position parsers 17 | interface IExternalPositionParser { 18 | function parseAssetsForAction(address _externalPosition, uint256 _actionId, bytes memory _encodedActionArgs) 19 | external 20 | returns ( 21 | address[] memory assetsToTransfer_, 22 | uint256[] memory amountsToTransfer_, 23 | address[] memory assetsToReceive_ 24 | ); 25 | 26 | function parseInitArgs(address _vaultProxy, bytes memory _initializationData) 27 | external 28 | returns (bytes memory initArgs_); 29 | } 30 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/IAaveDebtPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveDebtPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IAaveDebtPosition is IExternalPosition { 17 | enum Actions { 18 | AddCollateral, 19 | RemoveCollateral, 20 | Borrow, 21 | RepayBorrow, 22 | ClaimRewards 23 | } 24 | 25 | function getDebtTokenForBorrowedAsset(address) external view returns (address); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/aave-v3-debt/IAaveV3DebtPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity 0.8.19; 13 | 14 | /// @title IAaveDebtPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3DebtPosition is IExternalPosition { 17 | enum Actions { 18 | AddCollateral, 19 | RemoveCollateral, 20 | Borrow, 21 | RepayBorrow, 22 | SetEMode, 23 | SetUseReserveAsCollateral, 24 | ClaimRewards, 25 | Sweep, 26 | ClaimMerklRewards 27 | } 28 | 29 | function getDebtTokenForBorrowedAsset(address) external view returns (address); 30 | } 31 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/IArbitraryLoanPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IArbitraryLoanPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IArbitraryLoanPosition is IExternalPosition { 17 | enum Actions { 18 | ConfigureLoan, 19 | UpdateBorrowableAmount, 20 | CallOnAccountingModule, 21 | Reconcile, 22 | CloseLoan 23 | } 24 | 25 | function getLoanAsset() external view returns (address asset_); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/compound-debt/ICompoundDebtPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICompoundDebtPosition Interface 15 | /// @author Enzyme Foundation 16 | interface ICompoundDebtPosition is IExternalPosition { 17 | enum ExternalPositionActions { 18 | AddCollateral, 19 | RemoveCollateral, 20 | Borrow, 21 | RepayBorrow, 22 | ClaimComp 23 | } 24 | 25 | function getCTokenFromBorrowedAsset(address _borrowedAsset) external view returns (address cToken_); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/convex-voting/IConvexVotingPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IConvexVotingPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IConvexVotingPosition is IExternalPosition { 17 | enum Actions { 18 | Lock, 19 | Relock, 20 | Withdraw, 21 | ClaimRewards, 22 | Delegate 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/kiln-staking/IKilnStakingPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IKilnStakingPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IKilnStakingPosition is IExternalPosition { 17 | enum Actions { 18 | Stake, 19 | ClaimFees, 20 | SweepEth, 21 | Unstake, 22 | PausePositionValue, 23 | UnpausePositionValue 24 | } 25 | 26 | enum ClaimFeeTypes { 27 | ExecutionLayer, 28 | ConsensusLayer, 29 | All 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/lido-withdrawals/ILidoWithdrawalsPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity 0.8.19; 13 | 14 | /// @title ILidoWithdrawalsPosition Interface 15 | /// @author Enzyme Foundation 16 | interface ILidoWithdrawalsPosition is IExternalPosition { 17 | // REQUIRED; APPEND-ONLY 18 | 19 | // Required by: LibBase1 20 | 21 | struct Request { 22 | uint128 amount; 23 | uint128 id; 24 | } 25 | 26 | // ARBITRARY FOR VERSION 27 | 28 | enum Actions { 29 | RequestWithdrawals, 30 | ClaimWithdrawals 31 | } 32 | 33 | function getRequests() external view returns (Request[] memory requests_); 34 | } 35 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/lido-withdrawals/bases/LidoWithdrawalsPositionLibBase1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {ILidoWithdrawalsPosition} from "../ILidoWithdrawalsPosition.sol"; 15 | 16 | /// @title LidoWithdrawalsPositionLibBase1 Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A persistent contract containing all storage variables, events, and data structures 19 | /// @dev DO NOT EDIT CONTRACT. If new events or storage are necessary, 20 | /// a new contract should inherit the most recent base. 21 | contract LidoWithdrawalsPositionLibBase1 { 22 | event RequestAdded(uint256 indexed id, uint256 amount); 23 | 24 | event RequestRemoved(uint256 indexed id); 25 | 26 | ILidoWithdrawalsPosition.Request[] internal requests; 27 | } 28 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/morpho-blue/IMorphoBluePosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMorphoBluePosition Interface 15 | /// @author Enzyme Foundation 16 | interface IMorphoBluePosition is IExternalPosition { 17 | enum Actions { 18 | Lend, 19 | Redeem, 20 | AddCollateral, 21 | RemoveCollateral, 22 | Borrow, 23 | Repay 24 | } 25 | 26 | function getMarketIds() external view returns (bytes32[] memory marketIds_); 27 | } 28 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/stader-withdrawals/IStaderWithdrawalsPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity 0.8.19; 13 | 14 | /// @title IStaderWithdrawalsPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IStaderWithdrawalsPosition is IExternalPosition { 17 | enum Actions { 18 | RequestWithdrawal, 19 | ClaimWithdrawal 20 | } 21 | 22 | struct RequestWithdrawalActionArgs { 23 | uint256 ethXAmount; 24 | } 25 | 26 | struct ClaimWithdrawalActionArgs { 27 | uint256 requestId; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/term-finance-v1-lending/ITermFinanceV1LendingPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITermFinanceV1LendingPosition Interface 15 | /// @author Enzyme Foundation 16 | interface ITermFinanceV1LendingPosition is IExternalPosition { 17 | enum Actions { 18 | AddOrUpdateOffers, 19 | RemoveOffers, 20 | Redeem, 21 | Sweep 22 | } 23 | 24 | function getOfferIdsFromTermAuction(address _termAuctionAddress) 25 | external 26 | view 27 | returns (bytes32[] memory offerIds_); 28 | 29 | function getTermAuctions() external view returns (address[] memory termAuctions_); 30 | } 31 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/ITheGraphDelegationPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITheGraphDelegationPosition Interface 15 | /// @author Enzyme Foundation 16 | interface ITheGraphDelegationPosition is IExternalPosition { 17 | enum Actions { 18 | Delegate, 19 | Undelegate, 20 | Withdraw 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/IUniswapV3LiquidityPosition.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IExternalPosition} from "../../IExternalPosition.sol"; 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IUniswapV3LiquidityPosition Interface 15 | /// @author Enzyme Foundation 16 | interface IUniswapV3LiquidityPosition is IExternalPosition { 17 | enum UniswapV3LiquidityPositionActions { 18 | Mint, 19 | AddLiquidity, 20 | RemoveLiquidity, 21 | Collect, 22 | Purge 23 | } 24 | 25 | function getPairForNft(uint256) external view returns (address, address); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import {IFeeManager} from "../IFeeManager.sol"; 15 | import {EntranceRateFeeBase} from "./utils/EntranceRateFeeBase.sol"; 16 | 17 | /// @title EntranceRateBurnFee Contract 18 | /// @author Enzyme Foundation 19 | /// @notice An EntranceRateFee that burns the fee shares 20 | contract EntranceRateBurnFee is EntranceRateFeeBase { 21 | constructor(address _feeManager) public EntranceRateFeeBase(_feeManager, IFeeManager.SettlementType.Burn) {} 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/fee-manager/fees/ExitRateBurnFee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import {IFeeManager} from "../IFeeManager.sol"; 15 | import {ExitRateFeeBase} from "./utils/ExitRateFeeBase.sol"; 16 | 17 | /// @title ExitRateBurnFee Contract 18 | /// @author Enzyme Foundation 19 | /// @notice An ExitRateFee that burns the fee shares 20 | contract ExitRateBurnFee is ExitRateFeeBase { 21 | constructor(address _feeManager) public ExitRateFeeBase(_feeManager, IFeeManager.SettlementType.Burn) {} 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/fee-manager/fees/interfaces/IManagementFee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IManagementFee Interface 15 | /// @author Enzyme Foundation 16 | interface IManagementFee { 17 | struct FeeInfo { 18 | // The scaled rate representing 99.99% is under 10^28, 19 | // thus `uint128 scaledPerSecondRate` is sufficient for any reasonable fee rate 20 | uint128 scaledPerSecondRate; 21 | uint128 lastSettled; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/extensions/fee-manager/fees/interfaces/IPerformanceFee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IPerformanceFee Interface 15 | /// @author Enzyme Foundation 16 | interface IPerformanceFee { 17 | // Does not use variable packing as `highWaterMark` will often be read without reading `rate`, 18 | // `rate` will never be updated after deployment, and each is set at a different time 19 | struct FeeInfo { 20 | uint256 rate; 21 | uint256 highWaterMark; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/extensions/fee-manager/fees/utils/interfaces/IExitRateFeeBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IExitRateFeeBase Interface 15 | /// @author Enzyme Foundation 16 | interface IExitRateFeeBase { 17 | struct FeeInfo { 18 | uint16 inKindRate; 19 | uint16 specificAssetsRate; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/release/extensions/integration-manager/IIntegrationManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IIntegrationManager interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for the IntegrationManager 17 | interface IIntegrationManager { 18 | enum SpendAssetsHandleType { 19 | None, 20 | Approve, 21 | Transfer 22 | } 23 | 24 | function getPolicyManager() external view returns (address policyManager_); 25 | } 26 | -------------------------------------------------------------------------------- /contracts/release/extensions/integration-manager/integrations/adapters/interfaces/IParaSwapV5Adapter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IParaSwapV5Adapter interface 15 | /// @author Enzyme Foundation 16 | interface IParaSwapV5Adapter { 17 | struct SimpleSwapParams { 18 | address incomingAsset; 19 | address[] callees; 20 | bytes exchangeData; 21 | uint256[] startIndexes; 22 | uint256[] values; 23 | } 24 | 25 | enum SwapType { 26 | Simple, 27 | Multi, 28 | Mega 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /contracts/release/extensions/integration-manager/integrations/adapters/interfaces/ITransferAssetsAdapter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ITransferAssetsAdapter interface 15 | /// @author Enzyme Foundation 16 | interface ITransferAssetsAdapter { 17 | struct TransferERC20CallArgs { 18 | address recipient; 19 | address[] assetAddresses; 20 | uint256[] amounts; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/integration-manager/integrations/adapters/interfaces/IZeroExV4Adapter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IZeroExV4Adapter interface 15 | /// @author Enzyme Foundation 16 | interface IZeroExV4Adapter { 17 | enum OrderType { 18 | Limit, 19 | Rfq, 20 | Otc 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/integration-manager/integrations/utils/interfaces/ICurveLiquidityAdapterBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurveLiquidityAdapterBase interface 15 | /// @author Enzyme Foundation 16 | interface ICurveLiquidityAdapterBase { 17 | enum RedeemType { 18 | Standard, 19 | OneCoin 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/release/extensions/policy-manager/policies/interfaces/ICumulativeSlippageTolerancePolicy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICumulativeSlippageTolerancePolicy Interface 15 | /// @author Enzyme Foundation 16 | interface ICumulativeSlippageTolerancePolicy { 17 | struct PolicyInfo { 18 | uint64 tolerance; 19 | uint64 cumulativeSlippage; 20 | uint128 lastSlippageTimestamp; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/extensions/policy-manager/policies/interfaces/IMinMaxInvestmentPolicy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMinMaxInvestmentPolicy Interface 15 | /// @author Enzyme Foundation 16 | interface IMinMaxInvestmentPolicy { 17 | struct FundSettings { 18 | uint256 minInvestmentAmount; 19 | uint256 maxInvestmentAmount; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /contracts/release/extensions/policy-manager/policies/utils/interfaces/INoDepegPolicyBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IERC20} from "../../../../../../external-interfaces/IERC20.sol"; 15 | 16 | /// @title INoDepegPolicyBase Interface 17 | /// @author Enzyme Foundation 18 | interface INoDepegPolicyBase { 19 | struct AssetConfig { 20 | IERC20 asset; 21 | IERC20 referenceAsset; 22 | uint16 deviationToleranceInBps; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/gas-relayer/IGasRelayPaymasterDepositor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGasRelayPaymasterDepositor Interface 15 | /// @author Enzyme Foundation 16 | interface IGasRelayPaymasterDepositor { 17 | function pullWethForGasRelayer(uint256) external; 18 | } 19 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {GasRelayPaymasterLibBase1} from "./GasRelayPaymasterLibBase1.sol"; 15 | 16 | /// @title GasRelayPaymasterLibBase2 Contract 17 | /// @author Enzyme Foundation 18 | /// @notice A persistent contract containing all required storage variables and events 19 | /// for a GasRelayPaymasterLib 20 | /// @dev DO NOT EDIT CONTRACT ONCE DEPLOYED. If new events or storage are necessary, 21 | /// they should be added to a numbered GasRelayPaymasterLibBaseXXX that inherits the previous base. 22 | /// e.g., `GasRelayPaymasterLibBase2 is GasRelayPaymasterLibBase1` 23 | abstract contract GasRelayPaymasterLibBase2 is GasRelayPaymasterLibBase1 { 24 | uint256 internal lastDepositTimestamp; 25 | } 26 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/IAggregatedDerivativePriceFeedMixin.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAggregatedDerivativePriceFeedMixin Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Interface for AggregatedDerivativePriceFeedMixin 17 | interface IAggregatedDerivativePriceFeedMixin { 18 | function getPriceFeedForDerivative(address _derivative) external view returns (address priceFeed_); 19 | } 20 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/IDerivativePriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IDerivativePriceFeed Interface 15 | /// @author Enzyme Foundation 16 | /// @notice Simple interface for derivative price source oracle implementations 17 | interface IDerivativePriceFeed { 18 | function calcUnderlyingValues(address _derivative, uint256 _derivativeAmount) 19 | external 20 | returns (address[] memory underlyings_, uint256[] memory underlyingAmounts_); 21 | 22 | function isSupportedAsset(address _asset) external view returns (bool isSupported_); 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/feeds/PeggedDerivativesPriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | import {PeggedDerivativesPriceFeedBase} from "./utils/PeggedDerivativesPriceFeedBase.sol"; 15 | 16 | /// @title PeggedDerivativesPriceFeed Contract 17 | /// @author Enzyme Foundation 18 | /// @notice Price feed for multiple derivatives that are pegged 1:1 to their underlyings, 19 | /// and have the same decimals as their underlying 20 | contract PeggedDerivativesPriceFeed is PeggedDerivativesPriceFeedBase { 21 | constructor(address _fundDeployer) public PeggedDerivativesPriceFeedBase(_fundDeployer) {} 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/feeds/interfaces/IBalancerV2StablePoolPriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IBalancerV2StablePoolPriceFeed Interface 15 | /// @author Enzyme Foundation 16 | interface IBalancerV2StablePoolPriceFeed { 17 | // We take one asset as representative of the pool's invariant, e.g., WETH for ETH-based pools. 18 | struct PoolInfo { 19 | address invariantProxyAsset; 20 | uint8 invariantProxyAssetDecimals; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/feeds/interfaces/ICurvePriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICurvePriceFeed Interface 15 | /// @author Enzyme Foundation 16 | interface ICurvePriceFeed { 17 | // We take one asset as representative of the pool's invariant, e.g., WETH for ETH-based pools. 18 | // Caching invariantProxyAssetDecimals in a packed storage slot 19 | // removes an additional external call and cold SLOAD operation during value lookups. 20 | struct PoolInfo { 21 | address invariantProxyAsset; // 20 bytes 22 | uint8 invariantProxyAssetDecimals; // 1 byte 23 | uint88 lastValidatedVirtualPrice; // 11 bytes (could safely be 8-10 bytes) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/derivatives/feeds/interfaces/IUniswapV2PoolPriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IUniswapV2PoolPriceFeed Interface 15 | /// @author Enzyme Foundation 16 | interface IUniswapV2PoolPriceFeed { 17 | struct PoolTokenInfo { 18 | address token0; 19 | address token1; 20 | uint8 token0Decimals; 21 | uint8 token1Decimals; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/primitives/BtcToEthQuotedSimulatedAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {TwoAggregatorsWithCommonQuoteSimulatedAggregator} from 15 | "./utils/TwoAggregatorsWithCommonQuoteSimulatedAggregator.sol"; 16 | 17 | /// @title BtcToEthQuotedSimulatedAggregator Contract 18 | /// @author Enzyme Foundation 19 | /// @notice A simulated ETH-quoted aggregator to support a Chainlink-like aggregator quoted in BTC 20 | contract BtcToEthQuotedSimulatedAggregator is TwoAggregatorsWithCommonQuoteSimulatedAggregator { 21 | constructor(address _btcQuotedAggregatorAddress, address _ethBtcAggregatorAddress) 22 | TwoAggregatorsWithCommonQuoteSimulatedAggregator(_btcQuotedAggregatorAddress, _ethBtcAggregatorAddress, 18) 23 | {} 24 | } 25 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/primitives/utils/RateEthAggregatorBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {RateAggregatorBase} from "./RateAggregatorBase.sol"; 15 | 16 | /// @title RateEthAggregatorBase Contract 17 | /// @author Enzyme Foundation 18 | /// @notice Base contract for Chainlink-like aggregators quoted in ETH 19 | abstract contract RateEthAggregatorBase is RateAggregatorBase { 20 | constructor(address _quoteConversionAggregatorAddress, bool _quoteConversionAggregatorInverted) 21 | RateAggregatorBase(18, _quoteConversionAggregatorAddress, _quoteConversionAggregatorInverted) 22 | {} 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/infrastructure/price-feeds/primitives/utils/RateUsdAggregatorBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.8.19; 13 | 14 | import {RateAggregatorBase} from "./RateAggregatorBase.sol"; 15 | 16 | /// @title RateUsdAggregatorBase Contract 17 | /// @author Enzyme Foundation 18 | /// @notice Base contract for Chainlink-like aggregators quoted in USD 19 | abstract contract RateUsdAggregatorBase is RateAggregatorBase { 20 | constructor(address _quoteConversionAggregatorAddress, bool _quoteConversionAggregatorInverted) 21 | RateAggregatorBase(8, _quoteConversionAggregatorAddress, _quoteConversionAggregatorInverted) 22 | {} 23 | } 24 | -------------------------------------------------------------------------------- /contracts/release/off-chain/README.md: -------------------------------------------------------------------------------- 1 | # Contracts primarily for off-chain consumption 2 | 3 | This directory contains data aggregation contracts that are primarily intended to be consumed off-chain. 4 | 5 | Prior to using any of these contracts for on-chain purposes, confirm that: 6 | 7 | 1. it has been audited 8 | 2. the logic is suitable for on-chain use (gas, state changes, etc) 9 | -------------------------------------------------------------------------------- /contracts/test/MultiCallAccountMixinHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity 0.8.19; 4 | 5 | import {MultiCallAccountMixin} from "../persistent/smart-accounts/utils/MultiCallAccountMixin.sol"; 6 | 7 | /// @title MultiCallAccountMixinHarness Contract 8 | /// @author Enzyme Foundation 9 | contract MultiCallAccountMixinHarness is MultiCallAccountMixin { 10 | constructor(address _addressListRegistry, uint256 _gsnTrustedForwardersAddressListId) 11 | MultiCallAccountMixin(_addressListRegistry, _gsnTrustedForwardersAddressListId) 12 | {} 13 | 14 | function exposed_setOwner(address _nextOwner) external { 15 | __setOwner(_nextOwner); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /contracts/utils/0.6.12/beacon-proxy/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity 0.6.12; 13 | 14 | /// @title IBeacon interface 15 | /// @author Enzyme Foundation 16 | interface IBeacon { 17 | function getCanonicalLib() external view returns (address); 18 | } 19 | -------------------------------------------------------------------------------- /contracts/utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | import {IBeacon} from "./IBeacon.sol"; 13 | 14 | pragma solidity 0.6.12; 15 | 16 | /// @title IBeaconProxyFactory interface 17 | /// @author Enzyme Foundation 18 | interface IBeaconProxyFactory is IBeacon { 19 | function deployProxy(bytes memory _constructData) external returns (address proxy_); 20 | 21 | function getOwner() external view returns (address owner_); 22 | 23 | function setCanonicalLib(address _canonicalLib) external; 24 | } 25 | -------------------------------------------------------------------------------- /contracts/utils/0.8.19/deprecated/beacon-proxy/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | // ** DO NOT AUDIT THIS, IT WILL BE REMOVED IN A SUBSEQUENT COMMIT ** 13 | 14 | pragma solidity >=0.6.0 <0.9.0; 15 | 16 | /// @title IBeacon interface 17 | /// @author Enzyme Foundation 18 | interface IBeacon { 19 | function getCanonicalLib() external view returns (address); 20 | } 21 | -------------------------------------------------------------------------------- /contracts/utils/0.8.19/deprecated/beacon-proxy/IBeaconProxyFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | // ** DO NOT AUDIT THIS, IT WILL BE REMOVED IN A SUBSEQUENT COMMIT ** 13 | 14 | import {IBeacon} from "./IBeacon.sol"; 15 | 16 | pragma solidity >=0.6.0 <0.9.0; 17 | 18 | /// @title IBeaconProxyFactory interface 19 | /// @author Enzyme Foundation 20 | interface IBeaconProxyFactory is IBeacon { 21 | function deployProxy(bytes memory _constructData) external returns (address proxy_); 22 | 23 | function getOwner() external view returns (address owner_); 24 | 25 | function setCanonicalLib(address _canonicalLib) external; 26 | } 27 | -------------------------------------------------------------------------------- /contracts/utils/0.8.19/dispatcher-owned-beacon/IDispatcherOwnedBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IDispatcherOwnedBeacon Interface 13 | /// @author Enzyme Foundation 14 | interface IDispatcherOwnedBeacon { 15 | function getOwner() external view returns (address owner_); 16 | 17 | // From OpenZeppelin's IBeacon interface (which is only scoped in OZ to >=0.8.0) 18 | function implementation() external view returns (address implementation_); 19 | 20 | function setImplementation(address _nextImplementation) external; 21 | } 22 | -------------------------------------------------------------------------------- /contracts/utils/0.8.19/dispatcher-owned-beacon/IDispatcherOwnedBeaconFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IDispatcherOwnedBeaconFactory Interface 13 | /// @author Enzyme Foundation 14 | interface IDispatcherOwnedBeaconFactory { 15 | function deployProxy(bytes calldata _constructData) external returns (address proxyAddress_); 16 | } 17 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 4 | utils.url = "github:numtide/flake-utils"; 5 | foundry.url = "github:shazow/foundry.nix"; 6 | }; 7 | 8 | outputs = { self, nixpkgs, utils, foundry, ... }: 9 | utils.lib.eachDefaultSystem (system: let 10 | pkgs = import nixpkgs { 11 | inherit system; 12 | overlays = [ foundry.overlay ]; 13 | }; 14 | in { 15 | formatter = pkgs.alejandra; 16 | 17 | devShells = { 18 | default = pkgs.mkShell { 19 | buildInputs = with pkgs; [ 20 | bun 21 | foundry-bin 22 | gnumake 23 | ]; 24 | }; 25 | }; 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | auto_detect_remappings = false 3 | libs = ["lib"] 4 | src = "contracts" 5 | test = "tests" 6 | out = "artifacts" 7 | cache_path = "cache" 8 | bytecode_hash = "none" 9 | cbor_metadata = false 10 | verbosity = 3 11 | fs_permissions = [{ access = "read", path = "./artifacts"}] 12 | optimizer=true 13 | 14 | # Ignore compiler warnings that should be intentionally-skipped 15 | ignored_warnings_from = ["contracts/release/extensions/integration-manager/integrations/utils/0.8.19/bases/GenericWrappingAdapterBase.sol"] 16 | 17 | # NOTE: Specifying shanghai as the evm_version seems required for the Goerli tests to pass 18 | evm_version = "cancun" 19 | 20 | [profile.default.optimizer_details] 21 | yul = false 22 | 23 | [profile.dev] 24 | optimizer=false 25 | 26 | [rpc_endpoints] 27 | mainnet = "${ETHEREUM_NODE_MAINNET}" 28 | polygon = "${ETHEREUM_NODE_POLYGON}" 29 | arbitrum = "${ETHEREUM_NODE_ARBITRUM}" 30 | base = "${ETHEREUM_NODE_BASE}" 31 | 32 | [etherscan] 33 | mainnet = { key = "${ETHERSCAN_API_KEY_MAINNET}", chain = "mainnet" } 34 | polygon = { key = "${ETHERSCAN_API_KEY_POLYGON}", chain = "polygon" } 35 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | @openzeppelin/contracts/=lib/openzeppelin-solc-0.6/contracts/ 2 | @uniswap/v3-core/=lib/uniswap-v3-core/ 3 | ds-test/=lib/forge-std/lib/ds-test/src/ 4 | forge-std/=lib/forge-std/src/ 5 | morpho-blue/=lib/morpho-blue/src/libraries 6 | openzeppelin-solc-0.6/=lib/openzeppelin-solc-0.6/contracts/ 7 | openzeppelin-solc-0.7/=lib/openzeppelin-solc-0.7/contracts/ 8 | openzeppelin-solc-0.8/=lib/openzeppelin-solc-0.8/contracts/ 9 | uniswap-v3-core/=lib/uniswap-v3-core/ 10 | uniswap-v3-core-0.8/=lib/uniswap-v3-core-0.8/ 11 | uniswap-v3-periphery/=lib/uniswap-v3-periphery/contracts/ 12 | -------------------------------------------------------------------------------- /tests/bases/UnitTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {CommonUtils} from "tests/utils/CommonUtils.sol"; 5 | 6 | abstract contract UnitTest is CommonUtils {} 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveAToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveAToken interface 15 | /// @author Enzyme Foundation 16 | /// @notice Common Aave aToken interface for V2 and V3 17 | interface IAaveAToken { 18 | function UNDERLYING_ASSET_ADDRESS() external view returns (address underlying_); 19 | } 20 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV2IncentivesController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV2IncentivesController interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV2IncentivesController { 17 | function claimRewards(address[] memory _assets, uint256 _amount, address _to) external; 18 | 19 | function configureAssets(address[] calldata _assets, uint256[] calldata _emissionsPerSecond) external; 20 | 21 | function EMISSION_MANAGER() external view returns (address); 22 | 23 | function setDistributionEnd(uint256 _distributionEnd) external; 24 | } 25 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV2LendingPoolAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IAaveV2LendingPool} from "./IAaveV2LendingPool.sol"; 15 | 16 | /// @title IAaveV2LendingPoolAddressProvider interface 17 | /// @author Enzyme Foundation 18 | 19 | interface IAaveV2LendingPoolAddressProvider { 20 | function getLendingPool() external view returns (IAaveV2LendingPool pool_); 21 | } 22 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV2ProtocolDataProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV2ProtocolDataProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV2ProtocolDataProvider { 17 | function getReserveTokensAddresses(address _underlying) 18 | external 19 | view 20 | returns (address aToken_, address stableDebtToken_, address variableDebtToken_); 21 | } 22 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV3PoolAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IAaveV3Pool} from "./IAaveV3Pool.sol"; 15 | /// @title IAaveV3PoolAddressProvider interface 16 | /// @author Enzyme Foundation 17 | 18 | interface IAaveV3PoolAddressProvider { 19 | function getPool() external view returns (IAaveV3Pool pool_); 20 | 21 | function getPriceOracle() external view returns (address priceOracleAddress_); 22 | } 23 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV3PriceOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3PriceOracle interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3PriceOracle { 17 | function getAssetPrice(address _asset) external view returns (uint256 price_); 18 | } 19 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAaveV3ProtocolDataProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IAaveV3ProtocolDataProvider interface 15 | /// @author Enzyme Foundation 16 | interface IAaveV3ProtocolDataProvider { 17 | function getReserveTokensAddresses(address _underlying) 18 | external 19 | view 20 | returns (address aToken_, address stableDebtToken_, address variableDebtToken_); 21 | } 22 | -------------------------------------------------------------------------------- /tests/interfaces/external/IAliceWhitelistManager.sol: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Enzyme Protocol. 3 | 4 | (c) Enzyme Foundation 5 | 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | // SPDX-License-Identifier: GPL-3.0 11 | pragma solidity >=0.6.0 <0.9.0; 12 | 13 | /// @title IAliceWhitelistManager Interface 14 | /// @author Enzyme Foundation 15 | interface IAliceWhitelistManager { 16 | function addAddress(address _userAddress) external; 17 | 18 | function owner() external returns (address owner_); 19 | } 20 | -------------------------------------------------------------------------------- /tests/interfaces/external/IBalancerV2LiquidityGauge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IBalancerV2LiquidityGauge { 5 | function lp_token() external view returns (address lpToken_); 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/IChainlinkAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | interface IChainlinkAggregator { 5 | function decimals() external view returns (uint8); 6 | 7 | function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80); 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV2CERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | import {IERC20} from "./IERC20.sol"; 6 | 7 | interface ICompoundV2CERC20 is IERC20 { 8 | function accrueInterest() external returns (uint256 interest_); 9 | 10 | function borrow(uint256 _borrowAmount) external returns (uint256 status_); 11 | 12 | function borrowBalanceStored(address _account) external view returns (uint256 balance_); 13 | 14 | function redeem(uint256 _redeemAmount) external returns (uint256 status_); 15 | 16 | function repayBorrow(uint256 _repayAmouny) external returns (uint256 status_); 17 | 18 | function exchangeRateStored() external view returns (uint256 exchangeRate_); 19 | 20 | function underlying() external returns (address underlying_); 21 | } 22 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV2CEther.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | interface ICompoundV2CEther { 6 | function accrueInterest() external returns (uint256 interest_); 7 | 8 | function mint() external payable; 9 | 10 | function repayBorrow() external payable; 11 | } 12 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV2Comptroller.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title ICompoundV2Comptroller Interface 13 | /// @author Enzyme Foundation 14 | /// @notice Minimal interface for interactions with Compound Comptroller 15 | interface ICompoundV2Comptroller { 16 | function getCompAddress() external view returns (address comp_); 17 | 18 | function _setCompSpeeds(address[] memory _cTokens, uint256[] memory _supplySpeeds, uint256[] memory _borrowSpeeds) 19 | external; 20 | 21 | function admin() external view returns (address admin_); 22 | } 23 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV3Comet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICompoundV3Comet Interface 15 | /// @author Enzyme Foundation 16 | interface ICompoundV3Comet { 17 | function baseToken() external view returns (address baseToken_); 18 | 19 | function supplyTo(address _dst, address _asset, uint256 _amount) external; 20 | } 21 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV3CometRewards.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | pragma experimental ABIEncoderV2; 14 | 15 | /// @title ICompoundV3CometRewards Interface 16 | /// @author Enzyme Foundation 17 | /// @dev Source: https://github.com/compound-finance/comet/blob/main/contracts/CometRewards.sol 18 | interface ICompoundV3CometRewards { 19 | struct RewardConfig { 20 | address token; 21 | uint64 rescaleFactor; 22 | bool shouldUpscale; 23 | } 24 | 25 | function rewardConfig(address _cToken) external view returns (RewardConfig memory rewardConfig_); 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICompoundV3Configurator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title ICompoundV3Configurator Interface 15 | /// @author Enzyme Foundation 16 | interface ICompoundV3Configurator { 17 | function factory(address _comet) external view returns (address factory_); 18 | } 19 | -------------------------------------------------------------------------------- /tests/interfaces/external/IConvexBaseRewardPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IConvexBaseRewardPool Interface 13 | /// @author Enzyme Foundation 14 | interface IConvexBaseRewardPool { 15 | function stakeFor(address _for, uint256 _amount) external returns (bool success_); 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/IConvexVlCvxExtraRewardDistribution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IConvexVlCvxExtraRewardDistribution Interface 13 | /// @author Enzyme Foundation 14 | interface IConvexVlCvxExtraRewardDistribution { 15 | function addReward(address _token, uint256 _amount) external; 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICurveAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ICurveAddressProvider { 5 | function get_address(uint256 _id) external view returns (address contractAddress_); 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICurveGaugeController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ICurveGaugeController { 5 | function change_gauge_weight(address _gauge, uint256 _weight) external; 6 | 7 | function get_gauge_weight(address _gauge) external view returns (uint256 weight_); 8 | 9 | function get_total_weight() external view returns (uint256 totalWeight_); 10 | } 11 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICurveLiquidityPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ICurveLiquidityPool { 5 | function coins(int128) external view returns (address); 6 | 7 | function coins(uint256) external view returns (address); 8 | 9 | function get_virtual_price() external view returns (uint256); 10 | 11 | function underlying_coins(int128) external view returns (address); 12 | 13 | function underlying_coins(uint256) external view returns (address); 14 | } 15 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICurveMinter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ICurveMinter { 5 | function toggle_approve_mint(address) external; 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/ICurveSwapRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ICurveSwapRouter { 5 | function get_best_rate(address _outgoingAssetAddress, address _incomingAssetAddress, uint256 _outgoingAssetAmount) 6 | external 7 | view 8 | returns (address bestPoolAddress_, uint256 amountReceived_); 9 | } 10 | -------------------------------------------------------------------------------- /tests/interfaces/external/IDivaEther.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IDivaEther { 5 | function convertToShares(uint256 _assets) external returns (uint256 shares_); 6 | 7 | function deposit() external payable returns (uint256 shares_); 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {IERC20 as IERC20Base} from "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; 5 | import {IERC20Metadata} from "openzeppelin-solc-0.8/token/ERC20/extensions/IERC20Metadata.sol"; 6 | 7 | interface IERC20 is IERC20Base, IERC20Metadata {} 8 | -------------------------------------------------------------------------------- /tests/interfaces/external/IERC4626.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {IERC4626 as OZ_IERC4626} from "openzeppelin-solc-0.8/interfaces/IERC4626.sol"; 5 | 6 | interface IERC4626 is OZ_IERC4626 {} 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/IEtherFiLiquidityPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IEtherFiLiquidityPool { 5 | function deposit() external payable; 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/IEtherFiWrappedEth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IEtherFiWrappedEth Interface 15 | /// @author Enzyme Foundation 16 | interface IEtherFiWrappedEth { 17 | function getEETHByWeETH(uint256 _weETHAmount) external view returns (uint256 _eETHAmount_); 18 | } 19 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2ChainlinkPriceFeedProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2ChainlinkPriceFeedProvider Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2ChainlinkPriceFeedProvider { 17 | struct ValidatedPrice { 18 | address token; 19 | uint256 min; 20 | uint256 max; 21 | uint256 timestamp; 22 | address provider; 23 | } 24 | 25 | function getOraclePrice(address _token, bytes memory _data) 26 | external 27 | view 28 | returns (ValidatedPrice memory validatedPrice_); 29 | } 30 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2LiquidationHandler.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IGMXV2Prices} from "./IGMXV2Prices.sol"; 15 | 16 | /// @title IGMXV2LiquidationHandler Interface 17 | /// @author Enzyme Foundation 18 | interface IGMXV2LiquidationHandler { 19 | function executeLiquidation( 20 | address _account, 21 | address _market, 22 | address _collateralToken, 23 | bool _isLong, 24 | IGMXV2Prices.SetPricesParams calldata _oracleParams 25 | ) external; 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2Market.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2Market Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2Market { 17 | struct Props { 18 | address marketToken; 19 | address indexToken; 20 | address longToken; 21 | address shortToken; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2OrderHandler.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IGMXV2Prices} from "./IGMXV2Prices.sol"; 15 | 16 | /// @title IGMXV2OrderHandler Interface 17 | /// @author Enzyme Foundation 18 | interface IGMXV2OrderHandler { 19 | function orderVault() external view returns (address orderVault_); 20 | 21 | function executeOrder(bytes32 _orderKey, IGMXV2Prices.SetPricesParams calldata _oracleParams) external; 22 | } 23 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2Prices.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2Prices Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2Prices { 17 | struct SetPricesParams { 18 | address[] tokens; 19 | address[] providers; 20 | bytes[] data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/interfaces/external/IGMXV2RoleStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IGMXV2RoleStore Interface 15 | /// @author Enzyme Foundation 16 | interface IGMXV2RoleStore { 17 | function hasRole(address _account, bytes32 _roleKey) external view returns (bool hasRole_); 18 | 19 | function getRoleMembers(bytes32 _roleKey, uint256 _start, uint256 _end) 20 | external 21 | view 22 | returns (address[] memory members_); 23 | } 24 | -------------------------------------------------------------------------------- /tests/interfaces/external/IKilnStakingContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | interface IKilnStakingContract { 5 | function deposit() external payable; 6 | 7 | function getCLFeeRecipient(bytes calldata _publicKey) external view returns (address feeRecipient_); 8 | 9 | function getELFeeRecipient(bytes calldata _publicKey) external view returns (address feeRecipient_); 10 | 11 | function getExitRequestedFromRoot(bytes32 _publicKeyRoot) external view returns (bool exitRequested_); 12 | 13 | function getGlobalFee() external view returns (uint256 globalFee_); 14 | } 15 | -------------------------------------------------------------------------------- /tests/interfaces/external/ILidoSteth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ILidoSteth { 5 | function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256 ethAmount_); 6 | 7 | function submit(address _referral) external payable; 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMapleV2Globals.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | interface IMapleV2Globals { 15 | function isInstanceOf(bytes32 _key, address _who) external view returns (bool isInstanceOf_); 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMapleV2Pool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IERC4626} from "./IERC4626.sol"; 15 | import {IMapleV2PoolManager} from "./IMapleV2PoolManager.sol"; 16 | 17 | interface IMapleV2Pool is IERC4626 { 18 | function asset() external view returns (address underlying_); 19 | 20 | function convertToExitAssets(uint256 _shares) external view returns (uint256 assets_); 21 | 22 | function manager() external view returns (IMapleV2PoolManager manager_); 23 | 24 | function maxDeposit(address _receiver) external view returns (uint256 maxAssets_); 25 | 26 | function maxRedeem(address _owner) external view returns (uint256 maxShares_); 27 | } 28 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMapleV2PoolManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IMapleV2Pool} from "./IMapleV2Pool.sol"; 15 | import {IMapleV2ProxyFactory} from "./IMapleV2ProxyFactory.sol"; 16 | import {IMapleV2WithdrawalManager} from "./IMapleV2WithdrawalManager.sol"; 17 | 18 | interface IMapleV2PoolManager { 19 | function factory() external view returns (IMapleV2ProxyFactory factory_); 20 | 21 | function pool() external view returns (IMapleV2Pool pool_); 22 | 23 | function withdrawalManager() external view returns (IMapleV2WithdrawalManager withdrawalManager_); 24 | } 25 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMapleV2ProxyFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | interface IMapleV2ProxyFactory { 15 | function isInstance(address instance_) external view returns (bool isInstance_); 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMapleV2WithdrawalManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | interface IMapleV2WithdrawalManager { 15 | function getWindowAtId(uint256 _cycleId) external view returns (uint256 windowStart_, uint256 windowEnd_); 16 | 17 | function exitCycleId(address _owner) external view returns (uint256 exitCycleId_); 18 | 19 | function lockedShares(address _owner) external view returns (uint256 lockedShares_); 20 | } 21 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMerklCore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMerklCore interface 15 | /// @author Enzyme Foundation 16 | interface IMerklCore { 17 | function isGovernor(address _user) external view returns (bool isGovernor_); 18 | } 19 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMerklDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IMerklDistributor interface 15 | /// @author Enzyme Foundation 16 | interface IMerklDistributor { 17 | struct MerkleTree { 18 | bytes32 merkleRoot; 19 | bytes32 ipfsHash; 20 | } 21 | 22 | function updateTree(MerkleTree calldata _tree) external; 23 | 24 | function core() external view returns (address core_); 25 | 26 | function claimed(address _user, address _token) external view returns (uint256 amount_); 27 | } 28 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMorphoMorpho.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IMorphoMorpho { 5 | function owner() external view returns (address owner_); 6 | 7 | function setIsSupplyPaused(address _poolToken, bool _isPaused) external; 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMorphoSupplyVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | import {IMorphoMorpho} from "./IMorphoMorpho.sol"; 5 | 6 | interface IMorphoSupplyVault { 7 | function morpho() external view returns (IMorphoMorpho morpho_); 8 | 9 | function poolToken() external view returns (address poolToken_); 10 | } 11 | -------------------------------------------------------------------------------- /tests/interfaces/external/IMysoV3Escrow.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IMysoV3DataTypes} from "./IMysoV3DataTypes.sol"; 15 | import {IMysoV3Escrow as IMysoV3EscrowProd} from "contracts/external-interfaces/IMysoV3Escrow.sol"; 16 | 17 | /// @title IMysoV3Escrow Interface 18 | /// @author Enzyme Foundation 19 | interface IMysoV3Escrow is IMysoV3EscrowProd { 20 | function owner() external view returns (address owner_); 21 | 22 | function previewBid(uint256 _relBid, uint256 _refSpot, bytes[] memory _oracleData) 23 | external 24 | view 25 | returns (IMysoV3DataTypes.BidPreview memory preview_, address distPartner_); 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/INonfungiblePositionManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title Non-fungible token for positions 5 | /// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred 6 | /// and authorized. 7 | interface INonfungiblePositionManager { 8 | function positions(uint256 _tokenId) 9 | external 10 | view 11 | returns ( 12 | uint96 nonce_, 13 | address operator_, 14 | address token0_, 15 | address token1_, 16 | uint24 fee_, 17 | int24 tickLower_, 18 | int24 tickUpper_, 19 | uint128 liquidity_, 20 | uint256 feeGrowthInside0LastX128_, 21 | uint256 feeGrowthInside1LastX128_, 22 | uint128 tokensOwed0_, 23 | uint128 tokensOwed1_ 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /tests/interfaces/external/IOneInchV5AggregationRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IOneInchV5AggregationRouter Interface 15 | /// @author Enzyme Foundation 16 | interface IOneInchV5AggregationRouter { 17 | struct SwapDescription { 18 | address srcToken; 19 | address dstToken; 20 | address payable srcReceiver; 21 | address payable dstReceiver; 22 | uint256 amount; 23 | uint256 minReturnAmount; 24 | uint256 flags; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/IParaSwapV5AugustusSwapper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | interface IParaSwapV5AugustusSwapper { 6 | struct Adapter { 7 | address payable adapter; 8 | uint256 percent; 9 | uint256 networkFee; 10 | Route[] route; 11 | } 12 | 13 | struct Route { 14 | uint256 index; 15 | address targetExchange; 16 | uint256 percent; 17 | bytes payload; 18 | uint256 networkFee; 19 | } 20 | 21 | struct Path { 22 | address to; 23 | uint256 totalNetworkFee; 24 | Adapter[] adapters; 25 | } 26 | 27 | struct MegaSwapPath { 28 | uint256 fromAmountPercent; 29 | Path[] path; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/interfaces/external/IParaSwapV6FeeVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | interface IParaSwapV6FeeVault { 6 | function getBalance(address _tokenAddress, address _partnerAddress) external view returns (uint256 feeBalance_); 7 | } 8 | -------------------------------------------------------------------------------- /tests/interfaces/external/IPendleV2Market.sol: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Enzyme Protocol. 3 | 4 | (c) Enzyme Foundation 5 | 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | import {IPendleV2PrincipalToken} from "./IPendleV2PrincipalToken.sol"; 11 | import {IPendleV2StandardizedYield} from "./IPendleV2StandardizedYield.sol"; 12 | 13 | // SPDX-License-Identifier: GPL-3.0 14 | pragma solidity >=0.6.0 <0.9.0; 15 | 16 | /// @title IPendleV2Market Interface 17 | /// @author Enzyme Foundation 18 | interface IPendleV2Market { 19 | function getRewardTokens() external view returns (address[] memory rewardsTokens_); 20 | 21 | function readTokens() 22 | external 23 | view 24 | returns (IPendleV2StandardizedYield _SY, IPendleV2PrincipalToken _PT, address _YT); 25 | } 26 | -------------------------------------------------------------------------------- /tests/interfaces/external/IPendleV2PrincipalToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title IPendleV2PrincipalToken Interface 5 | /// @author Enzyme Foundation 6 | interface IPendleV2PrincipalToken { 7 | function expiry() external view returns (uint256 expiry_); 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/IPendleV2PyYtLpOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title IPendleV2PyYtLpOracle Interface 5 | /// @author Enzyme Foundation 6 | interface IPendleV2PyYtLpOracle { 7 | function getLpToSyRate(address _market, uint32 _duration) external view returns (uint256 rate_); 8 | 9 | function getOracleState(address _market, uint32 _duration) 10 | external 11 | view 12 | returns (bool increaseCardinalityRequired_, uint16 cardinalityRequired_, bool oldestObservationSatisfied_); 13 | 14 | function getPtToSyRate(address _market, uint32 _duration) external view returns (uint256 rate_); 15 | } 16 | -------------------------------------------------------------------------------- /tests/interfaces/external/IPendleV2Router.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | /// @title IPendleV2Router Interface 6 | /// @author Enzyme Foundation 7 | interface IPendleV2Router { 8 | struct ApproxParams { 9 | uint256 guessMin; 10 | uint256 guessMax; 11 | uint256 guessOffchain; 12 | uint256 maxIteration; 13 | uint256 eps; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/interfaces/external/IPendleV2StandardizedYield.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title IPendleV2StandardizedYield Interface 5 | /// @author Enzyme Foundation 6 | interface IPendleV2StandardizedYield { 7 | function accruedRewards(address _user) external view returns (uint256[] memory rewardAmounts_); 8 | 9 | function getRewardTokens() external view returns (address[] memory rewardTokens_); 10 | 11 | function yieldToken() external view returns (address yieldToken_); 12 | 13 | function isValidTokenIn(address _token) external view returns (bool isValid_); 14 | 15 | function isValidTokenOut(address _token) external view returns (bool isValid_); 16 | 17 | function previewDeposit(address _tokenIn, uint256 _amountTokenToDeposit) 18 | external 19 | view 20 | returns (uint256 amountSharesOut_); 21 | 22 | function previewRedeem(address _tokenOut, uint256 _amountSharesToRedeem) 23 | external 24 | view 25 | returns (uint256 amountTokenOut_); 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/ISnapshotDelegateRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title ISnapshotDelegateRegistry Interface 13 | /// @author Enzyme Foundation 14 | interface ISnapshotDelegateRegistry { 15 | function delegation(address _account, bytes32 _snapshotId) external view returns (address delegatee_); 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/IStaderConfig.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IStaderConfig Interface 15 | /// @author Enzyme Foundation 16 | interface IStaderConfig { 17 | function getMinBlockDelayToFinalizeWithdrawRequest() external view returns (uint256 blocks_); 18 | } 19 | -------------------------------------------------------------------------------- /tests/interfaces/external/IStaderStakePoolsManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IStaderStakePoolsManager as IStaderStakePoolsManagerProd} from 15 | "contracts/external-interfaces/IStaderStakePoolsManager.sol"; 16 | 17 | /// @title IStaderStakePoolsManager Interface 18 | /// @author Enzyme Foundation 19 | interface IStaderStakePoolsManager is IStaderStakePoolsManagerProd { 20 | function previewDeposit(uint256 _assets) external payable returns (uint256 shares_); 21 | } 22 | -------------------------------------------------------------------------------- /tests/interfaces/external/IStaderUserWithdrawalManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | import {IStaderUserWithdrawalManager as IStaderUserWithdrawalManagerProd} from 15 | "contracts/external-interfaces/IStaderUserWithdrawalManager.sol"; 16 | 17 | /// @title IStaderUserWithdrawalManager Interface 18 | /// @author Enzyme Foundation 19 | interface IStaderUserWithdrawalManager is IStaderUserWithdrawalManagerProd { 20 | function finalizeUserWithdrawalRequest() external; 21 | 22 | function nextRequestId() external view returns (uint256 requestId_); 23 | 24 | function nextRequestIdToFinalize() external view returns (uint256 requestId_); 25 | 26 | function staderConfig() external view returns (address staderConfig_); 27 | } 28 | -------------------------------------------------------------------------------- /tests/interfaces/external/IStakeWiseV3OsTokenController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | 6 | (c) Enzyme Foundation 7 | 8 | For the full license information, please view the LICENSE 9 | file that was distributed with this source code. 10 | */ 11 | 12 | pragma solidity >=0.6.0 <0.9.0; 13 | 14 | /// @title IStakeWiseV3OsTokenController Interface 15 | /// @author Enzyme Foundation 16 | interface IStakeWiseV3OsTokenController { 17 | function avgRewardPerSecond() external view returns (uint256 avgRewardPerSecond_); 18 | 19 | function setAvgRewardPerSecond(uint256 _avgRewardPerSecond) external; 20 | } 21 | -------------------------------------------------------------------------------- /tests/interfaces/external/ISwellSweth.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ISwellSweth { 5 | function ethToSwETHRate() external view returns (uint256); 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1Auction.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITermFinanceV1Auction { 5 | struct CompleteAuctionInput { 6 | bytes32[] revealedBidSubmissions; 7 | bytes32[] expiredRolloverBids; 8 | bytes32[] unrevealedBidSubmissions; 9 | bytes32[] revealedOfferSubmissions; 10 | bytes32[] unrevealedOfferSubmissions; 11 | } 12 | 13 | function auctionEndTime() external view returns (uint256 auctionEndTime_); 14 | 15 | function completeAuction(CompleteAuctionInput calldata _completeAuctionInput) external; 16 | 17 | function dayCountFractionMantissa() external view returns (uint256 dayCountFractionMantissa_); 18 | 19 | function purchaseToken() external view returns (address purchaseToken_); 20 | 21 | function termAuctionBidLocker() external view returns (address termAuctionBidLocker_); 22 | 23 | function termAuctionOfferLocker() external view returns (address termAuctionOfferLocker_); 24 | 25 | function termRepoServicer() external view returns (address termRepoServicer_); 26 | } 27 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1BidLocker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITermFinanceV1BidLocker { 5 | struct TermAuctionBidSubmission { 6 | bytes32 id; 7 | address bidder; 8 | bytes32 bidPriceHash; 9 | uint256 amount; 10 | uint256[] collateralAmounts; 11 | address purchaseToken; 12 | address[] collateralTokens; 13 | } 14 | 15 | function lockBids(TermAuctionBidSubmission[] calldata _bidSubmissions) 16 | external 17 | returns (bytes32[] memory bidIds_); 18 | 19 | function revealBids(bytes32[] calldata _ids, uint256[] calldata _prices, uint256[] calldata _nonces) external; 20 | 21 | function revealTime() external view returns (uint256 revealTime_); 22 | } 23 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1OfferLocker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITermFinanceV1OfferLocker { 5 | struct TermAuctionOffer { 6 | bytes32 id; 7 | address offeror; 8 | bytes32 offerPriceHash; 9 | uint256 offerPriceRevealed; 10 | uint256 amount; 11 | address purchaseToken; 12 | bool isRevealed; 13 | } 14 | 15 | function auctionStartTime() external view returns (uint256 startTime); 16 | 17 | function lockedOffer(bytes32 _offerId) external view returns (TermAuctionOffer memory offer_); 18 | 19 | function revealOffers(bytes32[] calldata _ids, uint256[] calldata _prices, uint256[] calldata _nonces) external; 20 | } 21 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1RepoCollateralManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | /// @title ITermFinanceV1RepoCollateralManager Interface 5 | /// @author Enzyme Foundation 6 | interface ITermFinanceV1RepoCollateralManager { 7 | function encumberedCollateralRemaining() external view returns (bool encumberedCollateralRemaining_); 8 | 9 | function unlockCollateralOnRepurchase(address _borrower) external; 10 | } 11 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1RepoServicer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITermFinanceV1RepoServicer { 5 | function redemptionTimestamp() external view returns (uint256 redemptionTimestamp_); 6 | 7 | function submitRepurchasePayment(uint256 _amount) external; 8 | 9 | function termRepoCollateralManager() external view returns (address termRepoCollateralManager_); 10 | 11 | function termRepoLocker() external view returns (address repoLocker_); 12 | 13 | function termRepoToken() external view returns (address repoToken_); 14 | } 15 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITermFinanceV1RepoToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITermFinanceV1RepoToken { 5 | function redemptionValue() external view returns (uint256 redemptionValue_); 6 | } 7 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITheGraphController.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITheGraphController { 5 | function getContractProxy(bytes32 _id) external view returns (address contractProxyAddress_); 6 | 7 | function getGovernor() external view returns (address governorAddress_); 8 | } 9 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITheGraphEpochManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITheGraphEpochManager { 5 | function currentEpoch() external view returns (uint256 epoch_); 6 | 7 | function runEpoch() external; 8 | 9 | function setEpochLength(uint256 _epochLength) external; 10 | } 11 | -------------------------------------------------------------------------------- /tests/interfaces/external/ITheGraphStaking.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface ITheGraphStaking { 5 | function delegationPools(address _indexer) 6 | external 7 | view 8 | returns ( 9 | uint32 cooldownBlocks_, 10 | uint32 indexingRewardCut_, 11 | uint32 queryFeeCut_, 12 | uint256 updatedAtBlock_, 13 | uint256 poolTokens_, 14 | uint256 poolShares_ 15 | ); 16 | 17 | function delegationTaxPercentage() external view returns (uint32 taxPercentage_); 18 | 19 | function getDelegation(address _indexer, address _delegator) 20 | external 21 | view 22 | returns (uint256 shares_, uint256 tokensLocked_, uint256 tokensLockedUntil_); 23 | } 24 | -------------------------------------------------------------------------------- /tests/interfaces/external/IUniswapV2Pair.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity >=0.6.0 <0.9.0; 4 | 5 | /// @title IUniswapV2Pair Interface 6 | /// @author Enzyme Foundation 7 | /// @notice Minimal interface for our interactions with the Uniswap V2's Pair contract 8 | interface IUniswapV2Pair { 9 | function getReserves() external view returns (uint112 reserve0_, uint112 reserve1_, uint32 blockTimestampLast_); 10 | 11 | function token0() external view returns (address token0Address_); 12 | 13 | function token1() external view returns (address token1Address_); 14 | 15 | function totalSupply() external view returns (uint256 totalSupply_); 16 | } 17 | -------------------------------------------------------------------------------- /tests/interfaces/external/IUniswapV3SwapRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IUniswapV3SwapRouter { 6 | struct ExactInputParams { 7 | bytes path; 8 | address recipient; 9 | uint256 deadline; 10 | uint256 amountIn; 11 | uint256 amountOutMinimum; 12 | } 13 | 14 | function exactInput(ExactInputParams calldata _exactInputParams) external payable returns (uint256 amountOut_); 15 | } 16 | -------------------------------------------------------------------------------- /tests/interfaces/external/IVotiumMultiMerkleStash.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | /* 4 | This file is part of the Enzyme Protocol. 5 | (c) Enzyme Foundation 6 | For the full license information, please view the LICENSE 7 | file that was distributed with this source code. 8 | */ 9 | 10 | pragma solidity >=0.6.0 <0.9.0; 11 | 12 | /// @title IVotiumMultiMerkleStash Interface 13 | /// @author Enzyme Foundation 14 | interface IVotiumMultiMerkleStash { 15 | struct ClaimParam { 16 | address token; 17 | uint256 index; 18 | uint256 amount; 19 | bytes32[] merkleProof; 20 | } 21 | 22 | function updateMerkleRoot(address _token, bytes32 _merkleRoot) external; 23 | 24 | function owner() external view returns (address owner_); 25 | } 26 | -------------------------------------------------------------------------------- /tests/interfaces/external/IYearnVaultV2Vault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | import {IERC20} from "./IERC20.sol"; 5 | 6 | interface IYearnVaultV2Vault { 7 | function token() external view returns (IERC20 underlying_); 8 | 9 | function pricePerShare() external view returns (uint256 pricePerShare_); 10 | } 11 | -------------------------------------------------------------------------------- /tests/interfaces/internal/v4/IGasRelayPaymasterFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IGasRelayPaymasterFactory { 5 | event CanonicalLibSet(address nextCanonicalLib); 6 | event ProxyDeployed(address indexed caller, address proxy, bytes constructData); 7 | 8 | function deployProxy(bytes memory _constructData) external returns (address proxy_); 9 | function getCanonicalLib() external view returns (address canonicalLib_); 10 | function getDispatcher() external view returns (address dispatcher_); 11 | function getOwner() external view returns (address owner_); 12 | function setCanonicalLib(address _nextCanonicalLib) external; 13 | } 14 | -------------------------------------------------------------------------------- /tests/interfaces/internal/v4/IUsdEthSimulatedAggregator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity >=0.6.0 <0.9.0; 3 | 4 | interface IUsdEthSimulatedAggregator { 5 | function decimals() external pure returns (uint8 decimals_); 6 | 7 | function latestRoundData() 8 | external 9 | view 10 | returns (uint80 roundId_, int256 answer_, uint256 startedAt_, uint256 updatedAt_, uint80 answeredInRound_); 11 | } 12 | -------------------------------------------------------------------------------- /tests/tests/protocols/aave/AaveV2Constants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | // Ethereum 5 | address constant ETHEREUM_LENDING_POOL_ADDRESS = 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9; 6 | address constant ETHEREUM_LENDING_POOL_ADDRESS_PROVIDER_ADDRESS = 0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5; 7 | address constant ETHEREUM_INCENTIVES_CONTROLLER = 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5; 8 | address constant ETHEREUM_PROTOCOL_DATA_PROVIDER = 0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d; 9 | 10 | // Polygon 11 | address constant POLYGON_LENDING_POOL_ADDRESS = 0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf; 12 | address constant POLYGON_LENDING_POOL_ADDRESS_PROVIDER_ADDRESS = 0xd05e3E715d945B59290df0ae8eF85c1BdB684744; 13 | address constant POLYGON_INCENTIVES_CONTROLLER = 0x357D51124f59836DeD84c8a1730D72B749d8BC23; 14 | address constant POLYGON_PROTOCOL_DATA_PROVIDER = 0x7551b5D2763519d4e37e8B81929D336De671d46d; 15 | -------------------------------------------------------------------------------- /tests/tests/protocols/compound/CompoundV2Constants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | // Ethereum 5 | address constant ETHEREUM_COMPTROLLER = 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B; 6 | -------------------------------------------------------------------------------- /tests/tests/protocols/compound/CompoundV3Constants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | // Ethereum 5 | address constant ETHEREUM_COMPOUND_V3_CONFIGURATOR = 0x316f9708bB98af7dA9c68C1C3b5e79039cD336E3; 6 | address constant ETHEREUM_COMPOUND_V3_REWARDS = 0x1B0e765F6224C21223AeA2af16c1C46E38885a40; 7 | 8 | // Polygon 9 | address constant POLYGON_COMPOUND_V3_CONFIGURATOR = 0x83E0F742cAcBE66349E3701B171eE2487a26e738; 10 | address constant POLYGON_COMPOUND_V3_REWARDS = 0x45939657d1CA34A8FA39A924B71D28Fe8431e581; 11 | -------------------------------------------------------------------------------- /tests/tests/protocols/erc4626/ERC4626Utils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | // MetaMorpho vault 5 | address constant ETHEREUM_MORPHO_RE7_USDC_VAULT_ADDRESS = 0x60d715515d4411f7F43e4206dc5d4a3677f0eC78; 6 | // Spark vault 7 | address constant ETHEREUM_SPARK_SDAI_VAULT_ADDRESS = 0x83F20F44975D03b1b09e64809B757c47f942BEeA; 8 | -------------------------------------------------------------------------------- /tests/tests/protocols/maple/MapleLiquidityConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | // Ethereum 4 | 5 | address constant ETHEREUM_MAPLE_V2_GLOBALS_ADDRESS = 0x804a6F5F667170F545Bf14e5DDB48C70B788390C; 6 | address constant ETHEREUM_M11_CREDIT_USDC2_POOL_ADDRESS = 0xd3cd37a7299B963bbc69592e5Ba933388f70dc88; 7 | -------------------------------------------------------------------------------- /tests/tests/protocols/myso-v3/MockOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | contract MockOracle { 5 | mapping(address => mapping(address => uint256)) public prices; 6 | 7 | error MockOracle__PriceNotAvailable(); 8 | 9 | function setPrice(address _token, address _quoteToken, uint256 _price) external { 10 | prices[_token][_quoteToken] = _price; 11 | } 12 | 13 | function getPrice(address _token, address _quoteToken, bytes[] memory) external view returns (uint256 price_) { 14 | price_ = prices[_token][_quoteToken]; 15 | 16 | if (price_ == 0) { 17 | revert MockOracle__PriceNotAvailable(); 18 | } 19 | 20 | return price_; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/tests/protocols/yearn/YearnVaultV2Contants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | address constant ETHEREUM_YEARN_VAULT_V2_REGISTRY = 0x50c1a2eA0a861A967D9d0FFE2AE4012c2E053804; 5 | address constant ETHEREUM_YEARN_VAULT_V2_USDT_VAULT = 0x3B27F92C0e212C671EA351827EDF93DB27cc0c65; 6 | address constant ETHEREUM_YEARN_VAULT_V2_WETH_VAULT = 0xa258C4606Ca8206D8aA700cE2143D7db854D168c; 7 | -------------------------------------------------------------------------------- /tests/tests/protocols/zero-lend/ZeroLendConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | address constant ETHEREUM_ZERO_LEND_RWA_STABLECOINS_AAVE_V3_POOL = 0xD3a4DA66EC15a001466F324FA08037f3272BDbE8; 5 | address constant ETHEREUM_ZERO_LEND_RWA_STABLECOINS_AAVE_V3_POOL_ADDRESS_PROVIDER = 6 | 0xE3C3c5eAd58FC2BEd4E577E38985B8F7F1DDfF00; 7 | address constant ETHEREUM_ZERO_LEND_RWA_STABLECOINS_AAVE_V3_PROTOCOL_DATA_PROVIDER = 8 | 0x298ECDcb0369Aef75cBbdA3e46a224Cfe622E287; 9 | address constant ETHEREUM_ZERO_LEND_RWA_STABLECOINS_AAVE_V3_REWARDS_CONTROLLER = 10 | 0xbc2FDC58E3E06D265B46E32771442b7f5098725b; 11 | 12 | address constant ETHEREUM_ZERO_LEND_LRT_BTC_AAVE_V3_POOL = 0xCD2b31071119D7eA449a9D211AC8eBF7Ee97F987; 13 | address constant ETHEREUM_ZERO_LEND_LRT_BTC_AAVE_V3_POOL_ADDRESS_PROVIDER = 0x17878AFdD5772F4Ec93c265Ac7Ad8E2b29abB857; 14 | address constant ETHEREUM_ZERO_LEND_LRT_BTC_AAVE_V3_PROTOCOL_DATA_PROVIDER = 0x31063F7CA8ef4089Db0dEdf8D6e35690B468A611; 15 | address constant ETHEREUM_ZERO_LEND_LRT_BTC_AAVE_V3_REWARDS_CONTROLLER = 0x938e23c10C501CE5D42Bc516eCFDf5AbD9C51d2b; 16 | -------------------------------------------------------------------------------- /tests/utils/CommonUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {AccountUtils} from "tests/utils/common/AccountUtils.sol"; 5 | import {AssetBalanceUtils} from "tests/utils/common/AssetBalanceUtils.sol"; 6 | import {ErrorUtils} from "tests/utils/common/ErrorUtils.sol"; 7 | import {EventUtils} from "tests/utils/common/EventUtils.sol"; 8 | import {StorageUtils} from "tests/utils/common/StorageUtils.sol"; 9 | import {TokenUtils} from "tests/utils/common/TokenUtils.sol"; 10 | import {TypeUtils} from "tests/utils/common/TypeUtils.sol"; 11 | 12 | abstract contract CommonUtils is 13 | AccountUtils, 14 | AssetBalanceUtils, 15 | ErrorUtils, 16 | EventUtils, 17 | StorageUtils, 18 | TokenUtils, 19 | TypeUtils 20 | {} 21 | -------------------------------------------------------------------------------- /tests/utils/CoreUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {DeploymentUtils} from "tests/utils/core/deployment/DeploymentUtils.sol"; 5 | import {AdapterUtils} from "tests/utils/core/AdapterUtils.sol"; 6 | import {AssetUniverseUtils} from "tests/utils/core/AssetUniverseUtils.sol"; 7 | import {ExternalPositionUtils} from "tests/utils/core/ExternalPositionUtils.sol"; 8 | import {FeeUtils} from "tests/utils/core/FeeUtils.sol"; 9 | import {FundUtils} from "tests/utils/core/FundUtils.sol"; 10 | import {ListRegistryUtils} from "tests/utils/core/ListRegistryUtils.sol"; 11 | import {PolicyUtils} from "tests/utils/core/PolicyUtils.sol"; 12 | 13 | abstract contract CoreUtils is 14 | DeploymentUtils, 15 | AdapterUtils, 16 | AssetUniverseUtils, 17 | ExternalPositionUtils, 18 | FeeUtils, 19 | FundUtils, 20 | ListRegistryUtils, 21 | PolicyUtils 22 | {} 23 | -------------------------------------------------------------------------------- /tests/utils/bases/AddOnUtilsBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {CoreUtils} from "tests/utils/CoreUtils.sol"; 5 | 6 | abstract contract AddOnUtilsBase is CoreUtils {} 7 | -------------------------------------------------------------------------------- /tests/utils/bases/CommonUtilsBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {Test} from "forge-std/Test.sol"; 5 | import {Constants} from "tests/utils/Constants.sol"; 6 | 7 | abstract contract CommonUtilsBase is Test, Constants {} 8 | -------------------------------------------------------------------------------- /tests/utils/bases/CoreUtilsBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {CommonUtils} from "tests/utils/CommonUtils.sol"; 5 | 6 | abstract contract CoreUtilsBase is CommonUtils {} 7 | -------------------------------------------------------------------------------- /tests/utils/common/AccountUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {CommonUtilsBase} from "tests/utils/bases/CommonUtilsBase.sol"; 5 | 6 | abstract contract AccountUtils is CommonUtilsBase { 7 | function computeCreateAddress(address _account) internal view returns (address address_) { 8 | return computeCreateAddress(_account, vm.getNonce(_account)); 9 | } 10 | 11 | function createSignature(uint256 _privateKey, bytes32 _digest) internal pure returns (bytes memory signature_) { 12 | (uint8 v, bytes32 r, bytes32 s) = vm.sign({privateKey: _privateKey, digest: _digest}); 13 | 14 | return abi.encodePacked(r, s, v); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/utils/common/ErrorUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {CommonUtilsBase} from "tests/utils/bases/CommonUtilsBase.sol"; 5 | 6 | abstract contract ErrorUtils is CommonUtilsBase { 7 | function formatError(string memory _error) internal pure returns (bytes memory) { 8 | return abi.encodeWithSignature("Error(string)", _error); 9 | } 10 | 11 | function formatError(string memory _prefix, string memory _error) internal pure returns (bytes memory) { 12 | return abi.encodePacked(_prefix, abi.encodeWithSignature("Error(string)", _error)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/utils/fees/PerformanceFeeUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | pragma solidity 0.8.19; 3 | 4 | import {AddOnUtilsBase} from "tests/utils/bases/AddOnUtilsBase.sol"; 5 | 6 | import {IFeeManager} from "tests/interfaces/internal/IFeeManager.sol"; 7 | import {IPerformanceFee} from "tests/interfaces/internal/IPerformanceFee.sol"; 8 | 9 | abstract contract PerformanceFeeUtils is AddOnUtilsBase { 10 | function deployPerformanceFee(IFeeManager _feeManager) internal returns (IPerformanceFee performanceFee_) { 11 | return IPerformanceFee(deployCode("PerformanceFee.sol", abi.encode(address(_feeManager)))); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/utils/libs/AddressLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity 0.8.19; 4 | 5 | library AddressLib { 6 | function toBytes32(address _self) internal pure returns (bytes32 bytes32_) { 7 | return bytes32(uint256(uint160(_self))); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/utils/libs/Bytes32Lib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity 0.8.19; 4 | 5 | library Bytes32Lib { 6 | function toAddress(bytes32 _self) internal pure returns (address address_) { 7 | return address(uint160(uint256(_self))); 8 | } 9 | 10 | function toBytes4(bytes32 _self) internal pure returns (bytes4 bytes4_) { 11 | return bytes4(_self); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/utils/libs/BytesArrayLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity 0.8.19; 4 | 5 | library BytesArrayLib { 6 | // MEMORY 7 | 8 | function encodePacked(bytes[] memory _self) internal pure returns (bytes memory packedArray_) { 9 | for (uint256 i; i < _self.length; i++) { 10 | packedArray_ = abi.encodePacked(packedArray_, _self[i]); 11 | } 12 | 13 | return packedArray_; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/utils/libs/GasLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | pragma solidity 0.8.19; 4 | 5 | import "forge-std/console.sol"; 6 | 7 | library GasLib { 8 | function logRepeatedCalls(address _contractAddress, bytes memory _data) internal { 9 | uint256 call1Gas = runCall(_contractAddress, _data); 10 | uint256 call2Gas = runCall(_contractAddress, _data); 11 | 12 | console.log("Call 1 gas:", call1Gas); 13 | console.log("Call 2 gas:", call2Gas); 14 | console.log("Gas diff:", call1Gas - call2Gas); 15 | } 16 | 17 | function runCall(address _contractAddress, bytes memory _data) internal returns (uint256 gasSpent_) { 18 | uint256 preGas = gasleft(); 19 | (bool success,) = _contractAddress.call(_data); 20 | uint256 postGas = gasleft(); 21 | require(success, "runCall: Call failed"); 22 | 23 | return preGas - postGas; 24 | } 25 | } 26 | --------------------------------------------------------------------------------