├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── README_DEPLOYS.md ├── README_TESTS.md ├── SAMPLE.env ├── SAMPLE.env.forge ├── binance-fxs.md ├── compiler_config.json ├── foundry.toml ├── fpi-airdrop-snapshot.json ├── frax_whitepaper_v1.pdf ├── package-lock.json ├── package.json ├── remappings.txt ├── src ├── audits │ ├── Curve AMO Audit Report - Frax Security Cartel - May 2024.pdf │ ├── FPISLocker + FraxtalERC4626MintRedeemer (Fraxtal sFRAX) - May 2024 - Frax Security Cartel.pdf │ ├── FXB, sFRAX, frxETH Redemption Queue, Frax Oracles - Trail of Bits - Oct 2023.pdf │ ├── Fraxchain (Fraxtal) - Trail of Bits - Jan 2024.pdf │ ├── Fraxtal Audit - April 2024 - Frax Security Cartel.pdf │ └── frxETH V2 Audit Report - Frax Security Cartel - March 2024.pdf ├── echidna │ ├── FraxswapPair-old.sol │ ├── FraxswapPair.sol │ ├── FraxswapPairV2.sol │ └── whitelist.yaml ├── foundry │ ├── deploy │ │ └── deployEvmosToEthFraxferry.s.sol │ └── test │ │ ├── BAMM │ │ └── BAMMTest.t.sol │ │ ├── FXS │ │ └── FXSDisableVoteTracking.t.sol │ │ └── veFPIS │ │ └── veFPISProxy.t.sol ├── hardhat │ ├── contracts │ │ ├── Bridges │ │ │ ├── Arbitrum │ │ │ │ ├── CrossChainBridgeBacker_ARBI_AnySwap.sol │ │ │ │ ├── FraxLiquidityBridger_ARBI_AnySwap.sol │ │ │ │ ├── IL1CustomGateway.sol │ │ │ │ └── IL2GatewayRouter.sol │ │ │ ├── CrossChainBridgeBacker.sol │ │ │ └── FraxLiquidityBridger.sol │ │ ├── Common │ │ │ ├── Context.sol │ │ │ ├── ContextV2.sol │ │ │ └── Ownable.sol │ │ ├── Curve │ │ │ ├── CurveInterfaces.sol │ │ │ ├── CurveVoterProxy.sol │ │ │ ├── FraxCrossChainRewarder.sol │ │ │ ├── FraxFamilialPitchGauge.sol │ │ │ ├── FraxGaugeControllerV2.vy │ │ │ ├── FraxGaugeFXSRewardsDistributor.sol │ │ │ ├── FraxMiddlemanGauge.sol │ │ │ ├── FraxMiddlemanGaugeFerryHelper.sol │ │ │ ├── FraxMiddlemanGaugeV2.sol │ │ │ ├── FraxMiddlemanGaugeV3.sol │ │ │ ├── ICurvefrxETHETHPool.sol │ │ │ ├── IDelegationProxy.sol │ │ │ ├── IFraxGaugeController.sol │ │ │ ├── IFraxGaugeControllerV2.sol │ │ │ ├── IFraxGaugeFXSRewardsDistributor.sol │ │ │ ├── ILiquidityGaugeV2.sol │ │ │ ├── IMetaImplementationUSD.sol │ │ │ ├── IMinter.sol │ │ │ ├── IStableSwap3Pool.sol │ │ │ ├── IVotingEscrowDelegation.sol │ │ │ ├── IveFPIS.sol │ │ │ ├── IveFXS.sol │ │ │ ├── Middleman_Gauges │ │ │ │ ├── FraxMiddlemanGauge_ARBI_Curve_VSTFRAX.sol │ │ │ │ └── FraxMiddlemanGauge_FRAX_mUSD.sol │ │ │ ├── NoopRewardsDistributor.sol │ │ │ ├── SmartWalletWhitelist.sol │ │ │ ├── veFPIS.vy │ │ │ └── veFPISProxy.sol │ │ ├── ERC165 │ │ │ ├── ERC165.sol │ │ │ └── IERC165.sol │ │ ├── ERC20 │ │ │ ├── DeflatingERC20.sol │ │ │ ├── ERC20.sol │ │ │ ├── ERC20Custom.sol │ │ │ ├── ERC20Mock.sol │ │ │ ├── ERC20MockTWAMM.sol │ │ │ ├── ERC20PermissionedMint.sol │ │ │ ├── ERC20Permit │ │ │ │ ├── Counters.sol │ │ │ │ ├── ECDSA.sol │ │ │ │ ├── EIP712.sol │ │ │ │ ├── ERC20Permit.sol │ │ │ │ └── IERC20Permit.sol │ │ │ ├── ERC20PermitPermissionedMint.sol │ │ │ ├── ERC20PermitPermissionedOptiMintable.sol │ │ │ ├── ERC20Virtual.sol │ │ │ ├── IERC20.sol │ │ │ ├── IERC20Metadata.sol │ │ │ ├── IERC20V2.sol │ │ │ ├── IERC20_Detailed.sol │ │ │ ├── IOptimismMintableERC20.sol │ │ │ ├── ISemver.sol │ │ │ ├── IWETH.sol │ │ │ ├── IsDAI.sol │ │ │ ├── IwfrxETH.sol │ │ │ ├── SafeERC20.sol │ │ │ ├── Variants │ │ │ │ ├── Comp.sol │ │ │ │ ├── FRAX3CRV_V2_Mock.sol │ │ │ │ ├── FarmToken.sol │ │ │ │ └── IQToken.sol │ │ │ ├── WETH.sol │ │ │ ├── __CROSSCHAIN │ │ │ │ ├── AnyswapV4ERC20.sol │ │ │ │ ├── AnyswapV5ERC20.sol │ │ │ │ ├── CrossChainCanonical.sol │ │ │ │ ├── CrossChainCanonicalFRAX.sol │ │ │ │ ├── CrossChainCanonicalFXS.sol │ │ │ │ ├── CrossChainCanonicalV2.sol │ │ │ │ ├── CrossChainCanonicalV2OptiMintable.sol │ │ │ │ ├── IAnyswapV4ERC20.sol │ │ │ │ ├── IAnyswapV5ERC20.sol │ │ │ │ ├── IArbFiatToken.sol │ │ │ │ ├── IChildChainManager.sol │ │ │ │ ├── ICrossChainCanonical.sol │ │ │ │ ├── IUChildAdministrableERC20.sol │ │ │ │ ├── IUChildERC20.sol │ │ │ │ ├── IanyFRAX.sol │ │ │ │ ├── IanyFXS.sol │ │ │ │ ├── anyFRAX.sol │ │ │ │ ├── anyFXS.sol │ │ │ │ ├── anyUSDC.sol │ │ │ │ ├── arbiUSDC.sol │ │ │ │ ├── celrFRAX.sol │ │ │ │ ├── celrFXS.sol │ │ │ │ ├── oneFRAX.sol │ │ │ │ ├── oneFXS.sol │ │ │ │ ├── oneUSDC.sol │ │ │ │ ├── polyFRAX.sol │ │ │ │ ├── polyFXS.sol │ │ │ │ └── polyUSDC.sol │ │ │ └── wfrxETH.sol │ │ ├── ERC721 │ │ │ ├── ERC721.sol │ │ │ ├── IERC721.sol │ │ │ ├── IERC721Enumerable.sol │ │ │ ├── IERC721Metadata.sol │ │ │ ├── IERC721Receiver.sol │ │ │ └── V8_0_0 │ │ │ │ ├── Common │ │ │ │ └── Context.sol │ │ │ │ ├── Governance │ │ │ │ └── AccessControl.sol │ │ │ │ ├── Math │ │ │ │ └── SafeMath.sol │ │ │ │ └── Utils │ │ │ │ ├── Address.sol │ │ │ │ ├── EnumerableMap.sol │ │ │ │ ├── EnumerableSet.sol │ │ │ │ └── Strings.sol │ │ ├── FPI │ │ │ ├── ABDKMath64x64.sol │ │ │ ├── FPI.sol │ │ │ ├── FPIControllerPool.sol │ │ │ ├── FPIS.sol │ │ │ ├── IERC20.sol │ │ │ ├── IFPI.sol │ │ │ ├── Math.sol │ │ │ └── SafeMath.sol │ │ ├── FXB │ │ │ ├── FXB.sol │ │ │ ├── FXBFactory.sol │ │ │ ├── FXBMintRedeemerAMO.sol │ │ │ └── IFXB.sol │ │ ├── FXS │ │ │ ├── FXS.sol │ │ │ ├── IFxs.sol │ │ │ ├── TokenVesting.sol │ │ │ └── veFXS_Solidity.sol.old │ │ ├── Frax │ │ │ ├── Frax.sol │ │ │ ├── FraxAMOMinter.sol │ │ │ ├── FraxAMOMinterLayer2.sol │ │ │ ├── FraxBridge.sol │ │ │ ├── IFrax.sol │ │ │ ├── IFraxAMOMinter.sol │ │ │ ├── IFraxAMOMinterOld.sol │ │ │ └── Pools │ │ │ │ ├── FraxPool.sol │ │ │ │ ├── FraxPoolLibrary.sol │ │ │ │ ├── FraxPoolV3.sol │ │ │ │ ├── FraxPoolvAMM.sol │ │ │ │ ├── IFraxPool.sol │ │ │ │ ├── Pool_USDC.sol │ │ │ │ ├── PoolvAMM_USDC.sol │ │ │ │ └── TestDriftingReserves.sol │ │ ├── FraxETH │ │ │ ├── FrxETHMiniRouter.sol │ │ │ ├── IfrxETH.sol │ │ │ ├── IfrxETHMinter.sol │ │ │ ├── IsfrxETH.sol │ │ │ ├── frxETHMinter.sol.old │ │ │ └── sfrxETH.sol.old │ │ ├── Fraxbonds │ │ │ ├── FXB.sol │ │ │ ├── FraxFPIBond.sol │ │ │ ├── FraxFPIBondYield.sol │ │ │ ├── Fraxauction.sol │ │ │ ├── SlippageAuction.sol │ │ │ └── interface │ │ │ │ └── IFPIControllerPool.sol │ │ ├── Fraxferry │ │ │ ├── DummyToken.sol │ │ │ ├── Fraxferry.sol │ │ │ └── IFraxferry.sol │ │ ├── FraxferryV2 │ │ │ ├── FerryOnL1.sol │ │ │ └── FerryOnL2.sol │ │ ├── Fraxlend │ │ │ ├── IFraxlendAMO.sol │ │ │ ├── IFraxlendAMOV3.sol │ │ │ ├── IFraxlendPair.sol │ │ │ └── IFraxlendPairHelper.sol │ │ ├── Fraxoracle │ │ │ ├── DummyPriceOracle.sol │ │ │ ├── DummyStateRootOracle.sol │ │ │ ├── Fraxoracle.sol │ │ │ ├── FraxoraclePriceSource.sol │ │ │ ├── MerkleProofPriceSource.sol │ │ │ ├── StateProver.sol │ │ │ ├── StateRootOracle.sol │ │ │ ├── interface │ │ │ │ ├── IBlockhashProvider.sol │ │ │ │ ├── IInbox.sol │ │ │ │ ├── IMessageProvider.sol │ │ │ │ ├── IPriceOracle.sol │ │ │ │ ├── IStateRootOracle.sol │ │ │ │ └── ITelepathyRouter.sol │ │ │ ├── library │ │ │ │ ├── MerklePatriciaProofVerifier.sol │ │ │ │ ├── MerkleTreeProver.sol │ │ │ │ ├── RLPReader.sol │ │ │ │ └── StateProofVerifier.sol │ │ │ └── provider │ │ │ │ ├── ArbitrumBlockhashProvider.sol │ │ │ │ ├── ArbitrumBlockhashRelay.sol │ │ │ │ ├── OperatorBlockhashProvider.sol │ │ │ │ ├── TelepathyBlockhashProvider.sol │ │ │ │ └── TelepathyBlockhashRelay.sol │ │ ├── Fraxswap │ │ │ ├── core │ │ │ │ ├── FraxswapERC20.sol │ │ │ │ ├── FraxswapFactory.sol │ │ │ │ ├── FraxswapPair.sol │ │ │ │ ├── GlobalPauseHelper.sol │ │ │ │ ├── interfaces │ │ │ │ │ ├── IERC20V5.sol │ │ │ │ │ ├── IFraxswapFactory.sol │ │ │ │ │ ├── IFraxswapPair.sol │ │ │ │ │ ├── IUniswapV2CalleeV5.sol │ │ │ │ │ ├── IUniswapV2ERC20V5.sol │ │ │ │ │ ├── IUniswapV2FactoryV5.sol │ │ │ │ │ ├── IUniswapV2PairPartialV5.sol │ │ │ │ │ └── IUniswapV2PairV5.sol │ │ │ │ ├── libraries │ │ │ │ │ ├── Math.sol │ │ │ │ │ ├── SafeMath.sol │ │ │ │ │ └── UQ112x112.sol │ │ │ │ └── test │ │ │ │ │ ├── ComputeUniswapV2PairInitHash.sol │ │ │ │ │ └── ERC20CoreTest.sol │ │ │ ├── interfaces │ │ │ │ └── ILiquidityModifier.sol │ │ │ ├── libraries │ │ │ │ ├── AddressStringUtil.sol │ │ │ │ ├── Babylonian.sol │ │ │ │ ├── BitMath.sol │ │ │ │ ├── FixedPoint.sol │ │ │ │ ├── FullMath.sol │ │ │ │ ├── SafeERC20Namer.sol │ │ │ │ └── TransferHelper.sol │ │ │ ├── periphery │ │ │ │ ├── FraxswapRouter.sol │ │ │ │ ├── FraxswapRouterMultihop.sol │ │ │ │ ├── examples │ │ │ │ │ ├── ExampleComputeLiquidityValue.sol │ │ │ │ │ ├── ExampleFlashSwap.sol │ │ │ │ │ ├── ExampleOracleSimple.sol │ │ │ │ │ ├── ExampleSlidingWindowOracle.sol │ │ │ │ │ └── ExampleSwapToPrice.sol │ │ │ │ ├── interfaces │ │ │ │ │ ├── IERC20.sol │ │ │ │ │ ├── IFraxswapRouterMultihop.sol │ │ │ │ │ ├── IUniswapV2MigratorV5.sol │ │ │ │ │ ├── IUniswapV2Router01V5.sol │ │ │ │ │ ├── IUniswapV2Router02V5.sol │ │ │ │ │ ├── IWETH.sol │ │ │ │ │ └── V1 │ │ │ │ │ │ ├── IUniswapV1Exchange.sol │ │ │ │ │ │ └── IUniswapV1Factory.sol │ │ │ │ ├── libraries │ │ │ │ │ ├── FraxswapRouterLibrary.sol │ │ │ │ │ ├── SafeMath.sol │ │ │ │ │ ├── UniswapV2LiquidityMathLibrary.sol │ │ │ │ │ ├── UniswapV2LiquidityMathLibraryMini.sol │ │ │ │ │ └── UniswapV2OracleLibrary.sol │ │ │ │ └── test │ │ │ │ │ ├── DeflatingERC20.sol │ │ │ │ │ ├── ERC20PeriTest.sol │ │ │ │ │ ├── RouterEventEmitter.sol │ │ │ │ │ └── WETH9.sol │ │ │ └── twamm │ │ │ │ └── LongTermOrders.sol │ │ ├── Governance │ │ │ ├── AccessControl.sol │ │ │ ├── Governance.sol │ │ │ ├── SigRelayer2.sol │ │ │ └── Timelock.sol │ │ ├── LeveragePool │ │ │ ├── IERC20.sol │ │ │ ├── LeveragePool.sol │ │ │ └── TestERC20.sol │ │ ├── Math │ │ │ ├── AddressStringUtil.sol │ │ │ ├── Babylonian.sol │ │ │ ├── BitMath.sol │ │ │ ├── BokkyPooBahsDateTimeContract.sol │ │ │ ├── BokkyPooBahsDateTimeLibrary.sol │ │ │ ├── FixedPoint.sol │ │ │ ├── FullMath.sol │ │ │ ├── HomoraMath.sol │ │ │ ├── MagnitudesAndPowers.sol │ │ │ ├── Math.sol │ │ │ ├── MathV2.sol │ │ │ ├── SafeDecimalMath.sol │ │ │ ├── SafeERC20Namer.sol │ │ │ ├── SafeMath.sol │ │ │ ├── SafeMathV2.sol │ │ │ ├── SignedSafeMath.sol │ │ │ └── UQ112x112.sol │ │ ├── Misc_AMOs │ │ │ ├── Convex_AMO_V2.sol │ │ │ ├── FXS1559_AMO_V3.sol │ │ │ ├── IAMO.sol │ │ │ ├── IConvexAMO_Old.sol │ │ │ ├── ICrossChainAMO.sol │ │ │ ├── Lending_AMOs │ │ │ │ ├── AaveAMO.sol │ │ │ │ ├── AaveAMO_V2.sol │ │ │ │ ├── FraxLendAMO.sol │ │ │ │ ├── KashiAMO.sol │ │ │ │ ├── RariFuseLendingAMO_V2.sol │ │ │ │ ├── RariFuseLendingAMO_V3.sol │ │ │ │ ├── TruefiAMO 2.sol │ │ │ │ ├── TruefiAMO.sol │ │ │ │ ├── aave │ │ │ │ │ ├── IAAVELendingPool_Partial.sol │ │ │ │ │ ├── IAAVE_aFRAX.sol │ │ │ │ │ ├── IAAVE_aUSDC_Partial.sol │ │ │ │ │ ├── IAToken.sol │ │ │ │ │ ├── IAaveIncentivesControllerPartial.sol │ │ │ │ │ ├── ILendingPool.sol │ │ │ │ │ ├── ILendingPoolAddressesProvider.sol │ │ │ │ │ ├── IProtocolDataProvider.sol │ │ │ │ │ ├── IScaledBalanceToken.sol │ │ │ │ │ └── IStakedAave.sol │ │ │ │ ├── frax-lend │ │ │ │ │ ├── IFraxLendPairDeployer_Partial.sol │ │ │ │ │ └── IFraxLendPair_Partial.sol │ │ │ │ ├── kashi │ │ │ │ │ ├── IBentoBoxV1.sol │ │ │ │ │ ├── IKashiPairMediumRiskV1.sol │ │ │ │ │ └── IOracle.sol │ │ │ │ ├── rari │ │ │ │ │ ├── ICErc20Delegator.sol │ │ │ │ │ └── IRariComptroller.sol │ │ │ │ └── truefi │ │ │ │ │ ├── IManagedPortfolio.sol │ │ │ │ │ ├── IManagedPortfolioFactory.sol │ │ │ │ │ ├── IPoolFactory.sol │ │ │ │ │ ├── IStkTruToken.sol │ │ │ │ │ ├── ITrueFiPool2.sol │ │ │ │ │ └── ITrueMultiFarm.sol │ │ │ ├── MSIGHelper.sol │ │ │ ├── ManualTokenTrackerAMO.sol │ │ │ ├── TWAMM_AMO.sol │ │ │ ├── TokenTrackerV2.sol │ │ │ ├── UniV3LiquidityAMO_V2.sol │ │ │ ├── __CROSSCHAIN │ │ │ │ └── Arbitrum │ │ │ │ │ ├── CurveAMO_ARBI.sol │ │ │ │ │ └── SushiSwapLiquidityAMO_ARBI.sol │ │ │ ├── alphadex │ │ │ │ ├── IBBROARMasterchef.sol │ │ │ │ └── IROARMasterchef.sol │ │ │ ├── apeswap │ │ │ │ ├── IApePair.sol │ │ │ │ ├── IApeRouter.sol │ │ │ │ └── IMasterApe.sol │ │ │ ├── axial │ │ │ │ ├── IAxialToken.sol │ │ │ │ ├── IMasterChefAxialV3.sol │ │ │ │ └── ISwapFlashLoan.sol │ │ │ ├── balancer │ │ │ │ ├── IAuraDeposit.sol │ │ │ │ ├── IAuraDepositVault.sol │ │ │ │ ├── IBalancerChildLiquidityGauge.sol │ │ │ │ ├── IBalancerGauge.sol │ │ │ │ ├── IBalancerMinter.sol │ │ │ │ ├── IBalancerVault.sol │ │ │ │ ├── IComposableStablePool.sol │ │ │ │ ├── IL2BalancerPseudoMinter.sol │ │ │ │ └── IStablePool.sol │ │ │ ├── bunni │ │ │ │ ├── IBalancerOracle.sol │ │ │ │ ├── IBunniGauge.sol │ │ │ │ ├── IBunniLens.sol │ │ │ │ ├── IBunniMinter.sol │ │ │ │ ├── IBunniTokenLP.sol │ │ │ │ └── IOptionsToken.sol │ │ │ ├── compound │ │ │ │ ├── IComptroller.sol │ │ │ │ └── IcUSDC_Partial.sol │ │ │ ├── convex │ │ │ │ ├── IConvexBaseRewardPool.sol │ │ │ │ ├── IConvexBooster.sol │ │ │ │ ├── IConvexClaimZap.sol │ │ │ │ ├── IConvexCvxLPRewardPoolCombo.sol │ │ │ │ ├── IConvexStakingWrapperFrax.sol │ │ │ │ ├── IConvexStakingWrapperFraxWithEarned.sol │ │ │ │ ├── ICvxLocker.sol │ │ │ │ ├── ICvxLockerV2.sol │ │ │ │ ├── IDepositToken.sol │ │ │ │ ├── IStakingProxyConvex.sol │ │ │ │ ├── IVirtualBalanceRewardPool.sol │ │ │ │ └── IcvxRewardPool.sol │ │ │ ├── curve │ │ │ │ ├── I2PoolcvxCRVCRV.sol │ │ │ │ ├── I2pool.sol │ │ │ │ ├── I2poolGaugeDeposit.sol │ │ │ │ ├── I2poolToken.sol │ │ │ │ ├── I2poolTokenNoLending.sol │ │ │ │ ├── I3pool.sol │ │ │ │ ├── I3poolAndToken.sol │ │ │ │ ├── I3poolGaugeDeposit.sol │ │ │ │ ├── I3poolToken.sol │ │ │ │ ├── ICurveChildLiquidityGauge.sol │ │ │ │ ├── ICurveStableSwapMetaNG.sol │ │ │ │ ├── ICurveStableSwapNG.sol │ │ │ │ ├── ICurveTricryptoOptimizedWETH.sol │ │ │ │ ├── ICurveTwocryptoOptimized.sol │ │ │ │ ├── IFRAX2pool.sol │ │ │ │ ├── IFRAX3pool.sol │ │ │ │ ├── IZapDepositor2pool.sol │ │ │ │ └── IZapDepositor3pool.sol │ │ │ ├── echidna │ │ │ │ └── IMasterPlatypusV3.sol │ │ │ ├── gelato │ │ │ │ └── IGUniPool.sol │ │ │ ├── hundred │ │ │ │ └── ICErc20DelegatorOld.sol │ │ │ ├── kyberswap │ │ │ │ ├── KyberTickMath.sol │ │ │ │ ├── elastic │ │ │ │ │ ├── IKSElasticLMV2.sol │ │ │ │ │ ├── IKSReinvestmentTokenPool.sol │ │ │ │ │ └── IKyberSwapFarmingToken.sol │ │ │ │ ├── factory │ │ │ │ │ └── IKyberFactory.sol │ │ │ │ ├── pool │ │ │ │ │ ├── IKyberPool.sol │ │ │ │ │ ├── IPoolActions.sol │ │ │ │ │ ├── IPoolEvents.sol │ │ │ │ │ └── IPoolStorage.sol │ │ │ │ ├── position_manager │ │ │ │ │ ├── IAntiSnipAttackPositionManager.sol │ │ │ │ │ ├── ITickFeesReader.sol │ │ │ │ │ ├── KyberFullMath.sol │ │ │ │ │ ├── KyberLiquidityMath.sol │ │ │ │ │ ├── KyberMathConstants.sol │ │ │ │ │ └── KyberSafeCast.sol │ │ │ │ └── router │ │ │ │ │ ├── IRouter.sol │ │ │ │ │ └── ISwapCallback.sol │ │ │ ├── kyberswap_v2 │ │ │ │ ├── IFactory.sol │ │ │ │ ├── IPool.sol │ │ │ │ ├── ITickFeesReader.sol │ │ │ │ ├── IWETHV2.sol │ │ │ │ ├── TickMath.sol │ │ │ │ ├── callback │ │ │ │ │ ├── IFlashCallback.sol │ │ │ │ │ ├── IMintCallback.sol │ │ │ │ │ └── ISwapCallback.sol │ │ │ │ ├── libraries │ │ │ │ │ ├── BaseSplitCodeFactory.sol │ │ │ │ │ ├── CodeDeployer.sol │ │ │ │ │ ├── FullMath.sol │ │ │ │ │ ├── Linkedlist.sol │ │ │ │ │ ├── LiqDeltaMath.sol │ │ │ │ │ ├── LiquidityMath.sol │ │ │ │ │ ├── MathConstants.sol │ │ │ │ │ ├── Oracle.sol │ │ │ │ │ ├── QtyDeltaMath.sol │ │ │ │ │ ├── QuadMath.sol │ │ │ │ │ ├── ReinvestmentMath.sol │ │ │ │ │ ├── SafeCast.sol │ │ │ │ │ ├── SwapMath.sol │ │ │ │ │ └── TickMath.sol │ │ │ │ ├── oracle │ │ │ │ │ └── IPoolOracle.sol │ │ │ │ ├── periphery │ │ │ │ │ ├── IBasePositionManager.sol │ │ │ │ │ ├── IERC721Permit.sol │ │ │ │ │ ├── IMulticall.sol │ │ │ │ │ ├── INonfungibleTokenPositionDescriptor.sol │ │ │ │ │ ├── IQuoterV2.sol │ │ │ │ │ ├── IRouter.sol │ │ │ │ │ ├── IRouterTokenHelper.sol │ │ │ │ │ ├── IRouterTokenHelperWithFee.sol │ │ │ │ │ └── base_position_manager │ │ │ │ │ │ └── IBasePositionManagerEvents.sol │ │ │ │ └── pool │ │ │ │ │ ├── IPoolActions.sol │ │ │ │ │ ├── IPoolEvents.sol │ │ │ │ │ └── IPoolStorage.sol │ │ │ ├── morpho │ │ │ │ └── IMetaMorpho.sol │ │ │ ├── mstable │ │ │ │ └── IFeederPool.sol │ │ │ ├── optimism │ │ │ │ ├── IL1StandardBridge.sol │ │ │ │ └── IL2StandardBridge.sol │ │ │ ├── platypus │ │ │ │ ├── IAsset.sol │ │ │ │ ├── IMasterPlatypusV4.sol │ │ │ │ └── IVoter.sol │ │ │ ├── polygon │ │ │ │ └── IRootChainManager.sol │ │ │ ├── saddle │ │ │ │ ├── IChildLiquidityGauge.sol │ │ │ │ ├── IChildLiquidityGaugeFactory.sol │ │ │ │ ├── IGaugeMinter.sol │ │ │ │ ├── IPoolRegistry.sol │ │ │ │ ├── IRootGauge.sol │ │ │ │ ├── ISaddleD4_LP.sol │ │ │ │ ├── ISaddleLPToken.sol │ │ │ │ ├── ISaddleMiniChefV2.sol │ │ │ │ └── ISaddlePermissionlessSwap.sol │ │ │ ├── sentiment │ │ │ │ ├── ILToken.sol │ │ │ │ └── ILinearRateModel.sol │ │ │ ├── snowball │ │ │ │ ├── ILPToken.sol │ │ │ │ └── ISwapFlashLoan.sol │ │ │ ├── stakedao │ │ │ │ ├── ICurveVault.sol │ │ │ │ ├── IOpynPerpVault.sol │ │ │ │ ├── IStakeDAOController.sol │ │ │ │ ├── IStakeDAOGauge.sol │ │ │ │ └── IStakeDaoVault.sol │ │ │ ├── stargate │ │ │ │ └── ILPStaking.sol │ │ │ ├── stellaswap │ │ │ │ ├── IStellaDistributorV2.sol │ │ │ │ └── IStellaSwapFlashLoan.sol │ │ │ ├── temple │ │ │ │ └── ITempleFraxAMMOps.sol │ │ │ ├── testing │ │ │ │ └── OwnerTesting.sol │ │ │ ├── thena │ │ │ │ └── IThenaGaugeV2.sol │ │ │ ├── tokemak │ │ │ │ └── ItAsset.sol │ │ │ └── vesper │ │ │ │ ├── IPoolRewards.sol │ │ │ │ └── IVPool.sol │ │ ├── Openzeppelin_Manual │ │ │ ├── Context.sol │ │ │ └── Pausable.sol │ │ ├── Oracle │ │ │ ├── AggregatorV3Interface.sol │ │ │ ├── CPITrackerOracle.sol │ │ │ ├── ChainlinkETHUSDPriceConsumer.sol │ │ │ ├── ChainlinkETHUSDPriceConsumerTest.sol │ │ │ ├── ChainlinkFXSUSDPriceConsumer.sol │ │ │ ├── ComboOracle.sol │ │ │ ├── ComboOracle_KyberSwapElastic.sol │ │ │ ├── ComboOracle_KyberSwapElasticV2.sol │ │ │ ├── ComboOracle_UniV2_UniV3.sol │ │ │ ├── CrossChainOracle.sol │ │ │ ├── CrossChainOracleSingleAsset.sol │ │ │ ├── CrossChainOracleSingleAssetV2.sol │ │ │ ├── FRAXOracleWrapper.sol │ │ │ ├── FXSOracleWrapper.sol │ │ │ ├── ICPITrackerOracle.sol │ │ │ ├── ICrossChainOracle.sol │ │ │ ├── IPricePerShareOptions.sol │ │ │ ├── PIDController.sol │ │ │ ├── ReserveTracker.sol │ │ │ ├── UniV3TWAPOracle.sol │ │ │ ├── UniswapPairOracle.sol │ │ │ ├── UniswapPairOracleExtra.sol │ │ │ └── Variants │ │ │ │ ├── UniswapPairOracleExtra_SDT_WETH.sol │ │ │ │ ├── UniswapPairOracle_6DEC_WETH.sol │ │ │ │ ├── UniswapPairOracle_FRAX_6DEC.sol │ │ │ │ ├── UniswapPairOracle_FRAX_FXS.sol │ │ │ │ ├── UniswapPairOracle_FRAX_USDC.sol │ │ │ │ ├── UniswapPairOracle_FRAX_USDT.sol │ │ │ │ ├── UniswapPairOracle_FRAX_WETH.sol │ │ │ │ ├── UniswapPairOracle_FXS_6DEC.sol │ │ │ │ ├── UniswapPairOracle_FXS_USDC.sol │ │ │ │ ├── UniswapPairOracle_FXS_USDT.sol │ │ │ │ ├── UniswapPairOracle_FXS_WETH.sol │ │ │ │ ├── UniswapPairOracle_USDC_WETH.sol │ │ │ │ └── UniswapPairOracle_USDT_WETH.sol │ │ ├── Proxy │ │ │ ├── AdminUpgradeabilityProxy.sol │ │ │ ├── ERC1967Proxy.sol │ │ │ ├── ERC1967Storage.sol │ │ │ ├── ERC1967Upgrade.sol │ │ │ ├── IBeacon.sol │ │ │ ├── Initializable.sol │ │ │ └── Proxy.sol │ │ ├── Staking │ │ │ ├── CommunalFarm.sol │ │ │ ├── FLETwammGauge.sol │ │ │ ├── FRAX3CRV_Curve_FXS_Distributor.sol │ │ │ ├── FXSRewards.sol │ │ │ ├── FraxCrossChainFarm.sol │ │ │ ├── FraxCrossChainFarmV2.sol │ │ │ ├── FraxCrossChainFarmV3_ERC20.sol │ │ │ ├── FraxCrossChainFarmV3_Pos_Rebase.sol │ │ │ ├── FraxCrossChainFarmV4_ERC20.sol │ │ │ ├── FraxFarmRageQuitter_Gelato_FRAX_DAI.sol │ │ │ ├── FraxFarmRageQuitter_Saddle_L2D4.sol │ │ │ ├── FraxFarmRageQuitter_StakeDAO_FraxPut.sol │ │ │ ├── FraxFarmRageQuitter_Temple.sol │ │ │ ├── FraxFarmRageQuitter_VSTFRAX.sol │ │ │ ├── FraxFarmRageQuitter_mStable.sol │ │ │ ├── FraxUniV3Farm_Stable.sol │ │ │ ├── FraxUnifiedFarmTemplate.sol │ │ │ ├── FraxUnifiedFarmTemplate.sol.old │ │ │ ├── FraxUnifiedFarm_ERC20.sol │ │ │ ├── IFraxCrossChainFarmV3_ERC20_Mod7.sol │ │ │ ├── IFraxFarm.sol │ │ │ ├── IFraxUnifiedFarm_ERC20_V105.sol │ │ │ ├── ILockReceiver.sol │ │ │ ├── IStakingRewards.sol │ │ │ ├── IStakingRewardsDual.sol │ │ │ ├── IStakingRewardsDualForMigrator.sol │ │ │ ├── IStakingRewardsDualV3.sol │ │ │ ├── IveFPISYieldDistributor.sol │ │ │ ├── IveFXSYieldDistributor.sol │ │ │ ├── MicroVeFXSStaker.sol │ │ │ ├── Owned.sol │ │ │ ├── OwnedV2.sol │ │ │ ├── Owned_Proxy.sol │ │ │ ├── Pausable.sol │ │ │ ├── RewardsDistributionRecipient.sol │ │ │ ├── StakingRewardsDualV5.sol │ │ │ ├── StakingRewardsMultiGauge.sol │ │ │ ├── UniLPToSushiLPMigrator.sol.old │ │ │ ├── Variants │ │ │ │ ├── CommunalFarm_SaddleD4.sol │ │ │ │ ├── FraxCCFarmV2_ArbiCurveVSTFRAX.sol │ │ │ │ ├── FraxCCFarmV2_SaddleArbUSDv2.sol │ │ │ │ ├── FraxCCFarmV3_ArbiSaddleL2D4.sol │ │ │ │ ├── FraxCCFarmV4_cvxLP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_FRAXBP_Stable.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_FRAXBP_Stable_Factory.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_FRAXBP_Volatile.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_Generic.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_frxETH.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxlend.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_FraxswapV2.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_KyberERC20Mainnet.sol.off │ │ │ │ ├── FraxUnifiedFarm_ERC20_KyberSwapElasticV2.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Other.sol │ │ │ │ └── FraxUnifiedFarm_ERC20_Other_Oracled.sol.off │ │ │ ├── veFPISYieldDistributorV4.sol │ │ │ ├── veFPISYieldDistributorV5.sol │ │ │ └── veFXSYieldDistributorV4.sol │ │ ├── Uniswap │ │ │ ├── Interfaces │ │ │ │ ├── IUniswapV2Callee.sol │ │ │ │ ├── IUniswapV2ERC20.sol │ │ │ │ ├── IUniswapV2Factory.sol │ │ │ │ ├── IUniswapV2Pair.sol │ │ │ │ ├── IUniswapV2Router01.sol │ │ │ │ └── IUniswapV2Router02.sol │ │ │ ├── SwapToPrice.sol │ │ │ ├── TransferHelper.sol │ │ │ ├── TransferHelperV2.sol │ │ │ ├── UniswapV2Library.sol │ │ │ └── UniswapV2OracleLibrary.sol │ │ ├── Uniswap_V3 │ │ │ ├── ISwapRouter.sol │ │ │ ├── IUniswapV3Factory.sol │ │ │ ├── IUniswapV3Pool.sol │ │ │ ├── IUniswapV3PoolDeployer.sol │ │ │ ├── IUniswapV3PositionsNFT.sol │ │ │ ├── deployment_addresses.txt │ │ │ ├── libraries │ │ │ │ ├── FixedPoint96.sol │ │ │ │ ├── FullMath.sol │ │ │ │ ├── LiquidityAmounts.sol │ │ │ │ ├── Testing.sol │ │ │ │ └── TickMath.sol │ │ │ ├── periphery │ │ │ │ ├── interfaces │ │ │ │ │ ├── IERC721Permit.sol │ │ │ │ │ ├── INonfungiblePositionManager.sol │ │ │ │ │ ├── IPeripheryImmutableState.sol │ │ │ │ │ ├── IPeripheryPayments.sol │ │ │ │ │ └── IPoolInitializer.sol │ │ │ │ └── libraries │ │ │ │ │ ├── OracleLibrary.sol │ │ │ │ │ └── PoolAddress.sol │ │ │ └── pool │ │ │ │ ├── IUniswapV3PoolActions.sol │ │ │ │ ├── IUniswapV3PoolDerivedState.sol │ │ │ │ ├── IUniswapV3PoolEvents.sol │ │ │ │ ├── IUniswapV3PoolImmutables.sol │ │ │ │ ├── IUniswapV3PoolOwnerActions.sol │ │ │ │ └── IUniswapV3PoolState.sol │ │ ├── Utils │ │ │ ├── Address.sol │ │ │ ├── Address_8.sol │ │ │ ├── BlockMiner.sol │ │ │ ├── EnumerableSet.sol │ │ │ ├── GasHelper.sol │ │ │ ├── MigrationHelper.sol │ │ │ ├── Migrations.sol │ │ │ ├── Multicall_Oz.sol │ │ │ ├── ReentrancyGuard.sol │ │ │ ├── ReentrancyGuardV2.sol │ │ │ ├── StorageSlot.sol │ │ │ └── StringHelpers.sol │ │ └── mocks │ │ │ ├── MockConvexRegistry.sol │ │ │ └── MockConvexVault.sol │ ├── gnosis-safe-scripts │ │ ├── Bribe_Related │ │ │ ├── BSC │ │ │ │ ├── BSC_Rewards_Collection.json │ │ │ │ └── Reward_Collections.js │ │ │ └── test-abi.json │ │ ├── Convex_Farm_Deployments │ │ │ ├── Script_Constants.js │ │ │ ├── Step_1_Vault_Gauge_Proxy.js │ │ │ ├── Step_1_Vault_Gauge_Proxy.json │ │ │ ├── Step_2_CRVCVXDistro_Contracts.js │ │ │ ├── Step_2_CRVCVXDistro_Contracts.json │ │ │ ├── Step_3_RewDist_Seeding_Sync.js │ │ │ └── Step_3_RewDist_Seeding_Sync.json │ │ ├── Frax_Comptroller_Routine │ │ │ ├── Sunday_Part_1.js │ │ │ └── Sunday_Part_1.json │ │ └── utils │ │ │ └── utils.js │ ├── hardhat.config.js │ ├── old_contracts │ │ ├── BAMM │ │ │ ├── BAMM.sol │ │ │ ├── BAMMHelper.sol │ │ │ ├── Babylonian.sol │ │ │ ├── FixedPoint.sol │ │ │ ├── FraxswapDummyRouter.sol │ │ │ └── FraxswapOracle.sol │ │ ├── Bridges │ │ │ ├── Aurora │ │ │ │ ├── CrossChainBridgeBacker_AUR_Rainbow.sol │ │ │ │ └── FraxLiquidityBridger_AUR_Rainbow.sol │ │ │ ├── Avalanche │ │ │ │ ├── CrossChainBridgeBacker_AVAX_AnySwap.sol │ │ │ │ ├── FraxLiquidityBridger_AVAX_AnySwap.sol │ │ │ │ └── IBridgeToken.sol │ │ │ ├── BSC │ │ │ │ ├── CrossChainBridgeBacker_BSC_AnySwap.sol │ │ │ │ └── FraxLiquidityBridger_BSC_AnySwap.sol │ │ │ ├── Boba │ │ │ │ ├── CrossChainBridgeBacker_BOBA_BobaGateway.sol │ │ │ │ ├── FraxLiquidityBridger_BOBA_BobaGateway.sol │ │ │ │ ├── IDiscretionaryExitBurn.sol │ │ │ │ └── IL1StandardBridge.sol │ │ │ ├── CrossChainBridgeBackerOLDTEMPLATE.sol.old │ │ │ ├── Evmos │ │ │ │ ├── CrossChainBridgeBacker_EVMOS_Nomad.sol │ │ │ │ └── FraxLiquidityBridger_EVMOS_Nomad.sol │ │ │ ├── Fantom │ │ │ │ ├── CrossChainBridgeBacker_FTM_AnySwap.sol │ │ │ │ └── FraxLiquidityBridger_FTM_AnySwap.sol │ │ │ ├── Fraxchain │ │ │ │ ├── FraxchainFrxEthMinter.sol │ │ │ │ └── FraxchainPortal.sol │ │ │ ├── Harmony │ │ │ │ ├── CrossChainBridgeBacker_HARM_Celer.sol │ │ │ │ ├── CrossChainBridgeBacker_HARM_Horizon.sol │ │ │ │ ├── FraxLiquidityBridger_HARM_Celer.sol │ │ │ │ └── FraxLiquidityBridger_HARM_Horizon.sol │ │ │ ├── Moonbeam │ │ │ │ ├── CrossChainBridgeBacker_MNBM_Nomad.sol │ │ │ │ └── FraxLiquidityBridger_MNBM_Nomad.sol │ │ │ ├── Moonriver │ │ │ │ ├── CrossChainBridgeBacker_MOON_AnySwap.sol │ │ │ │ └── FraxLiquidityBridger_MOON_AnySwap.sol │ │ │ ├── Optimism │ │ │ │ ├── CrossChainBridgeBacker_OPTI_Celer.sol │ │ │ │ ├── FraxLiquidityBridger_OPTI_Celer.sol │ │ │ │ └── NOTES.txt │ │ │ ├── Polygon │ │ │ │ ├── CrossChainBridgeBacker_POLY_MaticBridge.sol │ │ │ │ └── FraxLiquidityBridger_POLY_MaticBridge.sol │ │ │ └── Solana │ │ │ │ └── FraxLiquidityBridger_SOL_WormholeV2.sol │ │ ├── Curve │ │ │ ├── CurveAMO.sol │ │ │ ├── CurveAMO_V2.sol │ │ │ ├── CurveAMO_V3.sol │ │ │ ├── DelegationProxy.vy │ │ │ ├── Factory.vy │ │ │ ├── FraxGaugeController.vy │ │ │ ├── GaugeController.vy │ │ │ ├── LiquidityGauge.vy │ │ │ ├── LiquidityGaugeV2.vy │ │ │ ├── MetaImplementationUSD.vy │ │ │ ├── Minter.vy │ │ │ ├── StableSwap3Pool.vy │ │ │ ├── VotingEscrowDelegation.vy │ │ │ ├── veFXS.vy │ │ │ ├── veFXS_Old2.vy.old │ │ │ └── veFXS_old.vy.old │ │ ├── ERC20 │ │ │ └── Variants │ │ │ │ ├── CRV_DAO_ERC20_Mock.sol │ │ │ │ ├── FRAX3CRV_Mock.sol │ │ │ │ ├── IDLEToken.sol │ │ │ │ ├── OHM.sol │ │ │ │ ├── RookToken.sol │ │ │ │ └── SushiToken.sol │ │ ├── FPI │ │ │ ├── FPIStaking.sol │ │ │ ├── FPIStaking2.sol │ │ │ ├── PermissionedSend.sol │ │ │ ├── StakedFPI.sol │ │ │ ├── TWAMM.sol │ │ │ └── TWAMMSwap.sol │ │ ├── FXB │ │ │ ├── Curves │ │ │ │ ├── FraxBond_Curves_RC_Discharge.sol │ │ │ │ └── IFraxBond_Curve.sol │ │ │ ├── ERC-1155 │ │ │ │ └── FXB.sol │ │ │ ├── FXB.sol │ │ │ ├── FraxBondIssuer.sol │ │ │ ├── FraxBondIssuerOld.sol │ │ │ ├── FraxBondIssuerWithDeposits.sol │ │ │ ├── NFT │ │ │ │ ├── FraxBond_NFT.sol │ │ │ │ ├── FraxBond_NFT_Library.sol │ │ │ │ └── Variants │ │ │ │ │ └── FXBA10000M3.sol │ │ │ └── Snippets.txt │ │ ├── FakeCollateral │ │ │ ├── FakeCollateral.sol │ │ │ ├── FakeCollateral_6DEC.sol │ │ │ ├── FakeCollateral_DAI.sol │ │ │ ├── FakeCollateral_USDC.sol │ │ │ ├── FakeCollateral_USDT.sol │ │ │ ├── FakeCollateral_WETH.sol │ │ │ └── note.txt │ │ ├── Fraxswap_OLD │ │ │ ├── DummyToken.sol │ │ │ ├── FraxswapRangeFactory.sol │ │ │ ├── FraxswapRangePair.sol │ │ │ └── interfaces │ │ │ │ └── IFraxswapRangePair.sol │ │ ├── Governance │ │ │ ├── Delegate.sol │ │ │ ├── GovernorBravoDelegate.sol │ │ │ └── GovernorBravoInterfaces.sol │ │ ├── Misc_AMOs │ │ │ ├── CurveAMO_V3.sol │ │ │ ├── CurveAMO_V4.sol │ │ │ ├── CurveMetapoolLockerAMO.sol │ │ │ ├── FXS1559_AMO.sol │ │ │ ├── FraxCrossChainLiquidityTracker.sol │ │ │ ├── FraxLendingAMO_V2.sol │ │ │ ├── FraxPoolInvestor.sol │ │ │ ├── FraxPoolInvestorForV2.sol │ │ │ ├── InvestorAMOProxy.sol │ │ │ ├── InvestorAMO_V2_non_proxy.sol │ │ │ ├── InvestorAMO_V3.sol │ │ │ ├── MIM_Convex_AMO.sol │ │ │ ├── OHM_AMO.sol │ │ │ ├── OHM_AMO_V3.sol │ │ │ ├── StakeDAO_AMO_V2.sol │ │ │ ├── TokenTrackerAMO.sol │ │ │ ├── UniV3LiquidityAMO.sol │ │ │ ├── UniV3LiquidityAMO_V2_old.sol │ │ │ ├── __CROSSCHAIN │ │ │ │ ├── Arbitrum │ │ │ │ │ └── HundredLendingAMO_ARBI.sol │ │ │ │ ├── Avalanche │ │ │ │ │ ├── AxialAMO.sol │ │ │ │ │ └── PangolinLiquidityAMO.sol │ │ │ │ ├── BSC │ │ │ │ │ ├── ApeSwapLiquidityAMO.sol │ │ │ │ │ └── ApeSwapLiquidityAMO_V2.sol │ │ │ │ ├── Boba │ │ │ │ │ └── OolongSwapLiquidityAMO.sol │ │ │ │ ├── Fantom │ │ │ │ │ ├── CurveAMO_FTM.sol │ │ │ │ │ ├── ScreamAMO.sol │ │ │ │ │ ├── SpiritOlaLendingAMO.sol │ │ │ │ │ └── SpiritSwapLiquidityAMO.sol │ │ │ │ ├── Harmony │ │ │ │ │ └── SushiSwapLiquidityAMO_HARM.sol │ │ │ │ ├── Moonriver copy │ │ │ │ │ └── SushiSwapLiquidityAMO_MOON.sol │ │ │ │ ├── Moonriver │ │ │ │ │ └── CCFrax1to1AMM.sol │ │ │ │ └── Polygon │ │ │ │ │ ├── CurveAMO_POLY.sol │ │ │ │ │ ├── MarketXYZLendingAMO.sol │ │ │ │ │ └── SushiSwapLiquidityAMO_POLY.sol │ │ │ ├── aurora │ │ │ │ ├── IERC20Locker.sol │ │ │ │ └── IEvmErc20V2.sol │ │ │ ├── celer │ │ │ │ ├── IBridge.sol │ │ │ │ ├── IOriginalTokenVault.sol │ │ │ │ └── IPeggedTokenBridge.sol │ │ │ ├── harmony │ │ │ │ ├── IDeposit.sol │ │ │ │ ├── IERC20EthManager.sol │ │ │ │ └── IERC20HmyManager.sol │ │ │ ├── hundred │ │ │ │ └── IHundred.sol │ │ │ ├── keeper │ │ │ │ ├── IKEEPERLiquidityPool_V2.sol │ │ │ │ ├── IKToken.sol │ │ │ │ └── IkUSDC_Partial.sol │ │ │ ├── moonbeam │ │ │ │ └── IBridgeRouter.sol │ │ │ ├── morganle │ │ │ │ └── ITC.sol │ │ │ ├── olympus │ │ │ │ ├── IOlympusBondDepository.sol │ │ │ │ ├── IOlympusERC20Token.sol │ │ │ │ ├── IOlympusStaking.sol │ │ │ │ ├── IOlympusTreasury.sol │ │ │ │ ├── IStakingHelper.sol │ │ │ │ └── IsOlympus.sol │ │ │ ├── oolongswap │ │ │ │ ├── IOolongSwapPair.sol │ │ │ │ └── IOolongSwapRouter02.sol │ │ │ ├── pangolin │ │ │ │ ├── IPangolinPair.sol │ │ │ │ └── IPangolinRouter.sol │ │ │ ├── scream │ │ │ │ ├── CErc20Delegator.sol │ │ │ │ ├── ISCREAM.sol │ │ │ │ ├── IScreamComptroller.sol │ │ │ │ ├── IscToken.sol │ │ │ │ └── IxSCREAM.sol │ │ │ ├── solana │ │ │ │ ├── IBridgeImplementation.sol │ │ │ │ └── IWormhole.sol │ │ │ ├── solidly │ │ │ │ ├── IBaseV1Pair.sol │ │ │ │ └── IDepositToken.sol │ │ │ ├── spiritswap │ │ │ │ ├── IPancakePair.sol │ │ │ │ ├── IRainMaker.sol │ │ │ │ ├── ISpirit.sol │ │ │ │ ├── ISpiritRouter.sol │ │ │ │ └── IZap.sol │ │ │ ├── yearn │ │ │ │ ├── IYearnVault.sol │ │ │ │ ├── IyFRAX3CRV_Partial.sol │ │ │ │ └── IyUSDC_V2_Partial.sol │ │ │ └── zenlink │ │ │ │ ├── IZenlinkPair.sol │ │ │ │ └── IZenlinkRouter.sol │ │ ├── Oracle │ │ │ ├── ComboOracle_UniV2_UniV3_Zenlink.sol │ │ │ ├── ComboOracle_V1.sol │ │ │ └── SolidlySingleLPOracle.sol │ │ ├── Staking │ │ │ ├── FraxCrossChainFarmOLD.sol.old │ │ │ ├── FraxCrossChainFarmSushi.sol │ │ │ ├── FraxUniV3Farm_V2.sol │ │ │ ├── FraxUniV3Farm_Volatile.sol │ │ │ ├── FraxUnifiedFarmTemplateClone.sol │ │ │ ├── FraxUnifiedFarmTemplate_V2.sol │ │ │ ├── FraxUnifiedFarm_ERC20_V2.sol │ │ │ ├── FraxUnifiedFarm_ERC20_V2_BEFORE_MANUAL_MERGE.sol.old │ │ │ ├── FraxUnifiedFarm_KyberSwapElastic.sol │ │ │ ├── FraxUnifiedFarm_PosRebase.sol │ │ │ ├── FraxUnifiedFarm_UniV3.sol │ │ │ ├── StakingRewards.sol │ │ │ ├── StakingRewardsDual.sol │ │ │ ├── StakingRewardsDualV2.sol │ │ │ ├── StakingRewardsDualV3.sol │ │ │ ├── StakingRewardsDualV4.sol │ │ │ ├── Variants │ │ │ │ ├── FraxCrossChainFarm_FRAX_FXS_Impossible.sol │ │ │ │ ├── FraxCrossChainFarm_FRAX_FXS_Spirit.sol │ │ │ │ ├── FraxCrossChainFarm_FRAX_IF_Impossible.sol │ │ │ │ ├── FraxCrossChainFarm_FRAX_mUSD.sol │ │ │ │ ├── FraxUniV3Farm_Stable_FRAX_DAI.sol │ │ │ │ ├── FraxUniV3Farm_Stable_FRAX_USDC.sol │ │ │ │ ├── FraxUniV3Farm_Stable_FRAX_agEUR.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_frxETH_V2.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxBUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxFPIFRAX.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxGUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxLUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxTUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxUSDDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxalUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxapeUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Convex_stkcvxsUSDFRAXBP.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FPIS.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FXS.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_IQ.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_OHM.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SDL.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SYN.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_ZZ.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Fraxswap_FRAX_pitchFXS.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Gelato_FRAX_DAI.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Temple_FRAX_TEMPLE.sol │ │ │ │ ├── FraxUnifiedFarm_ERC20_Vesper_Orbit_FRAX.sol │ │ │ │ ├── FraxUnifiedFarm_PosRebase_aFRAX.sol │ │ │ │ ├── FraxUnifiedFarm_UniV3_FRAX_RAI.sol │ │ │ │ ├── IOldMigratableFraxFarm.sol │ │ │ │ ├── Stake_FRAX_FXS.sol │ │ │ │ ├── Stake_FRAX_USDC.sol │ │ │ │ ├── Stake_FRAX_WETH.sol │ │ │ │ ├── Stake_FXS_WETH.sol │ │ │ │ ├── StakingRewardsDualV2_FRAX3CRV_V2.sol │ │ │ │ ├── StakingRewardsDualV3_FRAX_IQ.sol │ │ │ │ ├── StakingRewardsDualV4_FRAX_OHM.sol │ │ │ │ ├── StakingRewardsDualV5_FRAX_OHM.sol │ │ │ │ ├── StakingRewardsDual_FRAX3CRV.sol │ │ │ │ ├── StakingRewardsDual_FRAX_FXS_Sushi.sol │ │ │ │ ├── StakingRewardsDual_FXS_WETH_Sushi.sol │ │ │ │ ├── StakingRewardsMultiGauge_FRAX_SUSHI.sol │ │ │ │ ├── StakingRewardsMultiGauge_FXS_WETH.sol │ │ │ │ ├── StakingRewardsMultiGauge_StakeDAO.sol │ │ │ │ └── StakingRewardsMultiGauge_StakeDAO_FRAX_Put.sol │ │ │ ├── veFXSYieldDistributor.sol │ │ │ ├── veFXSYieldDistributorV2.sol │ │ │ └── veFXSYieldDistributorV3.sol │ │ ├── Uniswap_V2_TWAMM │ │ │ └── twamm │ │ │ │ └── OrderPoolPRB.sol │ │ ├── Utils │ │ │ ├── BundleUtils.sol │ │ │ ├── LongTermOrders.sol │ │ │ ├── MigrationBundleUtils.sol │ │ │ └── OrderPool.sol │ │ └── __BSC │ │ │ ├── Access │ │ │ └── Ownable.sol │ │ │ ├── AnyswapV4ERC20 │ │ │ └── AnyswapV4ERC20.sol │ │ │ ├── BEP20 │ │ │ ├── BEP20.sol │ │ │ ├── IBEP20.sol │ │ │ ├── Mocks │ │ │ │ ├── Cake.sol │ │ │ │ ├── FraxMock.sol │ │ │ │ ├── FxsMock.sol │ │ │ │ └── ImpossibleFinance.sol │ │ │ └── SafeBEP20.sol │ │ │ ├── GSN │ │ │ └── Context.sol │ │ │ ├── Impossible │ │ │ ├── IImpossibleERC20.sol │ │ │ └── IImpossiblePair.sol │ │ │ ├── Math │ │ │ ├── Math.sol │ │ │ └── SafeMath.sol │ │ │ ├── PancakeSwap │ │ │ └── IPancakePair.sol │ │ │ ├── Staking │ │ │ ├── FraxFarmBSC_Dual_V5.sol │ │ │ ├── MigratableFarmBSC.sol │ │ │ ├── Owned.sol │ │ │ ├── Pausable.sol │ │ │ └── Variants │ │ │ │ ├── FraxFarmBSC_Dual_FRAX_IF.sol │ │ │ │ ├── FraxFarmBSC_Dual_FXS_IF.sol │ │ │ │ └── MigratableFarmBSC_FRAX_FXS.sol │ │ │ ├── Uniswap │ │ │ └── TransferHelper.sol │ │ │ └── Utils │ │ │ ├── Address.sol │ │ │ └── ReentrancyGuard.sol │ ├── public-scripts │ │ ├── fraxtal_yield_distributor_mass_checkpointer.js │ │ ├── l1veFXS_proof_collector.js │ │ └── veFPIS_mass_checkpointer.js │ └── test │ │ ├── BAMM │ │ ├── BAMM-Fuzz.js │ │ ├── BAMM.js │ │ ├── BAMMHelper.js │ │ └── FraxswapOracle.js │ │ ├── CPITrackerOracle-Tests.js │ │ ├── ComboOracle_SLP_UniV2_UniV3-Tests.js │ │ ├── CrossChainCanonical-Tests.js │ │ ├── FPI-FPIS-Tests.js │ │ ├── FPIControllerPool-Tests.js │ │ ├── FraxFarmRageQuitter-Tests.js │ │ ├── FraxGaugeController-Tests.js │ │ ├── FraxGaugeFXSRewardsDistributor-Tests.js │ │ ├── FraxLiquidityBridger-Tests.js │ │ ├── FraxMiddlemanGauge-Tests.js │ │ ├── FraxUnifiedFarm_ERC20-Tests.js │ │ ├── FraxUnifiedFarm_KyberSwapElastic-Tests.js │ │ ├── FraxUnifiedFarm_PosRebase-Tests.js │ │ ├── FraxUnifiedFarm_UniV3-Tests.js │ │ ├── Fraxbonds │ │ └── SlippageAuction.js │ │ ├── Fraxferry │ │ └── Fraxferry-test.js │ │ ├── FraxferryV2 │ │ └── FerryV2-test.js │ │ ├── Fraxoracle │ │ ├── Fraxoracle-test.js │ │ ├── StateProver-test.js │ │ └── StateRootOracle.js │ │ ├── Fraxswap-FraxswapRange-test.js │ │ ├── Fraxswap-UniswapV2-test.js │ │ ├── Fraxswap │ │ ├── brick-pause-test.js │ │ ├── fraxswap-router-test.js │ │ ├── fraxswap-router │ │ │ ├── 1inch-saved-routes │ │ │ │ └── 1inchOutput.json │ │ │ ├── ethereumOutputCurve.js │ │ │ ├── ethereumOutputFraxswap.js │ │ │ ├── ethereumOutputFraxswapV2.js │ │ │ ├── ethereumOutputSaddle.js │ │ │ ├── ethereumOutputSushiSwap.js │ │ │ ├── ethereumOutputUniswapV2.js │ │ │ ├── ethereumOutputUniswapV3.js │ │ │ └── fraxswap-router-utils.js │ │ ├── fraxswap-twamm-test-unbalanced.js │ │ ├── fraxswap-twamm-test.js │ │ ├── fraxswap-uniV2-test.js │ │ ├── twamm-utils.js │ │ └── utilities.js │ │ ├── FrxETH │ │ └── FrxETHMiniRouter-Tests.js │ │ ├── Governance_Slap_2.js │ │ ├── Lending_AMOs │ │ ├── AaveAMO-Tests.js │ │ ├── KashiAMO-Tests.js │ │ ├── Rari-AMO-Tests.js │ │ └── TruefiAMO-Tests.js │ │ ├── LeveragePool-test.js │ │ ├── TWAMM_AMO-Tests.js │ │ ├── UniV3TWAPOracle-Tests.js │ │ ├── __ARBITRUM │ │ ├── ComboOracle_KyberSwapElastic-Tests_ARBI.js │ │ ├── CrossChainBridgeBacker_ARBI_AnySwap-Tests.js │ │ ├── CurveAMO-ARBI-Tests.js │ │ ├── FraxCrossChainFarmV2-Tests.js │ │ ├── FraxCrossChainFarmV3_ERC20-Tests.js │ │ └── FraxCrossChainFarmV4_ERC20-Tests.js │ │ ├── __AURORA │ │ └── CrossChainBridgeBacker_AUR_Rainbow-Tests.js │ │ ├── __AVALANCHE │ │ ├── AxialAMO-Tests.js │ │ ├── CrossChainBridgeBacker_AVAX_AnySwap-Tests.js │ │ └── PangolinLiquidityAMO-Tests.js │ │ ├── __BSC │ │ └── ApeSwapAMO-Tests.js │ │ ├── __FANTOM │ │ ├── CrossChainBridgeBacker_FTM_AnySwap-Tests.js │ │ ├── CurveAMO-FTM-Tests.js │ │ ├── FPIControllerPool-Tests.js │ │ ├── ScreamAMO-Tests.js │ │ └── SpiritSwapAMO-Tests.js │ │ ├── __HARMONY │ │ └── CrossChainBridgeBacker_HARM_Horizon-Tests.js │ │ ├── __MOONBEAM │ │ └── CrossChainBridgeBacker_MNBM_Nomad-Tests.js │ │ ├── __MOONRIVER │ │ └── CCFrax1to1AMM-Tests.js │ │ ├── __OPTIMISM │ │ └── CrossChainBridgeBacker_OPTI_Celer-Tests.js │ │ ├── __POLYGON │ │ ├── CrossChainBridgeBacker_POLY_MaticBridge-Tests.js │ │ └── SushiSwapLiquidityAMO_POLY-Tests.js │ │ ├── old_tests │ │ ├── AaveAMO-Tests.js │ │ ├── CommunalFarm-Tests.js │ │ ├── Convex-AMO.js │ │ ├── Core-Tests.js │ │ ├── Curve-AMO-V4.js │ │ ├── CurveMetapoolLockerAMO-Tests.js │ │ ├── FPI-PermissionedSend-test.js │ │ ├── FPI-TWAMMSwap-test.js │ │ ├── FPI-staking2-test.js │ │ ├── FPI-test.js │ │ ├── FXS1559AMO-Tests.js │ │ ├── FXSOracleWrapper-Tests.js │ │ ├── FXSRewards-Tests.js │ │ ├── FraxBond_NFT-Tests.js │ │ ├── FraxBonds.js │ │ ├── FraxCrossChainLiquidityTracker-Tests.js │ │ ├── FraxFarmBSC_Dual_V5.js │ │ ├── FraxLendingAMO.js │ │ ├── FraxPoolInvestorForV2-Tests.js │ │ ├── FraxPoolV3-Tests.js │ │ ├── FraxUniV3Farm_Stable_FRAX_DAI-Tests.js │ │ ├── FraxUniV3Farm_Stable_FRAX_USDC-Tests.js │ │ ├── Governance_Slap.js │ │ ├── InvestorAMO_V2-Upgrade.js │ │ ├── InvestorAMO_V3-Tests.js │ │ ├── MIM-Convex-AMO-Tests.js │ │ ├── MSIGHelper-Tests.js │ │ ├── MigratableFarmBSC_FRAX_FXS-Tests.js │ │ ├── OHM-AMO.js │ │ ├── PIDController-Tests.js │ │ ├── Rari-AMO-Tests.js │ │ ├── Slippage-Tests.js │ │ ├── Smart-Wallet-Whitelist-Tests.js │ │ ├── StakeDAO-AMO.js │ │ ├── StakingRewardsDualV5-Tests.js │ │ ├── TokenTrackerV2-Tests.js │ │ ├── UniV3LiquidityAMO-Tests.js │ │ ├── UniV3LiquidityAMO_V2-Tests.js │ │ ├── UnlockStakes.js │ │ ├── openzeppelin │ │ │ ├── ERC20.behavior.js │ │ │ ├── ERC20.test.js │ │ │ └── signatures.ts │ │ └── truffle-fixture-old.js │ │ ├── truffle-fixture-Aurora.js │ │ ├── truffle-fixture-Avalanche.js │ │ ├── truffle-fixture-BSC.js │ │ ├── truffle-fixture-Ethereum.js │ │ ├── truffle-fixture-Fantom.js │ │ ├── truffle-fixture-Harmony.js │ │ ├── truffle-fixture-Moonbeam.js │ │ ├── truffle-fixture-Moonriver.js │ │ ├── truffle-fixture-Optimism.js │ │ ├── truffle-fixture-Polygon.js │ │ ├── truffle-fixture.js │ │ ├── veFPIS-Tests.js │ │ ├── veFPISYieldDistributorV5-Tests.js │ │ ├── veFXS-Tests.js │ │ └── veFXSYieldDistributorV4-Tests.js ├── misc │ └── utilities.ts └── types │ ├── api.d.ts │ └── constants.ts └── tsconfig.json /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "solidity.compileUsingRemoteVersion": "v0.8.17+commit.8df45f5f", 3 | "solidity.packageDefaultDependenciesContractsDirectory": "src/hardhat/contracts", 4 | "solidity.packageDefaultDependenciesDirectory": "lib", 5 | "solidity.remappings": [ 6 | "forge-std/=lib/forge-std/src/", 7 | "@openzeppelin/=lib/openzeppelin-contracts/", 8 | "@mocks/=src/hardhat/contracts/mocks/", 9 | "@staking/=src/hardhat/contracts/Staking/", 10 | "@openzeppelin/=node_modules/@openzeppelin/" 11 | ] 12 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Truffle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /SAMPLE.env.forge: -------------------------------------------------------------------------------- 1 | # Common 2 | # ================================= 3 | MAINNET_RPC_URL="https://mainnet.infura.io/v3/" -------------------------------------------------------------------------------- /binance-fxs.md: -------------------------------------------------------------------------------- 1 | ## BSC FXS tokens 2 | Many users have asked how they can withdraw $FXS from Binance to BSC and get natively issued (canonical/official) FXS onchain. If you withdraw FXS from Binance directly to BSC, you can use this handy swap UI to get the native $FXS token on BSC! 3 | Link: https://app.frax.finance/bridge?chain=bsc&from=0xDE2F075f6F14EB9D96755b24E416A53E736Ca363&to=0xe48A3d7d0Bc88d552f730B62c006bC925eadB9eE 4 |
5 | **Swap Ratio:** 1 to 1 6 |
7 | **Binance FXS on BSC:** 0xDE2F075f6F14EB9D96755b24E416A53E736Ca363 8 |
9 | **Canonical (official) FXS on BSC:** 0xe48A3d7d0Bc88d552f730B62c006bC925eadB9eE 10 |
11 | **Rationale**: Fraxferry is now the official bridging solution for moving Frax-related tokens across chains. There are still a number of old bridge tokens that have not been converted to their official / canonical equivalents. The Binance FXS token (0xDE2...363) is one of them. We are working with Binance to gradually retire these to reduce confusion about users sending unsupported tokens to Binance Exchange and having them stranded. 12 | -------------------------------------------------------------------------------- /compiler_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Solidity", 3 | "settings": { 4 | "optimizer": { 5 | "enabled": true, 6 | "runs": 100000, 7 | "details": { 8 | "orderLiterals": true, 9 | "deduplicate": true, 10 | "cse": true, 11 | "constantOptimizer": true, 12 | "yul": true, 13 | "yulDetails": { 14 | "stackAllocation": true 15 | } 16 | } 17 | }, 18 | "viaIR": true, 19 | "outputSelection": { 20 | "*": { 21 | "": ["ast"], 22 | "*": ["abi", "metadata", "devdoc", "userdoc", "storageLayout", "evm.legacyAssembly", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers", "evm.gasEstimates", "evm.assembly"] 23 | } 24 | }, 25 | "evmVersion": "london" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'src/hardhat/contracts/BAMM' 3 | out = 'out' 4 | libs = ['node_modules', 'lib'] 5 | test = 'src/foundry/test/' 6 | cache_path = 'forge-cache' 7 | remappings = [ 8 | '@fraxmocks/=lib/frax-solidity/src/hardhat/contracts/mocks/', 9 | '@staking/=/src/hardhat/contracts/Staking/', 10 | '@openzeppelin-contracts/=lib/openzeppelin-contracts/', 11 | 'openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/', 12 | '@openzeppelin/=lib/openzeppelin-contracts/', 13 | ] 14 | 15 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config 16 | 17 | solc_version = "0.8.19" 18 | gas_reports = ["*"] 19 | 20 | # settings for coverage reports 21 | via_ir = true 22 | optimizer = true #testing this out - was false 23 | optimizer_runs = 100_000 24 | 25 | 26 | [profile.default.optimizer_details] 27 | jumpdestRemover = true 28 | orderLiterals = true 29 | deduplicate = true 30 | 31 | yul = true 32 | constantOptimizer = true 33 | stackAllocation = true 34 | 35 | # Have `cse = true` commented out for faster testing compilation, 36 | ### but UNCOMMENT it for DEPLOYMENT! ### 37 | cse = true 38 | 39 | 40 | [profile.default.optimizer_details.yulDetails] 41 | stackAllocation = true 42 | 43 | # Have `optimizerSteps = ""` uncommented for faster testing compilation, 44 | ### but COMMENT IT out for DEPLOYMENT!### 45 | # optimizerSteps = "" -------------------------------------------------------------------------------- /frax_whitepaper_v1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/frax_whitepaper_v1.pdf -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | @chainlink/=node_modules/@chainlink/ 2 | @ensdomains/=node_modules/@ensdomains/ 3 | @eth-optimism/=node_modules/@eth-optimism/ 4 | @openzeppelin/=node_modules/@openzeppelin/ 5 | @openzeppelin-contracts/=lib/openzeppelin-contracts/ 6 | openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/ 7 | @openzeppelin/=lib/openzeppelin-contracts/ 8 | @uniswap/=node_modules/@uniswap/ 9 | base64-sol/=node_modules/base64-sol/ 10 | ds-test/=lib/forge-std/lib/ds-test/src/ 11 | eth-gas-reporter/=node_modules/eth-gas-reporter/ 12 | forge-std/=lib/forge-std/src/ 13 | frax-std/=lib/frax-standard-solidity/src/ 14 | hardhat-deploy/=node_modules/hardhat-deploy/ 15 | hardhat/=node_modules/hardhat/ 16 | prb-math/=node_modules/prb-math/ 17 | truffle/=node_modules/truffle/ -------------------------------------------------------------------------------- /src/audits/Curve AMO Audit Report - Frax Security Cartel - May 2024.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/Curve AMO Audit Report - Frax Security Cartel - May 2024.pdf -------------------------------------------------------------------------------- /src/audits/FPISLocker + FraxtalERC4626MintRedeemer (Fraxtal sFRAX) - May 2024 - Frax Security Cartel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/FPISLocker + FraxtalERC4626MintRedeemer (Fraxtal sFRAX) - May 2024 - Frax Security Cartel.pdf -------------------------------------------------------------------------------- /src/audits/FXB, sFRAX, frxETH Redemption Queue, Frax Oracles - Trail of Bits - Oct 2023.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/FXB, sFRAX, frxETH Redemption Queue, Frax Oracles - Trail of Bits - Oct 2023.pdf -------------------------------------------------------------------------------- /src/audits/Fraxchain (Fraxtal) - Trail of Bits - Jan 2024.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/Fraxchain (Fraxtal) - Trail of Bits - Jan 2024.pdf -------------------------------------------------------------------------------- /src/audits/Fraxtal Audit - April 2024 - Frax Security Cartel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/Fraxtal Audit - April 2024 - Frax Security Cartel.pdf -------------------------------------------------------------------------------- /src/audits/frxETH V2 Audit Report - Frax Security Cartel - March 2024.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FraxFinance/frax-solidity/3429eeaeb0ba56e18923ffd5c3434db37305aafd/src/audits/frxETH V2 Audit Report - Frax Security Cartel - March 2024.pdf -------------------------------------------------------------------------------- /src/hardhat/contracts/Common/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | /* 5 | * @dev Provides information about the current execution context, including the 6 | * sender of the transaction and its data. While these are generally available 7 | * via msg.sender and msg.data, they should not be accessed in such a direct 8 | * manner, since when dealing with GSN meta-transactions the account sending and 9 | * paying for execution may not be the actual sender (as far as an application 10 | * is concerned). 11 | * 12 | * This contract is only required for intermediate, library-like contracts. 13 | */ 14 | abstract contract Context { 15 | function _msgSender() internal view virtual returns (address payable) { 16 | return payable(msg.sender); 17 | } 18 | 19 | function _msgData() internal view virtual returns (bytes memory) { 20 | this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 21 | return msg.data; 22 | } 23 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Common/ContextV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Curve/IDelegationProxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IDelegationProxy { 5 | function adjusted_balance_of(address _account) external view returns (uint256); 6 | function kill_delegation() external; 7 | function set_delegation(address _delegation) external; 8 | function commit_set_admins(address _o_admin, address _e_admin) external; 9 | function apply_set_admins() external; 10 | function delegation() external view returns (address); 11 | function emergency_admin() external view returns (address); 12 | function ownership_admin() external view returns (address); 13 | function future_emergency_admin() external view returns (address); 14 | function future_ownership_admin() external view returns (address); 15 | } 16 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Curve/IFraxGaugeControllerV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity ^0.8.0; 3 | 4 | import "./IFraxGaugeController.sol"; 5 | 6 | // https://github.com/swervefi/swerve/edit/master/packages/swerve-contracts/interfaces/IGaugeController.sol 7 | 8 | interface IFraxGaugeControllerV2 is IFraxGaugeController { 9 | struct CorrectedPoint { 10 | uint256 bias; 11 | uint256 slope; 12 | uint256 lock_end; 13 | } 14 | 15 | function get_corrected_info(address) external view returns (CorrectedPoint memory); 16 | } 17 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Curve/IMinter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // https://github.com/swervefi/swerve/blob/master/packages/swerve-contracts/interfaces/IMinter.sol 5 | 6 | interface IMinter { 7 | // Public variables 8 | function minter() external view returns (address); 9 | function controller() external view returns (address); 10 | function minted(address, address) external view returns (uint256); 11 | function allowed_to_mint_for(address, address) external view returns (bool); 12 | 13 | // External functions 14 | function mint(address) external; 15 | function mint_many(address[] memory) external; 16 | function mint_for(address, address) external; 17 | function toggle_approve_mint(address) external; 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Curve/Middleman_Gauges/FraxMiddlemanGauge_ARBI_Curve_VSTFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxMiddlemanGauge.sol"; 6 | 7 | contract FraxMiddlemanGauge_ARBI_Curve_VSTFRAX is FraxMiddlemanGauge { 8 | constructor ( 9 | address _owner, 10 | address _timelock_address, 11 | address _rewards_distributor_address, 12 | address _bridge_address, 13 | uint256 _bridge_type, 14 | address _destination_address_override, 15 | string memory _non_evm_destination_address, 16 | string memory _name 17 | ) 18 | FraxMiddlemanGauge(_owner, _timelock_address, _rewards_distributor_address, _bridge_address, _bridge_type, _destination_address_override, _non_evm_destination_address, _name) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Curve/Middleman_Gauges/FraxMiddlemanGauge_FRAX_mUSD.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxMiddlemanGauge.sol"; 6 | 7 | contract FraxMiddlemanGauge_FRAX_mUSD is FraxMiddlemanGauge { 8 | constructor ( 9 | address _owner, 10 | address _timelock_address, 11 | address _rewards_distributor_address, 12 | address _bridge_address, 13 | uint256 _bridge_type, 14 | address _destination_address_override, 15 | string memory _non_evm_destination_address, 16 | string memory _name 17 | ) 18 | FraxMiddlemanGauge(_owner, _timelock_address, _rewards_distributor_address, _bridge_address, _bridge_type, _destination_address_override, _non_evm_destination_address, _name) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC165/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.6.11; 4 | 5 | /** 6 | * @dev Interface of the ERC165 standard, as defined in the 7 | * https://eips.ethereum.org/EIPS/eip-165[EIP]. 8 | * 9 | * Implementers can declare support of contract interfaces, which can then be 10 | * queried by others ({ERC165Checker}). 11 | * 12 | * For an implementation, see {ERC165}. 13 | */ 14 | interface IERC165 { 15 | /** 16 | * @dev Returns true if this contract implements the interface defined by 17 | * `interfaceId`. See the corresponding 18 | * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] 19 | * to learn more about how these ids are created. 20 | * 21 | * This function call must use less than 30 000 gas. 22 | */ 23 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./ERC20.sol"; 6 | 7 | // mock class using ERC20 8 | contract ERC20Mock is ERC20 { 9 | constructor( 10 | string memory name, 11 | string memory symbol, 12 | address initialAccount, 13 | uint256 initialBalance 14 | ) payable ERC20(name, symbol) { 15 | _mint(initialAccount, initialBalance); 16 | } 17 | 18 | function mint(address account, uint256 amount) public { 19 | _mint(account, amount); 20 | } 21 | 22 | function burn(address account, uint256 amount) public { 23 | _burn(account, amount); 24 | } 25 | 26 | function transferInternal( 27 | address from, 28 | address to, 29 | uint256 value 30 | ) public { 31 | _transfer(from, to, value); 32 | } 33 | 34 | function approveInternal( 35 | address owner, 36 | address spender, 37 | uint256 value 38 | ) public { 39 | _approve(owner, spender, value); 40 | } 41 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/ERC20MockTWAMM.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 6 | 7 | contract ERC20MockTWAMM is ERC20 { 8 | 9 | constructor( 10 | string memory name, 11 | string memory symbol, 12 | uint256 supply 13 | ) ERC20(name, symbol) { 14 | _mint(msg.sender, supply); 15 | } 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./IERC20.sol"; 6 | 7 | /** 8 | * @dev Interface for the optional metadata functions from the ERC20 standard. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC20Metadata is IERC20 { 13 | /** 14 | * @dev Returns the name of the token. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the symbol of the token. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the decimals places of the token. 25 | */ 26 | function decimals() external view returns (uint8); 27 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/IOptimismMintableERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; 5 | 6 | /// @title IOptimismMintableERC20 7 | /// @notice This interface is available on the OptimismMintableERC20 contract. 8 | /// We declare it as a separate interface so that it can be used in 9 | /// custom implementations of OptimismMintableERC20. 10 | interface IOptimismMintableERC20 is IERC165 { 11 | function remoteToken() external view returns (address); 12 | 13 | function bridge() external returns (address); 14 | 15 | function mint(address _to, uint256 _amount) external; 16 | 17 | function burn(address _from, uint256 _amount) external; 18 | } 19 | 20 | /// @custom:legacy 21 | /// @title ILegacyMintableERC20 22 | /// @notice This interface was available on the legacy L2StandardERC20 contract. 23 | /// It remains available on the OptimismMintableERC20 contract for 24 | /// backwards compatibility. 25 | interface ILegacyMintableERC20 is IERC165 { 26 | function l1Token() external view returns (address); 27 | 28 | function mint(address _to, uint256 _amount) external; 29 | 30 | function burn(address _from, uint256 _amount) external; 31 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/ISemver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /// @title ISemver 5 | /// @notice ISemver is a simple contract for ensuring that contracts are 6 | /// versioned using semantic versioning. 7 | interface ISemver { 8 | /// @notice Getter for the semantic version of the contract. This is not 9 | /// meant to be used onchain but instead meant to be used by offchain 10 | /// tooling. 11 | /// @return Semver contract version as a string. 12 | function version() external view returns (string memory); 13 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/IWETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | interface IWETH { 5 | function deposit() external payable; 6 | function transfer(address to, uint value) external returns (bool); 7 | function transferFrom(address src, address dst, uint wad) external returns (bool); 8 | function withdraw(uint) external; 9 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/IwfrxETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | interface IwfrxETH { 5 | function DOMAIN_SEPARATOR ( ) external view returns ( bytes32 ); 6 | function allowance ( address, address ) external view returns ( uint256 ); 7 | function approve ( address guy, uint256 wad ) external returns ( bool ); 8 | function balanceOf ( address ) external view returns ( uint256 ); 9 | function decimals ( ) external view returns ( uint8 ); 10 | function deposit ( ) external; 11 | function eip712Domain ( ) external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); 12 | function name ( ) external view returns ( string memory ); 13 | function nonces ( address owner ) external view returns ( uint256 ); 14 | function permit ( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; 15 | function symbol ( ) external view returns ( string memory ); 16 | function totalSupply ( ) external view returns ( uint256 ); 17 | function transfer ( address dst, uint256 wad ) external returns ( bool ); 18 | function transferFrom ( address src, address dst, uint256 wad ) external returns ( bool ); 19 | function withdraw ( uint256 wad ) external; 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/Variants/FRAX3CRV_V2_Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.6.11; 4 | 5 | import "../ERC20.sol"; 6 | 7 | contract FRAX3CRV_V2_Mock is ERC20 { 8 | constructor () 9 | ERC20("Curve.fi Factory USD Metapool: Frax", "FRAX3CRV-f-2") 10 | {} 11 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/Variants/FarmToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../ERC20.sol"; 4 | 5 | // Mock Farm token 6 | contract FarmToken is ERC20("FARM Reward Token", "FARM") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/Variants/IQToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../ERC20.sol"; 4 | 5 | // Mock IQ token 6 | contract IQToken is ERC20("Everipedia IQ", "IQ") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/CrossChainCanonicalFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | import "./CrossChainCanonical.sol"; 4 | 5 | contract CrossChainCanonicalFRAX is CrossChainCanonical { 6 | constructor ( 7 | string memory _name, 8 | string memory _symbol, 9 | address _creator_address, 10 | uint256 _initial_mint_amt, 11 | address _custodian_address, 12 | address[] memory _bridge_tokens 13 | ) 14 | CrossChainCanonical(_name, _symbol, _creator_address, _initial_mint_amt, _custodian_address, _bridge_tokens) 15 | {} 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/CrossChainCanonicalFXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | import "./CrossChainCanonical.sol"; 4 | 5 | contract CrossChainCanonicalFXS is CrossChainCanonical { 6 | constructor ( 7 | string memory _name, 8 | string memory _symbol, 9 | address _creator_address, 10 | uint256 _initial_mint_amt, 11 | address _custodian_address, 12 | address[] memory _bridge_tokens 13 | ) 14 | CrossChainCanonical(_name, _symbol, _creator_address, _initial_mint_amt, _custodian_address, _bridge_tokens) 15 | {} 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/anyFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "./AnyswapV4ERC20.sol"; 4 | 5 | // Mock anyFRAX token 6 | contract anyFRAX is AnyswapV4ERC20 { 7 | constructor ( 8 | address _vault_address 9 | ) 10 | AnyswapV4ERC20("anyFRAX", "anyFRAX", 18, 0x0000000000000000000000000000000000000000, _vault_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/anyFXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "./AnyswapV4ERC20.sol"; 4 | 5 | // Mock anyFXS token 6 | contract anyFXS is AnyswapV4ERC20 { 7 | constructor ( 8 | address _vault_address 9 | ) 10 | AnyswapV4ERC20("anyFXS", "anyFXS", 18, 0x0000000000000000000000000000000000000000, _vault_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/anyUSDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock anyUSDC token 6 | contract anyUSDC is ERC20("USD Coin", "USDC") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/arbiUSDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock arbiUSDC token 6 | contract arbiUSDC is ERC20("USD Coin (Arb1)", "USDC") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/oneFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock oneFRAX token 6 | contract oneFRAX is ERC20("Frax", "1FRAX") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/oneFXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock oneFXS token 6 | contract oneFXS is ERC20("Frax Share", "1FXS") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/oneUSDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock oneUSDC token 6 | contract oneUSDC is ERC20("USDC", "1USDC") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/polyFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock polyFRAX token 6 | contract polyFRAX is ERC20("Polygon FRAX", "polyFRAX") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/polyFXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock polyFXS token 6 | contract polyFXS is ERC20("Polygon FXS", "polyFXS") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC20/__CROSSCHAIN/polyUSDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | import "../ERC20.sol"; 4 | 5 | // Mock polyUSDC token 6 | contract polyUSDC is ERC20("Polygon USDC", "polyUSDC") { 7 | // Nothing here 8 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC721/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./IERC721.sol"; 6 | 7 | /** 8 | * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension 9 | * @dev See https://eips.ethereum.org/EIPS/eip-721 10 | */ 11 | interface IERC721Enumerable is IERC721 { 12 | 13 | /** 14 | * @dev Returns the total amount of tokens stored by the contract. 15 | */ 16 | function totalSupply() external view returns (uint256); 17 | 18 | /** 19 | * @dev Returns a token ID owned by `owner` at a given `index` of its token list. 20 | * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. 21 | */ 22 | function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); 23 | 24 | /** 25 | * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. 26 | * Use along with {totalSupply} to enumerate all tokens. 27 | */ 28 | function tokenByIndex(uint256 index) external view returns (uint256); 29 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC721/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./IERC721.sol"; 6 | 7 | /** 8 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 9 | * @dev See https://eips.ethereum.org/EIPS/eip-721 10 | */ 11 | interface IERC721Metadata is IERC721 { 12 | 13 | /** 14 | * @dev Returns the token collection name. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the token collection symbol. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 25 | */ 26 | function tokenURI(uint256 tokenId) external view returns (string memory); 27 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC721/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @title ERC721 token receiver interface 7 | * @dev Interface for any contract that wants to support safeTransfers 8 | * from ERC721 asset contracts. 9 | */ 10 | interface IERC721Receiver { 11 | /** 12 | * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} 13 | * by `operator` from `from`, this function is called. 14 | * 15 | * It must return its Solidity selector to confirm the token transfer. 16 | * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. 17 | * 18 | * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. 19 | */ 20 | function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); 21 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/ERC721/V8_0_0/Common/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /* 6 | * @dev Provides information about the current execution context, including the 7 | * sender of the transaction and its data. While these are generally available 8 | * via msg.sender and msg.data, they should not be accessed in such a direct 9 | * manner, since when dealing with GSN meta-transactions the account sending and 10 | * paying for execution may not be the actual sender (as far as an application 11 | * is concerned). 12 | * 13 | * This contract is only required for intermediate, library-like contracts. 14 | */ 15 | abstract contract Context { 16 | function _msgSender() internal view virtual returns (address) { 17 | return msg.sender; 18 | } 19 | 20 | function _msgData() internal view virtual returns (bytes calldata) { 21 | this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 22 | return msg.data; 23 | } 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/FPI/IERC20.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity >=0.5.0; 3 | 4 | interface IERC20 { 5 | event Approval(address indexed owner, address indexed spender, uint value); 6 | event Transfer(address indexed from, address indexed to, uint value); 7 | 8 | function name() external view returns (string memory); 9 | function symbol() external view returns (string memory); 10 | function decimals() external view returns (uint8); 11 | function totalSupply() external view returns (uint); 12 | function balanceOf(address owner) external view returns (uint); 13 | function allowance(address owner, address spender) external view returns (uint); 14 | 15 | function approve(address spender, uint value) external returns (bool); 16 | function transfer(address to, uint value) external returns (bool); 17 | function transferFrom(address from, address to, uint value) external returns (bool); 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/FPI/IFPI.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity >=0.8.0; 3 | 4 | interface IFPI { 5 | event Approval(address indexed owner, address indexed spender, uint value); 6 | event Transfer(address indexed from, address indexed to, uint value); 7 | 8 | function name() external view returns (string memory); 9 | function symbol() external view returns (string memory); 10 | function decimals() external view returns (uint8); 11 | function totalSupply() external view returns (uint); 12 | function balanceOf(address owner) external view returns (uint); 13 | function allowance(address owner, address spender) external view returns (uint); 14 | 15 | function approve(address spender, uint value) external returns (bool); 16 | function transfer(address to, uint value) external returns (bool); 17 | function transferFrom(address from, address to, uint value) external returns (bool); 18 | 19 | function fpi_pools(address ) external view returns (bool); 20 | function fpi_pools_array(uint256 ) external view returns (address); 21 | 22 | function pool_burn_from(address b_address, uint256 b_amount ) external; 23 | function pool_mint(address m_address, uint256 m_amount ) external; 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/FPI/Math.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | // a library for performing various math operations 5 | 6 | library Math { 7 | function min(uint x, uint y) internal pure returns (uint z) { 8 | z = x < y ? x : y; 9 | } 10 | 11 | // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) 12 | function sqrt(uint y) internal pure returns (uint z) { 13 | if (y > 3) { 14 | z = y; 15 | uint x = y / 2 + 1; 16 | while (x < z) { 17 | z = x; 18 | x = (y / x + x) / 2; 19 | } 20 | } else if (y != 0) { 21 | z = 1; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/FPI/SafeMath.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) 5 | 6 | library SafeMath { 7 | function add(uint x, uint y) internal pure returns (uint z) { 8 | require((z = x + y) >= x, 'ds-math-add-overflow'); 9 | } 10 | 11 | function sub(uint x, uint y) internal pure returns (uint z) { 12 | require((z = x - y) <= x, 'ds-math-sub-underflow'); 13 | } 14 | 15 | function mul(uint x, uint y) internal pure returns (uint z) { 16 | require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); 17 | } 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Frax/Pools/Pool_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FraxPool.sol"; 5 | 6 | contract Pool_USDC is FraxPool { 7 | address public USDC_address; 8 | constructor ( 9 | address _frax_contract_address, 10 | address _fxs_contract_address, 11 | address _collateral_address, 12 | address _creator_address, 13 | address _timelock_address, 14 | uint256 _pool_ceiling 15 | ) 16 | FraxPool(_frax_contract_address, _fxs_contract_address, _collateral_address, _creator_address, _timelock_address, _pool_ceiling) 17 | public { 18 | require(_collateral_address != address(0), "Zero address detected"); 19 | 20 | _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); 21 | USDC_address = _collateral_address; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Frax/Pools/PoolvAMM_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FraxPoolvAMM.sol"; 5 | 6 | contract PoolvAMM_USDC is FraxPoolvAMM { 7 | address public USDC_address; 8 | constructor ( 9 | address _frax_contract_address, 10 | address _fxs_contract_address, 11 | address _collateral_address, 12 | address _creator_address, 13 | address _timelock_address, 14 | address _uniswap_factory_address, 15 | address _fxs_usdc_oracle_addr, 16 | uint256 _pool_ceiling 17 | ) 18 | FraxPoolvAMM(_frax_contract_address, _fxs_contract_address, _collateral_address, _creator_address, _timelock_address, _uniswap_factory_address, _fxs_usdc_oracle_addr, _pool_ceiling) 19 | { 20 | _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); 21 | USDC_address = _collateral_address; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxbonds/FXB.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol"; 5 | import "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol"; 6 | 7 | contract FXB is ERC20Permit { 8 | address constant public FRAX = 0x853d955aCEf822Db058eb8505911ED77F175b99e; 9 | uint immutable public expiry; 10 | 11 | constructor(string memory _name, string memory _symbol, uint _expiry) ERC20(_name, _symbol) ERC20Permit(_name) { 12 | expiry = _expiry; 13 | } 14 | 15 | function mint(address to, uint256 amount) external { 16 | TransferHelper.safeTransferFrom(FRAX, msg.sender, address(this), amount); 17 | _mint(to, amount); 18 | } 19 | 20 | function redeem(address to, uint256 amount) external { 21 | if (block.timestamp BlockInfo) public blocks; 8 | function getBlockInfo(uint blockNumber) external view returns (BlockInfo memory) { 9 | return blocks[blockNumber]; 10 | } 11 | function setStateRoot(uint blockNumber,bytes32 stateRoot, uint32 timestamp) external { 12 | blocks[blockNumber]=BlockInfo(stateRoot,timestamp); 13 | } 14 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/FraxoraclePriceSource.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; 5 | 6 | import "hardhat/console.sol"; 7 | import "./Fraxoracle.sol"; 8 | 9 | contract FraxoraclePriceSource { 10 | Fraxoracle immutable public fraxoracle; 11 | IPriceOracle immutable public priceOracle; 12 | constructor(Fraxoracle _fraxoracle, IPriceOracle _priceOracle) { 13 | fraxoracle=_fraxoracle; 14 | priceOracle=_priceOracle; 15 | } 16 | 17 | function addRoundData() external { 18 | (bool _isBadData, uint256 _priceLow, uint256 _priceHigh) = priceOracle.getPrices(); 19 | fraxoracle.addRoundData(_isBadData, _priceLow, _priceHigh, uint32(block.timestamp)); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/interface/IBlockhashProvider.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | interface IBlockhashProvider { 5 | function hashStored(bytes32 hash) external view returns (bool result); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/interface/IMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | /* 4 | * Copyright 2021, Offchain Labs, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | pragma solidity ^0.8.4; 20 | 21 | interface IMessageProvider { 22 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 23 | 24 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 25 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/interface/IPriceOracle.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | interface IPriceOracle { 5 | function getPrices() external view returns (bool _isBadData, uint256 _priceLow, uint256 _priceHigh); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/interface/IStateRootOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.0; 3 | 4 | interface IStateRootOracle { 5 | struct BlockInfo { 6 | bytes32 stateRoot; 7 | uint32 timestamp; 8 | } 9 | function getBlockInfo(uint blockNumber) external view returns (BlockInfo memory); 10 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/interface/ITelepathyRouter.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | interface ITelepathyRouter { 4 | function send(uint32 destinationChainId, address destinationAddress, bytes calldata data) 5 | external 6 | returns (bytes32); 7 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/library/MerkleTreeProver.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import {RLPReader} from "./RLPReader.sol"; 5 | import {StateProofVerifier as Verifier} from "./StateProofVerifier.sol"; 6 | 7 | library MerkleTreeProver { 8 | using RLPReader for bytes; 9 | using RLPReader for RLPReader.RLPItem; 10 | 11 | function proofStorageRoot(bytes32 stateRootHash, address proofAddress, bytes[] memory _proofBytesArray) internal view returns (Verifier.Account memory accountPool) { 12 | RLPReader.RLPItem[] memory proof = new RLPReader.RLPItem[](_proofBytesArray.length); 13 | for (uint i=0;i<_proofBytesArray.length;i++) proof[i] = _proofBytesArray[i].toRlpItem(); 14 | accountPool = Verifier.extractAccountFromProof(keccak256(abi.encodePacked(proofAddress)), stateRootHash, proof); 15 | } 16 | 17 | function proofStorageSlotValue(bytes32 storageRoot, bytes32 slot, bytes[] memory _proofBytesArray) internal view returns (Verifier.SlotValue memory slotValue) { 18 | RLPReader.RLPItem[] memory proof = new RLPReader.RLPItem[](_proofBytesArray.length); 19 | for (uint i=0;i<_proofBytesArray.length;i++) proof[i] = _proofBytesArray[i].toRlpItem(); 20 | slotValue = Verifier.extractSlotValueFromProof(keccak256(abi.encodePacked(slot)),storageRoot,proof); 21 | } 22 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/provider/ArbitrumBlockhashProvider.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "../interface/IBlockhashProvider.sol"; 5 | import "@arbitrum/nitro-contracts/src/libraries/AddressAliasHelper.sol"; 6 | 7 | contract ArbitrumBlockhashProvider is IBlockhashProvider { 8 | address public l1Source; 9 | address immutable deployer; 10 | mapping(bytes32 => bool) storedHashes; 11 | 12 | event BlockhashReceived(bytes32 hash); 13 | 14 | constructor() { 15 | deployer = msg.sender; 16 | } 17 | 18 | function init(address _l1Source) external { 19 | require (msg.sender==deployer); 20 | require(l1Source==address(0)); 21 | l1Source = _l1Source; 22 | } 23 | 24 | function receiveBlockHash(bytes32 hash) external { 25 | if (msg.sender!=AddressAliasHelper.applyL1ToL2Alias(l1Source)) revert("Wrong source"); 26 | storedHashes[hash]=true; 27 | emit BlockhashReceived(hash); 28 | } 29 | 30 | function hashStored(bytes32 hash) external view returns (bool result) { 31 | return storedHashes[hash]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/provider/ArbitrumBlockhashRelay.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "../interface/IInbox.sol"; 5 | import "./ArbitrumBlockhashProvider.sol"; 6 | 7 | contract ArbitrumBlockhashRelay { 8 | address immutable public l2Target; 9 | IInbox immutable public inbox; 10 | 11 | event BlockhashRelayed(uint indexed blockNo); 12 | 13 | constructor(address _l2Target, IInbox _inbox) { 14 | l2Target = _l2Target; 15 | inbox = _inbox; 16 | } 17 | 18 | function relayHash(uint blockNo, uint256 maxSubmissionCost, uint256 maxGas, uint256 gasPriceBid) external payable returns (uint256 ticketID) { 19 | bytes32 hash = blockhash(blockNo); 20 | bytes memory data = abi.encodeWithSelector(ArbitrumBlockhashProvider.receiveBlockHash.selector, hash); 21 | ticketID = inbox.createRetryableTicket{ value: msg.value }( 22 | l2Target, 23 | 0, 24 | maxSubmissionCost, 25 | msg.sender, 26 | msg.sender, 27 | maxGas, 28 | gasPriceBid, 29 | data 30 | ); 31 | emit BlockhashRelayed(blockNo); 32 | } 33 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/provider/OperatorBlockhashProvider.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "../interface/IBlockhashProvider.sol"; 5 | 6 | contract OperatorBlockhashProvider is IBlockhashProvider { 7 | address immutable public operator; 8 | mapping(bytes32 => bool) storedHashes; 9 | 10 | event BlockhashReceived(bytes32 hash); 11 | 12 | constructor(address _operator) { 13 | operator = _operator; 14 | } 15 | 16 | function receiveBlockHash(bytes32 hash) external { 17 | if (msg.sender!=operator) revert("Wrong operator"); 18 | storedHashes[hash]=true; 19 | emit BlockhashReceived(hash); 20 | } 21 | 22 | function hashStored(bytes32 hash) external view returns (bool result) { 23 | return storedHashes[hash]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxoracle/provider/TelepathyBlockhashRelay.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "../interface/IInbox.sol"; 5 | import "../interface/ITelepathyRouter.sol"; 6 | 7 | contract TelepathyBlockhashRelay { 8 | ITelepathyRouter constant public telepathyRouter = ITelepathyRouter(0x41EA857C32c8Cb42EEFa00AF67862eCFf4eB795a); 9 | address immutable public l2Target; 10 | uint32 immutable public destinationChainId; 11 | 12 | event BlockhashRelayed(uint indexed blockNo); 13 | 14 | constructor(address _l2Target,uint32 _destinationChainId) { 15 | l2Target = _l2Target; 16 | destinationChainId = _destinationChainId; 17 | } 18 | 19 | function relayHash(uint blockNo) external payable returns (uint256 ticketID) { 20 | bytes32 hash = blockhash(blockNo); 21 | ticketID = uint(telepathyRouter.send(destinationChainId,l2Target,abi.encodePacked(hash))); 22 | emit BlockhashRelayed(blockNo); 23 | } 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/GlobalPauseHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.0; 3 | 4 | import './interfaces/IUniswapV2PairPartialV5.sol'; 5 | 6 | contract GlobalPauseHelper { 7 | 8 | function globalPause(address[] calldata pairAddresses) 9 | external 10 | returns (bool[] memory successful) 11 | { 12 | address pairAddress; 13 | successful = new bool[](pairAddresses.length); 14 | for (uint i = 0; i < pairAddresses.length; ++i) { 15 | pairAddress = pairAddresses[i]; 16 | try IUniswapV2PairPartialV5(pairAddress).togglePauseNewSwaps() { 17 | successful[i] = true; 18 | } catch {} 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/interfaces/IERC20V5.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IERC20V5 { 4 | event Approval(address indexed owner, address indexed spender, uint value); 5 | event Transfer(address indexed from, address indexed to, uint value); 6 | 7 | function name() external view returns (string memory); 8 | function symbol() external view returns (string memory); 9 | function decimals() external view returns (uint8); 10 | function totalSupply() external view returns (uint); 11 | function balanceOf(address owner) external view returns (uint); 12 | function allowance(address owner, address spender) external view returns (uint); 13 | 14 | function approve(address spender, uint value) external returns (bool); 15 | function transfer(address to, uint value) external returns (bool); 16 | function transferFrom(address from, address to, uint value) external returns (bool); 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/interfaces/IFraxswapFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity ^0.8.0; 3 | 4 | interface IFraxswapFactory { 5 | function allPairs ( uint256 ) external view returns ( address ); 6 | function allPairsLength ( ) external view returns ( uint256 ); 7 | function createPair ( address tokenA, address tokenB, uint256 fee ) external returns ( address pair ); 8 | function createPair ( address tokenA, address tokenB ) external returns ( address pair ); 9 | function feeTo ( ) external view returns ( address ); 10 | function feeToSetter ( ) external view returns ( address ); 11 | function getPair ( address, address ) external view returns ( address ); 12 | function globalPause ( ) external view returns ( bool ); 13 | function setFeeTo ( address _feeTo ) external; 14 | function setFeeToSetter ( address _feeToSetter ) external; 15 | function toggleGlobalPause ( ) external; 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/interfaces/IUniswapV2CalleeV5.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2CalleeV5 { 4 | function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; 5 | } 6 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/interfaces/IUniswapV2ERC20V5.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2ERC20V5 { 4 | event Approval(address indexed owner, address indexed spender, uint value); 5 | event Transfer(address indexed from, address indexed to, uint value); 6 | 7 | function name() external pure returns (string memory); 8 | function symbol() external pure returns (string memory); 9 | function decimals() external pure returns (uint8); 10 | function totalSupply() external view returns (uint); 11 | function balanceOf(address owner) external view returns (uint); 12 | function allowance(address owner, address spender) external view returns (uint); 13 | 14 | function approve(address spender, uint value) external returns (bool); 15 | function transfer(address to, uint value) external returns (bool); 16 | function transferFrom(address from, address to, uint value) external returns (bool); 17 | 18 | function DOMAIN_SEPARATOR() external view returns (bytes32); 19 | function PERMIT_TYPEHASH() external pure returns (bytes32); 20 | function nonces(address owner) external view returns (uint); 21 | 22 | function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/interfaces/IUniswapV2FactoryV5.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2FactoryV5 { 4 | event PairCreated(address indexed token0, address indexed token1, address pair, uint); 5 | 6 | function feeTo() external view returns (address); 7 | function feeToSetter() external view returns (address); 8 | function globalPause() external view returns (bool); 9 | 10 | function getPair(address tokenA, address tokenB) external view returns (address pair); 11 | function allPairs(uint) external view returns (address pair); 12 | function allPairsLength() external view returns (uint); 13 | 14 | function createPair(address tokenA, address tokenB) external returns (address pair); 15 | function createPair(address tokenA, address tokenB, uint fee) external returns (address pair); 16 | 17 | function setFeeTo(address) external; 18 | function setFeeToSetter(address) external; 19 | function toggleGlobalPause() external; 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/libraries/Math.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.16; 2 | 3 | // a library for performing various math operations 4 | 5 | library Math { 6 | function min(uint x, uint y) internal pure returns (uint z) { 7 | z = x < y ? x : y; 8 | } 9 | 10 | // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) 11 | function sqrt(uint y) internal pure returns (uint z) { 12 | if (y > 3) { 13 | z = y; 14 | uint x = y / 2 + 1; 15 | while (x < z) { 16 | z = x; 17 | x = (y / x + x) / 2; 18 | } 19 | } else if (y != 0) { 20 | z = 1; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/libraries/SafeMath.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.16; 2 | 3 | // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) 4 | 5 | library SafeMath { 6 | function add(uint x, uint y) internal pure returns (uint z) { 7 | require((z = x + y) >= x, 'add-of'); 8 | } 9 | 10 | function sub(uint x, uint y) internal pure returns (uint z) { 11 | require((z = x - y) <= x, 'sub-uf'); 12 | } 13 | 14 | function mul(uint x, uint y) internal pure returns (uint z) { 15 | require(y == 0 || (z = x * y) / y == x, 'mul-of'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/libraries/UQ112x112.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.16; 2 | 3 | // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) 4 | 5 | // range: [0, 2**112 - 1] 6 | // resolution: 1 / 2**112 7 | 8 | library UQ112x112 { 9 | uint224 constant Q112 = 2**112; 10 | 11 | // encode a uint112 as a UQ112x112 12 | function encode(uint112 y) internal pure returns (uint224 z) { 13 | z = uint224(y) * Q112; // never overflows 14 | } 15 | 16 | // divide a UQ112x112 by a uint112, returning a UQ112x112 17 | function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { 18 | z = x / uint224(y); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/test/ComputeUniswapV2PairInitHash.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | import '../FraxswapPair.sol'; 4 | 5 | contract ComputeUniswapV2PairInitHash{ 6 | 7 | function getInitHash() public pure returns(bytes32){ 8 | bytes memory bytecode = type(FraxswapPair).creationCode; 9 | return keccak256(abi.encodePacked(bytecode)); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/core/test/ERC20CoreTest.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.16; 2 | 3 | import '../FraxswapERC20.sol'; 4 | 5 | contract ERC20CoreTest is FraxswapERC20 { 6 | constructor(uint _totalSupply) public { 7 | _mint(msg.sender, _totalSupply); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/interfaces/ILiquidityModifier.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface ILiquidityModifier { 4 | function getUpdatedReserve() external returns (uint256 reserve0, uint256 reserve1); 5 | } 6 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IERC20 { 4 | event Approval(address indexed owner, address indexed spender, uint value); 5 | event Transfer(address indexed from, address indexed to, uint value); 6 | 7 | function name() external view returns (string memory); 8 | function symbol() external view returns (string memory); 9 | function decimals() external view returns (uint8); 10 | function totalSupply() external view returns (uint); 11 | function balanceOf(address owner) external view returns (uint); 12 | function allowance(address owner, address spender) external view returns (uint); 13 | 14 | function approve(address spender, uint value) external returns (bool); 15 | function transfer(address to, uint value) external returns (bool); 16 | function transferFrom(address from, address to, uint value) external returns (bool); 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/IFraxswapRouterMultihop.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | 5 | interface IFraxswapRouterMultihop { 6 | 7 | struct FraxswapParams { 8 | address tokenIn; 9 | uint256 amountIn; 10 | address tokenOut; 11 | uint256 amountOutMinimum; 12 | address recipient; 13 | uint256 deadline; 14 | bool approveMax; 15 | uint8 v; 16 | bytes32 r; 17 | bytes32 s; 18 | bytes route; 19 | } 20 | 21 | function encodeRoute ( address tokenOut, uint256 percentOfHop, bytes[] memory steps, bytes[] memory nextHops ) external pure returns ( bytes memory out ); 22 | function encodeStep ( uint8 swapType, uint8 directFundNextPool, uint8 directFundThisPool, address tokenOut, address pool, uint256 extraParam1, uint256 extraParam2, uint256 percentOfHop ) external pure returns ( bytes memory out ); 23 | function owner ( ) external view returns ( address ); 24 | function renounceOwnership ( ) external; 25 | function swap ( FraxswapParams memory params ) external returns ( uint256 amountOut ); 26 | function transferOwnership ( address newOwner ) external; 27 | function uniswapV3SwapCallback ( int256 amount0Delta, int256 amount1Delta, bytes memory _data ) external; 28 | } 29 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/IUniswapV2MigratorV5.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2MigratorV5 { 4 | function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external; 5 | } 6 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/IWETH.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IWETH { 4 | function deposit() external payable; 5 | function transfer(address to, uint value) external returns (bool); 6 | function withdraw(uint) external; 7 | } 8 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/V1/IUniswapV1Exchange.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV1Exchange { 4 | function balanceOf(address owner) external view returns (uint); 5 | function transferFrom(address from, address to, uint value) external returns (bool); 6 | function removeLiquidity(uint, uint, uint, uint) external returns (uint, uint); 7 | function tokenToEthSwapInput(uint, uint, uint) external returns (uint); 8 | function ethToTokenSwapInput(uint, uint) external payable returns (uint); 9 | } 10 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/interfaces/V1/IUniswapV1Factory.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV1Factory { 4 | function getExchange(address) external view returns (address); 5 | } 6 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Fraxswap/periphery/libraries/SafeMath.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.6.6; 2 | 3 | // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) 4 | 5 | library SafeMath { 6 | function add(uint x, uint y) internal pure returns (uint z) { 7 | require((z = x + y) >= x, 'ds-math-add-overflow'); 8 | } 9 | 10 | function sub(uint x, uint y) internal pure returns (uint z) { 11 | require((z = x - y) <= x, 'ds-math-sub-underflow'); 12 | } 13 | 14 | function mul(uint x, uint y) internal pure returns (uint z) { 15 | require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/LeveragePool/IERC20.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity >=0.5.0; 3 | 4 | interface IERC20 { 5 | event Approval(address indexed owner, address indexed spender, uint value); 6 | event Transfer(address indexed from, address indexed to, uint value); 7 | 8 | function name() external view returns (string memory); 9 | function symbol() external view returns (string memory); 10 | function decimals() external view returns (uint8); 11 | function totalSupply() external view returns (uint); 12 | function balanceOf(address owner) external view returns (uint); 13 | function allowance(address owner, address spender) external view returns (uint); 14 | 15 | function approve(address spender, uint value) external returns (bool); 16 | function transfer(address to, uint value) external returns (bool); 17 | function transferFrom(address from, address to, uint value) external returns (bool); 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/LeveragePool/TestERC20.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 5 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 6 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; 7 | import "@openzeppelin/contracts/utils/Pausable.sol"; 8 | import "@openzeppelin/contracts/access/Ownable.sol"; 9 | import "@openzeppelin/contracts/access/AccessControl.sol"; 10 | 11 | contract TestERC20 is ERC20, ERC20Burnable, Ownable { 12 | constructor() ERC20("TestERC20", "TestERC20") Ownable(msg.sender) {} 13 | 14 | function mint(address to, uint256 amount) external onlyOwner { 15 | _mint(to, amount); 16 | } 17 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Math/Babylonian.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // computes square roots using the babylonian method 5 | // https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method 6 | library Babylonian { 7 | function sqrt(uint y) internal pure returns (uint z) { 8 | if (y > 3) { 9 | z = y; 10 | uint x = y / 2 + 1; 11 | while (x < z) { 12 | z = x; 13 | x = (y / x + x) / 2; 14 | } 15 | } else if (y != 0) { 16 | z = 1; 17 | } 18 | // else z = 0 19 | } 20 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Math/MagnitudesAndPowers.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // https://ethereum.stackexchange.com/a/69590 5 | library MagnitudesAndPowers { 6 | 7 | function magnitude (uint x) public pure returns (uint) { 8 | require (x > 0); 9 | 10 | uint a = 0; 11 | uint b = 77; 12 | 13 | while (b > a) { 14 | uint m = a + b + 1 >> 1; 15 | if (x >= pow10 (m)) a = m; 16 | else b = m - 1; 17 | } 18 | 19 | return a; 20 | } 21 | 22 | function pow10 (uint x) private pure returns (uint) { 23 | uint result = 1; 24 | uint y = 10; 25 | while (x > 0) { 26 | if (x % 2 == 1) { 27 | result *= y; 28 | x -= 1; 29 | } else { 30 | y *= y; 31 | x >>= 1; 32 | } 33 | } 34 | return result; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Math/UQ112x112.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) 5 | 6 | // range: [0, 2**112 - 1] 7 | // resolution: 1 / 2**112 8 | 9 | library UQ112x112 { 10 | uint224 constant Q112 = 2**112; 11 | 12 | // encode a uint112 as a UQ112x112 13 | function encode(uint112 y) internal pure returns (uint224 z) { 14 | z = uint224(y) * Q112; // never overflows 15 | } 16 | 17 | // divide a UQ112x112 by a uint112, returning a UQ112x112 18 | function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { 19 | z = x / uint224(y); 20 | } 21 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/IAMO.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IAMO { 6 | function dollarBalances() external view returns (uint256 frax_val_e18, uint256 collat_val_e18); 7 | } 8 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/ICrossChainAMO.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ICrossChainAMO { 5 | function allDollarBalances() external view returns (uint256 frax_val_e18, uint256 fxs_val_e18, uint256 collat_val_e18, uint256 total_val_e18); 6 | } 7 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/Lending_AMOs/aave/IAAVE_aUSDC_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import '../../../ERC20/IERC20.sol'; 4 | 5 | // Original at https://etherscan.io/address/0xbCe3076b0d8EB2f640D4089A4929fE8c1a438213#code 6 | // Address [0xBcca60bB61934080951369a648Fb03DF4F96263C] used is a proxy 7 | // Some functions were omitted for brevity. See the contract for details 8 | 9 | interface IAAVE_aUSDC_Partial is IERC20 { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/Lending_AMOs/aave/IScaledBalanceToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity >=0.8.0; 3 | 4 | interface IScaledBalanceToken { 5 | /** 6 | * @dev Returns the scaled balance of the user. The scaled balance is the sum of all the 7 | * updated stored balance divided by the reserve's liquidity index at the moment of the update 8 | * @param user The user whose balance is calculated 9 | * @return The scaled balance of the user 10 | **/ 11 | function scaledBalanceOf(address user) external view returns (uint256); 12 | 13 | /** 14 | * @dev Returns the scaled balance of the user and the scaled total supply. 15 | * @param user The address of the user 16 | * @return The scaled balance of the user 17 | * @return The scaled balance and the scaled total supply 18 | **/ 19 | function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256); 20 | 21 | /** 22 | * @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index) 23 | * @return The scaled total supply 24 | **/ 25 | function scaledTotalSupply() external view returns (uint256); 26 | } 27 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/Lending_AMOs/aave/IStakedAave.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity >=0.6.11; 3 | 4 | import "../../../ERC20/IERC20_Detailed.sol"; 5 | 6 | interface IStakedAave is IERC20_Detailed { 7 | function COOLDOWN_SECONDS() external view returns (uint256); 8 | function getTotalRewardsBalance(address staker) external view returns (uint256); 9 | function stakersCooldowns(address staker) external view returns (uint256); 10 | function stake(address to, uint256 amount) external; 11 | function redeem(address to, uint256 amount) external; 12 | function cooldown() external; 13 | function claimRewards(address to, uint256 amount) external; 14 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/Lending_AMOs/frax-lend/IFraxLendPairDeployer_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: ISC 2 | 3 | pragma solidity >=0.6.11; 4 | pragma experimental ABIEncoderV2; 5 | 6 | 7 | interface IFraxLendPairDeployer_Partial { 8 | function deploy( 9 | address _asset, 10 | address _collateral, 11 | address _oracleTop, 12 | address _oracleDiv, 13 | uint256 _oracleNormalization, 14 | address _rateContract, 15 | bytes calldata _rateInitCallData 16 | ) external returns (address cloneAddress); 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/balancer/IAuraDeposit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IAuraDeposit { 5 | function allowance ( address owner, address spender ) external view returns ( uint256 ); 6 | function approve ( address spender, uint256 amount ) external returns ( bool ); 7 | function balanceOf ( address account ) external view returns ( uint256 ); 8 | function burn ( address _from, uint256 _amount ) external; 9 | function decimals ( ) external view returns ( uint8 ); 10 | function decreaseAllowance ( address spender, uint256 subtractedValue ) external returns ( bool ); 11 | function increaseAllowance ( address spender, uint256 addedValue ) external returns ( bool ); 12 | function mint ( address _to, uint256 _amount ) external; 13 | function name ( ) external view returns ( string memory ); 14 | function operator ( ) external view returns ( address ); 15 | function symbol ( ) external view returns ( string memory ); 16 | function totalSupply ( ) external view returns ( uint256 ); 17 | function transfer ( address recipient, uint256 amount ) external returns ( bool ); 18 | function transferFrom ( address sender, address recipient, uint256 amount ) external returns ( bool ); 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/bunni/IBalancerOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IBalancerOracle { 5 | function ago ( ) external view returns ( uint56 ); 6 | function balancerTwapOracle ( ) external view returns ( address ); 7 | function getPrice ( ) external view returns ( uint256 price ); 8 | function minPrice ( ) external view returns ( uint128 ); 9 | function multiplier ( ) external view returns ( uint16 ); 10 | function owner ( ) external view returns ( address ); 11 | function secs ( ) external view returns ( uint56 ); 12 | function setParams ( uint16 multiplier_, uint56 secs_, uint56 ago_, uint128 minPrice_ ) external; 13 | function transferOwnership ( address newOwner ) external; 14 | } 15 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/bunni/IBunniLens.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../../Uniswap_V3/IUniswapV3Pool.sol"; 5 | 6 | interface IBunniLens { 7 | struct BunniKey { 8 | IUniswapV3Pool pool; 9 | int24 tickLower; 10 | int24 tickUpper; 11 | } 12 | 13 | function getReserves (BunniKey calldata key) external view returns (uint112 reserve0, uint112 reserve1); 14 | function hub () external view returns (address); 15 | function pricePerFullShare (BunniKey calldata key) external view returns (uint128 liquidity, uint256 amount0, uint256 amount1); 16 | } 17 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/bunni/IBunniMinter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IBunniMinter { 5 | function allowed_to_mint_for ( address minter, address user ) external view returns ( bool ); 6 | function getGaugeController ( ) external view returns ( address ); 7 | function getMinterApproval ( address minter, address user ) external view returns ( bool ); 8 | function getToken ( ) external view returns ( address ); 9 | function getTokenAdmin ( ) external view returns ( address ); 10 | function mint ( address gauge ) external returns ( uint256 ); 11 | function mintFor ( address gauge, address user ) external returns ( uint256 ); 12 | function mintMany ( address[] memory gauges ) external returns ( uint256 ); 13 | function mintManyFor ( address[] memory gauges, address user ) external returns ( uint256 ); 14 | function mint_for ( address gauge, address user ) external; 15 | function mint_many ( address[8] memory gauges ) external; 16 | function minted ( address user, address gauge ) external view returns ( uint256 ); 17 | function setMinterApproval ( address minter, bool approval ) external; 18 | function toggle_approve_mint ( address minter ) external; 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/bunni/IBunniTokenLP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IBunniTokenLP { 5 | function DOMAIN_SEPARATOR () external view returns (bytes32); 6 | function allowance (address, address) external view returns (uint256); 7 | function approve (address spender, uint256 amount) external returns (bool); 8 | function balanceOf (address) external view returns (uint256); 9 | function burn (address from, uint256 amount) external; 10 | function decimals () external view returns (uint8); 11 | function hub () external view returns (address); 12 | function mint (address to, uint256 amount) external; 13 | function name () external view returns (string memory); 14 | function nonces (address) external view returns (uint256); 15 | function permit (address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; 16 | function pool () external view returns (address); 17 | function symbol () external view returns (string memory); 18 | function tickLower () external view returns (int24); 19 | function tickUpper () external view returns (int24); 20 | function totalSupply () external view returns (uint256); 21 | function transfer (address to, uint256 amount) external returns (bool); 22 | function transferFrom (address from, address to, uint256 amount) external returns (bool); 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/compound/IcUSDC_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import '../../ERC20/IERC20.sol'; 4 | 5 | // Original at https://etherscan.io/address/0x39aa39c021dfbae8fac545936693ac917d5e7563#code 6 | // Some functions were omitted for brevity. See the contract for details 7 | // https://compound.finance/docs/ctokens 8 | interface IcUSDC_Partial is IERC20 { 9 | function mint(uint mintAmount) external returns (uint); 10 | 11 | // redeemAmount = # of cUSDC 12 | function redeem(uint redeemAmount) external returns (uint); 13 | 14 | // redeemAmount = # of USDC 15 | function redeemUnderlying(uint redeemAmount) external returns (uint); 16 | 17 | // Multiply this by the E8 balance of cUSDC, then divide the product by E16 18 | function exchangeRateStored() external view returns (uint); 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/convex/IConvexStakingWrapperFraxWithEarned.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | import "./IConvexStakingWrapperFrax.sol"; 5 | 6 | interface IConvexStakingWrapperFraxWithEarned is IConvexStakingWrapperFrax { 7 | struct EarnedData { 8 | address token; 9 | uint256 amount; 10 | } 11 | 12 | function earned(address _account) external view returns (EarnedData[] memory claimable); 13 | } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/convex/IDepositToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IDepositToken { 5 | function allowance(address owner, address spender) external view returns (uint256); 6 | function approve(address spender, uint256 amount) external returns (bool); 7 | function balanceOf(address account) external view returns (uint256); 8 | function burn(address _from, uint256 _amount) external; 9 | function decimals() external view returns (uint8); 10 | function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); 11 | function increaseAllowance(address spender, uint256 addedValue) external returns (bool); 12 | function mint(address _to, uint256 _amount) external; 13 | function name() external view returns (string memory); 14 | function operator() external view returns (address); 15 | function symbol() external view returns (string memory); 16 | function totalSupply() external view returns (uint256); 17 | function transfer(address recipient, uint256 amount) external returns (bool); 18 | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/curve/I2poolToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface I2poolToken { 5 | function decimals() external view returns (uint256); 6 | function transfer(address _to, uint256 _value) external returns (bool); 7 | function transferFrom(address _from, address _to, uint256 _value) external returns (bool); 8 | function approve(address _spender, uint256 _value) external returns (bool); 9 | function increaseAllowance(address _spender, uint256 _added_value) external returns (bool); 10 | function decreaseAllowance(address _spender, uint256 _subtracted_value) external returns (bool); 11 | function mint(address _to, uint256 _value) external returns (bool); 12 | function burnFrom(address _to, uint256 _value) external returns (bool); 13 | function set_minter(address _minter) external; 14 | function set_name(string memory _name, string memory _symbol) external; 15 | function name() external view returns (string memory); 16 | function symbol() external view returns (string memory); 17 | function balanceOf(address arg0) external view returns (uint256); 18 | function allowance(address arg0, address arg1) external view returns (uint256); 19 | function totalSupply() external view returns (uint256); 20 | function minter() external view returns (address); 21 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/curve/I3poolToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface I3poolToken { 5 | function decimals() external view returns (uint256); 6 | function transfer(address _to, uint256 _value) external returns (bool); 7 | function transferFrom(address _from, address _to, uint256 _value) external returns (bool); 8 | function approve(address _spender, uint256 _value) external returns (bool); 9 | function increaseAllowance(address _spender, uint256 _added_value) external returns (bool); 10 | function decreaseAllowance(address _spender, uint256 _subtracted_value) external returns (bool); 11 | function mint(address _to, uint256 _value) external returns (bool); 12 | function burnFrom(address _to, uint256 _value) external returns (bool); 13 | function set_minter(address _minter) external; 14 | function set_name(string memory _name, string memory _symbol) external; 15 | function name() external view returns (string memory); 16 | function symbol() external view returns (string memory); 17 | function balanceOf(address arg0) external view returns (uint256); 18 | function allowance(address arg0, address arg1) external view returns (uint256); 19 | function totalSupply() external view returns (uint256); 20 | function minter() external view returns (address); 21 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap/pool/IKyberPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity >=0.8.0; 3 | 4 | import { IPoolActions } from './IPoolActions.sol'; 5 | import { IPoolEvents } from './IPoolEvents.sol'; 6 | import { IPoolStorage } from './IPoolStorage.sol'; 7 | 8 | interface IKyberPool is IPoolActions, IPoolEvents, IPoolStorage {} -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap/position_manager/ITickFeesReader.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ITickFeesReader { 5 | function getAllTicks ( address pool ) external view returns ( int24[] memory allTicks ); 6 | function getNearestInitializedTicks ( address pool, int24 tick ) external view returns ( int24 previous, int24 next ); 7 | function getTicksInRange ( address pool, int24 startTick, uint32 length ) external view returns ( int24[] memory allTicks ); 8 | function getTotalFeesOwedToPosition ( address posManager, address pool, uint256 tokenId ) external view returns ( uint256 token0Owed, uint256 token1Owed ); 9 | function getTotalRTokensOwedToPosition ( address posManager, address pool, uint256 tokenId ) external view returns ( uint256 rTokenOwed ); 10 | } 11 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap/position_manager/KyberMathConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Contains constants needed for math libraries 5 | library KyberMathConstants { 6 | uint256 internal constant TWO_FEE_UNITS = 200_000; 7 | uint256 internal constant TWO_POW_96 = 2**96; 8 | uint128 internal constant MIN_LIQUIDITY = 100000; 9 | uint8 internal constant RES_96 = 96; 10 | uint24 internal constant BPS = 10000; 11 | uint24 internal constant FEE_UNITS = 100000; 12 | // it is strictly less than 5% price movement if jumping MAX_TICK_DISTANCE ticks 13 | int24 internal constant MAX_TICK_DISTANCE = 480; 14 | // max number of tick travel when inserting if data changes 15 | uint256 internal constant MAX_TICK_TRAVEL = 10; 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap/router/ISwapCallback.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Callback for IPool#swap 5 | /// @notice Any contract that calls IPool#swap must implement this interface 6 | interface ISwapCallback { 7 | /// @notice Called to `msg.sender` after swap execution of IPool#swap. 8 | /// @dev This function's implementation must pay tokens owed to the pool for the swap. 9 | /// The caller of this method must be checked to be a Pool deployed by the canonical Factory. 10 | /// deltaQty0 and deltaQty1 can both be 0 if no tokens were swapped. 11 | /// @param deltaQty0 The token0 quantity that was sent (negative) or must be received (positive) by the pool by 12 | /// the end of the swap. If positive, the callback must send deltaQty0 of token0 to the pool. 13 | /// @param deltaQty1 The token1 quantity that was sent (negative) or must be received (positive) by the pool by 14 | /// the end of the swap. If positive, the callback must send deltaQty1 of token1 to the pool. 15 | /// @param data Data passed through by the caller via the IPool#swap call 16 | function swapCallback( 17 | int256 deltaQty0, 18 | int256 deltaQty1, 19 | bytes calldata data 20 | ) external; 21 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/IPool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | import {IPoolActions} from './pool/IPoolActions.sol'; 5 | import {IPoolEvents} from './pool/IPoolEvents.sol'; 6 | import {IPoolStorage} from './pool/IPoolStorage.sol'; 7 | 8 | interface IPool is IPoolActions, IPoolEvents, IPoolStorage {} 9 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/ITickFeesReader.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ITickFeesReader { 5 | function getAllTicks ( address pool ) external view returns ( int24[] memory allTicks ); 6 | function getNearestInitializedTicks ( address pool, int24 tick ) external view returns ( int24 previous, int24 next ); 7 | function getTicksInRange ( address pool, int24 startTick, uint32 length ) external view returns ( int24[] memory allTicks ); 8 | function getTotalFeesOwedToPosition ( address posManager, address pool, uint256 tokenId ) external view returns ( uint256 token0Owed, uint256 token1Owed ); 9 | function getTotalRTokensOwedToPosition ( address posManager, address pool, uint256 tokenId ) external view returns ( uint256 rTokenOwed ); 10 | } 11 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/IWETHV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import {IERC20 as IERC20Duplicate} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; 5 | 6 | /// @title Interface for WETH 7 | interface IWETH is IERC20Duplicate { 8 | /// @notice Deposit ether to get wrapped ether 9 | function deposit() external payable; 10 | 11 | /// @notice Withdraw wrapped ether to get ether 12 | function withdraw(uint256) external; 13 | } 14 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/callback/IFlashCallback.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Callback for IPool#flash 5 | /// @notice Any contract that calls IPool#flash must implement this interface 6 | interface IFlashCallback { 7 | /// @notice Called to `msg.sender` after flash loaning to the recipient from IPool#flash. 8 | /// @dev This function's implementation must send the loaned amounts with computed fee amounts 9 | /// The caller of this method must be checked to be a Pool deployed by the canonical Factory. 10 | /// @param feeQty0 The token0 fee to be sent to the pool. 11 | /// @param feeQty1 The token1 fee to be sent to the pool. 12 | /// @param data Data passed through by the caller via the IPool#flash call 13 | function flashCallback( 14 | uint256 feeQty0, 15 | uint256 feeQty1, 16 | bytes calldata data 17 | ) external; 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/callback/IMintCallback.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Callback for IPool#mint 5 | /// @notice Any contract that calls IPool#mint must implement this interface 6 | interface IMintCallback { 7 | /// @notice Called to `msg.sender` after minting liquidity via IPool#mint. 8 | /// @dev This function's implementation must send pool tokens to the pool for the minted LP tokens. 9 | /// The caller of this method must be checked to be a Pool deployed by the canonical Factory. 10 | /// @param deltaQty0 The token0 quantity to be sent to the pool. 11 | /// @param deltaQty1 The token1 quantity to be sent to the pool. 12 | /// @param data Data passed through by the caller via the IPool#mint call 13 | function mintCallback( 14 | uint256 deltaQty0, 15 | uint256 deltaQty1, 16 | bytes calldata data 17 | ) external; 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/callback/ISwapCallback.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Callback for IPool#swap 5 | /// @notice Any contract that calls IPool#swap must implement this interface 6 | interface ISwapCallback { 7 | /// @notice Called to `msg.sender` after swap execution of IPool#swap. 8 | /// @dev This function's implementation must pay tokens owed to the pool for the swap. 9 | /// The caller of this method must be checked to be a Pool deployed by the canonical Factory. 10 | /// deltaQty0 and deltaQty1 can both be 0 if no tokens were swapped. 11 | /// @param deltaQty0 The token0 quantity that was sent (negative) or must be received (positive) by the pool by 12 | /// the end of the swap. If positive, the callback must send deltaQty0 of token0 to the pool. 13 | /// @param deltaQty1 The token1 quantity that was sent (negative) or must be received (positive) by the pool by 14 | /// the end of the swap. If positive, the callback must send deltaQty1 of token1 to the pool. 15 | /// @param data Data passed through by the caller via the IPool#swap call 16 | function swapCallback( 17 | int256 deltaQty0, 18 | int256 deltaQty1, 19 | bytes calldata data 20 | ) external; 21 | } 22 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/libraries/LiqDeltaMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Contains helper function to add or remove uint128 liquidityDelta to uint128 liquidity 5 | library LiqDeltaMath { 6 | function applyLiquidityDelta( 7 | uint128 liquidity, 8 | uint128 liquidityDelta, 9 | bool isAddLiquidity 10 | ) internal pure returns (uint128) { 11 | return isAddLiquidity ? liquidity + liquidityDelta : liquidity - liquidityDelta; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/libraries/MathConstants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Contains constants needed for math libraries 5 | library MathConstants { 6 | uint256 internal constant TWO_FEE_UNITS = 200_000; 7 | uint256 internal constant TWO_POW_96 = 2 ** 96; 8 | uint128 internal constant MIN_LIQUIDITY = 100; 9 | uint8 internal constant RES_96 = 96; 10 | uint24 internal constant FEE_UNITS = 100000; 11 | // it is strictly less than 5% price movement if jumping MAX_TICK_DISTANCE ticks 12 | int24 internal constant MAX_TICK_DISTANCE = 480; 13 | // max number of tick travel when inserting if data changes 14 | uint256 internal constant MAX_TICK_TRAVEL = 10; 15 | } 16 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/libraries/QuadMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | library QuadMath { 5 | // our equation is ax^2 - 2bx + c = 0, where a, b and c > 0 6 | // the qudratic formula to obtain the smaller root is (2b - sqrt((2*b)^2 - 4ac)) / 2a 7 | // which can be simplified to (b - sqrt(b^2 - ac)) / a 8 | function getSmallerRootOfQuadEqn( 9 | uint256 a, 10 | uint256 b, 11 | uint256 c 12 | ) internal pure returns (uint256 smallerRoot) { 13 | smallerRoot = (b - sqrt(b * b - a * c)) / a; 14 | } 15 | 16 | // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) 17 | function sqrt(uint256 y) internal pure returns (uint256 z) { 18 | unchecked { 19 | if (y > 3) { 20 | z = y; 21 | uint256 x = y / 2 + 1; 22 | while (x < z) { 23 | z = x; 24 | x = (y / x + x) / 2; 25 | } 26 | } else if (y != 0) { 27 | z = 1; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/libraries/ReinvestmentMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | import {MathConstants as C} from './MathConstants.sol'; 5 | import {FullMath} from './FullMath.sol'; 6 | 7 | /// @title Contains helper function to calculate the number of reinvestment tokens to be minted 8 | library ReinvestmentMath { 9 | /// @dev calculate the mint amount with given reinvestL, reinvestLLast, baseL and rTotalSupply 10 | /// contribution of lp to the increment is calculated by the proportion of baseL with reinvestL + baseL 11 | /// then rMintQty is calculated by mutiplying this with the liquidity per reinvestment token 12 | /// rMintQty = rTotalSupply * (reinvestL - reinvestLLast) / reinvestLLast * baseL / (baseL + reinvestL) 13 | function calcrMintQty( 14 | uint256 reinvestL, 15 | uint256 reinvestLLast, 16 | uint128 baseL, 17 | uint256 rTotalSupply 18 | ) internal pure returns (uint256 rMintQty) { 19 | uint256 lpContribution = FullMath.mulDivFloor( 20 | baseL, 21 | reinvestL - reinvestLLast, 22 | baseL + reinvestL 23 | ); 24 | rMintQty = FullMath.mulDivFloor(rTotalSupply, lpContribution, reinvestLLast); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/periphery/IMulticall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | pragma abicoder v2; 4 | 5 | /// @title Multicall interface 6 | /// @notice Enables calling multiple methods in a single call to the contract 7 | interface IMulticall { 8 | /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed 9 | /// @dev The `msg.value` should not be trusted for any method callable from multicall. 10 | /// @param data The encoded function data for each of the calls to make to this contract 11 | /// @return results The results from each of the calls passed in via data 12 | function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); 13 | } 14 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/periphery/INonfungibleTokenPositionDescriptor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import './IBasePositionManager.sol'; 5 | 6 | /// @title Describes position NFT tokens via URI 7 | interface INonfungibleTokenPositionDescriptor { 8 | /// @notice Produces the URI describing a particular token ID for a position manager 9 | /// @dev Note this URI may be a data: URI with the JSON contents directly inlined 10 | /// @param positionManager The position manager for which to describe the token 11 | /// @param tokenId The ID of the token for which to produce a description, which may not be valid 12 | /// @return The URI of the ERC721-compliant metadata 13 | function tokenURI(IBasePositionManager positionManager, uint256 tokenId) 14 | external 15 | view 16 | returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/kyberswap_v2/periphery/IRouterTokenHelperWithFee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import './IRouterTokenHelper.sol'; 5 | 6 | interface IRouterTokenHelperWithFee is IRouterTokenHelper { 7 | /// @notice Unwraps the contract's WETH balance and sends it to recipient as ETH, with a percentage between 8 | /// 0 (exclusive), and 1 (inclusive) going to feeRecipient 9 | /// @dev The minAmount parameter prevents malicious contracts from stealing WETH from users. 10 | function unwrapWethWithFee( 11 | uint256 minAmount, 12 | address recipient, 13 | uint256 feeUnits, 14 | address feeRecipient 15 | ) external payable; 16 | 17 | /// @notice Transfers the full amount of a token held by this contract to recipient, with a percentage between 18 | /// 0 (exclusive) and 1 (inclusive) going to feeRecipient 19 | /// @dev The minAmount parameter prevents malicious contracts from stealing the token from users 20 | function transferAllTokensWithFee( 21 | address token, 22 | uint256 minAmount, 23 | address recipient, 24 | uint256 feeBips, 25 | address feeRecipient 26 | ) external payable; 27 | } 28 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/optimism/IL1StandardBridge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | 5 | interface IL1StandardBridge { 6 | function depositERC20(address _l1Token, address _l2Token, uint256 _amount, uint32 _l2Gas, bytes memory _data) external; 7 | function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _l2Gas, bytes memory _data) external; 8 | function depositETH(uint32 _l2Gas, bytes memory _data) external; 9 | function depositETHTo(address _to, uint32 _l2Gas, bytes memory _data) external; 10 | function deposits(address, address) external view returns (uint256); 11 | function donateETH() external; 12 | function finalizeERC20Withdrawal(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes memory _data) external; 13 | function finalizeETHWithdrawal(address _from, address _to, uint256 _amount, bytes memory _data) external; 14 | function initialize(address _l1messenger, address _l2TokenBridge) external; 15 | function l2TokenBridge() external view returns (address); 16 | function messenger() external view returns (address); 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/optimism/IL2StandardBridge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | 5 | interface IL2StandardBridge { 6 | function finalizeDeposit(address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, bytes memory _data) external; 7 | function l1TokenBridge() external view returns (address); 8 | function messenger() external view returns (address); 9 | function withdraw(address _l2Token, uint256 _amount, uint32 _l1Gas, bytes memory _data) external; 10 | function withdrawTo(address _l2Token, address _to, uint256 _amount, uint32 _l1Gas, bytes memory _data) external; 11 | } 12 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/saddle/IRootGauge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IRootGauge { 5 | struct InflationParams { 6 | uint256 rate; 7 | uint256 finish_time; 8 | } 9 | 10 | function transmit_emissions () external; 11 | function integrate_fraction (address _user) external view returns (uint256); 12 | function user_checkpoint (address _user) external returns (bool); 13 | function set_killed (bool _is_killed) external; 14 | function update_bridger () external; 15 | function initialize (address _bridger, uint256 _chain_id, string memory _name) external; 16 | function chain_id () external view returns (uint256); 17 | function bridger () external view returns (address); 18 | function factory () external view returns (address); 19 | function name () external view returns (string memory); 20 | function inflation_params () external view returns (InflationParams memory); 21 | function last_period () external view returns (uint256); 22 | function total_emissions () external view returns (uint256); 23 | function is_killed () external view returns (bool); 24 | } 25 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/sentiment/ILinearRateModel.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ILinearRateModel { 5 | function MAX_EXCESS_USAGE_RATIO ( ) external view returns ( uint256 ); 6 | function OPTIMAL_USAGE_RATIO ( ) external view returns ( uint256 ); 7 | function baseRate ( ) external view returns ( uint256 ); 8 | function getBorrowRatePerSecond ( uint256 liquidity, uint256 totalDebt ) external view returns ( uint256 ); 9 | function slope1 ( ) external view returns ( uint256 ); 10 | function slope2 ( ) external view returns ( uint256 ); 11 | } 12 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/snowball/ILPToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | interface ILPToken { 5 | function allowance(address owner, address spender) external view returns(uint256); 6 | function approve(address spender, uint256 amount) external returns(bool); 7 | function balanceOf(address account) external view returns(uint256); 8 | function burn(uint256 amount) external; 9 | function burnFrom(address account, uint256 amount) external; 10 | function decimals() external view returns(uint8); 11 | function decreaseAllowance(address spender, uint256 subtractedValue) external returns(bool); 12 | function increaseAllowance(address spender, uint256 addedValue) external returns(bool); 13 | function mint(address recipient, uint256 amount) external; 14 | function name() external view returns(string memory); 15 | function owner() external view returns(address); 16 | function renounceOwnership() external; 17 | function symbol() external view returns(string memory); 18 | function totalSupply() external view returns(uint256); 19 | function transfer(address recipient, uint256 amount) external returns(bool); 20 | function transferFrom(address sender, address recipient, uint256 amount) external returns(bool); 21 | function transferOwnership(address newOwner) external; 22 | } 23 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/temple/ITempleFraxAMMOps.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ITempleFraxAMMOps { 5 | function ammRouter() external view returns (address); 6 | function deepenLiquidity(uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin) external; 7 | function fraxToken() external view returns (address); 8 | function manager() external view returns (address); 9 | function owner() external view returns (address); 10 | function raiseIV(uint256 amount) external; 11 | function removeLiquidity(uint256 liquidity, uint256 amountAMin, uint256 amountBMin) external; 12 | function renounceOwnership() external; 13 | function setManager(address _manager) external; 14 | function templeToken() external view returns (address); 15 | function templeTreasury() external view returns (address); 16 | function templeUniswapV2Pair() external view returns (address); 17 | function transferOwnership(address newOwner) external; 18 | function treasuryManagementProxy() external view returns (address); 19 | function withdraw(address token, address to, uint256 amount) external; 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Misc_AMOs/testing/OwnerTesting.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | contract OwnerTesting { 5 | constructor () {} 6 | 7 | function owner() external view returns(address) {} 8 | function owner_address() external view returns(address) {} 9 | function controller_address() external view returns(address) {} 10 | function admin() external view returns(address) {} 11 | function timelock() external view returns(address) {} 12 | function timelock_address() external view returns(address) {} 13 | function custodian() external view returns(address) {} 14 | function custodian_address() external view returns(address) {} 15 | function rewardManagers(address tkn_addr) external view returns(address) {} 16 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Openzeppelin_Manual/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) 3 | 4 | pragma solidity >=0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | 25 | function _contextSuffixLength() internal view virtual returns (uint256) { 26 | return 0; 27 | } 28 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/AggregatorV3Interface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.0; 3 | 4 | interface AggregatorV3Interface { 5 | 6 | function decimals() external view returns (uint8); 7 | function description() external view returns (string memory); 8 | function version() external view returns (uint256); 9 | 10 | // getRoundData and latestRoundData should both raise "No data present" 11 | // if they do not have data to report, instead of returning unset values 12 | // which could be misinterpreted as actual reported values. 13 | function getRoundData(uint80 _roundId) 14 | external 15 | view 16 | returns ( 17 | uint80 roundId, 18 | int256 answer, 19 | uint256 startedAt, 20 | uint256 updatedAt, 21 | uint80 answeredInRound 22 | ); 23 | function latestRoundData() 24 | external 25 | view 26 | returns ( 27 | uint80 roundId, 28 | int256 answer, 29 | uint256 startedAt, 30 | uint256 updatedAt, 31 | uint80 answeredInRound 32 | ); 33 | 34 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/ChainlinkETHUSDPriceConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./AggregatorV3Interface.sol"; 5 | 6 | contract ChainlinkETHUSDPriceConsumer { 7 | 8 | AggregatorV3Interface internal priceFeed; 9 | 10 | 11 | constructor () public { 12 | priceFeed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419); 13 | } 14 | 15 | /** 16 | * Returns the latest price 17 | */ 18 | function getLatestPrice() public view returns (int) { 19 | (uint80 roundID, int price, , uint256 updatedAt, uint80 answeredInRound) = priceFeed.latestRoundData(); 20 | require(price >= 0 && updatedAt!= 0 && answeredInRound >= roundID, "Invalid chainlink price"); 21 | 22 | return price; 23 | } 24 | 25 | function getDecimals() public view returns (uint8) { 26 | return priceFeed.decimals(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/ChainlinkFXSUSDPriceConsumer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./AggregatorV3Interface.sol"; 5 | 6 | contract ChainlinkFXSUSDPriceConsumer { 7 | 8 | AggregatorV3Interface internal priceFeed; 9 | 10 | 11 | constructor () public { 12 | priceFeed = AggregatorV3Interface(0x6Ebc52C8C1089be9eB3945C4350B68B8E4C2233f); 13 | } 14 | 15 | /** 16 | * Returns the latest price 17 | */ 18 | function getLatestPrice() public view returns (int) { 19 | (uint80 roundID, int price, , uint256 updatedAt, uint80 answeredInRound) = priceFeed.latestRoundData(); 20 | require(price >= 0 && updatedAt!= 0 && answeredInRound >= roundID, "Invalid chainlink price"); 21 | 22 | return price; 23 | } 24 | 25 | function getDecimals() public view returns (uint8) { 26 | return priceFeed.decimals(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/ICrossChainOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface ICrossChainOracle { 5 | // Returns in USD E6 6 | function getPrice(address token_address) external view returns (uint256 token_price); 7 | } 8 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/IPricePerShareOptions.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IPricePerShareOptions { 5 | // Compound-style [Comp, Cream, Rari, Scream] 6 | // Multiplied by 1e18 7 | function exchangeRateStored() external view returns (uint256); 8 | 9 | // Curve-style [Curve, Convex, NOT StakeDAO] 10 | // In 1e18 11 | function get_virtual_price() external view returns (uint256); 12 | 13 | // SaddleD4Pool (SwapFlashLoan) 14 | function getVirtualPrice() external view returns (uint256); 15 | 16 | // StakeDAO 17 | function getPricePerFullShare() external view returns (uint256); 18 | 19 | // Yearn Vault 20 | function pricePerShare() external view returns (uint256); 21 | } 22 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracleExtra_SDT_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracleExtra.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracleExtra_SDT_WETH is UniswapPairOracleExtra { 9 | constructor ( 10 | address pair_address, 11 | address owner_address, 12 | address timelock_address, 13 | string memory description, 14 | address address_to_consult 15 | ) 16 | UniswapPairOracleExtra(pair_address, owner_address, timelock_address, description, address_to_consult) 17 | {} 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_6DEC_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_6DEC_WETH is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FRAX_6DEC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FRAX_6DEC is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FRAX_FXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FRAX_FXS is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FRAX_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FRAX_USDC is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FRAX_USDT.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FRAX_USDT is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FRAX_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FRAX_WETH is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FXS_6DEC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FXS_6DEC is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FXS_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FXS_USDC is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FXS_USDT.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FXS_USDT is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_FXS_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_FXS_WETH is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_USDC_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_USDC_WETH is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Oracle/Variants/UniswapPairOracle_USDT_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import '../UniswapPairOracle.sol'; 5 | 6 | // Fixed window oracle that recomputes the average price for the entire period once every period 7 | // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period 8 | contract UniswapPairOracle_USDT_WETH is UniswapPairOracle { 9 | constructor (address factory, address tokenA, address tokenB, address owner_address, address timelock_address) 10 | UniswapPairOracle(factory, tokenA, tokenB, owner_address, timelock_address) 11 | {} 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Proxy/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 7 | */ 8 | interface IBeacon { 9 | /** 10 | * @dev Must return an address that can be used as a delegate call target. 11 | * 12 | * {BeaconProxy} will check that this address is a contract. 13 | */ 14 | function implementation() external view returns (address); 15 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/ILockReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | interface ILockReceiver { 5 | function beforeLockTransfer( 6 | address _sender, 7 | address _receiver, 8 | uint256 _lockId, 9 | bytes calldata _data 10 | ) external returns (bytes4); 11 | 12 | function onLockReceived( 13 | address _sender, 14 | address _receiver, 15 | uint256 _lockId, 16 | bytes calldata _data 17 | ) external returns (bytes4); 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/IStakingRewardsDual.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IStakingRewardsDual { 6 | // Views 7 | 8 | function earned(address account) external view returns (uint256, uint256); 9 | 10 | function getRewardForDuration() external view returns (uint256, uint256); 11 | 12 | function totalSupply() external view returns (uint256); 13 | 14 | function balanceOf(address account) external view returns (uint256); 15 | 16 | // Mutative 17 | 18 | function stake(uint256 amount) external; 19 | 20 | function withdraw(uint256 amount) external; 21 | 22 | function getReward() external; 23 | 24 | //function exit() external; 25 | } 26 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Owned.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | // https://docs.synthetix.io/contracts/Owned 5 | contract Owned { 6 | address public owner; 7 | address public nominatedOwner; 8 | 9 | constructor (address _owner) public { 10 | require(_owner != address(0), "Owner address cannot be 0"); 11 | owner = _owner; 12 | emit OwnerChanged(address(0), _owner); 13 | } 14 | 15 | function nominateNewOwner(address _owner) external onlyOwner { 16 | nominatedOwner = _owner; 17 | emit OwnerNominated(_owner); 18 | } 19 | 20 | function acceptOwnership() external { 21 | require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); 22 | emit OwnerChanged(owner, nominatedOwner); 23 | owner = nominatedOwner; 24 | nominatedOwner = address(0); 25 | } 26 | 27 | modifier onlyOwner { 28 | require(msg.sender == owner, "Only the contract owner may perform this action"); 29 | _; 30 | } 31 | 32 | event OwnerNominated(address newOwner); 33 | event OwnerChanged(address oldOwner, address newOwner); 34 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Owned_Proxy.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | // https://docs.synthetix.io/contracts/Owned 5 | contract Owned_Proxy { 6 | address public owner; 7 | address public nominatedOwner; 8 | 9 | function nominateNewOwner(address _owner) external onlyOwner { 10 | nominatedOwner = _owner; 11 | emit OwnerNominated(_owner); 12 | } 13 | 14 | function acceptOwnership() external { 15 | require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); 16 | emit OwnerChanged(owner, nominatedOwner); 17 | owner = nominatedOwner; 18 | nominatedOwner = address(0); 19 | } 20 | 21 | modifier onlyOwner { 22 | require(msg.sender == owner, "Only the contract owner may perform this action"); 23 | _; 24 | } 25 | 26 | event OwnerNominated(address newOwner); 27 | event OwnerChanged(address oldOwner, address newOwner); 28 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/RewardsDistributionRecipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | // Inheritance 5 | import "./Owned.sol"; 6 | 7 | 8 | // https://docs.synthetix.io/contracts/RewardsDistributionRecipient 9 | abstract contract RewardsDistributionRecipient is Owned { 10 | address public rewardsDistribution; 11 | 12 | //function notifyRewardAmount(uint256 reward) external virtual; 13 | 14 | modifier onlyRewardsDistribution() { 15 | require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract"); 16 | _; 17 | } 18 | 19 | function setRewardsDistribution(address _rewardsDistribution) external onlyOwner { 20 | rewardsDistribution = _rewardsDistribution; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Variants/CommunalFarm_SaddleD4.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../CommunalFarm.sol"; 6 | 7 | contract CommunalFarm_SaddleD4 is CommunalFarm { 8 | constructor ( 9 | address _owner, 10 | address _stakingToken, 11 | string[] memory _rewardSymbols, 12 | address[] memory _rewardTokens, 13 | address[] memory _rewardManagers, 14 | uint256[] memory _rewardRates 15 | ) 16 | CommunalFarm(_owner, _stakingToken, _rewardSymbols, _rewardTokens, _rewardManagers, _rewardRates) 17 | {} 18 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Variants/FraxCCFarmV2_ArbiCurveVSTFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxCrossChainFarmV2.sol"; 5 | 6 | contract FraxCCFarmV2_ArbiCurveVSTFRAX is FraxCrossChainFarmV2 { 7 | constructor ( 8 | address _owner, 9 | address _bridge_token, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarmV2(_owner, _bridge_token, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Variants/FraxCCFarmV2_SaddleArbUSDv2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxCrossChainFarmV2.sol"; 5 | 6 | contract FraxCCFarmV2_SaddleArbUSDv2 is FraxCrossChainFarmV2 { 7 | constructor ( 8 | address _owner, 9 | address _bridge_token, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarmV2(_owner, _bridge_token, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Variants/FraxCCFarmV3_ArbiSaddleL2D4.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxCrossChainFarmV3_ERC20.sol"; 5 | 6 | contract FraxCCFarmV3_ArbiSaddleL2D4 is FraxCrossChainFarmV3_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address _rewardsToken0, 10 | address _rewardsToken1, 11 | address _stakingToken, 12 | address _frax_address, 13 | address _timelock_address, 14 | address _rewarder_address 15 | ) 16 | FraxCrossChainFarmV3_ERC20(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Staking/Variants/FraxCCFarmV4_cvxLP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxCrossChainFarmV4_ERC20.sol"; 5 | 6 | contract FraxCCFarmV4_cvxLP is FraxCrossChainFarmV4_ERC20 { 7 | string public farm_type = "FraxCCFarmV4_cvxLP"; 8 | 9 | constructor ( 10 | address _owner, 11 | address[] memory _rewardTokens, 12 | address _stakingToken, 13 | address _fraxAddress, 14 | address _timelockAddress, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarmV4_ERC20(_owner, _rewardTokens, _stakingToken, _fraxAddress, _timelockAddress, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap/Interfaces/IUniswapV2Callee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | interface IUniswapV2Callee { 5 | function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; 6 | } 7 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap/Interfaces/IUniswapV2ERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | interface IUniswapV2ERC20 { 5 | event Approval(address indexed owner, address indexed spender, uint value); 6 | event Transfer(address indexed from, address indexed to, uint value); 7 | 8 | function name() external pure returns (string memory); 9 | function symbol() external pure returns (string memory); 10 | function decimals() external pure returns (uint8); 11 | function totalSupply() external view returns (uint); 12 | function balanceOf(address owner) external view returns (uint); 13 | function allowance(address owner, address spender) external view returns (uint); 14 | 15 | function approve(address spender, uint value) external returns (bool); 16 | function transfer(address to, uint value) external returns (bool); 17 | function transferFrom(address from, address to, uint value) external returns (bool); 18 | 19 | function DOMAIN_SEPARATOR() external view returns (bytes32); 20 | function PERMIT_TYPEHASH() external pure returns (bytes32); 21 | function nonces(address owner) external view returns (uint); 22 | 23 | function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; 24 | } 25 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap/Interfaces/IUniswapV2Factory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | interface IUniswapV2Factory { 5 | event PairCreated(address indexed token0, address indexed token1, address pair, uint); 6 | 7 | function feeTo() external view returns (address); 8 | function feeToSetter() external view returns (address); 9 | 10 | function getPair(address tokenA, address tokenB) external view returns (address pair); 11 | function allPairs(uint) external view returns (address pair); 12 | function allPairsLength() external view returns (uint); 13 | 14 | function createPair(address tokenA, address tokenB) external returns (address pair); 15 | 16 | function setFeeTo(address) external; 17 | function setFeeToSetter(address) external; 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/IUniswapV3Pool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | import './pool/IUniswapV3PoolImmutables.sol'; 5 | import './pool/IUniswapV3PoolState.sol'; 6 | import './pool/IUniswapV3PoolDerivedState.sol'; 7 | import './pool/IUniswapV3PoolActions.sol'; 8 | import './pool/IUniswapV3PoolOwnerActions.sol'; 9 | import './pool/IUniswapV3PoolEvents.sol'; 10 | 11 | /// @title The interface for a Uniswap V3 Pool 12 | /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform 13 | /// to the ERC20 specification 14 | /// @dev The pool interface is broken up into many smaller pieces 15 | interface IUniswapV3Pool is 16 | IUniswapV3PoolImmutables, 17 | IUniswapV3PoolState, 18 | IUniswapV3PoolDerivedState, 19 | IUniswapV3PoolActions, 20 | IUniswapV3PoolOwnerActions, 21 | IUniswapV3PoolEvents 22 | { 23 | 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/deployment_addresses.txt: -------------------------------------------------------------------------------- 1 | DEPLOYMENT ADDRESSES 2 | https://github.com/Uniswap/uniswap-v3-periphery/blob/main/deploys.md -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/libraries/FixedPoint96.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.4.0; 3 | 4 | /// @title FixedPoint96 5 | /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) 6 | /// @dev Used in SqrtPriceMath.sol 7 | library FixedPoint96 { 8 | uint8 internal constant RESOLUTION = 96; 9 | uint256 internal constant Q96 = 0x1000000000000000000000000; 10 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/periphery/interfaces/IPeripheryImmutableState.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Immutable state 5 | /// @notice Functions that return immutable state of the router 6 | interface IPeripheryImmutableState { 7 | /// @return Returns the address of the Uniswap V3 factory 8 | function factory() external view returns (address); 9 | 10 | /// @return Returns the address of WETH9 11 | function WETH9() external view returns (address); 12 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/periphery/interfaces/IPoolInitializer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.7.5; 3 | pragma abicoder v2; 4 | 5 | /// @title Creates and initializes V3 Pools 6 | /// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that 7 | /// require the pool to exist. 8 | interface IPoolInitializer { 9 | /// @notice Creates a new pool if it does not exist, then initializes if not initialized 10 | /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool 11 | /// @param token0 The contract address of token0 of the pool 12 | /// @param token1 The contract address of token1 of the pool 13 | /// @param fee The fee amount of the v3 pool for the specified token pair 14 | /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value 15 | /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary 16 | function createAndInitializePoolIfNecessary( 17 | address token0, 18 | address token1, 19 | uint24 fee, 20 | uint160 sqrtPriceX96 21 | ) external payable returns (address pool); 22 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Uniswap_V3/pool/IUniswapV3PoolOwnerActions.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | /// @title Permissioned pool actions 5 | /// @notice Contains pool methods that may only be called by the factory owner 6 | interface IUniswapV3PoolOwnerActions { 7 | /// @notice Set the denominator of the protocol's % share of the fees 8 | /// @param feeProtocol0 new protocol fee for token0 of the pool 9 | /// @param feeProtocol1 new protocol fee for token1 of the pool 10 | function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; 11 | 12 | /// @notice Collect the protocol fee accrued to the pool 13 | /// @param recipient The address to which collected protocol fees should be sent 14 | /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 15 | /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 16 | /// @return amount0 The protocol fee collected in token0 17 | /// @return amount1 The protocol fee collected in token1 18 | function collectProtocol( 19 | address recipient, 20 | uint128 amount0Requested, 21 | uint128 amount1Requested 22 | ) external returns (uint128 amount0, uint128 amount1); 23 | } 24 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Utils/BlockMiner.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | // file: BlockMinder.sol 4 | 5 | // used to "waste" blocks for truffle tests 6 | contract BlockMiner { 7 | uint256 public blocksMined; 8 | 9 | constructor () public { 10 | blocksMined = 0; 11 | } 12 | 13 | function mine() public { 14 | blocksMined += 1; 15 | } 16 | 17 | function blockTime() external view returns (uint256) { 18 | return block.timestamp; 19 | } 20 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Utils/GasHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | contract GasHelper { 5 | string private checkpointLabel; 6 | uint256 private checkpointGasLeft = 1; // Start the slot warm. 7 | 8 | function startMeasuringGas(string memory label) internal virtual { 9 | checkpointLabel = label; 10 | 11 | checkpointGasLeft = gasleft(); 12 | } 13 | 14 | function stopMeasuringGas() internal virtual returns (uint256 gasDelta) { 15 | uint256 checkpointGasLeft2 = gasleft(); 16 | 17 | // Subtract 100 to account for the warm SLOAD in startMeasuringGas. 18 | gasDelta = checkpointGasLeft - checkpointGasLeft2 - 100; 19 | 20 | emit GasUsed(string(abi.encodePacked(checkpointLabel, " Gas")), gasDelta); 21 | } 22 | 23 | event GasUsed(string key, uint val); 24 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/Utils/MigrationHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | contract MigrationHelper { 5 | address public owner; 6 | uint256 public gov_to_timelock_eta; 7 | 8 | modifier restricted() { 9 | if (msg.sender == owner) _; 10 | } 11 | 12 | constructor (address _owner) public { 13 | owner = _owner; 14 | } 15 | 16 | function setGovToTimeLockETA(uint256 _eta) public restricted { 17 | gov_to_timelock_eta = _eta; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/Utils/Migrations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | contract Migrations { 5 | address public owner; 6 | uint public last_completed_migration; 7 | 8 | modifier restricted() { 9 | if (msg.sender == owner) _; 10 | } 11 | 12 | constructor () public { 13 | owner = msg.sender; 14 | } 15 | 16 | function setCompleted(uint completed) public restricted { 17 | last_completed_migration = completed; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/contracts/mocks/MockConvexRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.10; 3 | 4 | contract MockConvexRegistry { 5 | // 6 | } -------------------------------------------------------------------------------- /src/hardhat/contracts/mocks/MockConvexVault.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.10; 3 | 4 | contract MockConvexVault { 5 | // 6 | } -------------------------------------------------------------------------------- /src/hardhat/gnosis-safe-scripts/Convex_Farm_Deployments/Step_3_RewDist_Seeding_Sync.json: -------------------------------------------------------------------------------- 1 | {"version":"1.0","chainId":"1","createdAt":1714413023000,"meta":{"name":"Transactions Batch","description":"","txBuilderVersion":"1.14.1","createdFromSafeAddress":"0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27","createdFromOwnerAddress":"","checksum":"0x0771ed3c5751f474d7dd77ae27325d5961195b0778bd2b2bd5ab5c1841c45e8b"},"transactions":[{"to":"0x278dC748edA1d8eFEf1aDFB518542612b49Fcd34","value":"0","data":null,"contractMethod":{"inputs":[{"internalType":"address","name":"_gauge_address","type":"address"},{"internalType":"bool","name":"_is_middleman","type":"bool"},{"internalType":"bool","name":"_is_active","type":"bool"}],"name":"setGaugeState","payable":false},"contractInputsValues":{"_gauge_address":"0xE2E998A68C6f1D10c41884931457B7C302C6fA97","_is_middleman":"false","_is_active":"true"}},{"to":"0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0","value":"0","data":null,"contractMethod":{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","payable":false},"contractInputsValues":{"recipient":"0xE2E998A68C6f1D10c41884931457B7C302C6fA97","amount":"1000000000000000000"}},{"to":"0xE2E998A68C6f1D10c41884931457B7C302C6fA97","value":"0","data":null,"contractMethod":{"inputs":[],"name":"sync","payable":false},"contractInputsValues":{}}]} -------------------------------------------------------------------------------- /src/hardhat/old_contracts/BAMM/Babylonian.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // computes square roots using the babylonian method 5 | // https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method 6 | library Babylonian { 7 | function sqrt(uint y) internal pure returns (uint z) { 8 | if (y > 3) { 9 | z = y; 10 | uint x = y / 2 + 1; 11 | while (x < z) { 12 | z = x; 13 | x = (y / x + x) / 2; 14 | } 15 | } else if (y != 0) { 16 | z = 1; 17 | } 18 | // else z = 0 19 | } 20 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Bridges/Boba/IDiscretionaryExitBurn.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IDiscretionaryExitBurn { 5 | function burnAndWithdraw(address _l2Token, uint256 _amount, uint32 _l1Gas, bytes calldata _data) external payable; 6 | } 7 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Bridges/Boba/IL1StandardBridge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IL1StandardBridge { 5 | function depositERC20To(address _l1Token, address _l2Token, address _to, uint256 _amount, uint32 _l2Gas, bytes calldata _data) external; 6 | } 7 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Bridges/Optimism/NOTES.txt: -------------------------------------------------------------------------------- 1 | ETH FRAX to OPTIMISM 2 | 1) (approve) ??? 3 | 2) (deposit) https://etherscan.io/tx/0x33e657c5cb4216e3f2faf69df8011b71b442a01de6be9da8abc6e4df5b5b0c28 4 | 5 | ETH FXS to OPTIMISM 6 | 1) (approve) https://etherscan.io/address/0xb37d31b2a74029b5951a2778f959282e2d518595#code 7 | 2) (deposit) https://etherscan.io/tx/0xec5c04ef260802927aa909650dca8ad654047c9d722368b9ff533281e62904af 8 | 9 | ETH USDC to OPTIMISM (Optimism Gateway) 10 | 1) (approve) https://etherscan.io/tx/0x6fc22d5e1b18d60292c6f34a2e1ba01e167484f6aa4efd0fbd4cc60e3a50b4b3 11 | 2) (DepositERC20) https://etherscan.io/tx/0x3bdf86dd4030554a764734472a3faf56dccac2814f91e0c371be6eb4b3c1224e 12 | 13 | 14 | ============================================================================== 15 | OPTIMISM FRAX to ETH 16 | 1) (approve) https://optimistic.etherscan.io/tx/0x7bf3fd22342a1bf5d5f6894ded9ca7ea34d8114d5525986a95f20fd66cc90f8d 17 | 2) (burn) https://optimistic.etherscan.io/tx/0x011e2d01134eb0f38b2b5219c7872338d10a4eacb72a7d0f7a64a53973060525 18 | 19 | OPTIMISM FXS to ETH 20 | 1) (approve) 21 | 2) (burn) 22 | 23 | OPTIMISM USDC to ETH (Optimism Gateway) 24 | 1) (withdraw) https://optimistic.etherscan.io/tx/0x15f6119bf164db156894cceb1db13de68be7455986d953567bf6beea7b7eda78 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/ERC20/Variants/CRV_DAO_ERC20_Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.6.11; 4 | 5 | import "../ERC20.sol"; 6 | 7 | contract CRV_DAO_ERC20_Mock is ERC20 { 8 | constructor () 9 | ERC20("Curve DAO Token", "CRV") 10 | {} 11 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/ERC20/Variants/FRAX3CRV_Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.6.11; 4 | 5 | import "../ERC20.sol"; 6 | 7 | contract FRAX3CRV_Mock is ERC20 { 8 | constructor () 9 | ERC20("Curve.fi Factory USD Metapool: Frax", "FRAX3CRV-f") 10 | {} 11 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/ERC20/Variants/IDLEToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../ERC20.sol"; 4 | 5 | // Mock IDLE token 6 | contract IDLEToken is ERC20("Idle", "IDLE") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/ERC20/Variants/OHM.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../ERC20.sol"; 4 | 5 | // Mock Farm token 6 | contract OHM is ERC20("Olympus", "OHM") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/ERC20/Variants/RookToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../ERC20.sol"; 4 | 5 | // Mock Rook token 6 | contract RookToken is ERC20("ROOK", "ROOK") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FPI/StakedFPI.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 5 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 6 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; 7 | import "@openzeppelin/contracts/utils/Pausable.sol"; 8 | import "@openzeppelin/contracts/access/Ownable.sol"; 9 | import "@openzeppelin/contracts/access/AccessControl.sol"; 10 | /** 11 | * Created and owned by the staking contract. 12 | * 13 | * It mints and burns OGTemple as users stake/unstake 14 | */ 15 | contract StakedFPI is ERC20, ERC20Burnable, Ownable { 16 | constructor() ERC20("StakedFPI", "sFPI") {} 17 | 18 | function mint(address to, uint256 amount) external onlyOwner { 19 | _mint(to, amount); 20 | } 21 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FXB/Curves/IFraxBond_Curve.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | interface IFraxBond_Curve { 5 | function get_total_points(uint8 curve_choice) external view returns (uint32); 6 | function get_curve_point(uint8 curve_choice, uint8 index) external view returns (uint32); 7 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/FakeCollateral_6DEC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FakeCollateral.sol"; 5 | 6 | contract FakeCollateral_6DEC is FakeCollateral { 7 | constructor ( 8 | address _creator_address, 9 | uint256 _genesis_supply, 10 | string memory _symbol, 11 | uint8 _decimals 12 | ) 13 | FakeCollateral(_creator_address, _genesis_supply, _symbol, _decimals) 14 | {} 15 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/FakeCollateral_DAI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FakeCollateral.sol"; 5 | 6 | contract FakeCollateral_DAI is FakeCollateral { 7 | constructor ( 8 | address _creator_address, 9 | uint256 _genesis_supply, 10 | string memory _symbol, 11 | uint8 _decimals 12 | ) 13 | FakeCollateral(_creator_address, _genesis_supply, _symbol, _decimals) 14 | {} 15 | } 16 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/FakeCollateral_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FakeCollateral.sol"; 5 | 6 | contract FakeCollateral_USDC is FakeCollateral { 7 | constructor ( 8 | address _creator_address, 9 | uint256 _genesis_supply, 10 | string memory _symbol, 11 | uint8 _decimals 12 | ) 13 | FakeCollateral(_creator_address, _genesis_supply, _symbol, _decimals) 14 | {} 15 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/FakeCollateral_USDT.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FakeCollateral.sol"; 5 | 6 | contract FakeCollateral_USDT is FakeCollateral { 7 | constructor ( 8 | address _creator_address, 9 | uint256 _genesis_supply, 10 | string memory _symbol, 11 | uint8 _decimals 12 | ) 13 | FakeCollateral(_creator_address, _genesis_supply, _symbol, _decimals) 14 | {} 15 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/FakeCollateral_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "./FakeCollateral.sol"; 5 | 6 | contract FakeCollateral_WETH is FakeCollateral { 7 | constructor ( 8 | address _creator_address, 9 | uint256 _genesis_supply, 10 | string memory _symbol, 11 | uint8 _decimals 12 | ) 13 | FakeCollateral(_creator_address, _genesis_supply, _symbol, _decimals) 14 | {} 15 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/FakeCollateral/note.txt: -------------------------------------------------------------------------------- 1 | Truffle doesn't really allow multiple versions of a contract to be deployed, so you have to kind of jank it and duplicate code. -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Fraxswap_OLD/DummyToken.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.4; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 5 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 6 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; 7 | import "@openzeppelin/contracts/utils/Pausable.sol"; 8 | import "@openzeppelin/contracts/access/Ownable.sol"; 9 | import "@openzeppelin/contracts/access/AccessControl.sol"; 10 | 11 | contract DummyToken is ERC20, ERC20Burnable, Ownable { 12 | constructor() ERC20("DummyToken", "DUM") {} 13 | 14 | function mint(address to, uint256 amount) external onlyOwner { 15 | _mint(to, amount); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/aurora/IERC20Locker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IERC20Locker { 5 | function admin() external view returns (address); 6 | function adminDelegatecall(address target, bytes memory data) external returns (bytes memory); 7 | function adminPause(uint256 flags) external; 8 | function adminReceiveEth() external; 9 | function adminSendEth(address destination, uint256 amount) external; 10 | function adminSstore(uint256 key, uint256 value) external; 11 | function adminTransfer(address token, address destination, uint256 amount) external; 12 | function lockToken(address ethToken, uint256 amount, string memory accountId) external; 13 | function minBlockAcceptanceHeight_() external view returns (uint64); 14 | function nearTokenFactory_() external view returns (bytes memory); 15 | function paused() external view returns (uint256); 16 | function prover_() external view returns (address); 17 | function tokenFallback(address _from, uint256 _value, bytes memory _data) external pure; 18 | function unlockToken(bytes memory proofData, uint64 proofBlockHeight) external; 19 | function usedProofs_(bytes32) external view returns (bool); 20 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/aurora/IEvmErc20V2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IEvmErc20V2 { 5 | function name() external view returns (string memory); 6 | function symbol() external view returns (string memory); 7 | function decimals() external view returns (uint8); 8 | function totalSupply() external view returns (uint256); 9 | function balanceOf(address account) external view returns (uint256); 10 | function transfer(address recipient, uint256 amount) external returns (bool); 11 | function allowance(address owner, address spender) external view returns (uint256); 12 | 13 | function setMetadata(string memory metadata_name, string memory metadata_symbol, uint8 metadata_decimals) external; 14 | function mint(address account, uint256 amount) external; 15 | function withdrawToNear(bytes memory recipient, uint256 amount) external; 16 | function withdrawToEthereum(address recipient, uint256 amount) external; 17 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/harmony/IDeposit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IDeposit { 5 | function deposit(uint256 amount) payable external; 6 | function owner() external view returns(address); 7 | function payout() external; 8 | function renounceOwnership() external; 9 | function transferOwnership(address newOwner) external; 10 | function wallet() external view returns(address); 11 | function withdraw(address recipient, uint256 amount) external; 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/harmony/IERC20EthManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IERC20EthManager { 6 | function lockToken(address ethTokenAddr, uint256 amount, address recipient) external; 7 | function lockTokenFor(address ethTokenAddr, address userAddr, uint256 amount, address recipient) external; 8 | function unlockToken(address ethTokenAddr, uint256 amount, address recipient, bytes32 receiptId) external; 9 | function usedEvents_(bytes32) external view returns(bool); 10 | function wallet() external view returns(address); 11 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/harmony/IERC20HmyManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | interface IERC20HmyManager { 5 | function mappings(address) external view returns(address); 6 | function usedEvents_(bytes32) external view returns(bool); 7 | function wallet() external view returns(address); 8 | function addToken(address tokenManager, address ethTokenAddr, string memory name, string memory symbol, uint8 decimals) external; 9 | function removeToken(address tokenManager, address ethTokenAddr) external; 10 | function burnToken(address oneToken, uint256 amount, address recipient) external; 11 | function mintToken(address oneToken, uint256 amount, address recipient, bytes32 receiptId) external; 12 | } 13 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/keeper/IKEEPERLiquidityPool_V2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import '../../ERC20/IERC20.sol'; 4 | import './IKToken.sol'; 5 | 6 | // Original at https://etherscan.io/address/0x53463cd0b074E5FDafc55DcE7B1C82ADF1a43B2E#code 7 | // Some functions were omitted for brevity. See the contract for details 8 | 9 | interface IKEEPERLiquidityPool_V2 { 10 | function kToken(address _token) external view returns (IKToken); 11 | function register(IKToken _kToken) external; 12 | function renounceOperator() external; 13 | function deposit(address _token, uint256 _amount) external payable returns (uint256); 14 | function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external; 15 | function borrowableBalance(address _token) external view returns (uint256); 16 | function underlyingBalance(address _token, address _owner) external view returns (uint256); 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/keeper/IKToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | interface IKToken { 5 | function underlying() external view returns (address); 6 | function totalSupply() external view returns (uint256); 7 | function balanceOf(address account) external view returns (uint256); 8 | function transfer(address recipient, uint256 amount) external returns (bool); 9 | function allowance(address owner, address spender) external view returns (uint256); 10 | function approve(address spender, uint256 amount) external returns (bool); 11 | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); 12 | function mint(address recipient, uint256 amount) external returns (bool); 13 | function burnFrom(address sender, uint256 amount) external; 14 | function addMinter(address sender) external; 15 | function renounceMinter() external; 16 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/keeper/IkUSDC_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import './IKToken.sol'; 4 | 5 | // Original at https://etherscan.io/address/0xac826952bc30504359a099c3a486d44E97415c77#code 6 | // Some functions were omitted for brevity. See the contract for details 7 | 8 | interface IkUSDC_Partial is IKToken { 9 | 10 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/olympus/IStakingHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | 4 | interface IStakingHelper { 5 | function OHM() external view returns (address); 6 | function stake(uint256 _amount) external; 7 | function staking() external view returns (address); 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/solana/IWormhole.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IWormhole { 6 | function guardian_set_expirity () external view returns (uint32); 7 | function guardian_set_index () external view returns (uint32); 8 | function guardian_sets (uint32) external view returns (uint32 expiration_time); 9 | function isWrappedAsset (address) external view returns (bool); 10 | function lockAssets (address asset, uint256 amount, bytes32 recipient, uint8 target_chain, uint32 nonce, bool refund_dust) external; 11 | function lockETH (bytes32 recipient, uint8 target_chain, uint32 nonce) external; 12 | function wrappedAssetMaster () external view returns (address); 13 | function wrappedAssets (bytes32) external view returns (address); 14 | } 15 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/solidly/IDepositToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | interface IDepositToken { 5 | function allowance(address, address) external view returns (uint256); 6 | function approve(address _spender, uint256 _value) external returns (bool); 7 | function balanceOf(address account) external view returns (uint256); 8 | function burn(address _from, uint256 _value) external returns (bool); 9 | function decimals() external view returns (uint8); 10 | function depositor() external view returns (address); 11 | function initialize(address _pool) external returns (bool); 12 | function mint(address _to, uint256 _value) external returns (bool); 13 | function name() external view returns (string memory); 14 | function pool() external view returns (address); 15 | function symbol() external view returns (string memory); 16 | function totalSupply() external view returns (uint256); 17 | function transfer(address _to, uint256 _value) external returns (bool); 18 | function transferFrom(address _from, address _to, uint256 _value) external returns (bool); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/yearn/IyFRAX3CRV_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import '../../ERC20/IERC20.sol'; 4 | 5 | // Original at https://etherscan.io/address/0x2c7796c0590cc100d70af473993890d457cb2ac9#code 6 | // Address [0x83D2944d5fC10A064451Dc5852f4F47759F249B6] used is a proxy 7 | 8 | interface IyFRAX3CRV_Partial is IERC20 { 9 | function coins(uint256 i) external view returns (address); 10 | function get_virtual_price() external view returns (uint256); 11 | // def calc_token_amount(amounts: uint256[BASE_N_COINS], deposit: bool) -> uint256: view 12 | // def calc_withdraw_one_coin(_token_amount: uint256, i: int128) -> uint256: view 13 | // def fee() -> uint256: view 14 | // def get_dy(i: int128, j: int128, dx: uint256) -> uint256: view 15 | // def exchange(i: int128, j: int128, dx: uint256, min_dy: uint256): nonpayable 16 | // def add_liquidity(amounts: uint256[BASE_N_COINS], min_mint_amount: uint256): nonpayable 17 | // def remove_liquidity_one_coin(_token_amount: uint256, i: int128, min_amount: uint256): nonpayable 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Misc_AMOs/yearn/IyUSDC_V2_Partial.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | import '../../ERC20/IERC20.sol'; 4 | 5 | // https://etherscan.io/address/0x5f18C75AbDAe578b483E5F43f12a39cF75b973a9 6 | // Some functions were omitted for brevity. See the contract for details 7 | 8 | interface IyUSDC_V2_Partial is IERC20 { 9 | function balance() external returns (uint); 10 | function available() external returns (uint); 11 | function earn() external; 12 | function deposit(uint _amount) external; 13 | function withdraw(uint _shares) external; 14 | function pricePerShare() external view returns (uint); 15 | } 16 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxCrossChainFarm_FRAX_FXS_Impossible.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxCrossChainFarm.sol"; 6 | 7 | contract FraxCrossChainFarm_FRAX_FXS_Impossible is FraxCrossChainFarm { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarm(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxCrossChainFarm_FRAX_FXS_Spirit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxCrossChainFarm.sol"; 6 | 7 | contract FraxCrossChainFarm_FRAX_FXS_Spirit is FraxCrossChainFarm { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarm(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxCrossChainFarm_FRAX_IF_Impossible.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxCrossChainFarm.sol"; 6 | 7 | contract FraxCrossChainFarm_FRAX_IF_Impossible is FraxCrossChainFarm { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarm(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxCrossChainFarm_FRAX_mUSD.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxCrossChainFarm.sol"; 6 | 7 | contract FraxCrossChainFarm_FRAX_mUSD is FraxCrossChainFarm { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _rewarder_address 16 | ) 17 | FraxCrossChainFarm(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _rewarder_address) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUniV3Farm_Stable_FRAX_DAI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxUniV3Farm_Stable.sol"; 6 | 7 | contract FraxUniV3Farm_Stable_FRAX_DAI is FraxUniV3Farm_Stable { 8 | constructor ( 9 | address _owner, 10 | address _lp_pool_address, 11 | address _timelock_address, 12 | address _rewards_distributor_address, 13 | int24 _uni_tick_lower, 14 | int24 _uni_tick_upper, 15 | int24 _uni_ideal_tick 16 | ) 17 | FraxUniV3Farm_Stable(_owner, _lp_pool_address, _timelock_address, _rewards_distributor_address, _uni_tick_lower, _uni_tick_upper, _uni_ideal_tick) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUniV3Farm_Stable_FRAX_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxUniV3Farm_Stable.sol"; 6 | 7 | contract FraxUniV3Farm_Stable_FRAX_USDC is FraxUniV3Farm_Stable { 8 | constructor ( 9 | address _owner, 10 | address _lp_pool_address, 11 | address _timelock_address, 12 | address _rewards_distributor_address, 13 | int24 _uni_tick_lower, 14 | int24 _uni_tick_upper, 15 | int24 _uni_ideal_tick 16 | ) 17 | FraxUniV3Farm_Stable(_owner, _lp_pool_address, _timelock_address, _rewards_distributor_address, _uni_tick_lower, _uni_tick_upper, _uni_ideal_tick) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUniV3Farm_Stable_FRAX_agEUR.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../FraxUniV3Farm_Stable.sol"; 6 | 7 | contract FraxUniV3Farm_Stable_FRAX_agEUR is FraxUniV3Farm_Stable { 8 | constructor ( 9 | address _owner, 10 | address _lp_pool_address, 11 | address _timelock_address, 12 | address _rewards_distributor_address, 13 | int24 _uni_tick_lower, 14 | int24 _uni_tick_upper, 15 | int24 _uni_ideal_tick 16 | ) 17 | FraxUniV3Farm_Stable(_owner, _lp_pool_address, _timelock_address, _rewards_distributor_address, _uni_tick_lower, _uni_tick_upper, _uni_ideal_tick) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxBUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxBUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxFPIFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxFPIFRAX is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxGUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxGUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxLUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxLUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxTUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxTUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxUSDDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxUSDDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxalUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxalUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxapeUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxapeUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Convex_stkcvxsUSDFRAXBP.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Convex_stkcvxsUSDFRAXBP is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FPIS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FPIS is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_FXS is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_IQ.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_IQ is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_OHM.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_OHM is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SDL.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SDL is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SYN.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_SYN is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_ZZ.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_ZZ is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Fraxswap_FRAX_pitchFXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Fraxswap_FRAX_pitchFXS is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Gelato_FRAX_DAI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Gelato_FRAX_DAI is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Temple_FRAX_TEMPLE.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Temple_FRAX_TEMPLE is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_ERC20_Vesper_Orbit_FRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_ERC20.sol"; 5 | 6 | contract FraxUnifiedFarm_ERC20_Vesper_Orbit_FRAX is FraxUnifiedFarm_ERC20 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_ERC20(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_PosRebase_aFRAX.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_PosRebase.sol"; 5 | 6 | contract FraxUnifiedFarm_PosRebase_aFRAX is FraxUnifiedFarm_PosRebase { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | address _stakingToken 15 | ) 16 | FraxUnifiedFarm_PosRebase(_owner , _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, _stakingToken) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/FraxUnifiedFarm_UniV3_FRAX_RAI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.8.0; 3 | 4 | import "../FraxUnifiedFarm_UniV3.sol"; 5 | 6 | contract FraxUnifiedFarm_UniV3_FRAX_RAI is FraxUnifiedFarm_UniV3 { 7 | constructor ( 8 | address _owner, 9 | address[] memory _rewardTokens, 10 | address[] memory _rewardManagers, 11 | uint256[] memory _rewardRates, 12 | address[] memory _gaugeControllers, 13 | address[] memory _rewardDistributors, 14 | uint256 seed_token_id 15 | ) 16 | FraxUnifiedFarm_UniV3(_owner, _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers, _rewardDistributors, seed_token_id) 17 | {} 18 | } 19 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/Stake_FRAX_FXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewards.sol"; 6 | 7 | contract Stake_FRAX_FXS is StakingRewards { 8 | constructor ( 9 | address _owner, 10 | address _rewardsDistribution, 11 | address _rewardsToken, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight 16 | ) 17 | StakingRewards(_owner, _rewardsDistribution, _rewardsToken, _stakingToken, _frax_address, _timelock_address, _pool_weight) 18 | public {} 19 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/Stake_FRAX_USDC.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewards.sol"; 6 | 7 | contract Stake_FRAX_USDC is StakingRewards { 8 | constructor ( 9 | address _owner, 10 | address _rewardsDistribution, 11 | address _rewardsToken, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight 16 | ) 17 | StakingRewards(_owner, _rewardsDistribution, _rewardsToken, _stakingToken, _frax_address, _timelock_address, _pool_weight) 18 | public {} 19 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/Stake_FRAX_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewards.sol"; 6 | 7 | contract Stake_FRAX_WETH is StakingRewards { 8 | constructor ( 9 | address _owner, 10 | address _rewardsDistribution, 11 | address _rewardsToken, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight 16 | ) 17 | StakingRewards(_owner, _rewardsDistribution, _rewardsToken, _stakingToken, _frax_address, _timelock_address, _pool_weight) 18 | public {} 19 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/Stake_FXS_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewards.sol"; 6 | 7 | contract Stake_FXS_WETH is StakingRewards { 8 | constructor ( 9 | address _owner, 10 | address _rewardsDistribution, 11 | address _rewardsToken, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight 16 | ) 17 | StakingRewards(_owner, _rewardsDistribution, _rewardsToken, _stakingToken, _frax_address, _timelock_address, _pool_weight) 18 | public {} 19 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDualV2_FRAX3CRV_V2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDualV2.sol"; 6 | 7 | contract StakingRewardsDualV2_FRAX3CRV_V2 is StakingRewardsDualV2 { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight0, 16 | uint256 _pool_weight1 17 | ) 18 | StakingRewardsDualV2(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _pool_weight0, _pool_weight1) 19 | public {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDualV3_FRAX_IQ.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDualV3.sol"; 6 | 7 | contract StakingRewardsDualV3_FRAX_IQ is StakingRewardsDualV3 { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _veFXS_address 16 | ) 17 | StakingRewardsDualV3(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _veFXS_address ) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDualV4_FRAX_OHM.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDualV4.sol"; 6 | 7 | contract StakingRewardsDualV4_FRAX_OHM is StakingRewardsDualV4 { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, // OHM is E9 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _veFXS_address 16 | ) 17 | StakingRewardsDualV4(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _veFXS_address ) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDualV5_FRAX_OHM.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDualV5.sol"; 6 | 7 | contract StakingRewardsDualV5_FRAX_OHM is StakingRewardsDualV5 { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, // OHM is E9 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | address _veFXS_address 16 | ) 17 | StakingRewardsDualV5(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _veFXS_address ) 18 | {} 19 | } 20 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDual_FRAX3CRV.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDual.sol"; 6 | 7 | contract StakingRewardsDual_FRAX3CRV is StakingRewardsDual { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight0, 16 | uint256 _pool_weight1 17 | ) 18 | StakingRewardsDual(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _pool_weight0, _pool_weight1) 19 | public {} 20 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDual_FRAX_FXS_Sushi.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDual.sol"; 6 | 7 | contract StakingRewardsDual_FRAX_FXS_Sushi is StakingRewardsDual { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight0, 16 | uint256 _pool_weight1 17 | ) 18 | StakingRewardsDual(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _pool_weight0, _pool_weight1) 19 | public {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsDual_FXS_WETH_Sushi.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsDual.sol"; 6 | 7 | contract StakingRewardsDual_FXS_WETH_Sushi is StakingRewardsDual { 8 | constructor ( 9 | address _owner, 10 | address _rewardsToken0, 11 | address _rewardsToken1, 12 | address _stakingToken, 13 | address _frax_address, 14 | address _timelock_address, 15 | uint256 _pool_weight0, 16 | uint256 _pool_weight1 17 | ) 18 | StakingRewardsDual(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _frax_address, _timelock_address, _pool_weight0, _pool_weight1) 19 | public {} 20 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsMultiGauge_FRAX_SUSHI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsMultiGauge.sol"; 6 | 7 | contract StakingRewardsMultiGauge_FRAX_SUSHI is StakingRewardsMultiGauge { 8 | constructor ( 9 | address _owner, 10 | address _stakingToken, 11 | address _rewards_distributor_address, 12 | string[] memory _rewardSymbols, 13 | address[] memory _rewardTokens, 14 | address[] memory _rewardManagers, 15 | uint256[] memory _rewardRates, 16 | address[] memory _gaugeControllers 17 | ) 18 | StakingRewardsMultiGauge(_owner, _stakingToken, _rewards_distributor_address, _rewardSymbols, _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsMultiGauge_FXS_WETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsMultiGauge.sol"; 6 | 7 | contract StakingRewardsMultiGauge_FXS_WETH is StakingRewardsMultiGauge { 8 | constructor ( 9 | address _owner, 10 | address _stakingToken, 11 | address _rewards_distributor_address, 12 | string[] memory _rewardSymbols, 13 | address[] memory _rewardTokens, 14 | address[] memory _rewardManagers, 15 | uint256[] memory _rewardRates, 16 | address[] memory _gaugeControllers 17 | ) 18 | StakingRewardsMultiGauge(_owner, _stakingToken, _rewards_distributor_address, _rewardSymbols, _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsMultiGauge_StakeDAO.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsMultiGauge.sol"; 6 | 7 | contract StakingRewardsMultiGauge_StakeDAO is StakingRewardsMultiGauge { 8 | constructor ( 9 | address _owner, 10 | address _stakingToken, 11 | address _rewards_distributor_address, 12 | string[] memory _rewardSymbols, 13 | address[] memory _rewardTokens, 14 | address[] memory _rewardManagers, 15 | uint256[] memory _rewardRates, 16 | address[] memory _gaugeControllers 17 | ) 18 | StakingRewardsMultiGauge(_owner, _stakingToken, _rewards_distributor_address, _rewardSymbols, _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Staking/Variants/StakingRewardsMultiGauge_StakeDAO_FRAX_Put.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.6.11; 3 | pragma experimental ABIEncoderV2; 4 | 5 | import "../StakingRewardsMultiGauge.sol"; 6 | 7 | contract StakingRewardsMultiGauge_StakeDAO_FRAX_Put is StakingRewardsMultiGauge { 8 | constructor ( 9 | address _owner, 10 | address _stakingToken, 11 | address _rewards_distributor_address, 12 | string[] memory _rewardSymbols, 13 | address[] memory _rewardTokens, 14 | address[] memory _rewardManagers, 15 | uint256[] memory _rewardRates, 16 | address[] memory _gaugeControllers 17 | ) 18 | StakingRewardsMultiGauge(_owner, _stakingToken, _rewards_distributor_address, _rewardSymbols, _rewardTokens, _rewardManagers, _rewardRates, _gaugeControllers) 19 | {} 20 | } 21 | -------------------------------------------------------------------------------- /src/hardhat/old_contracts/Utils/BundleUtils.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | pragma experimental ABIEncoderV2; 4 | 5 | contract BundleUtils { 6 | 7 | constructor () {} 8 | 9 | function checkParentHash(bytes32 _parent_hash) public view returns (bool) { 10 | require(blockhash(block.number - 1) == _parent_hash, "stale bundle"); 11 | return true; 12 | } 13 | 14 | function payFlashbotsMiner(uint256 _amount_wei) public payable returns (bool) { 15 | block.coinbase.transfer(_amount_wei); 16 | return true; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/BEP20/Mocks/Cake.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../BEP20.sol"; 4 | 5 | // Mock Farm token 6 | contract Cake is BEP20("PancakeSwap Token", "CAKE") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/BEP20/Mocks/FraxMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../BEP20.sol"; 4 | 5 | // Mock Farm token 6 | contract FraxMock is BEP20("Frax", "FRAX") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/BEP20/Mocks/FxsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../BEP20.sol"; 4 | 5 | // Mock Farm token 6 | contract FxsMock is BEP20("Fxs", "FXS") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/BEP20/Mocks/ImpossibleFinance.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | import "../BEP20.sol"; 4 | 5 | // Mock Farm token 6 | contract ImpossibleFinance is BEP20("Impossible Finance", "IF") { 7 | 8 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/GSN/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | 3 | pragma solidity >=0.6.11; 4 | 5 | /* 6 | * @dev Provides information about the current execution context, including the 7 | * sender of the transaction and its data. While these are generally available 8 | * via msg.sender and msg.data, they should not be accessed in such a direct 9 | * manner, since when dealing with GSN meta-transactions the account sending and 10 | * paying for execution may not be the actual sender (as far as an application 11 | * is concerned). 12 | * 13 | * This contract is only required for intermediate, library-like contracts. 14 | */ 15 | contract Context { 16 | // Empty internal constructor, to prevent people from mistakenly deploying 17 | // an instance of this contract, which should be used via inheritance. 18 | constructor () {} 19 | 20 | function _msgSender() internal view returns (address payable) { 21 | return payable(msg.sender); 22 | } 23 | 24 | function _msgData() internal view returns (bytes memory) { 25 | this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 26 | return msg.data; 27 | } 28 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/Impossible/IImpossibleERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3 2 | pragma solidity >=0.6.11; 3 | 4 | interface IImpossibleERC20 { 5 | event Approval(address indexed owner, address indexed spender, uint value); 6 | event Transfer(address indexed from, address indexed to, uint value); 7 | 8 | function name() external pure returns (string memory); 9 | function symbol() external pure returns (string memory); 10 | function decimals() external pure returns (uint8); 11 | function totalSupply() external view returns (uint); 12 | function balanceOf(address owner) external view returns (uint); 13 | function allowance(address owner, address spender) external view returns (uint); 14 | 15 | function approve(address spender, uint value) external returns (bool); 16 | function transfer(address to, uint value) external returns (bool); 17 | function transferFrom(address from, address to, uint value) external returns (bool); 18 | 19 | function DOMAIN_SEPARATOR() external view returns (bytes32); 20 | function PERMIT_TYPEHASH() external pure returns (bytes32); 21 | function nonces(address owner) external view returns (uint); 22 | 23 | function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; 24 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/Staking/Owned.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | // https://docs.synthetix.io/contracts/Owned 5 | contract Owned { 6 | address public owner; 7 | address public nominatedOwner; 8 | 9 | constructor (address _owner) { 10 | require(_owner != address(0), "Owner address cannot be 0"); 11 | owner = _owner; 12 | emit OwnerChanged(address(0), _owner); 13 | } 14 | 15 | function nominateNewOwner(address _owner) external onlyOwner { 16 | nominatedOwner = _owner; 17 | emit OwnerNominated(_owner); 18 | } 19 | 20 | function acceptOwnership() external { 21 | require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); 22 | emit OwnerChanged(owner, nominatedOwner); 23 | owner = nominatedOwner; 24 | nominatedOwner = address(0); 25 | } 26 | 27 | modifier onlyOwner { 28 | require(msg.sender == owner, "Only the contract owner may perform this action"); 29 | _; 30 | } 31 | 32 | event OwnerNominated(address newOwner); 33 | event OwnerChanged(address oldOwner, address newOwner); 34 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/Staking/Variants/FraxFarmBSC_Dual_FRAX_IF.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "../FraxFarmBSC_Dual_V5.sol"; 5 | 6 | contract FraxFarmBSC_Dual_FRAX_IF is FraxFarmBSC_Dual_V5 { 7 | constructor ( 8 | address _owner, 9 | address _rewardsToken0, 10 | address _rewardsToken1, 11 | address _stakingToken, 12 | address _timelock_address 13 | ) 14 | FraxFarmBSC_Dual_V5(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _timelock_address) 15 | {} 16 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/Staking/Variants/FraxFarmBSC_Dual_FXS_IF.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "../FraxFarmBSC_Dual_V5.sol"; 5 | 6 | contract FraxFarmBSC_Dual_FXS_IF is FraxFarmBSC_Dual_V5 { 7 | constructor ( 8 | address _owner, 9 | address _rewardsToken0, 10 | address _rewardsToken1, 11 | address _stakingToken, 12 | address _timelock_address 13 | ) 14 | FraxFarmBSC_Dual_V5(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _timelock_address) 15 | {} 16 | } -------------------------------------------------------------------------------- /src/hardhat/old_contracts/__BSC/Staking/Variants/MigratableFarmBSC_FRAX_FXS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.11; 3 | 4 | import "../MigratableFarmBSC.sol"; 5 | 6 | contract MigratableFarmBSC_FRAX_FXS is MigratableFarmBSC { 7 | constructor ( 8 | address _owner, 9 | address _rewardsToken0, 10 | address _rewardsToken1, 11 | address _stakingToken, 12 | address _timelock_address 13 | ) 14 | MigratableFarmBSC(_owner, _rewardsToken0, _rewardsToken1, _stakingToken, _timelock_address) 15 | {} 16 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "outDir": "./dist", 5 | "module": "commonjs", 6 | "declaration": false, 7 | "noImplicitAny": false, 8 | "removeComments": true, 9 | "esModuleInterop": true, 10 | "noLib": false, 11 | "importHelpers": true, 12 | "lib": ["es6", "es7", "dom", "es2015", "es2016", "es2017"], 13 | "allowSyntheticDefaultImports": true, 14 | "emitDecoratorMetadata": true, 15 | "noEmitOnError": false, 16 | "noFallthroughCasesInSwitch": true, 17 | "skipLibCheck": true, 18 | "strict": false, 19 | "downlevelIteration": true, 20 | "noImplicitReturns": false, 21 | "experimentalDecorators": true, 22 | "target": "es6", 23 | "types": ["node"], 24 | "resolveJsonModule": true, 25 | "sourceMap": true 26 | }, 27 | "exclude": ["dist", "out", "node_modules", "lib"], 28 | "include": ["**/*.ts", "**/*.tsx"] 29 | } 30 | --------------------------------------------------------------------------------