Spend less on fees, more on crypto. Buy crypto easily with MoonPay Balance. 20M+ users trust MoonPay worldwide.
Ready to onboard to Ethereum? With MetaMask Portfolio, you're in control.
Don’t invest unless you’re prepared to lose all the money you invest.
Ready to simplify your web3 experience? Try the all-in-one web3 app trusted by millions worldwide.
Available on 9 networks: Ethereum mainnet, Linea, Polygon, Optimism, BNB Chain, zkSync Era, Base, Avalanche.
Everyday giveaways up to 100 ETH, Lucky Spins. Deposit BONUS 300% and Cashbacks!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Slots, Roulette, Poker & more - Proud sponsors of UFC, Everton & StakeF1 team!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Anonymous play on awesome games - sign up now for 25 free jackpot spins - worth $100s!
100s of games, generous bonuses, 20+ years of trusted gaming. Join CryptoWins & start winning today!
Overview
ETH Balance
Eth Value
$0.00Token Holdings
Could not find any matches!
- ERC-20 Tokens (>200)0.32623844 404A404Aliens (404A)$1.15@3.511.50905005 AGLDAdventure Go... (AGLD)$2.30@1.52141,990.09278885 AEGAether Games (AEG)$20.82@0.01051.48723187 ALGOAlgowave (ALGO)$0.05@0.037927.87386605 AmericaAmerica (Americ...)$0.19@0.000240.91478787 ANIMAnimalia (ANIM)1,495.33390437 BTCBitcoin6900 (BTC)1.03797587 CLEVCLever Token (CLEV)$15.18@14.6220,752.87056049 DOGEDogecast (DOGE)$4.47@0.00024,609.13893859 EMRLDEMERALD (EMRLD)$12.40@0.0027873.50570224 FXFFinxflo (FXF)$0.88@0.00115,699,442.1269631 fluffyFluffy (fluffy)484,734,144.821248 FREEFree Coin (FREE)$79.47@0.004,115.65008936 TRUMPFreeTrump (TRUMP)$3.57@0.000911,254,516.5703803 GASGas DAO (GAS)$6.33@0.0058,589.17620726 BITCOINHarryPotterO... (BITCOI...)7,297.59385413 BTCHarryPotterT... (BTC)$3.58@0.000521,272.55504122 FlorkHeyFlork (Flork)$3.59@0.000250,908.81772666 IGOTSCAMMEDI Got Scamme... (IGOTSC...)128.81651746 JNEJake Newman ... (JNE)$2.92@0.0227263,391.40558562 dKUMAKumaDex Toke... (dKUMA)$48.61@0.00029,952.56200465 HERRISKumala Herri... (HERRIS)7,354.5147327 MAZZEMAZZE (MAZZE)$18.61@0.002550.63954538 MILEIMILEI Token (MILEI)$1.38@0.02721,814,536,785.72687 PIKAPikachu (PIKA)$195.31@0.0024,961.48011808 PCPlayable Coi... (PC)$1.50@0.00015,271.37153178 QANXQANX Token (QANX)56,993.35384577 $ROARRoaring Kitt... ($ROAR)$458.34@0.0086,171,776,387.91759 SHIBAShiba (SHIBA)$0.97@0.00336.40756256 SPXSPX6900 (SPX)$225.28@0.6697142.71977663 STRDYSturdy Token (STRDY)$288.29@2.023,135.01345959 TAONUTAO Inu (TAONU)$10.52@0.00340.70138077 TheDAOTheDAO (TheDAO)$23.27@33.1836112,624.10935484 TIGRATigra (TIGRA)$20.28@0.00025,426,071,194.9999 TRUMPTrump (TRUMP)$0.79@0.00354.18179098 SPARKLETUpland (SPARKL...)$12.23@0.0345298,692.1120146 WSMWall Street ... (WSM)$303.09@0.001617,025.61633735 WOJAKWojak Coin (WOJAK)$524.85@0.000919,362.04275698 xSHIBxShib Staked... (xSHIB)15,563,289.6781247 $MaxETH$MaxETH ($MaxET...)$253.71@0.00254.80115794 0xBTC0xBitcoin To... (0xBTC)$27.38@0.1075697.15471927 1INCH1INCH Token (1INCH)$269.21@0.3862105,388.66924049 TRUMP4747th Preside... (TRUMP4...)$13.27@0.00018,382,844,694,473,660 4CHAN4CHAN (4CHAN)$182.62@0.0034.65015641 ERN@EthernityCh... (ERN)$89.40@2.587,726,393,592.82591 CAWA Hunters Dr... (CAW)$452.78@0.0062.871036 aUSDTAave interes... (aUSDT)$62.81@0.9990.00000778 aWBTCAave interes... (aWBTC)$0.74@94,759.000.00362682 aWETHAave interes... (aWETH)$12.03@3,317.386.47462596 GHSTAavegotchi G... (GHST)$6.51@1.00678.18582417 ABYSSAbyss (ABYSS)$0.49@0.006310,552,455,586.7008 TOADAcid Toad (TOAD)$21.42@0.00146.88048145 ADXAdEx (ADX)$33.57@0.228551.97462249 AERGOAergo (AERGO)$7.10@0.13667,931.94202077 ATHAethir Token (ATH)$543.08@0.0685148.37159608 AEVOAevo (AEVO)$53.27@0.359118.62380197 AGAAgora DEX To... (AGA)$5.65@0.0476282.96274387 AGRSAgoras Token (AGRS)$359.36@1.2758,369,723.6752497 AGURIAguri-Chan (AGURI)$29.93@0.003,524,913.53603528 AIAiDoge (AI)$1.67@0.00660.47430028 AIOZAIOZ Network (AIOZ)$619.31@0.9377257.9764 ASTAirSwap (AST)$28.06@0.10885,049,866,458.63007 AKITAAkita Inu (AKITA)$527.60@0.0010,185.94959351 AKROAkropolis (AKRO)$17.35@0.00178.17279552 ⚗️Alchemist (⚗️)$5.91@0.72347.88050984 ALCXAlchemix (ALCX)$155.64@19.757,668.91218068 ACHAlchemy (ACH)$180.11@0.0235636.69608093 ALEPHaleph.im v2 (ALEPH)$85.58@0.1344296.52789016 ALPHAlephium (Al... (ALPH)$441.83@1.49114.867341 ALICEALICE (ALICE)$128.65@1.12336.6942 TLMAlien Worlds... (TLM)$4.64@0.01387,680.40245139 NXRAAllianceBloc... (NXRA)$318.64@0.0415258.25486998 ALPHAAlphaToken (ALPHA)$20.86@0.08083,105.12826878 ALTAltLayer Tok... (ALT)$362.07@0.11668.61093438 ASIAltSignals (ASI)$0.02@0.00224,978.67354522 OMIKAMIAMATERASU OM... (OMIKAM...)$195.05@0.03926,936,313,046.16401 AMCAMC (AMC)$95.44@0.0042,167.87662597 AMERICAAmerica (AMERIC...)20,738,159,030.3704 SHIBAAmerican Shi... (SHIBA)$1.25@0.00149,669.90174041 AMOAmino (AMO)$24.03@0.000234,532.72541754 AMPAmp (AMP)$275.61@0.008461.29320608 AMPLAmpleforth (AMPL)$448.65@0.97262.98089437 FORTHAmpleforth G... (FORTH)$17.68@5.93379.15180643 CANDYAndy's C... (CANDY)$0.01@0.00111,951.04759279 ANDYMANAndyman (ANDYMA...)$174.81@0.001663.5058492 ANGLEANGLE (ANGLE)$1.43@0.02257,940.08301779 ANKRAnkr Network (ANKR)$282.73@0.03560.00284637 ankrETHAnkr Staked ... (ankrET...)$11.04@3,879.54194.73944404 MATTERAntimatter.F... (MATTER)$1.06@0.0055219.24874392 APEApeCoin (APE)$256.52@1.172,625,224.167698 NFTAPENFT (NFT)$1.38@0.000.03010773 APEXApeX Token (APEX)$0.05@1.54327.44916808 API3API3 (API3)$520.64@1.592,274.59280269 FTWApollo FTW (FTW)$6.15@0.0027416.54468439 APPCAppCoins (APPC)$0.23@0.00055,311,672.28750397 APUAPU (APU)$1.75@0.00509,058.33673123 APUGURLApu Gurl (APUGUR...)$1.82@0.004,402.77135488 APYAPY Governan... (APY)$5.94@0.001373.39512736 APYSAPYSwap (APYS)$0.25@0.00349,497.17273805 AQTISAQTIS Token (AQTIS)$0.45@0.0036.2570073 ANTAragon Netwo... (ANT)$46.41@1.289,199.16689072 RBISArbismart To... (RBIS)$0.92@0.00011.92533876 AIUSArbius (AIUS)$141.64@73.56626,145.69567108 ARCARC (ARC)$186.95@0.0304277.60832889 ABTArcBlock (ABT)$427.52@1.5422.72022599 ARCXArchitex (ARCX)$9.92@0.4367219.19974813 ARCONAArcona Distr... (ARCONA)$3.09@0.01410.28396613 ARIA20ARIANEE (ARIA20)$0.03@0.1176353.65143264 ARKMArkham (ARKM)$519.16@1.4682,632.7180721 ARMORArmor (ARMOR)$0.98@0.00040.00944467 arNXMArmor NXM (arNXM)$0.22@23.122.18865106 ARPAARPA Token (ARPA)$0.11@0.04856,602.05414821 ALIArtificial L... (ALI)$72.81@0.0113.42182644 ASTRAAstraAI (ASTRA)$8.63@2.52164.09182697 ASFAsymmetry Fi... (ASF)$5.97@1.461,468 ATRIAtariToken (ATRI)$0.39@0.000345,601.08015603 TUAAtua AI (TUA)$32.35@0.00071,452.89043707 AUCAuctus (AUC)$1.34@0.00093,724.08555081 AUDIOAudius (AUDIO)$571.62@0.153525.07421598 AURAAura (AURA)$9.86@0.39331,594.51426937 AURORAAurora (AURORA)$347.12@0.217720.07264796 URUSAurox Token (URUS)$52.59@2.6230.25471892 ATAAutomata (ATA)$2.89@0.095560.1696 NIOXAutonio (NIOX)$0.07@0.001232.55949465 AVAILAvail (AVAIL)$3.94@0.1211201.44390689 AVATLYAVATLY (AVATLY)$0.45@0.002323,088.3669112 AVIAviator (AVI)$18.44@0.0008178.855147 AXLAxelar (AXL)$135.22@0.75643.15121589 AXSAxie Infinit... (AXS)$264.95@6.1412.2477869 AZURAzuro (AZUR)$0.82@0.06735,336,693,935.33161 BMoneyB-money (BMoney)$1.37@0.003,881.22446221 BXXBaanx (BXX)$169.57@0.0437635,579.56208966 BAXBABB BAX (BAX)$66.55@0.000127,768,948.8557518 BABYPEPEBaby Pepe (BABYPE...)$389.44@0.00115,255,319,242.486 BABYPEPEBabyPepe (BABYPE...)$10.45@0.002,993.19176439 BACBAC (BAC)$6.75@0.002311.24000794 BADGERBadger (BADGER)$45.75@4.07635.53186937 BAGBag (BAG)$0.53@0.000843.75503056 BALBalancer (BAL)$110.70@2.531.08197553 bALPHAbAlpha (bALPHA)$13.80@12.75340.10495371 BANANABanana (BANANA)$0.03@0.32363.56325075 BANANABanana (BANANA)$143.96@40.4033,821.36575751 BCATBananaCat (BCAT)$164.06@0.004975.54247588 BANDBandToken (BAND)$107.27@1.42142,168.26976883 BANKBank Ai (BANK)$30.90@0.0002857.7191387 BANKBankless Tok... (BANK)$0.89@0.0011,888.87785867 BAOBao Token V2 (BAO)$1.30@0.00073,507,457,932.36594 SOLANABarbieCrashB... (SOLANA)$4.33@0.0054.72024772 BONDBarnBridge G... (BOND)$20.47@0.3741236.45948685 BASEBase Protoco... (BASE)$340.50@1.4434.31317073 BSXBasix (BSX)$1.31@0.0382215.53354482 BDPBDPToken (BDP)$23.69@0.109925,862.81336832 BEAMBeam (BEAM)$730.02@0.0282428.65253681 BEARDYBearded Drag... (BEARDY)$0.10@0.000210,855,009,779.6488 BEBEBEBE (BEBE)$197.01@0.0069,674.35880942 FROGBeer Frog (FROG)$17.66@0.000369.85036449 BEFEBEFE (BEFE)$0.00@0.0045.08122403 BELBella (BEL)$25.45@0.5645123.92423417 BelugaBeluga (Beluga)0.24579458 MARKBenchmark (MARK)$0.12@0.50140.93703664 BETABeta Token (BETA)$0.04@0.044469,878.3233476 BEPROBetProtocolT... (BEPRO)$39.05@0.0006327,393,619,200.21 BEZOGEBezoge Earth (BEZOGE)$4.21@0.0019,607.12891785 BIDBidao (BID)$14.62@0.0007624.28552919 BiFiBiFi (BiFi)$1.58@0.0025140.42584023 BFCBifrost (BFC)$6.30@0.044925,072,282,607.3673 BUDBig Bud (BUD)$10.97@0.0025,152,379.1816402 $BIGBig Eyes ($BIG)$9.39@0.0038,722.48837555 $BIKEYBikey ($BIKEY)0.00801002 BBTCBinance Wrap... (BBTC)$754.82@94,235.006,415,642.95851573 BIRDDOGBird Dog (BIRDDO...)$7.12@0.006,080,746.83644053 BIRDDOGBird Dog (BIRDDO...)$127.34@0.0010.25884884 BIRDBird.Money (BIRD)$6.76@0.6586153.16327131 BTCINUBitcoin Inu (BTCINU)$1.61@0.010522.77491874 BTC20Bitcoin20 (BTC20)$2.77@0.121658.65243874 CRYPTOBitcoinEther... (CRYPTO)$0.42@0.007145.98652447 BITBitDAO (BIT)$55.18@1.200.47370494 LEOBitfinex LEO... (LEO)$4.44@9.38245,619,461.742867 BRISEBitgert (BRISE)$30.77@0.004.73251625 BITROCKBitrock (BITROC...)$0.21@0.045134.17560409 BITTOBITTO (BITTO)34.58662597 BITTBITTOKEN (BITT)$0.03@0.0008378,821,049.071611 BTTBitTorrent (BTT)$431.91@0.0032,673,237.2896382 FTWBlack Agnus (FTW)$0.59@0.00249.67115935 BPTBlackPool To... (BPT)$8.86@0.03551,491.75500542 BSBlacksmith T... (BS)$0.62@0.00043.73807395 BCDTBlockchain C... (BCDT)$0.15@0.0408480.50121174 BSTBlocksquareT... (BST)$114.01@0.237327,565.14469112 VEEBLOCKv (VEE)$296.78@0.0108201.60883152 BLOODBlood (BLOOD)$2.52@0.012529,598.17781885 BLOODBloodboy (BLOOD)$10.13@0.0003545.63575483 BLZBluzelle (BLZ)$37.23@0.06820.19631347 $SWIPESBNDR ($SWIPE...)$0.00@0.001210,216,816.038311 BOBBOB (BOB)$227.87@0.0010,478,898,076.4503 BOBOBobo (BOBO)$217.51@0.0034,515,389.661032 BOBOBOBO (BOBO)$32.98@0.00485,440,505.981331 BOGBog (BOG)$0.76@0.00125,616.10734918 BOMEBOME AI (BOME)3,752.68144526 BONDLYBondly (BONDLY)$6.77@0.00182,076,868,094.54797 BONKBonk on ETH (BONK)$5.85@0.00NFT Tokens (89)claim rewards on aavetoken.netaavetoken.netERC-1155claim rewards on agixcoin.netagixcoin.netERC-1155claim rewards on aprgraph.comaprgraph.comERC-1155claim rewards on apyusd.netapyusd.netERC-1155claim rewards on beamprotocol.netbeamprotocol.netERC-1155claim rewards on beamprotocol.orgbeamprotocol.orgERC-1155claim rewards on clinkevent.comclinkevent.comERC-1155claim rewards on cronosprotocol.comcronosprotocol.comERC-1155claim rewards on dydxnetwork.orgdydxnetwork.orgERC-1155claim rewards on ensfoundation.orgensfoundation.orgERC-1155ether-origin.comether-origin.comERC-1155claim rewards on fetchfinance.netfetchfinance.netERC-1155claim rewards on fetpool.orgfetpool.orgERC-1155claim rewards on fraxprotocol.comfraxprotocol.comERC-1155claim rewards on galaportal.netgalaportal.netERC-1155GNUSGenius Token & NFT CollectionsERC-1155claim rewards on graphtoken.orggraphtoken.orgERC-1155claim rewards illuviumnetwork.netilluviumnetwork.netERC-1155claim rewards on injectivepool.orginjectivepool.orgERC-1155claim rewards on jasmyprotocol.comjasmyprotocol.comERC-1155claim rewards on link-get.orglink-get.orgERC-1155claim rewards on ondonetwork.orgondonetwork.orgERC-1155claim rewards on ondopool.comondopool.comERC-1155claim rewards on paxgnetwork.compaxgnetwork.comERC-1155claim rewards qntnetwork.netqntnetwork.netERC-1155claim rewards on quantprize.netquantprize.netERC-1155claim rewards on renderpool.orgrenderpool.orgERC-1155claim rewards on renderportal.netrenderportal.netERC-1155claim rewards riotoken.orgriotoken.orgERC-1155t.me/shibarmy_botShiba Inu Token AirdropERC-1155claim rewards on snxtoken.comsnxtoken.comERC-1155claim rewards on stakedeth.iostakedeth.ioERC-1155claim rewards on stether.usstether.usERC-1155claim rewards on univ4lab.comuniv4lab.comERC-1155claim rewards on univ4labs.orguniv4labs.orgERC-1155ether-origin.comWithdrawal NFT ether-origin.comERC-1155claim rewards on woonetwork.netwoonetwork.netERC-1155claim rewards on wsteth.orgwsteth.orgERC-1155ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]ERC-1155 TOKEN*[Spam]
- Transactions
- Internal Transactions
- Token Transfers (ERC-20)
- NFT Transfers
- Contract
- Events
- Analytics
- Multichain Portfolio
Transaction Hash MethodBlockFromToLatest 1 internal transaction
Advanced mode:Parent Transaction Hash Block FromTo19740424 2024-04-26 15:29:23 240 days ago 1714145363 Contract Creation 0 ETH$0.00 Loading...LoadingMinimal Proxy Contract for 0x167a871142494b86007761d12735017ceb227ed8
Contract Name:Depositor
Compiler Versionv0.8.17+commit.8df45f5f
Optimization Enabled:Yes with 1000 runs
Other Settings:default evmVersionContract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/Address.sol'; import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/primitives/IDepositor.sol'; /** * @title Depositor * @dev Task that can be used as the origin to start any workflow */ contract Depositor is IDepositor, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('DEPOSITOR'); /** * @dev Deposit config. Only used in the initializer. */ struct DepositConfig { TaskConfig taskConfig; } /** * @dev Initializes the depositor * @param config Deposit config */ function initialize(DepositConfig memory config) external virtual initializer { __Depositor_init(config); } /** * @dev Initializes the depositor. It does call upper contracts initializers. * @param config Deposit config */ function __Depositor_init(DepositConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __Depositor_init_unchained(config); } /** * @dev Initializes the depositor. It does not call upper contracts initializers. * @param config Deposit config */ function __Depositor_init_unchained(DepositConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Tells the address from where the token amounts to execute this task are fetched */ function getTokensSource() public view virtual override(IBaseTask, BaseTask) returns (address) { return address(this); } /** * @dev Tells the balance of the depositor for a given token * @param token Address of the token being queried */ function getTaskAmount(address token) public view virtual override(IBaseTask, BaseTask) returns (uint256) { return ERC20Helpers.balanceOf(token, getTokensSource()); } /** * @dev It allows receiving native token transfers */ receive() external payable { if (msg.value == 0) revert TaskValueZero(); } /** * @dev Execute Depositor */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeDepositor(token, amount); if (Denominations.isNativeToken(token)) { Address.sendValue(payable(smartVault), amount); } else { ERC20Helpers.approve(token, smartVault, amount); ISmartVault(smartVault).collect(token, getTokensSource(), amount); } _afterDepositor(token, amount); } /** * @dev Before depositor hook */ function _beforeDepositor(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After depositor hook */ function _afterDepositor(address token, uint256 amount) internal virtual { _increaseBalanceConnector(token, amount); _afterTask(token, amount); } /** * @dev Sets the balance connectors. Previous balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (previous != bytes32(0)) revert TaskPreviousConnectorNotZero(previous); super._setBalanceConnectors(previous, next); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.17; import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; import './AuthorizedHelpers.sol'; import './interfaces/IAuthorized.sol'; import './interfaces/IAuthorizer.sol'; /** * @title Authorized * @dev Implementation using an authorizer as its access-control mechanism. It offers `auth` and `authP` modifiers to * tag its own functions in order to control who can access them against the authorizer referenced. */ contract Authorized is IAuthorized, Initializable, AuthorizedHelpers { // Authorizer reference address public override authorizer; /** * @dev Modifier that should be used to tag protected functions */ modifier auth() { _authenticate(msg.sender, msg.sig); _; } /** * @dev Modifier that should be used to tag protected functions with params */ modifier authP(uint256[] memory params) { _authenticate(msg.sender, msg.sig, params); _; } /** * @dev Creates a new authorized contract. Note that initializers are disabled at creation time. */ constructor() { _disableInitializers(); } /** * @dev Initializes the authorized contract. It does call upper contracts initializers. * @param _authorizer Address of the authorizer to be set */ function __Authorized_init(address _authorizer) internal onlyInitializing { __Authorized_init_unchained(_authorizer); } /** * @dev Initializes the authorized contract. It does not call upper contracts initializers. * @param _authorizer Address of the authorizer to be set */ function __Authorized_init_unchained(address _authorizer) internal onlyInitializing { authorizer = _authorizer; } /** * @dev Reverts if `who` is not allowed to call `what` * @param who Address to be authenticated * @param what Function selector to be authenticated */ function _authenticate(address who, bytes4 what) internal view { _authenticate(who, what, new uint256[](0)); } /** * @dev Reverts if `who` is not allowed to call `what` with `how` * @param who Address to be authenticated * @param what Function selector to be authenticated * @param how Params to be authenticated */ function _authenticate(address who, bytes4 what, uint256[] memory how) internal view { if (!_isAuthorized(who, what, how)) revert AuthSenderNotAllowed(who, what, how); } /** * @dev Tells whether `who` has any permission on this contract * @param who Address asking permissions for */ function _hasPermissions(address who) internal view returns (bool) { return IAuthorizer(authorizer).hasPermissions(who, address(this)); } /** * @dev Tells whether `who` is allowed to call `what` * @param who Address asking permission for * @param what Function selector asking permission for */ function _isAuthorized(address who, bytes4 what) internal view returns (bool) { return _isAuthorized(who, what, new uint256[](0)); } /** * @dev Tells whether `who` is allowed to call `what` with `how` * @param who Address asking permission for * @param what Function selector asking permission for * @param how Params asking permission for */ function _isAuthorized(address who, bytes4 what, uint256[] memory how) internal view returns (bool) { return IAuthorizer(authorizer).isAuthorized(who, address(this), what, how); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.17; /** * @title AuthorizedHelpers * @dev Syntax sugar methods to operate with authorizer params easily */ contract AuthorizedHelpers { function authParams(address p1) internal pure returns (uint256[] memory r) { return authParams(uint256(uint160(p1))); } function authParams(bytes32 p1) internal pure returns (uint256[] memory r) { return authParams(uint256(p1)); } function authParams(uint256 p1) internal pure returns (uint256[] memory r) { r = new uint256[](1); r[0] = p1; } function authParams(address p1, bool p2) internal pure returns (uint256[] memory r) { r = new uint256[](2); r[0] = uint256(uint160(p1)); r[1] = p2 ? 1 : 0; } function authParams(address p1, uint256 p2) internal pure returns (uint256[] memory r) { r = new uint256[](2); r[0] = uint256(uint160(p1)); r[1] = p2; } function authParams(address p1, address p2) internal pure returns (uint256[] memory r) { r = new uint256[](2); r[0] = uint256(uint160(p1)); r[1] = uint256(uint160(p2)); } function authParams(bytes32 p1, bytes32 p2) internal pure returns (uint256[] memory r) { r = new uint256[](2); r[0] = uint256(p1); r[1] = uint256(p2); } function authParams(address p1, address p2, uint256 p3) internal pure returns (uint256[] memory r) { r = new uint256[](3); r[0] = uint256(uint160(p1)); r[1] = uint256(uint160(p2)); r[2] = p3; } function authParams(address p1, address p2, address p3) internal pure returns (uint256[] memory r) { r = new uint256[](3); r[0] = uint256(uint160(p1)); r[1] = uint256(uint160(p2)); r[2] = uint256(uint160(p3)); } function authParams(address p1, address p2, bytes4 p3) internal pure returns (uint256[] memory r) { r = new uint256[](3); r[0] = uint256(uint160(p1)); r[1] = uint256(uint160(p2)); r[2] = uint256(uint32(p3)); } function authParams(address p1, uint256 p2, uint256 p3) internal pure returns (uint256[] memory r) { r = new uint256[](3); r[0] = uint256(uint160(p1)); r[1] = p2; r[2] = p3; } function authParams(uint256 p1, uint256 p2, uint256 p3, uint256 p4) internal pure returns (uint256[] memory r) { r = new uint256[](4); r[0] = p1; r[1] = p2; r[2] = p3; r[3] = p4; } function authParams(address p1, address p2, uint256 p3, uint256 p4) internal pure returns (uint256[] memory r) { r = new uint256[](4); r[0] = uint256(uint160(p1)); r[1] = uint256(uint160(p2)); r[2] = p3; r[3] = p4; } function authParams(address p1, uint256 p2, address p3, uint256 p4) internal pure returns (uint256[] memory r) { r = new uint256[](4); r[0] = uint256(uint160(p1)); r[1] = p2; r[2] = uint256(uint160(p3)); r[3] = p4; } function authParams(address p1, uint256 p2, uint256 p3, uint256 p4) internal pure returns (uint256[] memory r) { r = new uint256[](4); r[0] = uint256(uint160(p1)); r[1] = p2; r[2] = p3; r[3] = p4; } function authParams(bytes32 p1, address p2, uint256 p3, bool p4) internal pure returns (uint256[] memory r) { r = new uint256[](4); r[0] = uint256(p1); r[1] = uint256(uint160(p2)); r[2] = p3; r[3] = p4 ? 1 : 0; } function authParams(address p1, uint256 p2, uint256 p3, uint256 p4, uint256 p5) internal pure returns (uint256[] memory r) { r = new uint256[](5); r[0] = uint256(uint160(p1)); r[1] = p2; r[2] = p3; r[3] = p4; r[4] = p5; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @dev Authorized interface */ interface IAuthorized { /** * @dev Sender `who` is not allowed to call `what` with `how` */ error AuthSenderNotAllowed(address who, bytes4 what, uint256[] how); /** * @dev Tells the address of the authorizer reference */ function authorizer() external view returns (address); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @dev Authorizer interface */ interface IAuthorizer { /** * @dev Permission change * @param where Address of the contract to change a permission for * @param changes List of permission changes to be executed */ struct PermissionChange { address where; GrantPermission[] grants; RevokePermission[] revokes; } /** * @dev Grant permission data * @param who Address to be authorized * @param what Function selector to be authorized * @param params List of params to restrict the given permission */ struct GrantPermission { address who; bytes4 what; Param[] params; } /** * @dev Revoke permission data * @param who Address to be unauthorized * @param what Function selector to be unauthorized */ struct RevokePermission { address who; bytes4 what; } /** * @dev Params used to validate permissions params against * @param op ID of the operation to compute in order to validate a permission param * @param value Comparison value */ struct Param { uint8 op; uint248 value; } /** * @dev Sender is not authorized to call `what` on `where` with `how` */ error AuthorizerSenderNotAllowed(address who, address where, bytes4 what, uint256[] how); /** * @dev The operation param is invalid */ error AuthorizerInvalidParamOp(uint8 op); /** * @dev Emitted every time `who`'s permission to perform `what` on `where` is granted with `params` */ event Authorized(address indexed who, address indexed where, bytes4 indexed what, Param[] params); /** * @dev Emitted every time `who`'s permission to perform `what` on `where` is revoked */ event Unauthorized(address indexed who, address indexed where, bytes4 indexed what); /** * @dev Tells whether `who` has any permission on `where` * @param who Address asking permission for * @param where Target address asking permission for */ function hasPermissions(address who, address where) external view returns (bool); /** * @dev Tells the number of permissions `who` has on `where` * @param who Address asking permission for * @param where Target address asking permission for */ function getPermissionsLength(address who, address where) external view returns (uint256); /** * @dev Tells whether `who` has permission to call `what` on `where`. Note `how` is not evaluated here, * which means `who` might be authorized on or not depending on the call at the moment of the execution * @param who Address asking permission for * @param where Target address asking permission for * @param what Function selector asking permission for */ function hasPermission(address who, address where, bytes4 what) external view returns (bool); /** * @dev Tells whether `who` is allowed to call `what` on `where` with `how` * @param who Address asking permission for * @param where Target address asking permission for * @param what Function selector asking permission for * @param how Params asking permission for */ function isAuthorized(address who, address where, bytes4 what, uint256[] memory how) external view returns (bool); /** * @dev Tells the params set for a given permission * @param who Address asking permission params of * @param where Target address asking permission params of * @param what Function selector asking permission params of */ function getPermissionParams(address who, address where, bytes4 what) external view returns (Param[] memory); /** * @dev Executes a list of permission changes * @param changes List of permission changes to be executed */ function changePermissions(PermissionChange[] memory changes) external; /** * @dev Authorizes `who` to call `what` on `where` restricted by `params` * @param who Address to be authorized * @param where Target address to be granted for * @param what Function selector to be granted * @param params Optional params to restrict a permission attempt */ function authorize(address who, address where, bytes4 what, Param[] memory params) external; /** * @dev Unauthorizes `who` to call `what` on `where`. Sender must be authorized. * @param who Address to be authorized * @param where Target address to be revoked for * @param what Function selector to be revoked */ function unauthorize(address who, address where, bytes4 what) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title 1inch V5 connector interface */ interface IOneInchV5Connector { /** * @dev The token in is the same as the token out */ error OneInchV5SwapSameToken(address token); /** * @dev The amount out is lower than the minimum amount out */ error OneInchV5BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error OneInchV5BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the reference to 1inch aggregation router v5 */ function oneInchV5Router() external view returns (address); /** * @dev Executes a token swap in 1Inch V5 * @param tokenIn Token to be sent * @param tokenOut Token to be received * @param amountIn Amount of token in to be swapped * @param minAmountOut Minimum amount of token out willing to receive * @param data Calldata to be sent to the 1inch aggregation router */ function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes memory data) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Axelar connector interface */ interface IAxelarConnector { /** * @dev The recipient address is zero */ error AxelarBridgeRecipientZero(); /** * @dev The source and destination chains are the same */ error AxelarBridgeSameChain(uint256 chainId); /** * @dev The chain ID is not supported */ error AxelarBridgeUnknownChainId(uint256 chainId); /** * @dev The post token balance is lower than the previous token balance minus the amount bridged */ error AxelarBridgeBadPostTokenBalance(uint256 postBalance, uint256 preBalance, uint256 amount); /** * @dev Tells the reference to the Axelar gateway of the source chain */ function axelarGateway() external view returns (address); /** * @dev Executes a bridge of assets using Axelar * @param chainId ID of the destination chain * @param token Address of the token to be bridged * @param amount Amount of tokens to be bridged * @param recipient Address that will receive the tokens on the destination chain */ function execute(uint256 chainId, address token, uint256 amount, address recipient) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Balancer pool connector interface */ interface IBalancerV2PoolConnector { /** * @dev The given input length is invalid or do not match */ error BalancerV2InvalidInputLength(); /** * @dev The given tokens out length is not the expected one */ error BalancerV2InvalidTokensOutLength(); /** * @dev The given pool ID and bpt in do not match on Balancer vault */ error BalancerV2InvalidPoolId(bytes32 poolId, address bpt); /** * @dev The given token does not belong to the pool */ error BalancerV2InvalidToken(bytes32 poolId, address token); /** * @dev The post balance of the token in unexpected */ error BalancerV2BadTokenInBalance(uint256 postBalance, uint256 preBalance, uint256 amountIn); /** * @dev The post balance of the token out is unexpected */ error BalancerV2BadTokenOutBalance(uint256 postBalance, uint256 preBalance); /** * @dev The resulting amount out is lower than the expected min amount out */ error BalancerV2BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev Tells the reference to Balancer v2 vault */ function balancerV2Vault() external view returns (address); /** * @dev Adds liquidity to a Balancer pool * @param poolId Balancer pool ID * @param tokenIn Address of the token to join the Balancer pool * @param amountIn Amount of tokens to join the Balancer pool * @param minAmountOut Minimum amount of pool tokens expected to receive after join */ function join(bytes32 poolId, address tokenIn, uint256 amountIn, uint256 minAmountOut) external returns (uint256 amountOut); /** * @dev Removes liquidity from a Balancer pool * @param tokenIn Address of the pool to exit * @param amountIn Amount of pool tokens to exit * @param tokensOut List of addresses of tokens in the pool * @param minAmountsOut List of min amounts out to be expected for each pool token */ function exit(address tokenIn, uint256 amountIn, address[] memory tokensOut, uint256[] memory minAmountsOut) external returns (uint256[] memory amountsOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Balancer v2 swap connector interface */ interface IBalancerV2SwapConnector { /** * @dev The input length mismatch */ error BalancerV2InputLengthMismatch(); /** * @dev The token in is the same as the token out */ error BalancerV2SwapSameToken(address token); /** * @dev The pool does not exist on the Balancer vault */ error BalancerV2InvalidPool(bytes32 poolId); /** * @dev The requested tokens do not belong to the pool */ error BalancerV2InvalidPoolTokens(bytes32 poolId, address tokenA, address tokenB); /** * @dev The returned amount in is not equal to the requested amount in */ error BalancerV2InvalidAmountIn(int256 amountIn); /** * @dev The returned amount out is greater than or equal to zero */ error BalancerV2InvalidAmountOut(int256 amountOut); /** * @dev The amount out is lower than the minimum amount out */ error BalancerV2BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error BalancerV2BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the reference to Balancer v2 vault */ function balancerV2Vault() external view returns (address); /** * @dev Executes a token swap in Balancer V2 * @param tokenIn Token being sent * @param tokenOut Token being received * @param amountIn Amount of tokenIn being swapped * @param minAmountOut Minimum amount of tokenOut willing to receive * @param poolId Pool ID to be used * @param hopPoolsIds Optional list of hop-pools between tokenIn and tokenOut, only used for multi-hops * @param hopTokens Optional list of hop-tokens between tokenIn and tokenOut, only used for multi-hops */ function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes32 poolId, bytes32[] memory hopPoolsIds, address[] memory hopTokens ) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IBalancerV2Vault { function getPool(bytes32 poolId) external view returns (address, uint256); function getPoolTokens(bytes32 poolId) external view returns (IERC20[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock); struct JoinPoolRequest { IERC20[] assets; uint256[] maxAmountsIn; bytes userData; bool fromInternalBalance; } function joinPool(bytes32 poolId, address sender, address recipient, JoinPoolRequest memory request) external payable; struct ExitPoolRequest { IERC20[] assets; uint256[] minAmountsOut; bytes userData; bool toInternalBalance; } function exitPool(bytes32 poolId, address sender, address payable recipient, ExitPoolRequest memory request) external; enum SwapKind { GIVEN_IN, GIVEN_OUT } struct SingleSwap { bytes32 poolId; SwapKind kind; address assetIn; address assetOut; uint256 amount; bytes userData; } struct FundManagement { address sender; bool fromInternalBalance; address payable recipient; bool toInternalBalance; } function swap(SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline) external payable returns (uint256); struct BatchSwapStep { bytes32 poolId; uint256 assetInIndex; uint256 assetOutIndex; uint256 amount; bytes userData; } function batchSwap( SwapKind kind, BatchSwapStep[] memory swaps, address[] memory assets, FundManagement memory funds, int256[] memory limits, uint256 deadline ) external payable returns (int256[] memory); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Connext connector interface * @dev Interfaces with Connext to bridge tokens */ interface IConnextConnector { /** * @dev The recipient address is zero */ error ConnextBridgeRecipientZero(); /** * @dev The source and destination chains are the same */ error ConnextBridgeSameChain(uint256 chainId); /** * @dev The chain ID is not supported */ error ConnextBridgeUnknownChainId(uint256 chainId); /** * @dev The relayer fee is greater than the amount to be bridged */ error ConnextBridgeRelayerFeeGtAmount(uint256 relayerFee, uint256 amount); /** * @dev The minimum amount out is greater than the amount to be bridged minus the relayer fee */ error ConnextBridgeMinAmountOutTooBig(uint256 minAmountOut, uint256 amount, uint256 relayerFee); /** * @dev The post token balance is lower than the previous token balance minus the amount bridged */ error ConnextBridgeBadPostTokenBalance(uint256 postBalance, uint256 preBalance, uint256 amount); /** * @dev Tells the reference to the Connext contract of the source chain */ function connext() external view returns (address); /** * @dev Executes a bridge of assets using Connext * @param chainId ID of the destination chain * @param token Address of the token to be bridged * @param amount Amount of tokens to be bridged * @param minAmountOut Min amount of tokens to receive on the destination chain after relayer fees and slippage * @param recipient Address that will receive the tokens on the destination chain * @param relayerFee Fee to be paid to the relayer */ function execute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, uint256 relayerFee ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Convex connector interface */ interface IConvexConnector { /** * @dev Missing Convex pool for the requested Curve pool */ error ConvexCvxPoolNotFound(address curvePool); /** * @dev Failed to deposit tokens into the Convex booster */ error ConvexBoosterDepositFailed(uint256 poolId, uint256 amount); /** * @dev Failed to withdraw tokens from Convex pool */ error ConvexCvxPoolWithdrawFailed(address cvxPool, uint256 amount); /** * @dev Tells the reference to the Convex booster */ function booster() external view returns (address); /** * @dev Finds the Curve pool address associated to a Convex pool */ function getCurvePool(address cvxPool) external view returns (address); /** * @dev Finds the Curve pool address associated to a Convex pool */ function getCvxPool(address curvePool) external view returns (address); /** * @dev Claims Convex pool rewards for a Curve pool */ function claim(address cvxPool) external returns (address[] memory tokens, uint256[] memory amounts); /** * @dev Deposits Curve pool tokens into Convex * @param curvePool Address of the Curve pool to join Convex * @param amount Amount of Curve pool tokens to be deposited into Convex */ function join(address curvePool, uint256 amount) external returns (uint256); /** * @dev Withdraws Curve pool tokens from Convex * @param cvxPool Address of the Convex pool to exit from Convex * @param amount Amount of Convex tokens to be withdrawn */ function exit(address cvxPool, uint256 amount) external returns (uint256); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Curve 2CRV connector interface */ interface ICurve2CrvConnector { /** * @dev Failed to find the token in the 2CRV pool */ error Curve2CrvTokenNotFound(address pool, address token); /** * @dev Token decimals exceed 18 */ error Curve2CrvTokenDecimalsAbove18(address token, uint256 decimals); /** * @dev The slippage is above one */ error Curve2CrvSlippageAboveOne(uint256 slippage); /** * @dev Adds liquidity to the 2CRV pool * @param pool Address of the 2CRV pool to join * @param tokenIn Address of the token to join the 2CRV pool * @param amountIn Amount of tokens to join the 2CRV pool * @param slippage Slippage value to be used to compute the desired min amount out of pool tokens */ function join(address pool, address tokenIn, uint256 amountIn, uint256 slippage) external returns (uint256); /** * @dev Removes liquidity from 2CRV pool * @param pool Address of the 2CRV pool to exit * @param amountIn Amount of pool tokens to exit from the 2CRV pool * @param tokenOut Address of the token to exit the pool * @param slippage Slippage value to be used to compute the desired min amount out of tokens */ function exit(address pool, uint256 amountIn, address tokenOut, uint256 slippage) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title ERC4626 connector interface */ interface IERC4626Connector { /** * @dev The token is not the underlying token of the ERC4626 */ error ERC4626InvalidToken(address token, address underlying); /** * @dev The amount deposited is lower than the expected amount */ error ERC4626BadSharesOut(uint256 shares, uint256 minSharesOut); /** * @dev The amount redeemed is lower than the expected amount */ error ERC4626BadAssetsOut(uint256 assets, uint256 minAssetsOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error ERC4626BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the underlying token of an ERC4626 */ function getToken(address erc4626) external view returns (address); /** * @dev Deposits assets to the underlying ERC4626 * @param erc4626 Address of the ERC4626 to join * @param tokenIn Address of the token to join the ERC4626 * @param assets Amount of assets to be deposited * @param minSharesOut Minimum amount of shares willing to receive */ function join(address erc4626, address tokenIn, uint256 assets, uint256 minSharesOut) external returns (address tokenOut, uint256 shares); /** * @dev Withdraws assets from the underlying ERC4626 * @param erc4626 Address of the ERC4626 to exit * @param shares Amount of shares to be redeemed * @param minAssetsOut Minimum amount of assets willing to receive */ function exit(address erc4626, uint256 shares, uint256 minAssetsOut) external returns (address token, uint256 assets); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Hop connector interface */ interface IHopBridgeConnector { /** * @dev The source and destination chains are the same */ error HopBridgeSameChain(uint256 chainId); /** * @dev The bridge operation is not supported */ error HopBridgeOpNotSupported(); /** * @dev The recipient address is zero */ error HopBridgeRecipientZero(); /** * @dev The relayer was sent when not needed */ error HopBridgeRelayerNotNeeded(); /** * @dev The deadline was sent when not needed */ error HopBridgeDeadlineNotNeeded(); /** * @dev The deadline is in the past */ error HopBridgePastDeadline(uint256 deadline, uint256 currentTimestamp); /** * @dev The post token balance is lower than the previous token balance minus the amount bridged */ error HopBridgeBadPostTokenBalance(uint256 postBalance, uint256 preBalance, uint256 amount); /** * @dev Tells the reference to the wrapped native token address */ function wrappedNativeToken() external view returns (address); /** * @dev Executes a bridge of assets using Hop Exchange * @param chainId ID of the destination chain * @param token Address of the token to be bridged * @param amount Amount of tokens to be bridged * @param minAmountOut Minimum amount of tokens willing to receive on the destination chain * @param recipient Address that will receive the tokens on the destination chain * @param bridge Address of the bridge component (i.e. hopBridge or hopAMM) * @param deadline Deadline to be used when bridging to L2 in order to swap the corresponding hToken * @param relayer Only used when transferring from L1 to L2 if a 3rd party is relaying the transfer on the user's behalf * @param fee Fee to be sent to the bridge based on the source and destination chain (i.e. relayerFee or bonderFee) */ function execute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, address bridge, uint256 deadline, address relayer, uint256 fee ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; interface IHopL2Amm { function hToken() external view returns (address); function exchangeAddress() external view returns (address); /** * @notice To send funds L2->L1 or L2->L2, call the swapAndSend method on the L2 AMM Wrapper contract * @dev Do not set destinationAmountOutMin and destinationDeadline when sending to L1 because there is no AMM on L1, * otherwise the calculated transferId will be invalid and the transfer will be unbondable. These parameters should * be set to 0 when sending to L1. * @param amount is the amount the user wants to send plus the Bonder fee */ function swapAndSend( uint256 chainId, address recipient, uint256 amount, uint256 bonderFee, uint256 amountOutMin, uint256 deadline, uint256 destinationAmountOutMin, uint256 destinationDeadline ) external payable; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Hop swap connector interface */ interface IHopSwapConnector { /** * @dev The dex address is zero */ error HopDexAddressZero(); /** * @dev The token in is the same as the token out */ error HopSwapSameToken(address token); /** * @dev The amount out is lower than the minimum amount out */ error HopBadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the pre token in balance minus the amount in */ error HopBadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Executes a token swap in Hop * @param tokenIn Token being sent * @param tokenOut Token being received * @param amountIn Amount of tokenIn being swapped * @param minAmountOut Minimum amount of tokenOut willing to receive * @param hopDexAddress Address of the Hop dex to be used */ function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address hopDexAddress) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Paraswap V5 connector interface */ interface IParaswapV5Connector { /** * @dev The token in is the same as the token out */ error ParaswapV5SwapSameToken(address token); /** * @dev The amount out is lower than the minimum amount out */ error ParaswapV5BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error ParaswapV5BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the reference to Paraswap V5 Augustus swapper */ function paraswapV5Augustus() external view returns (address); /** * @dev Executes a token swap in Paraswap V5 * @param tokenIn Token being sent * @param tokenOut Token being received * @param amountIn Amount of tokenIn being swapped * @param minAmountOut Minimum amount of tokenOut willing to receive * @param data Calldata to be sent to the Augusuts swapper */ function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes memory data) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Uniswap V2 connector interface */ interface IUniswapV2Connector { /** * @dev The token in is the same as the token out */ error UniswapV2SwapSameToken(address token); /** * @dev The pool does not exist */ error UniswapV2InvalidPool(address tokenA, address tokenB); /** * @dev The amount out is lower than the minimum amount out */ error UniswapV2BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error UniswapV2BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the reference to UniswapV2 router */ function uniswapV2Router() external view returns (address); /** * @dev Executes a token swap in Uniswap V2 * @param tokenIn Token being sent * @param tokenOut Token being received * @param amountIn Amount of tokenIn being swapped * @param minAmountOut Minimum amount of tokenOut willing to receive * @param hopTokens Optional list of hop-tokens between tokenIn and tokenOut, only used for multi-hops */ function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address[] memory hopTokens ) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Uniswap V3 connector interface */ interface IUniswapV3Connector { /** * @dev The input length mismatch */ error UniswapV3InputLengthMismatch(); /** * @dev The token in is the same as the token out */ error UniswapV3SwapSameToken(address token); /** * @dev A pool with the given tokens and fee does not exist */ error UniswapV3InvalidPoolFee(address token0, address token1, uint24 fee); /** * @dev The amount out is lower than the minimum amount out */ error UniswapV3BadAmountOut(uint256 amountOut, uint256 minAmountOut); /** * @dev The post token in balance is lower than the previous token in balance minus the amount in */ error UniswapV3BadPostTokenInBalance(uint256 postBalanceIn, uint256 preBalanceIn, uint256 amountIn); /** * @dev Tells the reference to UniswapV3 router */ function uniswapV3Router() external view returns (address); /** * @dev Executes a token swap in Uniswap V3 * @param tokenIn Token being sent * @param tokenOut Token being received * @param amountIn Amount of tokenIn being swapped * @param minAmountOut Minimum amount of tokenOut willing to receive * @param fee Fee to be used * @param hopTokens Optional list of hop-tokens between tokenIn and tokenOut, only used for multi-hops * @param hopFees Optional list of hop-fees between tokenIn and tokenOut, only used for multi-hops */ function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint24 fee, address[] memory hopTokens, uint24[] memory hopFees ) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @title Wormhole connector interface */ interface IWormholeConnector { /** * @dev The recipient address is zero */ error WormholeBridgeRecipientZero(); /** * @dev The source and destination chains are the same */ error WormholeBridgeSameChain(uint256 chainId); /** * @dev The chain ID is not supported */ error WormholeBridgeUnknownChainId(uint256 chainId); /** * @dev The relayer fee is greater than the amount to be bridged */ error WormholeBridgeRelayerFeeGtAmount(uint256 relayerFee, uint256 amount); /** * @dev The minimum amount out is greater than the amount to be bridged minus the relayer fee */ error WormholeBridgeMinAmountOutTooBig(uint256 minAmountOut, uint256 amount, uint256 relayerFee); /** * @dev The post token balance is lower than the previous token balance minus the amount bridged */ error WormholeBridgeBadPostTokenBalance(uint256 postBalance, uint256 preBalance, uint256 amount); /** * @dev Tells the reference to the Wormhole's CircleRelayer contract of the source chain */ function wormholeCircleRelayer() external view returns (address); /** * @dev Executes a bridge of assets using Wormhole's CircleRelayer integration * @param chainId ID of the destination chain * @param token Address of the token to be bridged * @param amount Amount of tokens to be bridged * @param minAmountOut Minimum amount of tokens willing to receive on the destination chain after relayer fees * @param recipient Address that will receive the tokens on the destination chain */ function execute(uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; /** * @title FixedPoint * @dev Math library to operate with fixed point values with 18 decimals */ library FixedPoint { // 1 in fixed point value: 18 decimal places uint256 internal constant ONE = 1e18; /** * @dev Multiplication overflow */ error FixedPointMulOverflow(uint256 a, uint256 b); /** * @dev Division by zero */ error FixedPointZeroDivision(); /** * @dev Division internal error */ error FixedPointDivInternal(uint256 a, uint256 aInflated); /** * @dev Multiplies two fixed point numbers rounding down */ function mulDown(uint256 a, uint256 b) internal pure returns (uint256) { unchecked { uint256 product = a * b; if (a != 0 && product / a != b) revert FixedPointMulOverflow(a, b); return product / ONE; } } /** * @dev Multiplies two fixed point numbers rounding up */ function mulUp(uint256 a, uint256 b) internal pure returns (uint256) { unchecked { uint256 product = a * b; if (a != 0 && product / a != b) revert FixedPointMulOverflow(a, b); return product == 0 ? 0 : (((product - 1) / ONE) + 1); } } /** * @dev Divides two fixed point numbers rounding down */ function divDown(uint256 a, uint256 b) internal pure returns (uint256) { unchecked { if (b == 0) revert FixedPointZeroDivision(); if (a == 0) return 0; uint256 aInflated = a * ONE; if (aInflated / a != ONE) revert FixedPointDivInternal(a, aInflated); return aInflated / b; } } /** * @dev Divides two fixed point numbers rounding up */ function divUp(uint256 a, uint256 b) internal pure returns (uint256) { unchecked { if (b == 0) revert FixedPointZeroDivision(); if (a == 0) return 0; uint256 aInflated = a * ONE; if (aInflated / a != ONE) revert FixedPointDivInternal(a, aInflated); return ((aInflated - 1) / b) + 1; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; contract TokenMock is ERC20 { uint8 internal _decimals; constructor(string memory symbol, uint8 dec) ERC20(symbol, symbol) { _decimals = dec; } function mint(address account, uint256 amount) external { _mint(account, amount); } function decimals() public view override returns (uint8) { return _decimals; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; /** * @title BytesHelpers * @dev Provides a list of Bytes helper methods */ library BytesHelpers { /** * @dev The length is shorter than start plus 32 */ error BytesOutOfBounds(uint256 start, uint256 length); /** * @dev Concatenates an address to a bytes array */ function concat(bytes memory self, address value) internal pure returns (bytes memory) { return abi.encodePacked(self, value); } /** * @dev Concatenates an uint24 to a bytes array */ function concat(bytes memory self, uint24 value) internal pure returns (bytes memory) { return abi.encodePacked(self, value); } /** * @dev Decodes a bytes array into an uint256 */ function toUint256(bytes memory self) internal pure returns (uint256) { return toUint256(self, 0); } /** * @dev Reads an uint256 from a bytes array starting at a given position */ function toUint256(bytes memory self, uint256 start) internal pure returns (uint256 result) { if (self.length < start + 32) revert BytesOutOfBounds(start, self.length); assembly { result := mload(add(add(self, 0x20), start)) } } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; /** * @title Denominations * @dev Provides a list of ground denominations for those tokens that cannot be represented by an ERC20. * For now, the only needed is the native token that could be ETH, MATIC, or other depending on the layer being operated. */ library Denominations { address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // Fiat currencies follow https://en.wikipedia.org/wiki/ISO_4217 address internal constant USD = address(840); function isNativeToken(address token) internal pure returns (bool) { return token == NATIVE_TOKEN; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import './Denominations.sol'; /** * @title ERC20Helpers * @dev Provides a list of ERC20 helper methods */ library ERC20Helpers { function approve(address token, address to, uint256 amount) internal { SafeERC20.forceApprove(IERC20(token), to, amount); } function transfer(address token, address to, uint256 amount) internal { if (Denominations.isNativeToken(token)) Address.sendValue(payable(to), amount); else SafeERC20.safeTransfer(IERC20(token), to, amount); } function balanceOf(address token, address account) internal view returns (uint256) { if (Denominations.isNativeToken(token)) return address(account).balance; else return IERC20(token).balanceOf(address(account)); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '@mimic-fi/v3-authorizer/contracts/interfaces/IAuthorized.sol'; /** * @title IPriceOracle * @dev Price oracle interface * * Tells the price of a token (base) in a given quote based the following rule: the response is expressed using the * corresponding number of decimals so that when performing a fixed point product of it by a `base` amount it results * in a value expressed in `quote` decimals. For example, if `base` is ETH and `quote` is USDC, then the returned * value is expected to be expressed using 6 decimals: * * FixedPoint.mul(X[ETH], price[USDC/ETH]) = FixedPoint.mul(X[18], price[6]) = X * price [6] */ interface IPriceOracle is IAuthorized { /** * @dev Price data * @param base Token to rate * @param quote Token used for the price rate * @param rate Price of a token (base) expressed in `quote` * @param deadline Expiration timestamp until when the given quote is considered valid */ struct PriceData { address base; address quote; uint256 rate; uint256 deadline; } /** * @dev The signer is not allowed */ error PriceOracleInvalidSigner(address signer); /** * @dev The feed for the given (base, quote) pair doesn't exist */ error PriceOracleMissingFeed(address base, address quote); /** * @dev The price deadline is in the past */ error PriceOracleOutdatedPrice(address base, address quote, uint256 deadline, uint256 currentTimestamp); /** * @dev The base decimals are bigger than the quote decimals plus the fixed point decimals */ error PriceOracleBaseDecimalsTooBig(address base, uint256 baseDecimals, address quote, uint256 quoteDecimals); /** * @dev The inverse feed decimals are bigger than the maximum inverse feed decimals */ error PriceOracleInverseFeedDecimalsTooBig(address inverseFeed, uint256 inverseFeedDecimals); /** * @dev The quote feed decimals are bigger than the base feed decimals plus the fixed point decimals */ error PriceOracleQuoteFeedDecimalsTooBig(uint256 quoteFeedDecimals, uint256 baseFeedDecimals); /** * @dev Emitted every time a signer is changed */ event SignerSet(address indexed signer, bool allowed); /** * @dev Emitted every time a feed is set for (base, quote) pair */ event FeedSet(address indexed base, address indexed quote, address feed); /** * @dev Tells whether an address is as an allowed signer or not * @param signer Address of the signer being queried */ function isSignerAllowed(address signer) external view returns (bool); /** * @dev Tells the list of allowed signers */ function getAllowedSigners() external view returns (address[] memory); /** * @dev Tells the digest expected to be signed by the off-chain oracle signers for a list of prices * @param prices List of prices to be signed */ function getPricesDigest(PriceData[] memory prices) external view returns (bytes32); /** * @dev Tells the price of a token `base` expressed in a token `quote` * @param base Token to rate * @param quote Token used for the price rate */ function getPrice(address base, address quote) external view returns (uint256); /** * @dev Tells the price of a token `base` expressed in a token `quote` * @param base Token to rate * @param quote Token used for the price rate * @param data Encoded data to validate in order to compute the requested rate */ function getPrice(address base, address quote, bytes memory data) external view returns (uint256); /** * @dev Tells the feed address for (base, quote) pair. It returns the zero address if there is no one set. * @param base Token to be rated * @param quote Token used for the price rate */ function getFeed(address base, address quote) external view returns (address); /** * @dev Sets a signer condition * @param signer Address of the signer to be set * @param allowed Whether the requested signer is allowed */ function setSigner(address signer, bool allowed) external; /** * @dev Sets a feed for a (base, quote) pair * @param base Token base to be set * @param quote Token quote to be set * @param feed Feed to be set */ function setFeed(address base, address quote, address feed) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; /** * @dev Relayer interface */ interface IRelayer { /** * @dev The token is zero */ error RelayerTokenZero(); /** * @dev The amount is zero */ error RelayerAmountZero(); /** * @dev The collector is zero */ error RelayerCollectorZero(); /** * @dev The recipient is zero */ error RelayerRecipientZero(); /** * @dev The executor is zero */ error RelayerExecutorZero(); /** * @dev Relayer no task given to execute */ error RelayerNoTaskGiven(); /** * @dev Relayer input length mismatch */ error RelayerInputLengthMismatch(); /** * @dev The sender is not allowed */ error RelayerExecutorNotAllowed(address sender); /** * @dev Trying to execute tasks from different smart vaults */ error RelayerMultipleTaskSmartVaults(address task, address taskSmartVault, address expectedSmartVault); /** * @dev The task to execute does not have permissions on the associated smart vault */ error RelayerTaskDoesNotHavePermissions(address task, address smartVault); /** * @dev The smart vault balance plus the available quota are lower than the amount to pay the relayer */ error RelayerPaymentInsufficientBalance(address smartVault, uint256 balance, uint256 quota, uint256 amount); /** * @dev It failed to send amount minus quota to the smart vault's collector */ error RelayerPaymentFailed(address smartVault, uint256 amount, uint256 quota); /** * @dev The smart vault balance is lower than the amount to withdraw */ error RelayerWithdrawInsufficientBalance(address sender, uint256 balance, uint256 amount); /** * @dev It failed to send the amount to the sender */ error RelayerWithdrawFailed(address sender, uint256 amount); /** * @dev The value sent and the amount differ */ error RelayerValueDoesNotMatchAmount(uint256 value, uint256 amount); /** * @dev The simulation executed properly */ error RelayerSimulationResult(TaskResult[] taskResults); /** * @dev Emitted every time an executor is configured */ event ExecutorSet(address indexed executor, bool allowed); /** * @dev Emitted every time the default collector is set */ event DefaultCollectorSet(address indexed collector); /** * @dev Emitted every time a collector is set for a smart vault */ event SmartVaultCollectorSet(address indexed smartVault, address indexed collector); /** * @dev Emitted every time a smart vault's maximum quota is set */ event SmartVaultMaxQuotaSet(address indexed smartVault, uint256 maxQuota); /** * @dev Emitted every time a smart vault's task is executed */ event TaskExecuted( address indexed smartVault, address indexed task, bytes data, bool success, bytes result, uint256 gas, uint256 index ); /** * @dev Emitted every time some native tokens are deposited for the smart vault's balance */ event Deposited(address indexed smartVault, uint256 amount); /** * @dev Emitted every time some native tokens are withdrawn from the smart vault's balance */ event Withdrawn(address indexed smartVault, uint256 amount); /** * @dev Emitted every time some ERC20 tokens are withdrawn from the relayer to an external account */ event FundsRescued(address indexed token, address indexed recipient, uint256 amount); /** * @dev Emitted every time a smart vault's quota is paid */ event QuotaPaid(address indexed smartVault, uint256 amount); /** * @dev Emitted every time a smart vault pays for transaction gas to the relayer */ event GasPaid(address indexed smartVault, uint256 amount, uint256 quota); /** * @dev Task result * @param success Whether the task execution succeeds or not * @param result Result of the task execution */ struct TaskResult { bool success; bytes result; } /** * @dev Tells the default collector address */ function defaultCollector() external view returns (address); /** * @dev Tells whether an executor is allowed * @param executor Address of the executor being queried */ function isExecutorAllowed(address executor) external view returns (bool); /** * @dev Tells the smart vault available balance to relay transactions * @param smartVault Address of the smart vault being queried */ function getSmartVaultBalance(address smartVault) external view returns (uint256); /** * @dev Tells the custom collector address set for a smart vault * @param smartVault Address of the smart vault being queried */ function getSmartVaultCollector(address smartVault) external view returns (address); /** * @dev Tells the smart vault maximum quota to be used * @param smartVault Address of the smart vault being queried */ function getSmartVaultMaxQuota(address smartVault) external view returns (uint256); /** * @dev Tells the smart vault used quota * @param smartVault Address of the smart vault being queried */ function getSmartVaultUsedQuota(address smartVault) external view returns (uint256); /** * @dev Tells the collector address applicable for a smart vault * @param smartVault Address of the smart vault being queried */ function getApplicableCollector(address smartVault) external view returns (address); /** * @dev Configures an external executor * @param executor Address of the executor to be set * @param allowed Whether the given executor should be allowed or not */ function setExecutor(address executor, bool allowed) external; /** * @dev Sets the default collector * @param collector Address of the new default collector to be set */ function setDefaultCollector(address collector) external; /** * @dev Sets a custom collector for a smart vault * @param smartVault Address of smart vault to set a collector for * @param collector Address of the collector to be set for the given smart vault */ function setSmartVaultCollector(address smartVault, address collector) external; /** * @dev Sets a maximum quota for a smart vault * @param smartVault Address of smart vault to set a maximum quota for * @param maxQuota Maximum quota to be set for the given smart vault */ function setSmartVaultMaxQuota(address smartVault, uint256 maxQuota) external; /** * @dev Deposits native tokens for a given smart vault * @param smartVault Address of smart vault to deposit balance for * @param amount Amount of native tokens to be deposited, must match msg.value */ function deposit(address smartVault, uint256 amount) external payable; /** * @dev Withdraws native tokens from a given smart vault * @param amount Amount of native tokens to be withdrawn */ function withdraw(uint256 amount) external; /** * @dev Executes a list of tasks * @param tasks Addresses of the tasks to execute * @param data List of calldata to execute each of the given tasks * @param continueIfFailed Whether the execution should fail in case one of the tasks fail */ function execute(address[] memory tasks, bytes[] memory data, bool continueIfFailed) external; /** * @dev Simulates an execution. * WARNING: THIS METHOD IS MEANT TO BE USED AS A VIEW FUNCTION * This method will always revert. Successful results or task execution errors are returned as * `RelayerSimulationResult` errors. Any other error should be treated as failure. * @param tasks Addresses of the tasks to simulate the execution of * @param data List of calldata to simulate each of the given tasks execution * @param continueIfFailed Whether the simulation should fail in case one of the tasks execution fails */ function simulate(address[] memory tasks, bytes[] memory data, bool continueIfFailed) external; /** * @dev Withdraw ERC20 tokens to an external account. To be used in case of accidental token transfers. * @param token Address of the token to be withdrawn * @param recipient Address where the tokens will be transferred to * @param amount Amount of tokens to withdraw */ function rescueFunds(address token, address recipient, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '@mimic-fi/v3-authorizer/contracts/interfaces/IAuthorized.sol'; /** * @dev Smart Vault interface */ interface ISmartVault is IAuthorized { /** * @dev The smart vault is paused */ error SmartVaultPaused(); /** * @dev The smart vault is unpaused */ error SmartVaultUnpaused(); /** * @dev The token is zero */ error SmartVaultTokenZero(); /** * @dev The amount is zero */ error SmartVaultAmountZero(); /** * @dev The recipient is zero */ error SmartVaultRecipientZero(); /** * @dev The connector is deprecated */ error SmartVaultConnectorDeprecated(address connector); /** * @dev The connector is not registered */ error SmartVaultConnectorNotRegistered(address connector); /** * @dev The connector is not stateless */ error SmartVaultConnectorNotStateless(address connector); /** * @dev The connector ID is zero */ error SmartVaultBalanceConnectorIdZero(); /** * @dev The balance connector's balance is lower than the requested amount to be deducted */ error SmartVaultBalanceConnectorInsufficientBalance(bytes32 id, address token, uint256 balance, uint256 amount); /** * @dev The smart vault's native token balance is lower than the requested amount to be deducted */ error SmartVaultInsufficientNativeTokenBalance(uint256 balance, uint256 amount); /** * @dev Emitted every time a smart vault is paused */ event Paused(); /** * @dev Emitted every time a smart vault is unpaused */ event Unpaused(); /** * @dev Emitted every time the price oracle is set */ event PriceOracleSet(address indexed priceOracle); /** * @dev Emitted every time a connector check is overridden */ event ConnectorCheckOverridden(address indexed connector, bool ignored); /** * @dev Emitted every time a balance connector is updated */ event BalanceConnectorUpdated(bytes32 indexed id, address indexed token, uint256 amount, bool added); /** * @dev Emitted every time `execute` is called */ event Executed(address indexed connector, bytes data, bytes result); /** * @dev Emitted every time `call` is called */ event Called(address indexed target, bytes data, uint256 value, bytes result); /** * @dev Emitted every time `wrap` is called */ event Wrapped(uint256 amount); /** * @dev Emitted every time `unwrap` is called */ event Unwrapped(uint256 amount); /** * @dev Emitted every time `collect` is called */ event Collected(address indexed token, address indexed from, uint256 amount); /** * @dev Emitted every time `withdraw` is called */ event Withdrawn(address indexed token, address indexed recipient, uint256 amount, uint256 fee); /** * @dev Tells if the smart vault is paused or not */ function isPaused() external view returns (bool); /** * @dev Tells the address of the price oracle */ function priceOracle() external view returns (address); /** * @dev Tells the address of the Mimic's registry */ function registry() external view returns (address); /** * @dev Tells the address of the Mimic's fee controller */ function feeController() external view returns (address); /** * @dev Tells the address of the wrapped native token */ function wrappedNativeToken() external view returns (address); /** * @dev Tells if a connector check is ignored * @param connector Address of the connector being queried */ function isConnectorCheckIgnored(address connector) external view returns (bool); /** * @dev Tells the balance to a balance connector for a token * @param id Balance connector identifier * @param token Address of the token querying the balance connector for */ function getBalanceConnector(bytes32 id, address token) external view returns (uint256); /** * @dev Tells whether someone has any permission over the smart vault */ function hasPermissions(address who) external view returns (bool); /** * @dev Pauses a smart vault */ function pause() external; /** * @dev Unpauses a smart vault */ function unpause() external; /** * @dev Sets the price oracle * @param newPriceOracle Address of the new price oracle to be set */ function setPriceOracle(address newPriceOracle) external; /** * @dev Overrides connector checks * @param connector Address of the connector to override its check * @param ignored Whether the connector check should be ignored */ function overrideConnectorCheck(address connector, bool ignored) external; /** * @dev Updates a balance connector * @param id Balance connector identifier to be updated * @param token Address of the token to update the balance connector for * @param amount Amount to be updated to the balance connector * @param add Whether the balance connector should be increased or decreased */ function updateBalanceConnector(bytes32 id, address token, uint256 amount, bool add) external; /** * @dev Executes a connector inside of the Smart Vault context * @param connector Address of the connector that will be executed * @param data Call data to be used for the delegate-call * @return result Call response if it was successful, otherwise it reverts */ function execute(address connector, bytes memory data) external returns (bytes memory result); /** * @dev Executes an arbitrary call from the Smart Vault * @param target Address where the call will be sent * @param data Call data to be used for the call * @param value Value in wei that will be attached to the call * @return result Call response if it was successful, otherwise it reverts */ function call(address target, bytes memory data, uint256 value) external returns (bytes memory result); /** * @dev Wrap an amount of native tokens to the wrapped ERC20 version of it * @param amount Amount of native tokens to be wrapped */ function wrap(uint256 amount) external; /** * @dev Unwrap an amount of wrapped native tokens * @param amount Amount of wrapped native tokens to unwrapped */ function unwrap(uint256 amount) external; /** * @dev Collect tokens from an external account to the Smart Vault * @param token Address of the token to be collected * @param from Address where the tokens will be transferred from * @param amount Amount of tokens to be transferred */ function collect(address token, address from, uint256 amount) external; /** * @dev Withdraw tokens to an external account * @param token Address of the token to be withdrawn * @param recipient Address where the tokens will be transferred to * @param amount Amount of tokens to withdraw */ function withdraw(address token, address recipient, uint256 amount) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // DateTime Library v2.0 // // A gas-efficient Solidity date and time library // // https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary // // Tested date range 1970/01/01 to 2345/12/31 // // Conventions: // Unit | Range | Notes // :-------- |:-------------:|:----- // timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC // year | 1970 ... 2345 | // month | 1 ... 12 | // day | 1 ... 31 | // hour | 0 ... 23 | // minute | 0 ... 59 | // second | 0 ... 59 | // dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday // // // Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018-2019. The MIT Licence. // ---------------------------------------------------------------------------- library DateTime { uint256 constant SECONDS_PER_DAY = 24 * 60 * 60; uint256 constant SECONDS_PER_HOUR = 60 * 60; uint256 constant SECONDS_PER_MINUTE = 60; int256 constant OFFSET19700101 = 2440588; uint256 constant DOW_MON = 1; uint256 constant DOW_TUE = 2; uint256 constant DOW_WED = 3; uint256 constant DOW_THU = 4; uint256 constant DOW_FRI = 5; uint256 constant DOW_SAT = 6; uint256 constant DOW_SUN = 7; // ------------------------------------------------------------------------ // Calculate the number of days from 1970/01/01 to year/month/day using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and subtracting the offset 2440588 so that 1970/01/01 is day 0 // // days = day // - 32075 // + 1461 * (year + 4800 + (month - 14) / 12) / 4 // + 367 * (month - 2 - (month - 14) / 12 * 12) / 12 // - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4 // - offset // ------------------------------------------------------------------------ function _daysFromDate(uint256 year, uint256 month, uint256 day) internal pure returns (uint256 _days) { require(year >= 1970); int256 _year = int256(year); int256 _month = int256(month); int256 _day = int256(day); int256 __days = _day - 32075 + (1461 * (_year + 4800 + (_month - 14) / 12)) / 4 + (367 * (_month - 2 - ((_month - 14) / 12) * 12)) / 12 - (3 * ((_year + 4900 + (_month - 14) / 12) / 100)) / 4 - OFFSET19700101; _days = uint256(__days); } // ------------------------------------------------------------------------ // Calculate year/month/day from the number of days since 1970/01/01 using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and adding the offset 2440588 so that 1970/01/01 is day 0 // // int L = days + 68569 + offset // int N = 4 * L / 146097 // L = L - (146097 * N + 3) / 4 // year = 4000 * (L + 1) / 1461001 // L = L - 1461 * year / 4 + 31 // month = 80 * L / 2447 // dd = L - 2447 * month / 80 // L = month / 11 // month = month + 2 - 12 * L // year = 100 * (N - 49) + year + L // ------------------------------------------------------------------------ function _daysToDate(uint256 _days) internal pure returns (uint256 year, uint256 month, uint256 day) { unchecked { int256 __days = int256(_days); int256 L = __days + 68569 + OFFSET19700101; int256 N = (4 * L) / 146097; L = L - (146097 * N + 3) / 4; int256 _year = (4000 * (L + 1)) / 1461001; L = L - (1461 * _year) / 4 + 31; int256 _month = (80 * L) / 2447; int256 _day = L - (2447 * _month) / 80; L = _month / 11; _month = _month + 2 - 12 * L; _year = 100 * (N - 49) + _year + L; year = uint256(_year); month = uint256(_month); day = uint256(_day); } } function timestampFromDate(uint256 year, uint256 month, uint256 day) internal pure returns (uint256 timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY; } function timestampFromDateTime( uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second ) internal pure returns (uint256 timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + hour * SECONDS_PER_HOUR + minute * SECONDS_PER_MINUTE + second; } function timestampToDate(uint256 timestamp) internal pure returns (uint256 year, uint256 month, uint256 day) { unchecked { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } } function timestampToDateTime(uint256 timestamp) internal pure returns (uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) { unchecked { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint256 secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; secs = secs % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; second = secs % SECONDS_PER_MINUTE; } } function isValidDate(uint256 year, uint256 month, uint256 day) internal pure returns (bool valid) { if (year >= 1970 && month > 0 && month <= 12) { uint256 daysInMonth = _getDaysInMonth(year, month); if (day > 0 && day <= daysInMonth) { valid = true; } } } function isValidDateTime(uint256 year, uint256 month, uint256 day, uint256 hour, uint256 minute, uint256 second) internal pure returns (bool valid) { if (isValidDate(year, month, day)) { if (hour < 24 && minute < 60 && second < 60) { valid = true; } } } function isLeapYear(uint256 timestamp) internal pure returns (bool leapYear) { (uint256 year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); leapYear = _isLeapYear(year); } function _isLeapYear(uint256 year) internal pure returns (bool leapYear) { leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } function isWeekDay(uint256 timestamp) internal pure returns (bool weekDay) { weekDay = getDayOfWeek(timestamp) <= DOW_FRI; } function isWeekEnd(uint256 timestamp) internal pure returns (bool weekEnd) { weekEnd = getDayOfWeek(timestamp) >= DOW_SAT; } function getDaysInMonth(uint256 timestamp) internal pure returns (uint256 daysInMonth) { (uint256 year, uint256 month,) = _daysToDate(timestamp / SECONDS_PER_DAY); daysInMonth = _getDaysInMonth(year, month); } function _getDaysInMonth(uint256 year, uint256 month) internal pure returns (uint256 daysInMonth) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { daysInMonth = 31; } else if (month != 2) { daysInMonth = 30; } else { daysInMonth = _isLeapYear(year) ? 29 : 28; } } // 1 = Monday, 7 = Sunday function getDayOfWeek(uint256 timestamp) internal pure returns (uint256 dayOfWeek) { uint256 _days = timestamp / SECONDS_PER_DAY; dayOfWeek = ((_days + 3) % 7) + 1; } function getYear(uint256 timestamp) internal pure returns (uint256 year) { (year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getMonth(uint256 timestamp) internal pure returns (uint256 month) { (, month,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getDay(uint256 timestamp) internal pure returns (uint256 day) { (,, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getHour(uint256 timestamp) internal pure returns (uint256 hour) { uint256 secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; } function getMinute(uint256 timestamp) internal pure returns (uint256 minute) { uint256 secs = timestamp % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; } function getSecond(uint256 timestamp) internal pure returns (uint256 second) { second = timestamp % SECONDS_PER_MINUTE; } function addYears(uint256 timestamp, uint256 _years) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); year += _years; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addMonths(uint256 timestamp, uint256 _months) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); month += _months; year += (month - 1) / 12; month = ((month - 1) % 12) + 1; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp >= timestamp); } function addDays(uint256 timestamp, uint256 _days) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _days * SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addHours(uint256 timestamp, uint256 _hours) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _hours * SECONDS_PER_HOUR; require(newTimestamp >= timestamp); } function addMinutes(uint256 timestamp, uint256 _minutes) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE; require(newTimestamp >= timestamp); } function addSeconds(uint256 timestamp, uint256 _seconds) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp + _seconds; require(newTimestamp >= timestamp); } function subYears(uint256 timestamp, uint256 _years) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); year -= _years; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subMonths(uint256 timestamp, uint256 _months) internal pure returns (uint256 newTimestamp) { (uint256 year, uint256 month, uint256 day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint256 yearMonth = year * 12 + (month - 1) - _months; year = yearMonth / 12; month = (yearMonth % 12) + 1; uint256 daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + (timestamp % SECONDS_PER_DAY); require(newTimestamp <= timestamp); } function subDays(uint256 timestamp, uint256 _days) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _days * SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subHours(uint256 timestamp, uint256 _hours) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _hours * SECONDS_PER_HOUR; require(newTimestamp <= timestamp); } function subMinutes(uint256 timestamp, uint256 _minutes) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE; require(newTimestamp <= timestamp); } function subSeconds(uint256 timestamp, uint256 _seconds) internal pure returns (uint256 newTimestamp) { newTimestamp = timestamp - _seconds; require(newTimestamp <= timestamp); } function diffYears(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _years) { require(fromTimestamp <= toTimestamp); (uint256 fromYear,,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint256 toYear,,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _years = toYear - fromYear; } function diffMonths(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _months) { require(fromTimestamp <= toTimestamp); (uint256 fromYear, uint256 fromMonth,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint256 toYear, uint256 toMonth,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _months = toYear * 12 + toMonth - fromYear * 12 - fromMonth; } function diffDays(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _days) { require(fromTimestamp <= toTimestamp); _days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY; } function diffHours(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _hours) { require(fromTimestamp <= toTimestamp); _hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR; } function diffMinutes(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _minutes) { require(fromTimestamp <= toTimestamp); _minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE; } function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp) internal pure returns (uint256 _seconds) { require(fromTimestamp <= toTimestamp); _seconds = toTimestamp - fromTimestamp; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; import '@mimic-fi/v3-price-oracle/contracts/interfaces/IPriceOracle.sol'; import '@mimic-fi/v3-smart-vault/contracts/interfaces/ISmartVault.sol'; import '../interfaces/base/IBaseTask.sol'; /** * @title BaseTask * @dev Base task implementation with a Smart Vault reference and using the Authorizer */ abstract contract BaseTask is IBaseTask, Authorized { // Smart Vault reference address public override smartVault; // Optional balance connector id for the previous task in the workflow bytes32 internal previousBalanceConnectorId; // Optional balance connector id for the next task in the workflow bytes32 internal nextBalanceConnectorId; /** * @dev Base task config. Only used in the initializer. * @param smartVault Address of the smart vault this task will reference, it cannot be changed once set * @param previousBalanceConnectorId Balance connector id for the previous task in the workflow * @param nextBalanceConnectorId Balance connector id for the next task in the workflow */ struct BaseConfig { address smartVault; bytes32 previousBalanceConnectorId; bytes32 nextBalanceConnectorId; } /** * @dev Initializes the base task. It does call upper contracts initializers. * @param config Base task config */ function __BaseTask_init(BaseConfig memory config) internal onlyInitializing { __Authorized_init(ISmartVault(config.smartVault).authorizer()); __BaseTask_init_unchained(config); } /** * @dev Initializes the base task. It does not call upper contracts initializers. * @param config Base task config */ function __BaseTask_init_unchained(BaseConfig memory config) internal onlyInitializing { smartVault = config.smartVault; _setBalanceConnectors(config.previousBalanceConnectorId, config.nextBalanceConnectorId); } /** * @dev Tells the address from where the token amounts to execute this task are fetched. * Since by default tasks are supposed to use balance connectors, the tokens source has to be the smart vault. * In case a task does not need to rely on a previous balance connector, it must override this function to specify * where it is getting its tokens from. */ function getTokensSource() external view virtual override returns (address) { return smartVault; } /** * @dev Tells the amount a task should use for a token. By default tasks are expected to use balance connectors. * In case a task relies on an external tokens source, it must override how the task amount is calculated. * @param token Address of the token being queried */ function getTaskAmount(address token) public view virtual override returns (uint256) { return ISmartVault(smartVault).getBalanceConnector(previousBalanceConnectorId, token); } /** * @dev Tells the previous and next balance connectors id of the previous task in the workflow */ function getBalanceConnectors() external view returns (bytes32 previous, bytes32 next) { previous = previousBalanceConnectorId; next = nextBalanceConnectorId; } /** * @dev Sets the balance connectors * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function setBalanceConnectors(bytes32 previous, bytes32 next) external override authP(authParams(previous, next)) { _setBalanceConnectors(previous, next); } /** * @dev Tells the wrapped native token address if the given address is the native token * @param token Address of the token to be checked */ function _wrappedIfNative(address token) internal view returns (address) { return Denominations.isNativeToken(token) ? _wrappedNativeToken() : token; } /** * @dev Tells whether a token is the native or the wrapped native token * @param token Address of the token to be checked */ function _isWrappedOrNative(address token) internal view returns (bool) { return Denominations.isNativeToken(token) || token == _wrappedNativeToken(); } /** * @dev Tells the wrapped native token address */ function _wrappedNativeToken() internal view returns (address) { return ISmartVault(smartVault).wrappedNativeToken(); } /** * @dev Fetches a base/quote price from the smart vault's price oracle * @param base Token to rate * @param quote Token used for the price rate */ function _getPrice(address base, address quote) internal view virtual returns (uint256) { address priceOracle = ISmartVault(smartVault).priceOracle(); if (priceOracle == address(0)) revert TaskSmartVaultPriceOracleNotSet(smartVault); bytes memory extraCallData = _decodeExtraCallData(); return extraCallData.length == 0 ? IPriceOracle(priceOracle).getPrice(_wrappedIfNative(base), _wrappedIfNative(quote)) : IPriceOracle(priceOracle).getPrice(_wrappedIfNative(base), _wrappedIfNative(quote), extraCallData); } /** * @dev Before base task hook */ function _beforeBaseTask(address token, uint256 amount) internal virtual { _decreaseBalanceConnector(token, amount); } /** * @dev After base task hook */ function _afterBaseTask(address, uint256) internal virtual { emit Executed(); } /** * @dev Decreases the previous balance connector in the smart vault if defined * @param token Address of the token to update the previous balance connector of * @param amount Amount to be updated */ function _decreaseBalanceConnector(address token, uint256 amount) internal { if (previousBalanceConnectorId != bytes32(0)) { ISmartVault(smartVault).updateBalanceConnector(previousBalanceConnectorId, token, amount, false); } } /** * @dev Increases the next balance connector in the smart vault if defined * @param token Address of the token to update the next balance connector of * @param amount Amount to be updated */ function _increaseBalanceConnector(address token, uint256 amount) internal { if (nextBalanceConnectorId != bytes32(0)) { ISmartVault(smartVault).updateBalanceConnector(nextBalanceConnectorId, token, amount, true); } } /** * @dev Sets the balance connectors * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual { if (previous == next && previous != bytes32(0)) revert TaskSameBalanceConnectors(previous); previousBalanceConnectorId = previous; nextBalanceConnectorId = next; emit BalanceConnectorsSet(previous, next); } /** * @dev Decodes any potential extra calldata stored in the calldata space. Tasks relying on the extra calldata * pattern, assume that the last word of the calldata stores the extra calldata length so it can be decoded. Note * that tasks relying on this pattern must contemplate this function may return bogus data if no extra calldata * was given. */ function _decodeExtraCallData() private pure returns (bytes memory data) { uint256 length = uint256(_decodeLastCallDataWord()); if (msg.data.length < length) return new bytes(0); data = new bytes(length); assembly { calldatacopy(add(data, 0x20), sub(sub(calldatasize(), length), 0x20), length) } } /** * @dev Returns the last calldata word. This function returns zero if the calldata is not long enough. */ function _decodeLastCallDataWord() private pure returns (bytes32 result) { if (msg.data.length < 36) return bytes32(0); assembly { result := calldataload(sub(calldatasize(), 0x20)) } } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.17; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-smart-vault/contracts/interfaces/ISmartVault.sol'; import '../interfaces/base/IGasLimitedTask.sol'; /** * @dev Gas config for tasks. It allows setting different gas-related configs, specially useful to control relayed txs. */ abstract contract GasLimitedTask is IGasLimitedTask, Authorized { using FixedPoint for uint256; // Variable used to allow a better developer experience to reimburse tx gas cost // solhint-disable-next-line var-name-mixedcase uint256 private __initialGas__; // Gas limits config GasLimitConfig internal gasLimits; /** * @dev Gas limits config * @param gasPriceLimit Gas price limit expressed in the native token * @param priorityFeeLimit Priority fee limit expressed in the native token * @param txCostLimit Transaction cost limit to be set * @param txCostLimitPct Transaction cost limit percentage to be set */ struct GasLimitConfig { uint256 gasPriceLimit; uint256 priorityFeeLimit; uint256 txCostLimit; uint256 txCostLimitPct; } /** * @dev Initializes the gas limited task. It does call upper contracts initializers. * @param config Gas limited task config */ function __GasLimitedTask_init(GasLimitConfig memory config) internal onlyInitializing { __GasLimitedTask_init_unchained(config); } /** * @dev Initializes the gas limited task. It does not call upper contracts initializers. * @param config Gas limited task config */ function __GasLimitedTask_init_unchained(GasLimitConfig memory config) internal onlyInitializing { _setGasLimits(config.gasPriceLimit, config.priorityFeeLimit, config.txCostLimit, config.txCostLimitPct); } /** * @dev Tells the gas limits config */ function getGasLimits() external view returns (uint256 gasPriceLimit, uint256 priorityFeeLimit, uint256 txCostLimit, uint256 txCostLimitPct) { return (gasLimits.gasPriceLimit, gasLimits.priorityFeeLimit, gasLimits.txCostLimit, gasLimits.txCostLimitPct); } /** * @dev Sets the gas limits config * @param newGasPriceLimit New gas price limit to be set * @param newPriorityFeeLimit New priority fee limit to be set * @param newTxCostLimit New tx cost limit to be set * @param newTxCostLimitPct New tx cost percentage limit to be set */ function setGasLimits( uint256 newGasPriceLimit, uint256 newPriorityFeeLimit, uint256 newTxCostLimit, uint256 newTxCostLimitPct ) external override authP(authParams(newGasPriceLimit, newPriorityFeeLimit, newTxCostLimit, newTxCostLimitPct)) { _setGasLimits(newGasPriceLimit, newPriorityFeeLimit, newTxCostLimit, newTxCostLimitPct); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view virtual returns (uint256); /** * @dev Initializes gas limited tasks and validates gas price limit */ function _beforeGasLimitedTask(address, uint256) internal virtual { __initialGas__ = gasleft(); GasLimitConfig memory config = gasLimits; bool isGasPriceAllowed = config.gasPriceLimit == 0 || tx.gasprice <= config.gasPriceLimit; if (!isGasPriceAllowed) revert TaskGasPriceLimitExceeded(tx.gasprice, config.gasPriceLimit); uint256 priorityFee = tx.gasprice - block.basefee; bool isPriorityFeeAllowed = config.priorityFeeLimit == 0 || priorityFee <= config.priorityFeeLimit; if (!isPriorityFeeAllowed) revert TaskPriorityFeeLimitExceeded(priorityFee, config.priorityFeeLimit); } /** * @dev Validates transaction cost limit */ function _afterGasLimitedTask(address token, uint256 amount) internal virtual { if (__initialGas__ == 0) revert TaskGasNotInitialized(); GasLimitConfig memory config = gasLimits; uint256 totalGas = __initialGas__ - gasleft(); uint256 totalCost = totalGas * tx.gasprice; bool isTxCostAllowed = config.txCostLimit == 0 || totalCost <= config.txCostLimit; if (!isTxCostAllowed) revert TaskTxCostLimitExceeded(totalCost, config.txCostLimit); delete __initialGas__; if (config.txCostLimitPct > 0 && amount > 0) { uint256 price = _getPrice(ISmartVault(this.smartVault()).wrappedNativeToken(), token); uint256 totalCostInToken = totalCost.mulUp(price); uint256 txCostPct = totalCostInToken.divUp(amount); if (txCostPct > config.txCostLimitPct) revert TaskTxCostLimitPctExceeded(txCostPct, config.txCostLimitPct); } } /** * @dev Sets the gas limits config * @param newGasPriceLimit New gas price limit to be set * @param newPriorityFeeLimit New priority fee limit to be set * @param newTxCostLimit New tx cost limit to be set * @param newTxCostLimitPct New tx cost percentage limit to be set */ function _setGasLimits( uint256 newGasPriceLimit, uint256 newPriorityFeeLimit, uint256 newTxCostLimit, uint256 newTxCostLimitPct ) internal { if (newTxCostLimitPct > FixedPoint.ONE) revert TaskTxCostLimitPctAboveOne(); gasLimits.gasPriceLimit = newGasPriceLimit; gasLimits.priorityFeeLimit = newPriorityFeeLimit; gasLimits.txCostLimit = newTxCostLimit; gasLimits.txCostLimitPct = newTxCostLimitPct; emit GasLimitsSet(newGasPriceLimit, newPriorityFeeLimit, newTxCostLimit, newTxCostLimitPct); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.17; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/IPausableTask.sol'; /** * @dev Pausable config for tasks */ abstract contract PausableTask is IPausableTask, Authorized { using FixedPoint for uint256; // Whether the task is paused or not bool public override isPaused; /** * @dev Initializes the pausable task. It does call upper contracts initializers. */ function __PausableTask_init() internal onlyInitializing { __PausableTask_init_unchained(); } /** * @dev Initializes the pausable task. It does not call upper contracts initializers. */ function __PausableTask_init_unchained() internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Pauses a task */ function pause() external override auth { if (isPaused) revert TaskPaused(); isPaused = true; emit Paused(); } /** * @dev Unpauses a task */ function unpause() external override auth { if (!isPaused) revert TaskUnpaused(); isPaused = false; emit Unpaused(); } /** * @dev Before pausable task hook */ function _beforePausableTask(address, uint256) internal virtual { if (isPaused) revert TaskPaused(); } /** * @dev After pausable task hook */ function _afterPausableTask(address, uint256) internal virtual { // solhint-disable-previous-line no-empty-blocks } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.3; import '@quant-finance/solidity-datetime/contracts/DateTime.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '../interfaces/base/ITimeLockedTask.sol'; /** * @dev Time lock config for tasks. It allows limiting the frequency of a task. */ abstract contract TimeLockedTask is ITimeLockedTask, Authorized { using DateTime for uint256; uint256 private constant DAYS_28 = 60 * 60 * 24 * 28; /** * @dev Time-locks supports different frequency modes * @param Seconds To indicate the execution must occur every certain number of seconds * @param OnDay To indicate the execution must occur on day number from 1 to 28 every certain months * @param OnLastMonthDay To indicate the execution must occur on the last day of the month every certain months */ enum Mode { Seconds, OnDay, OnLastMonthDay } // Time lock mode Mode internal _mode; // Time lock frequency uint256 internal _frequency; // Future timestamp since when the task can be executed uint256 internal _allowedAt; // Next future timestamp since when the task can be executed to be set, only used internally uint256 internal _nextAllowedAt; // Period in seconds during when a time-locked task can be executed since the allowed timestamp uint256 internal _window; /** * @dev Time lock config params. Only used in the initializer. * @param mode Time lock mode * @param frequency Time lock frequency value * @param allowedAt Time lock allowed date * @param window Time lock execution window */ struct TimeLockConfig { uint8 mode; uint256 frequency; uint256 allowedAt; uint256 window; } /** * @dev Initializes the time locked task. It does not call upper contracts initializers. * @param config Time locked task config */ function __TimeLockedTask_init(TimeLockConfig memory config) internal onlyInitializing { __TimeLockedTask_init_unchained(config); } /** * @dev Initializes the time locked task. It does call upper contracts initializers. * @param config Time locked task config */ function __TimeLockedTask_init_unchained(TimeLockConfig memory config) internal onlyInitializing { _setTimeLock(config.mode, config.frequency, config.allowedAt, config.window); } /** * @dev Tells the time-lock related information */ function getTimeLock() external view returns (uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window) { return (uint8(_mode), _frequency, _allowedAt, _window); } /** * @dev Sets a new time lock */ function setTimeLock(uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window) external override authP(authParams(mode, frequency, allowedAt, window)) { _setTimeLock(mode, frequency, allowedAt, window); } /** * @dev Before time locked task hook */ function _beforeTimeLockedTask(address, uint256) internal virtual { // Load storage variables Mode mode = _mode; uint256 frequency = _frequency; uint256 allowedAt = _allowedAt; uint256 window = _window; // First we check the current timestamp is not in the past if (block.timestamp < allowedAt) revert TaskTimeLockActive(block.timestamp, allowedAt); if (mode == Mode.Seconds) { if (frequency == 0) return; // If no window is set, the next allowed date is simply moved the number of seconds set as frequency. // Otherwise, the offset must be validated and the next allowed date is set to the next period. if (window == 0) _nextAllowedAt = block.timestamp + frequency; else { uint256 diff = block.timestamp - allowedAt; uint256 periods = diff / frequency; uint256 offset = diff - (periods * frequency); if (offset > window) revert TaskTimeLockActive(block.timestamp, allowedAt); _nextAllowedAt = allowedAt + ((periods + 1) * frequency); } } else { if (block.timestamp >= allowedAt && block.timestamp <= allowedAt + window) { // Check the current timestamp has not passed the allowed date set _nextAllowedAt = _getNextAllowedDate(allowedAt, frequency); } else { // Check the current timestamp is not before the current allowed date uint256 currentAllowedDay = mode == Mode.OnDay ? allowedAt.getDay() : block.timestamp.getDaysInMonth(); uint256 currentAllowedAt = _getCurrentAllowedDate(allowedAt, currentAllowedDay); if (block.timestamp < currentAllowedAt) revert TaskTimeLockActive(block.timestamp, currentAllowedAt); // Check the current timestamp has not passed the allowed execution window uint256 extendedCurrentAllowedAt = currentAllowedAt + window; bool exceedsExecutionWindow = block.timestamp > extendedCurrentAllowedAt; if (exceedsExecutionWindow) revert TaskTimeLockActive(block.timestamp, extendedCurrentAllowedAt); // Finally set the next allowed date to the corresponding number of months from the current date _nextAllowedAt = _getNextAllowedDate(currentAllowedAt, frequency); } } } /** * @dev After time locked task hook */ function _afterTimeLockedTask(address, uint256) internal virtual { if (_nextAllowedAt == 0) return; _setTimeLockAllowedAt(_nextAllowedAt); _nextAllowedAt = 0; } /** * @dev Sets a new time lock */ function _setTimeLock(uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window) internal { if (mode == uint8(Mode.Seconds)) { // The execution window and timestamp are optional, but both must be given or none // If given the execution window cannot be larger than the number of seconds // Also, if these are given the frequency must be checked as well, otherwise it could be unsetting the lock if (window > 0 || allowedAt > 0) { if (frequency == 0) revert TaskInvalidFrequency(mode, frequency); if (window == 0 || window > frequency) revert TaskInvalidAllowedWindow(mode, window); if (allowedAt == 0) revert TaskInvalidAllowedDate(mode, allowedAt); } } else { // The other modes can be "on-day" or "on-last-day" where the frequency represents a number of months // There is no limit for the frequency, it simply cannot be zero if (frequency == 0) revert TaskInvalidFrequency(mode, frequency); // The execution window cannot be larger than the number of months considering months of 28 days if (window == 0 || window > frequency * DAYS_28) revert TaskInvalidAllowedWindow(mode, window); // The allowed date cannot be zero if (allowedAt == 0) revert TaskInvalidAllowedDate(mode, allowedAt); // If the mode is "on-day", the allowed date must be valid for every month, then the allowed day cannot be // larger than 28. But if the mode is "on-last-day", the allowed date day must be the last day of the month if (mode == uint8(Mode.OnDay)) { if (allowedAt.getDay() > 28) revert TaskInvalidAllowedDate(mode, allowedAt); } else if (mode == uint8(Mode.OnLastMonthDay)) { if (allowedAt.getDay() != allowedAt.getDaysInMonth()) revert TaskInvalidAllowedDate(mode, allowedAt); } else { revert TaskInvalidFrequencyMode(mode); } } _mode = Mode(mode); _frequency = frequency; _allowedAt = allowedAt; _window = window; emit TimeLockSet(mode, frequency, allowedAt, window); } /** * @dev Sets the time-lock execution allowed timestamp * @param allowedAt New execution allowed timestamp to be set */ function _setTimeLockAllowedAt(uint256 allowedAt) internal { _allowedAt = allowedAt; emit TimeLockAllowedAtSet(allowedAt); } /** * @dev Tells the corresponding allowed date based on a current timestamp */ function _getCurrentAllowedDate(uint256 allowedAt, uint256 day) private view returns (uint256) { (uint256 year, uint256 month, ) = block.timestamp.timestampToDate(); return _getAllowedDateFor(allowedAt, year, month, day); } /** * @dev Tells the next allowed date based on a current allowed date considering a number of months to increase */ function _getNextAllowedDate(uint256 allowedAt, uint256 monthsToIncrease) private view returns (uint256) { (uint256 year, uint256 month, uint256 day) = allowedAt.timestampToDate(); uint256 increasedMonth = month + monthsToIncrease; uint256 nextMonth = increasedMonth % 12; uint256 nextYear = year + (increasedMonth / 12); uint256 nextDay = _mode == Mode.OnLastMonthDay ? DateTime._getDaysInMonth(nextYear, nextMonth) : day; return _getAllowedDateFor(allowedAt, nextYear, nextMonth, nextDay); } /** * @dev Builds an allowed date using a specific year, month, and day */ function _getAllowedDateFor(uint256 allowedAt, uint256 year, uint256 month, uint256 day) private pure returns (uint256) { return DateTime.timestampFromDateTime( year, month, day, allowedAt.getHour(), allowedAt.getMinute(), allowedAt.getSecond() ); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.3; import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '../interfaces/base/ITokenIndexedTask.sol'; /** * @dev Token indexed task. It defines a token acceptance list to tell which are the tokens supported by the * task. Tokens acceptance can be configured either as an allow list or as a deny list. */ abstract contract TokenIndexedTask is ITokenIndexedTask, Authorized { using EnumerableSet for EnumerableSet.AddressSet; // Acceptance list type TokensAcceptanceType public override tokensAcceptanceType; // Enumerable set of tokens included in the acceptance list EnumerableSet.AddressSet internal _tokens; /** * @dev Token index config. Only used in the initializer. * @param acceptanceType Token acceptance type to be set * @param tokens List of token addresses to be set for the acceptance list */ struct TokenIndexConfig { TokensAcceptanceType acceptanceType; address[] tokens; } /** * @dev Initializes the token indexed task. It does not call upper contracts initializers. * @param config Token indexed task config */ function __TokenIndexedTask_init(TokenIndexConfig memory config) internal onlyInitializing { __TokenIndexedTask_init_unchained(config); } /** * @dev Initializes the token indexed task. It does call upper contracts initializers. * @param config Token indexed task config */ function __TokenIndexedTask_init_unchained(TokenIndexConfig memory config) internal onlyInitializing { _setTokensAcceptanceType(config.acceptanceType); for (uint256 i = 0; i < config.tokens.length; i++) { _setTokenAcceptanceList(config.tokens[i], true); } } /** * @dev Tells whether a token is allowed or not * @param token Address of the token being queried */ function isTokenAllowed(address token) public view override returns (bool) { bool containsToken = _tokens.contains(token); return tokensAcceptanceType == TokensAcceptanceType.AllowList ? containsToken : !containsToken; } /** * @dev Sets the tokens acceptance type of the task * @param newTokensAcceptanceType New token acceptance type to be set */ function setTokensAcceptanceType(TokensAcceptanceType newTokensAcceptanceType) external override authP(authParams(uint8(newTokensAcceptanceType))) { _setTokensAcceptanceType(newTokensAcceptanceType); } /** * @dev Updates the list of tokens of the tokens acceptance list * @param tokens List of tokens to be updated from the acceptance list * @param added Whether each of the given tokens should be added or removed from the list */ function setTokensAcceptanceList(address[] memory tokens, bool[] memory added) external override auth { if (tokens.length != added.length) revert TaskAcceptanceInputLengthMismatch(); for (uint256 i = 0; i < tokens.length; i++) { _setTokenAcceptanceList(tokens[i], added[i]); } } /** * @dev Before token indexed task hook */ function _beforeTokenIndexedTask(address token, uint256) internal virtual { if (!isTokenAllowed(token)) revert TaskTokenNotAllowed(token); } /** * @dev After token indexed task hook */ function _afterTokenIndexedTask(address token, uint256) internal virtual { // solhint-disable-previous-line no-empty-blocks } /** * @dev Sets the tokens acceptance type of the task * @param newTokensAcceptanceType New token acceptance type to be set */ function _setTokensAcceptanceType(TokensAcceptanceType newTokensAcceptanceType) internal { tokensAcceptanceType = newTokensAcceptanceType; emit TokensAcceptanceTypeSet(newTokensAcceptanceType); } /** * @dev Updates a token from the tokens acceptance list * @param token Token to be updated from the acceptance list * @param added Whether the token should be added or removed from the list */ function _setTokenAcceptanceList(address token, bool added) internal { if (token == address(0)) revert TaskAcceptanceTokenZero(); added ? _tokens.add(token) : _tokens.remove(token); emit TokensAcceptanceListSet(token, added); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.3; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/ITokenThresholdTask.sol'; /** * @dev Token threshold task. It mainly works with token threshold configs that can be used to tell if * a specific token amount is compliant with certain minimum or maximum values. Token threshold tasks * make use of a default threshold config as a fallback in case there is no custom threshold defined for the token * being evaluated. */ abstract contract TokenThresholdTask is ITokenThresholdTask, Authorized { using FixedPoint for uint256; // Default threshold Threshold internal _defaultThreshold; // Custom thresholds per token mapping (address => Threshold) internal _customThresholds; /** * @dev Threshold defined by a token address and min/max values */ struct Threshold { address token; uint256 min; uint256 max; } /** * @dev Custom token threshold config. Only used in the initializer. */ struct CustomThresholdConfig { address token; Threshold threshold; } /** * @dev Token threshold config. Only used in the initializer. * @param defaultThreshold Default threshold to be set * @param customThresholdConfigs List of custom threshold configs to be set */ struct TokenThresholdConfig { Threshold defaultThreshold; CustomThresholdConfig[] customThresholdConfigs; } /** * @dev Initializes the token threshold task. It does not call upper contracts initializers. * @param config Token threshold task config */ function __TokenThresholdTask_init(TokenThresholdConfig memory config) internal onlyInitializing { __TokenThresholdTask_init_unchained(config); } /** * @dev Initializes the token threshold task. It does call upper contracts initializers. * @param config Token threshold task config */ function __TokenThresholdTask_init_unchained(TokenThresholdConfig memory config) internal onlyInitializing { Threshold memory defaultThreshold = config.defaultThreshold; _setDefaultTokenThreshold(defaultThreshold.token, defaultThreshold.min, defaultThreshold.max); for (uint256 i = 0; i < config.customThresholdConfigs.length; i++) { CustomThresholdConfig memory customThresholdConfig = config.customThresholdConfigs[i]; Threshold memory custom = customThresholdConfig.threshold; _setCustomTokenThreshold(customThresholdConfig.token, custom.token, custom.min, custom.max); } } /** * @dev Tells the default token threshold */ function defaultTokenThreshold() external view override returns (address thresholdToken, uint256 min, uint256 max) { Threshold memory threshold = _defaultThreshold; return (threshold.token, threshold.min, threshold.max); } /** * @dev Tells the token threshold defined for a specific token * @param token Address of the token being queried */ function customTokenThreshold(address token) external view override returns (address thresholdToken, uint256 min, uint256 max) { Threshold memory threshold = _customThresholds[token]; return (threshold.token, threshold.min, threshold.max); } /** * @dev Tells the threshold that should be used for a token, it prioritizes custom thresholds over the default one * @param token Address of the token being queried */ function getTokenThreshold(address token) external view virtual override returns (address thresholdToken, uint256 min, uint256 max) { Threshold memory threshold = _getTokenThreshold(token); return (threshold.token, threshold.min, threshold.max); } /** * @dev Sets a new default threshold config * @param thresholdToken New threshold token to be set * @param min New threshold minimum to be set * @param max New threshold maximum to be set */ function setDefaultTokenThreshold(address thresholdToken, uint256 min, uint256 max) external override authP(authParams(thresholdToken, min, max)) { _setDefaultTokenThreshold(thresholdToken, min, max); } /** * @dev Sets a custom token threshold * @param token Address of the token to set a custom threshold for * @param thresholdToken New custom threshold token to be set * @param min New custom threshold minimum to be set * @param max New custom threshold maximum to be set */ function setCustomTokenThreshold(address token, address thresholdToken, uint256 min, uint256 max) external override authP(authParams(token, thresholdToken, min, max)) { _setCustomTokenThreshold(token, thresholdToken, min, max); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view virtual returns (uint256); /** * @dev Tells the threshold that should be used for a token, it prioritizes custom thresholds over the default one * @param token Address of the token being queried */ function _getTokenThreshold(address token) internal view returns (Threshold memory) { Threshold storage customThreshold = _customThresholds[token]; return customThreshold.token == address(0) ? _defaultThreshold : customThreshold; } /** * @dev Before token threshold task hook */ function _beforeTokenThresholdTask(address token, uint256 amount) internal virtual { Threshold memory threshold = _getTokenThreshold(token); if (threshold.token == address(0)) return; uint256 convertedAmount = threshold.token == token ? amount : amount.mulDown(_getPrice(token, threshold.token)); bool isValid = convertedAmount >= threshold.min && (threshold.max == 0 || convertedAmount <= threshold.max); if (!isValid) revert TaskTokenThresholdNotMet(threshold.token, convertedAmount, threshold.min, threshold.max); } /** * @dev After token threshold task hook */ function _afterTokenThresholdTask(address, uint256) internal virtual { // solhint-disable-previous-line no-empty-blocks } /** * @dev Sets a new default threshold config * @param thresholdToken New threshold token to be set * @param min New threshold minimum to be set * @param max New threshold maximum to be set */ function _setDefaultTokenThreshold(address thresholdToken, uint256 min, uint256 max) internal { _setTokenThreshold(_defaultThreshold, thresholdToken, min, max); emit DefaultTokenThresholdSet(thresholdToken, min, max); } /** * @dev Sets a custom of tokens thresholds * @param token Address of the token to set a custom threshold for * @param thresholdToken New custom threshold token to be set * @param min New custom threshold minimum to be set * @param max New custom threshold maximum to be set */ function _setCustomTokenThreshold(address token, address thresholdToken, uint256 min, uint256 max) internal { if (token == address(0)) revert TaskThresholdTokenZero(); _setTokenThreshold(_customThresholds[token], thresholdToken, min, max); emit CustomTokenThresholdSet(token, thresholdToken, min, max); } /** * @dev Sets a threshold * @param threshold Threshold to be updated * @param token New threshold token to be set * @param min New threshold minimum to be set * @param max New threshold maximum to be set */ function _setTokenThreshold(Threshold storage threshold, address token, uint256 min, uint256 max) private { // If there is no threshold, all values must be zero bool isZeroThreshold = token == address(0) && min == 0 && max == 0; bool isNonZeroThreshold = token != address(0) && (max == 0 || max >= min); if (!isZeroThreshold && !isNonZeroThreshold) revert TaskInvalidThresholdInput(token, min, max); threshold.token = token; threshold.min = min; threshold.max = max; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.17; import '@mimic-fi/v3-authorizer/contracts/Authorized.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../interfaces/base/IVolumeLimitedTask.sol'; /** * @dev Volume limit config for tasks. It allows setting volume limit per period of time. */ abstract contract VolumeLimitedTask is IVolumeLimitedTask, Authorized { using FixedPoint for uint256; // Default volume limit VolumeLimit internal _defaultVolumeLimit; // Custom volume limits per token mapping (address => VolumeLimit) internal _customVolumeLimits; /** * @dev Volume limit config * @param token Address to measure the volume limit */ struct VolumeLimit { address token; uint256 amount; uint256 accrued; uint256 period; uint256 nextResetTime; } /** * @dev Volume limit params. Only used in the initializer. */ struct VolumeLimitParams { address token; uint256 amount; uint256 period; } /** * @dev Custom token volume limit config. Only used in the initializer. */ struct CustomVolumeLimitConfig { address token; VolumeLimitParams volumeLimit; } /** * @dev Volume limit config. Only used in the initializer. */ struct VolumeLimitConfig { VolumeLimitParams defaultVolumeLimit; CustomVolumeLimitConfig[] customVolumeLimitConfigs; } /** * @dev Initializes the volume limited task. It does call upper contracts initializers. * @param config Volume limited task config */ function __VolumeLimitedTask_init(VolumeLimitConfig memory config) internal onlyInitializing { __VolumeLimitedTask_init_unchained(config); } /** * @dev Initializes the volume limited task. It does not call upper contracts initializers. * @param config Volume limited task config */ function __VolumeLimitedTask_init_unchained(VolumeLimitConfig memory config) internal onlyInitializing { VolumeLimitParams memory defaultLimit = config.defaultVolumeLimit; _setDefaultVolumeLimit(defaultLimit.token, defaultLimit.amount, defaultLimit.period); for (uint256 i = 0; i < config.customVolumeLimitConfigs.length; i++) { CustomVolumeLimitConfig memory customVolumeLimitConfig = config.customVolumeLimitConfigs[i]; VolumeLimitParams memory custom = customVolumeLimitConfig.volumeLimit; _setCustomVolumeLimit(customVolumeLimitConfig.token, custom.token, custom.amount, custom.period); } } /** * @dev Tells the default volume limit set */ function defaultVolumeLimit() external view override returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime) { VolumeLimit memory limit = _defaultVolumeLimit; return (limit.token, limit.amount, limit.accrued, limit.period, limit.nextResetTime); } /** * @dev Tells the custom volume limit set for a specific token * @param token Address of the token being queried */ function customVolumeLimit(address token) external view override returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime) { VolumeLimit memory limit = _customVolumeLimits[token]; return (limit.token, limit.amount, limit.accrued, limit.period, limit.nextResetTime); } /** * @dev Tells the volume limit that should be used for a token, it prioritizes custom limits over the default one * @param token Address of the token being queried */ function getVolumeLimit(address token) external view override returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime) { VolumeLimit memory limit = _getVolumeLimit(token); return (limit.token, limit.amount, limit.accrued, limit.period, limit.nextResetTime); } /** * @dev Sets a the default volume limit config * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function setDefaultVolumeLimit(address limitToken, uint256 limitAmount, uint256 limitPeriod) external override authP(authParams(limitToken, limitAmount, limitPeriod)) { _setDefaultVolumeLimit(limitToken, limitAmount, limitPeriod); } /** * @dev Sets a custom volume limit * @param token Address of the token to set a custom volume limit for * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function setCustomVolumeLimit(address token, address limitToken, uint256 limitAmount, uint256 limitPeriod) external override authP(authParams(token, limitToken, limitAmount, limitPeriod)) { _setCustomVolumeLimit(token, limitToken, limitAmount, limitPeriod); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view virtual returns (uint256); /** * @dev Tells the volume limit that should be used for a token, it prioritizes custom limits over the default one * @param token Address of the token being queried */ function _getVolumeLimit(address token) internal view returns (VolumeLimit storage) { VolumeLimit storage customLimit = _customVolumeLimits[token]; return customLimit.token == address(0) ? _defaultVolumeLimit : customLimit; } /** * @dev Before volume limited task hook */ function _beforeVolumeLimitedTask(address token, uint256 amount) internal virtual { VolumeLimit memory limit = _getVolumeLimit(token); if (limit.token == address(0)) return; uint256 amountInLimitToken = limit.token == token ? amount : amount.mulDown(_getPrice(token, limit.token)); uint256 processedVolume = amountInLimitToken + (block.timestamp < limit.nextResetTime ? limit.accrued : 0); if (processedVolume > limit.amount) revert TaskVolumeLimitExceeded(limit.token, limit.amount, processedVolume); } /** * @dev After volume limited task hook */ function _afterVolumeLimitedTask(address token, uint256 amount) internal virtual { VolumeLimit storage limit = _getVolumeLimit(token); if (limit.token == address(0)) return; uint256 amountInLimitToken = limit.token == token ? amount : amount.mulDown(_getPrice(token, limit.token)); if (block.timestamp >= limit.nextResetTime) { limit.accrued = 0; limit.nextResetTime = block.timestamp + limit.period; } limit.accrued += amountInLimitToken; } /** * @dev Sets the default volume limit * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function _setDefaultVolumeLimit(address limitToken, uint256 limitAmount, uint256 limitPeriod) internal { _setVolumeLimit(_defaultVolumeLimit, limitToken, limitAmount, limitPeriod); emit DefaultVolumeLimitSet(limitToken, limitAmount, limitPeriod); } /** * @dev Sets a custom volume limit * @param token Address of the token to set a custom volume limit for * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function _setCustomVolumeLimit(address token, address limitToken, uint256 limitAmount, uint256 limitPeriod) internal { if (token == address(0)) revert TaskVolumeLimitTokenZero(); _setVolumeLimit(_customVolumeLimits[token], limitToken, limitAmount, limitPeriod); emit CustomVolumeLimitSet(token, limitToken, limitAmount, limitPeriod); } /** * @dev Sets a volume limit * @param limit Volume limit to be updated * @param token Address of the token to measure the volume limit * @param amount Amount of tokens to be applied for the volume limit * @param period Frequency to Amount of tokens to be applied for the volume limit */ function _setVolumeLimit(VolumeLimit storage limit, address token, uint256 amount, uint256 period) private { // If there is no limit, all values must be zero bool isZeroLimit = token == address(0) && amount == 0 && period == 0; bool isNonZeroLimit = token != address(0) && amount > 0 && period > 0; if (!isZeroLimit && !isNonZeroLimit) revert TaskInvalidVolumeLimitInput(token, amount, period); // Changing the period only affects the end time of the next period, but not the end date of the current one limit.period = period; // Changing the amount does not affect the totalizator, it only applies when updating the accrued amount. // Note that it can happen that the new amount is lower than the accrued amount if the amount is lowered. // However, there shouldn't be any accounting issues with that. limit.amount = amount; // Therefore, only clean the totalizators if the limit is being removed if (isZeroLimit) { limit.accrued = 0; limit.nextResetTime = 0; } else { // If limit is not zero, set the next reset time if it wasn't set already // Otherwise, if the token is being changed the accrued amount must be updated accordingly if (limit.nextResetTime == 0) { limit.accrued = 0; limit.nextResetTime = block.timestamp + period; } else if (limit.token != token) { uint256 price = _getPrice(limit.token, token); limit.accrued = limit.accrued.mulDown(price); } } // Finally simply set the new requested token limit.token = token; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/axelar/IAxelarConnector.sol'; import './BaseBridgeTask.sol'; import '../interfaces/bridge/IAxelarBridger.sol'; /** * @title Axelar bridger * @dev Task that extends the base bridge task to use Axelar */ contract AxelarBridger is IAxelarBridger, BaseBridgeTask { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('AXELAR_BRIDGER'); /** * @dev Axelar bridge config. Only used in the initializer. */ struct AxelarBridgeConfig { BaseBridgeConfig baseBridgeConfig; } /** * @dev Initializes the Axelar bridger * @param config Axelar bridge config */ function initialize(AxelarBridgeConfig memory config) external virtual initializer { __AxelarBridger_init(config); } /** * @dev Initializes the Axelar bridger. It does call upper contracts initializers. * @param config Axelar bridge config */ function __AxelarBridger_init(AxelarBridgeConfig memory config) internal onlyInitializing { __BaseBridgeTask_init(config.baseBridgeConfig); __AxelarBridger_init_unchained(config); } /** * @dev Initializes the Axelar bridger. It does not call upper contracts initializers. * @param config Axelar bridge config */ function __AxelarBridger_init_unchained(AxelarBridgeConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Axelar bridger */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeAxelarBridger(token, amount); bytes memory connectorData = abi.encodeWithSelector( IAxelarConnector.execute.selector, getDestinationChain(token), token, amount, recipient ); ISmartVault(smartVault).execute(connector, connectorData); _afterAxelarBridger(token, amount); } /** * @dev Before Axelar bridger hook */ function _beforeAxelarBridger(address token, uint256 amount) internal virtual { // Axelar does not support specifying slippage nor fee _beforeBaseBridgeTask(token, amount, 0, 0); } /** * @dev After Axelar bridger task hook */ function _afterAxelarBridger(address token, uint256 amount) internal virtual { // Axelar does not support specifying slippage nor fee _afterBaseBridgeTask(token, amount, 0, 0); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../Task.sol'; import '../interfaces/bridge/IBaseBridgeTask.sol'; /** * @title Base bridge task * @dev Task that offers the basic components for more detailed bridge tasks */ abstract contract BaseBridgeTask is IBaseBridgeTask, Task { using FixedPoint for uint256; // Connector address address public override connector; // Connector address address public override recipient; // Default destination chain uint256 public override defaultDestinationChain; // Default maximum slippage in fixed point uint256 public override defaultMaxSlippage; // Default maximum fee MaxFee internal _defaultMaxFee; // Destination chain per token address mapping (address => uint256) public override customDestinationChain; // Maximum slippage per token address mapping (address => uint256) public override customMaxSlippage; // Maximum fee per token address mapping (address => MaxFee) internal _customMaxFee; /** * @dev Maximum fee defined by a token address and a max fee value */ struct MaxFee { address token; uint256 amount; } /** * @dev Custom destination chain config. Only used in the initializer. */ struct CustomDestinationChain { address token; uint256 destinationChain; } /** * @dev Custom max slippage config. Only used in the initializer. */ struct CustomMaxSlippage { address token; uint256 maxSlippage; } /** * @dev Custom max fee config. Only used in the initializer. */ struct CustomMaxFee { address token; MaxFee maxFee; } /** * @dev Base bridge config. Only used in the initializer. */ struct BaseBridgeConfig { address connector; address recipient; uint256 destinationChain; uint256 maxSlippage; MaxFee maxFee; CustomDestinationChain[] customDestinationChains; CustomMaxSlippage[] customMaxSlippages; CustomMaxFee[] customMaxFees; TaskConfig taskConfig; } /** * @dev Initializes the base bridge task. It does call upper contracts initializers. * @param config Base bridge config */ function __BaseBridgeTask_init(BaseBridgeConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseBridgeTask_init_unchained(config); } /** * @dev Initializes the base bridge task. It does not call upper contracts initializers. * @param config Base bridge config */ function __BaseBridgeTask_init_unchained(BaseBridgeConfig memory config) internal onlyInitializing { _setConnector(config.connector); _setRecipient(config.recipient); _setDefaultDestinationChain(config.destinationChain); _setDefaultMaxSlippage(config.maxSlippage); MaxFee memory defaultFee = config.maxFee; _setDefaultMaxFee(defaultFee.token, defaultFee.amount); for (uint256 i = 0; i < config.customDestinationChains.length; i++) { CustomDestinationChain memory customConfig = config.customDestinationChains[i]; _setCustomDestinationChain(customConfig.token, customConfig.destinationChain); } for (uint256 i = 0; i < config.customMaxSlippages.length; i++) { _setCustomMaxSlippage(config.customMaxSlippages[i].token, config.customMaxSlippages[i].maxSlippage); } for (uint256 i = 0; i < config.customMaxFees.length; i++) { CustomMaxFee memory customConfig = config.customMaxFees[i]; MaxFee memory maxFee = customConfig.maxFee; _setCustomMaxFee(customConfig.token, maxFee.token, maxFee.amount); } } /** * @dev Tells the default max fee */ function defaultMaxFee() external view override returns (address maxFeeToken, uint256 amount) { MaxFee memory maxFee = _defaultMaxFee; return (maxFee.token, maxFee.amount); } /** * @dev Tells the max fee defined for a specific token * @param token Address of the token being queried */ function customMaxFee(address token) external view override returns (address maxFeeToken, uint256 amount) { MaxFee memory maxFee = _customMaxFee[token]; return (maxFee.token, maxFee.amount); } /** * @dev Tells the destination chain that should be used for a token * @param token Address of the token to get the destination chain for */ function getDestinationChain(address token) public view virtual override returns (uint256) { uint256 chain = customDestinationChain[token]; return chain == 0 ? defaultDestinationChain : chain; } /** * @dev Tells the max slippage that should be used for a token * @param token Address of the token to get the max slippage for */ function getMaxSlippage(address token) public view virtual override returns (uint256) { uint256 maxSlippage = customMaxSlippage[token]; return maxSlippage == 0 ? defaultMaxSlippage : maxSlippage; } /** * @dev Tells the max fee that should be used for a token * @param token Address of the token to get the max fee for */ function getMaxFee(address token) external view virtual override returns (address maxFeeToken, uint256 amount) { MaxFee memory maxFee = _getMaxFee(token); return (maxFee.token, maxFee.amount); } /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Sets the recipient address. Sender must be authorized. * @param newRecipient Address of the new recipient to be set */ function setRecipient(address newRecipient) external override authP(authParams(newRecipient)) { _setRecipient(newRecipient); } /** * @dev Sets the default destination chain * @param destinationChain Default destination chain to be set */ function setDefaultDestinationChain(uint256 destinationChain) external override authP(authParams(destinationChain)) { _setDefaultDestinationChain(destinationChain); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external override authP(authParams(maxSlippage)) { _setDefaultMaxSlippage(maxSlippage); } /** * @dev Sets the default max fee * @param maxFeeToken Default max fee token to be set * @param amount Default max fee amount to be set */ function setDefaultMaxFee(address maxFeeToken, uint256 amount) external override authP(authParams(maxFeeToken, amount)) { _setDefaultMaxFee(maxFeeToken, amount); } /** * @dev Sets a custom destination chain * @param token Address of the token to set a custom destination chain for * @param destinationChain Destination chain to be set */ function setCustomDestinationChain(address token, uint256 destinationChain) external override authP(authParams(token, destinationChain)) { _setCustomDestinationChain(token, destinationChain); } /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external override authP(authParams(token, maxSlippage)) { _setCustomMaxSlippage(token, maxSlippage); } /** * @dev Sets a custom max fee * @param token Address of the token to set a custom max fee for * @param maxFeeToken Max fee token to be set for the given token * @param amount Max fee amount to be set for the given token */ function setCustomMaxFee(address token, address maxFeeToken, uint256 amount) external override authP(authParams(token, maxFeeToken, amount)) { _setCustomMaxFee(token, maxFeeToken, amount); } /** * @dev Tells the max fee that should be used for a token * @param token Address of the token to get the max fee for */ function _getMaxFee(address token) internal view virtual returns (MaxFee memory) { MaxFee memory maxFee = _customMaxFee[token]; return maxFee.token == address(0) ? _defaultMaxFee : maxFee; } /** * @dev Before base bridge task hook */ function _beforeBaseBridgeTask(address token, uint256 amount, uint256 slippage, uint256 fee) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); if (getDestinationChain(token) == 0) revert TaskDestinationChainNotSet(); uint256 maxSlippage = getMaxSlippage(token); if (slippage > maxSlippage) revert TaskSlippageAboveMax(slippage, maxSlippage); // If no fee is given we simply ignore the max fee config if (fee == 0) return; // Otherwise, we revert in case there is no max fee set MaxFee memory maxFee = _getMaxFee(token); if (maxFee.token == address(0)) revert TaskFeeAboveMax(fee, maxFee.amount); uint256 convertedFee = maxFee.token == token ? fee : fee.mulDown(_getPrice(token, maxFee.token)); if (convertedFee > maxFee.amount) revert TaskFeeAboveMax(convertedFee, maxFee.amount); } /** * @dev After base bridge task hook */ function _afterBaseBridgeTask(address token, uint256 amount, uint256, uint256) internal virtual { _afterTask(token, amount); } /** * @dev Sets the balance connectors. Next balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (next != bytes32(0)) revert TaskNextConnectorNotZero(next); super._setBalanceConnectors(previous, next); } /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } /** * @dev Sets the recipient address * @param newRecipient Address of the new recipient to be set */ function _setRecipient(address newRecipient) internal { if (newRecipient == address(0)) revert TaskRecipientZero(); recipient = newRecipient; emit RecipientSet(newRecipient); } /** * @dev Sets the default destination chain * @param destinationChain Default destination chain to be set */ function _setDefaultDestinationChain(uint256 destinationChain) internal { if (destinationChain == block.chainid) revert TaskBridgeCurrentChainId(destinationChain); defaultDestinationChain = destinationChain; emit DefaultDestinationChainSet(destinationChain); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function _setDefaultMaxSlippage(uint256 maxSlippage) internal { if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); defaultMaxSlippage = maxSlippage; emit DefaultMaxSlippageSet(maxSlippage); } /** * @dev Sets the default max fee * @param maxFeeToken Default max fee token to be set * @param amount Default max fee amount to be set */ function _setDefaultMaxFee(address maxFeeToken, uint256 amount) internal { _setMaxFee(_defaultMaxFee, maxFeeToken, amount); emit DefaultMaxFeeSet(maxFeeToken, amount); } /** * @dev Sets a custom destination chain for a token * @param token Address of the token to set the custom destination chain for * @param destinationChain Destination chain to be set */ function _setCustomDestinationChain(address token, uint256 destinationChain) internal { if (token == address(0)) revert TaskTokenZero(); if (destinationChain == block.chainid) revert TaskBridgeCurrentChainId(destinationChain); customDestinationChain[token] = destinationChain; emit CustomDestinationChainSet(token, destinationChain); } /** * @dev Sets a custom max slippage for a token * @param token Address of the token to set the custom max slippage for * @param maxSlippage Max slippage to be set */ function _setCustomMaxSlippage(address token, uint256 maxSlippage) internal { if (token == address(0)) revert TaskTokenZero(); if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); customMaxSlippage[token] = maxSlippage; emit CustomMaxSlippageSet(token, maxSlippage); } /** * @dev Sets a custom max fee for a token * @param token Address of the token to set the custom max fee for * @param maxFeeToken Max fee token to be set for the given token * @param amount Max fee amount to be set for the given token */ function _setCustomMaxFee(address token, address maxFeeToken, uint256 amount) internal { if (token == address(0)) revert TaskTokenZero(); _setMaxFee(_customMaxFee[token], maxFeeToken, amount); emit CustomMaxFeeSet(token, maxFeeToken, amount); } /** * @dev Sets a max fee * @param maxFee Max fee to be updated * @param token Max fee token to be set * @param amount Max fee amount to be set */ function _setMaxFee(MaxFee storage maxFee, address token, uint256 amount) private { if (token == address(0) && amount != 0) revert TaskInvalidMaxFee(); maxFee.token = token; maxFee.amount = amount; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/connext/IConnextConnector.sol'; import './BaseBridgeTask.sol'; import '../interfaces/bridge/IConnextBridger.sol'; /** * @title Connext bridger * @dev Task that extends the base bridge task to use Connext */ contract ConnextBridger is IConnextBridger, BaseBridgeTask { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CONNEXT_BRIDGER'); /** * @dev Connext bridge config. Only used in the initializer. */ struct ConnextBridgeConfig { BaseBridgeConfig baseBridgeConfig; } /** * @dev Initializes the Connext bridger * @param config Connext bridge config */ function initialize(ConnextBridgeConfig memory config) external virtual initializer { __ConnextBridger_init(config); } /** * @dev Initializes the Connext bridger. It does call upper contracts initializers. * @param config Connext bridge config */ function __ConnextBridger_init(ConnextBridgeConfig memory config) internal onlyInitializing { __BaseBridgeTask_init(config.baseBridgeConfig); __ConnextBridger_init_unchained(config); } /** * @dev Initializes the Connext bridger. It does not call upper contracts initializers. * @param config Connext bridge config */ function __ConnextBridger_init_unchained(ConnextBridgeConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Connext bridger */ function call(address token, uint256 amount, uint256 slippage, uint256 fee) external override authP(authParams(token, amount, slippage, fee)) { if (amount == 0) amount = getTaskAmount(token); _beforeConnextBridger(token, amount, slippage, fee); uint256 amountAfterFees = amount - fee; uint256 minAmountOut = amountAfterFees.mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IConnextConnector.execute.selector, getDestinationChain(token), token, amount, minAmountOut, recipient, fee ); ISmartVault(smartVault).execute(connector, connectorData); _afterConnextBridger(token, amount, slippage, fee); } /** * @dev Before connext bridger hook */ function _beforeConnextBridger(address token, uint256 amount, uint256 slippage, uint256 fee) internal virtual { _beforeBaseBridgeTask(token, amount, slippage, fee); } /** * @dev After connext bridger hook */ function _afterConnextBridger(address token, uint256 amount, uint256 slippage, uint256 fee) internal virtual { _afterBaseBridgeTask(token, amount, slippage, fee); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopBridgeConnector.sol'; import './BaseBridgeTask.sol'; import '../interfaces/bridge/IHopBridger.sol'; /** * @title Hop bridger * @dev Task that extends the base bridge task to use Hop */ contract HopBridger is IHopBridger, BaseBridgeTask { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('HOP_BRIDGER'); // Relayer address address public override relayer; // Maximum deadline in seconds uint256 public override maxDeadline; // List of Hop entrypoints per token mapping (address => address) public override tokenHopEntrypoint; /** * @dev Token Hop entrypoint config. Only used in the initializer. */ struct TokenHopEntrypoint { address token; address entrypoint; } /** * @dev Hop bridge config. Only used in the initializer. */ struct HopBridgeConfig { address relayer; uint256 maxDeadline; TokenHopEntrypoint[] tokenHopEntrypoints; BaseBridgeConfig baseBridgeConfig; } /** * @dev Initializes the Hop bridger * @param config Hop bridge config */ function initialize(HopBridgeConfig memory config) external virtual initializer { __HopBridger_init(config); } /** * @dev Initializes the Hop bridger. It does call upper contracts initializers. * @param config Hop bridge config */ function __HopBridger_init(HopBridgeConfig memory config) internal onlyInitializing { __BaseBridgeTask_init(config.baseBridgeConfig); __HopBridger_init_unchained(config); } /** * @dev Initializes the Hop bridger. It does not call upper contracts initializers. * @param config Hop bridge config */ function __HopBridger_init_unchained(HopBridgeConfig memory config) internal onlyInitializing { _setRelayer(config.relayer); _setMaxDeadline(config.maxDeadline); for (uint256 i = 0; i < config.tokenHopEntrypoints.length; i++) { TokenHopEntrypoint memory customConfig = config.tokenHopEntrypoints[i]; _setTokenHopEntrypoint(customConfig.token, customConfig.entrypoint); } } /** * @dev Sets the relayer, only used when bridging from L1 to L2 * @param newRelayer New relayer address to be set */ function setRelayer(address newRelayer) external override authP(authParams(newRelayer)) { _setRelayer(newRelayer); } /** * @dev Sets the max deadline * @param newMaxDeadline New max deadline to be set */ function setMaxDeadline(uint256 newMaxDeadline) external override authP(authParams(newMaxDeadline)) { _setMaxDeadline(newMaxDeadline); } /** * @dev Sets an entrypoint for a tokens * @param token Token address to set a Hop entrypoint for * @param entrypoint Hop entrypoint address to be set for a token */ function setTokenHopEntrypoint(address token, address entrypoint) external override authP(authParams(token, entrypoint)) { _setTokenHopEntrypoint(token, entrypoint); } /** * @dev Execute Hop bridger */ function call(address token, uint256 amount, uint256 slippage, uint256 fee) external override authP(authParams(token, amount, slippage, fee)) { if (amount == 0) amount = getTaskAmount(token); _beforeHopBridger(token, amount, slippage, fee); uint256 amountAfterFees = amount - fee; uint256 minAmountOut = amountAfterFees.mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IHopBridgeConnector.execute.selector, getDestinationChain(token), token, amount, minAmountOut, recipient, tokenHopEntrypoint[token], block.timestamp + maxDeadline, relayer, fee ); ISmartVault(smartVault).execute(connector, connectorData); _afterHopBridger(token, amount, slippage, fee); } /** * @dev Before Hop bridger hook */ function _beforeHopBridger(address token, uint256 amount, uint256 slippage, uint256 fee) internal virtual { _beforeBaseBridgeTask(token, amount, slippage, fee); if (tokenHopEntrypoint[token] == address(0)) revert TaskMissingHopEntrypoint(); } /** * @dev After Hop bridger hook */ function _afterHopBridger(address token, uint256 amount, uint256 slippage, uint256 fee) internal virtual { _afterBaseBridgeTask(token, amount, slippage, fee); } /** * @dev Sets the relayer address, only used when bridging from L1 to L2 */ function _setRelayer(address _relayer) internal { relayer = _relayer; emit RelayerSet(_relayer); } /** * @dev Sets the max deadline */ function _setMaxDeadline(uint256 _maxDeadline) internal { if (_maxDeadline == 0) revert TaskMaxDeadlineZero(); maxDeadline = _maxDeadline; emit MaxDeadlineSet(_maxDeadline); } /** * @dev Set a Hop entrypoint for a token * @param token Address of the token to set a Hop entrypoint for * @param entrypoint Hop entrypoint to be set */ function _setTokenHopEntrypoint(address token, address entrypoint) internal { if (token == address(0)) revert TaskTokenZero(); tokenHopEntrypoint[token] = entrypoint; emit TokenHopEntrypointSet(token, entrypoint); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/wormhole/IWormholeConnector.sol'; import './BaseBridgeTask.sol'; import '../interfaces/bridge/IWormholeBridger.sol'; /** * @title Wormhole bridger * @dev Task that extends the bridger task to use Wormhole */ contract WormholeBridger is IWormholeBridger, BaseBridgeTask { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('WORMHOLE_BRIDGER'); /** * @dev Wormhole bridge config. Only used in the initializer. */ struct WormholeBridgeConfig { BaseBridgeConfig baseBridgeConfig; } /** * @dev Initializes the Wormhole bridger * @param config Wormhole bridge config */ function initialize(WormholeBridgeConfig memory config) external virtual initializer { __WormholeBridger_init(config); } /** * @dev Initializes the Wormhole bridger. It does call upper contracts initializers. * @param config Wormhole bridge config */ function __WormholeBridger_init(WormholeBridgeConfig memory config) internal onlyInitializing { __BaseBridgeTask_init(config.baseBridgeConfig); __WormholeBridger_init_unchained(config); } /** * @dev Initializes the Wormhole bridger. It does not call upper contracts initializers. * @param config Wormhole bridge config */ function __WormholeBridger_init_unchained(WormholeBridgeConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Wormhole bridger */ function call(address token, uint256 amount, uint256 fee) external override authP(authParams(token, amount, fee)) { if (amount == 0) amount = getTaskAmount(token); _beforeWormholeBridger(token, amount, fee); uint256 minAmountOut = amount - fee; bytes memory connectorData = abi.encodeWithSelector( IWormholeConnector.execute.selector, getDestinationChain(token), token, amount, minAmountOut, recipient ); ISmartVault(smartVault).execute(connector, connectorData); _afterWormholeBridger(token, amount, fee); } /** * @dev Before Wormhole bridger hook */ function _beforeWormholeBridger(address token, uint256 amount, uint256 fee) internal virtual { // Wormhole does not support specifying slippage _beforeBaseBridgeTask(token, amount, 0, fee); } /** * @dev After Wormhole bridger hook */ function _afterWormholeBridger(address token, uint256 amount, uint256 fee) internal virtual { // Wormhole does not support specifying slippage _afterBaseBridgeTask(token, amount, 0, fee); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '@mimic-fi/v3-authorizer/contracts/interfaces/IAuthorized.sol'; /** * @dev Base task interface */ interface IBaseTask is IAuthorized { // Execution type serves for relayers in order to distinguish how each task must be executed // solhint-disable-next-line func-name-mixedcase function EXECUTION_TYPE() external view returns (bytes32); /** * @dev The balance connectors are the same */ error TaskSameBalanceConnectors(bytes32 connectorId); /** * @dev The smart vault's price oracle is not set */ error TaskSmartVaultPriceOracleNotSet(address smartVault); /** * @dev Emitted every time a task is executed */ event Executed(); /** * @dev Emitted every time the balance connectors are set */ event BalanceConnectorsSet(bytes32 indexed previous, bytes32 indexed next); /** * @dev Tells the address of the Smart Vault tied to it, it cannot be changed */ function smartVault() external view returns (address); /** * @dev Tells the address from where the token amounts to execute this task are fetched. * This address must be the Smart Vault in case the previous balance connector is set. */ function getTokensSource() external view returns (address); /** * @dev Tells the amount a task should use for a token * @param token Address of the token being queried */ function getTaskAmount(address token) external view returns (uint256); /** * @dev Tells the previous and next balance connectors id of the previous task in the workflow */ function getBalanceConnectors() external view returns (bytes32 previous, bytes32 next); /** * @dev Sets the balance connector IDs * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function setBalanceConnectors(bytes32 previous, bytes32 next) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Gas limited task interface */ interface IGasLimitedTask is IBaseTask { /** * @dev The tx initial gas cache has not been initialized */ error TaskGasNotInitialized(); /** * @dev The gas price used is greater than the limit */ error TaskGasPriceLimitExceeded(uint256 gasPrice, uint256 gasPriceLimit); /** * @dev The priority fee used is greater than the priority fee limit */ error TaskPriorityFeeLimitExceeded(uint256 priorityFee, uint256 priorityFeeLimit); /** * @dev The transaction cost is greater than the transaction cost limit */ error TaskTxCostLimitExceeded(uint256 txCost, uint256 txCostLimit); /** * @dev The transaction cost percentage is greater than the transaction cost limit percentage */ error TaskTxCostLimitPctExceeded(uint256 txCostPct, uint256 txCostLimitPct); /** * @dev The new transaction cost limit percentage is greater than one */ error TaskTxCostLimitPctAboveOne(); /** * @dev Emitted every time the gas limits are set */ event GasLimitsSet(uint256 gasPriceLimit, uint256 priorityFeeLimit, uint256 txCostLimit, uint256 txCostLimitPct); /** * @dev Tells the gas limits config */ function getGasLimits() external view returns (uint256 gasPriceLimit, uint256 priorityFeeLimit, uint256 txCostLimit, uint256 txCostLimitPct); /** * @dev Sets the gas limits config * @param newGasPriceLimit New gas price limit to be set * @param newPriorityFeeLimit New priority fee limit to be set * @param newTxCostLimit New tx cost limit to be set * @param newTxCostLimitPct New tx cost percentage limit to be set */ function setGasLimits( uint256 newGasPriceLimit, uint256 newPriorityFeeLimit, uint256 newTxCostLimit, uint256 newTxCostLimitPct ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Pausable task interface */ interface IPausableTask is IBaseTask { /** * @dev The task is paused */ error TaskPaused(); /** * @dev The task is unpaused */ error TaskUnpaused(); /** * @dev Emitted every time a task is paused */ event Paused(); /** * @dev Emitted every time a task is unpaused */ event Unpaused(); /** * @dev Tells the task is paused or not */ function isPaused() external view returns (bool); /** * @dev Pauses a task */ function pause() external; /** * @dev Unpauses a task */ function unpause() external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Time-locked task interface */ interface ITimeLockedTask is IBaseTask { /** * @dev The time lock frequency mode requested is invalid */ error TaskInvalidFrequencyMode(uint8 mode); /** * @dev The time lock frequency is not valid */ error TaskInvalidFrequency(uint8 mode, uint256 frequency); /** * @dev The time lock allowed date is not valid */ error TaskInvalidAllowedDate(uint8 mode, uint256 date); /** * @dev The time lock allowed window is not valid */ error TaskInvalidAllowedWindow(uint8 mode, uint256 window); /** * @dev The time lock is still active */ error TaskTimeLockActive(uint256 currentTimestamp, uint256 expiration); /** * @dev Emitted every time a new time lock is set */ event TimeLockSet(uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window); /** * @dev Emitted every time a new expiration timestamp is set */ event TimeLockAllowedAtSet(uint256 allowedAt); /** * @dev Tells all the time-lock related information */ function getTimeLock() external view returns (uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window); /** * @dev Sets the time-lock * @param mode Time lock mode * @param frequency Time lock frequency * @param allowedAt Future timestamp since when the task can be executed * @param window Period in seconds during when a time-locked task can be executed since the allowed timestamp */ function setTimeLock(uint8 mode, uint256 frequency, uint256 allowedAt, uint256 window) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Token indexed task interface */ interface ITokenIndexedTask is IBaseTask { /** * @dev Acceptance list types: either deny-list to express "all except" or allow-list to express "only" */ enum TokensAcceptanceType { DenyList, AllowList } /** * @dev The acceptance token is zero */ error TaskAcceptanceTokenZero(); /** * @dev The tokens acceptance input length mismatch */ error TaskAcceptanceInputLengthMismatch(); /** * @dev The token is not allowed */ error TaskTokenNotAllowed(address token); /** * @dev Emitted every time a tokens acceptance type is set */ event TokensAcceptanceTypeSet(TokensAcceptanceType acceptanceType); /** * @dev Emitted every time a token is added or removed from the acceptance list */ event TokensAcceptanceListSet(address indexed token, bool added); /** * @dev Tells the acceptance type of the config */ function tokensAcceptanceType() external view returns (TokensAcceptanceType); /** * @dev Tells whether a token is allowed or not * @param token Address of the token being queried */ function isTokenAllowed(address token) external view returns (bool); /** * @dev Sets the tokens acceptance type of the task * @param newTokensAcceptanceType New token acceptance type to be set */ function setTokensAcceptanceType(TokensAcceptanceType newTokensAcceptanceType) external; /** * @dev Updates the list of tokens of the tokens acceptance list * @param tokens List of tokens to be updated from the acceptance list * @param added Whether each of the given tokens should be added or removed from the list */ function setTokensAcceptanceList(address[] memory tokens, bool[] memory added) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General External License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General External License for more details. // You should have received a copy of the GNU General External License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Token threshold task interface */ interface ITokenThresholdTask is IBaseTask { /** * @dev The token threshold token is zero */ error TaskThresholdTokenZero(); /** * @dev The token threshold to be set is invalid */ error TaskInvalidThresholdInput(address token, uint256 min, uint256 max); /** * @dev The token threshold has not been met */ error TaskTokenThresholdNotMet(address token, uint256 amount, uint256 min, uint256 max); /** * @dev Emitted every time a default threshold is set */ event DefaultTokenThresholdSet(address token, uint256 min, uint256 max); /** * @dev Emitted every time a token threshold is set */ event CustomTokenThresholdSet(address indexed token, address thresholdToken, uint256 min, uint256 max); /** * @dev Tells the default token threshold */ function defaultTokenThreshold() external view returns (address thresholdToken, uint256 min, uint256 max); /** * @dev Tells the custom threshold defined for a specific token * @param token Address of the token being queried */ function customTokenThreshold(address token) external view returns (address thresholdToken, uint256 min, uint256 max); /** * @dev Tells the threshold that should be used for a token * @param token Address of the token being queried */ function getTokenThreshold(address token) external view returns (address thresholdToken, uint256 min, uint256 max); /** * @dev Sets a new default threshold config * @param thresholdToken New threshold token to be set * @param min New threshold minimum to be set * @param max New threshold maximum to be set */ function setDefaultTokenThreshold(address thresholdToken, uint256 min, uint256 max) external; /** * @dev Sets a custom token threshold * @param token Address of the token to set a custom threshold * @param thresholdToken New custom threshold token to be set * @param min New custom threshold minimum to be set * @param max New custom threshold maximum to be set */ function setCustomTokenThreshold(address token, address thresholdToken, uint256 min, uint256 max) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseTask.sol'; /** * @dev Volume limited task interface */ interface IVolumeLimitedTask is IBaseTask { /** * @dev The volume limit token is zero */ error TaskVolumeLimitTokenZero(); /** * @dev The volume limit to be set is invalid */ error TaskInvalidVolumeLimitInput(address token, uint256 amount, uint256 period); /** * @dev The volume limit has been exceeded */ error TaskVolumeLimitExceeded(address token, uint256 limit, uint256 volume); /** * @dev Emitted every time a default volume limit is set */ event DefaultVolumeLimitSet(address indexed limitToken, uint256 amount, uint256 period); /** * @dev Emitted every time a custom volume limit is set */ event CustomVolumeLimitSet(address indexed token, address indexed limitToken, uint256 amount, uint256 period); /** * @dev Tells the default volume limit set */ function defaultVolumeLimit() external view returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime); /** * @dev Tells the custom volume limit set for a specific token * @param token Address of the token being queried */ function customVolumeLimit(address token) external view returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime); /** * @dev Tells the volume limit that should be used for a token * @param token Address of the token being queried */ function getVolumeLimit(address token) external view returns (address limitToken, uint256 amount, uint256 accrued, uint256 period, uint256 nextResetTime); /** * @dev Sets a the default volume limit config * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function setDefaultVolumeLimit(address limitToken, uint256 limitAmount, uint256 limitPeriod) external; /** * @dev Sets a custom volume limit * @param token Address of the token to set a custom volume limit for * @param limitToken Address of the token to measure the volume limit * @param limitAmount Amount of tokens to be applied for the volume limit * @param limitPeriod Frequency to Amount of tokens to be applied for the volume limit */ function setCustomVolumeLimit(address token, address limitToken, uint256 limitAmount, uint256 limitPeriod) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseBridgeTask.sol'; /** * @dev Axelar bridger task interface */ interface IAxelarBridger is IBaseBridgeTask { /** * @dev Execute Axelar bridger task */ function call(address token, uint256 amountIn) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Base bridge task interface */ interface IBaseBridgeTask is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The recipient is zero */ error TaskRecipientZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev The next balance connector is not zero */ error TaskNextConnectorNotZero(bytes32 id); /** * @dev The destination chain is not set */ error TaskDestinationChainNotSet(); /** * @dev The destination chain id is the same as the current chain id */ error TaskBridgeCurrentChainId(uint256 destinationChain); /** * @dev The slippage to be set is greater than one */ error TaskSlippageAboveOne(); /** * @dev The requested slippage is greater than the maximum slippage */ error TaskSlippageAboveMax(uint256 slippage, uint256 maxSlippage); /** * @dev The requested fee is greater than the maximum fee */ error TaskFeeAboveMax(uint256 fee, uint256 maxFee); /** * @dev The max fee token is zero but the max fee value is not zero */ error TaskInvalidMaxFee(); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Emitted every time the recipient is set */ event RecipientSet(address indexed recipient); /** * @dev Emitted every time the default destination chain is set */ event DefaultDestinationChainSet(uint256 indexed defaultDestinationChain); /** * @dev Emitted every time the default max slippage is set */ event DefaultMaxSlippageSet(uint256 maxSlippage); /** * @dev Emitted every time the default max fee is set */ event DefaultMaxFeeSet(address indexed maxFeeToken, uint256 amount); /** * @dev Emitted every time a custom destination chain is set for a token */ event CustomDestinationChainSet(address indexed token, uint256 indexed destinationChain); /** * @dev Emitted every time a custom max slippage is set */ event CustomMaxSlippageSet(address indexed token, uint256 maxSlippage); /** * @dev Emitted every time a custom max fee is set */ event CustomMaxFeeSet(address indexed token, address indexed maxFeeToken, uint256 amount); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Tells the address of the allowed recipient */ function recipient() external view returns (address); /** * @dev Tells the default destination chain */ function defaultDestinationChain() external view returns (uint256); /** * @dev Tells the default max slippage */ function defaultMaxSlippage() external view returns (uint256); /** * @dev Tells the default max fee */ function defaultMaxFee() external view returns (address maxFeeToken, uint256 amount); /** * @dev Tells the destination chain defined for a specific token * @param token Address of the token being queried */ function customDestinationChain(address token) external view returns (uint256); /** * @dev Tells the max slippage defined for a specific token * @param token Address of the token being queried */ function customMaxSlippage(address token) external view returns (uint256); /** * @dev Tells the max fee defined for a specific token * @param token Address of the token being queried */ function customMaxFee(address token) external view returns (address maxFeeToken, uint256 amount); /** * @dev Tells the destination chain that should be used for a token * @param token Address of the token to get the destination chain for */ function getDestinationChain(address token) external view returns (uint256); /** * @dev Tells the max slippage that should be used for a token * @param token Address of the token to get the max slippage for */ function getMaxSlippage(address token) external view returns (uint256); /** * @dev Tells the max fee that should be used for a token * @param token Address of the token to get the max fee for */ function getMaxFee(address token) external view returns (address maxFeeToken, uint256 amount); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; /** * @dev Sets the recipient address * @param recipient Address of the new recipient to be set */ function setRecipient(address recipient) external; /** * @dev Sets the default destination chain * @param destinationChain Default destination chain to be set */ function setDefaultDestinationChain(uint256 destinationChain) external; /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external; /** * @dev Sets the default max fee * @param maxFeeToken Default max fee token to be set * @param amount Default max fee amount to be set */ function setDefaultMaxFee(address maxFeeToken, uint256 amount) external; /** * @dev Sets a custom destination chain for a token * @param token Address of the token to set a custom destination chain for * @param destinationChain Destination chain to be set */ function setCustomDestinationChain(address token, uint256 destinationChain) external; /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external; /** * @dev Sets a custom max fee * @param token Address of the token to set a custom max fee for * @param maxFeeToken Max fee token to be set for the given token * @param amount Max fee amount to be set for the given token */ function setCustomMaxFee(address token, address maxFeeToken, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseBridgeTask.sol'; /** * @dev Connext bridger task interface */ interface IConnextBridger is IBaseBridgeTask { /** * @dev Execute Connext bridger task */ function call(address token, uint256 amountIn, uint256 slippage, uint256 relayerFee) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseBridgeTask.sol'; /** * @dev Hop bridger task interface */ interface IHopBridger is IBaseBridgeTask { /** * @dev The max deadline is zero */ error TaskMaxDeadlineZero(); /** * @dev The Hop entrypoint is zero */ error TaskMissingHopEntrypoint(); /** * @dev Emitted every time the relayer is set */ event RelayerSet(address indexed relayer); /** * @dev Emitted every time the max deadline is set */ event MaxDeadlineSet(uint256 maxDeadline); /** * @dev Emitted every time a Hop entrypoint is set for a token */ event TokenHopEntrypointSet(address indexed token, address indexed entrypoint); /** * @dev Tells the relayer address, only used when bridging from L1 to L2 */ function relayer() external view returns (address); /** * @dev Tells the max deadline */ function maxDeadline() external view returns (uint256); /** * @dev Tells Hop entrypoint set for a token */ function tokenHopEntrypoint(address token) external view returns (address entrypoint); /** * @dev Sets the relayer, only used when bridging from L1 to L2 * @param relayer New relayer address to be set */ function setRelayer(address relayer) external; /** * @dev Sets the max deadline * @param maxDeadline New max deadline to be set */ function setMaxDeadline(uint256 maxDeadline) external; /** * @dev Sets an entrypoint for a tokens * @param token Token address to set a Hop entrypoint for * @param entrypoint Hop entrypoint address to be set for a token */ function setTokenHopEntrypoint(address token, address entrypoint) external; /** * @dev Execution function */ function call(address token, uint256 amountIn, uint256 slippage, uint256 fee) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseBridgeTask.sol'; /** * @dev Wormhole bridger task interface */ interface IWormholeBridger is IBaseBridgeTask { /** * @dev Execute Wormhole bridger task */ function call(address token, uint256 amountIn, uint256 fee) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './base/IBaseTask.sol'; import './base/IGasLimitedTask.sol'; import './base/ITimeLockedTask.sol'; import './base/ITokenIndexedTask.sol'; import './base/ITokenThresholdTask.sol'; import './base/IVolumeLimitedTask.sol'; // solhint-disable no-empty-blocks /** * @dev Task interface */ interface ITask is IBaseTask, IGasLimitedTask, ITimeLockedTask, ITokenIndexedTask, ITokenThresholdTask, IVolumeLimitedTask { }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import './IBalancerPool.sol'; interface IBalancerBoostedPool is IBalancerPool { function getRate() external view returns (uint256); function getBptIndex() external view returns (uint256); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import './IBalancerPool.sol'; interface IBalancerLinearPool is IBalancerPool { function getRate() external view returns (uint256); function getMainToken() external view returns (address); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IBalancerPool is IERC20 { function getPoolId() external view returns (bytes32); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../../ITask.sol'; /** * @dev Balancer V2 pool exit task interface */ interface IBalancerV2PoolExiter is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev The slippage to be set is greater than one */ error TaskSlippageAboveOne(); /** * @dev The requested slippage is greater than the maximum slippage */ error TaskSlippageAboveMax(uint256 slippage, uint256 maxSlippage); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Emitted every time the default max slippage is set */ event DefaultMaxSlippageSet(uint256 maxSlippage); /** * @dev Emitted every time a custom max slippage is set */ event CustomMaxSlippageSet(address indexed token, uint256 maxSlippage); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Tells the default token threshold */ function defaultMaxSlippage() external view returns (uint256); /** * @dev Tells the max slippage defined for a specific token * @param token Address of the token being queried */ function customMaxSlippage(address token) external view returns (uint256); /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) external view returns (uint256); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external; /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external; /** * @dev Execute Balancer v2 pool exiter * @param tokenIn Address of the Balancer pool token to exit * @param amountIn Amount of Balancer pool tokens to exit * @param slippage Slippage to be applied */ function call(address tokenIn, uint256 amountIn, uint256 slippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IBalancerVault { function getPool(bytes32 poolId) external view returns (address, uint256); function getPoolTokens(bytes32 poolId) external view returns (IERC20[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock); struct JoinPoolRequest { IERC20[] assets; uint256[] maxAmountsIn; bytes userData; bool fromInternalBalance; } function joinPool(bytes32 poolId, address sender, address recipient, JoinPoolRequest memory request) external payable; struct ExitPoolRequest { IERC20[] assets; uint256[] minAmountsOut; bytes userData; bool toInternalBalance; } function exitPool(bytes32 poolId, address sender, address payable recipient, ExitPoolRequest memory request) external; enum SwapKind { GIVEN_IN, GIVEN_OUT } struct SingleSwap { bytes32 poolId; SwapKind kind; address assetIn; address assetOut; uint256 amount; bytes userData; } struct FundManagement { address sender; bool fromInternalBalance; address payable recipient; bool toInternalBalance; } function swap(SingleSwap memory singleSwap, FundManagement memory funds, uint256 limit, uint256 deadline) external payable returns (uint256); struct BatchSwapStep { bytes32 poolId; uint256 assetInIndex; uint256 assetOutIndex; uint256 amount; bytes userData; } function batchSwap( SwapKind kind, BatchSwapStep[] memory swaps, address[] memory assets, FundManagement memory funds, int256[] memory limits, uint256 deadline ) external payable returns (int256[] memory); }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../../ITask.sol'; /** * @dev Base Convex task interface */ interface IBaseConvexTask is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseConvexTask.sol'; /** * @dev Convex claimer task interface */ interface IConvexClaimer is IBaseConvexTask { /** * @dev The amount is not zero */ error TaskAmountNotZero(); /** * @dev The previous balance connector is not zero */ error TaskPreviousConnectorNotZero(bytes32 id); /** * @dev The length of the claim result mismatch */ error TaskClaimResultLengthMismatch(); /** * @dev Executes the Convex claimer task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseConvexTask.sol'; /** * @dev Convex exiter task interface */ interface IConvexExiter is IBaseConvexTask { /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev Executes the Convex exiter task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseConvexTask.sol'; /** * @dev Convex joiner task interface */ interface IConvexJoiner is IBaseConvexTask { /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev Executes the Convex joiner task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../../ITask.sol'; /** * @dev Base Curve task interface */ interface IBaseCurveTask is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev The token out is not set */ error TaskTokenOutNotSet(); /** * @dev The slippage to be set is greater than one */ error TaskSlippageAboveOne(); /** * @dev The requested slippage is greater than the maximum slippage */ error TaskSlippageAboveMax(uint256 slippage, uint256 maxSlippage); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Emitted every time the default token out is set */ event DefaultTokenOutSet(address indexed tokenOut); /** * @dev Emitted every time the default max slippage is set */ event DefaultMaxSlippageSet(uint256 maxSlippage); /** * @dev Emitted every time a custom token out is set */ event CustomTokenOutSet(address indexed token, address tokenOut); /** * @dev Emitted every time a custom max slippage is set */ event CustomMaxSlippageSet(address indexed token, uint256 maxSlippage); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Tells the default token out */ function defaultTokenOut() external view returns (address); /** * @dev Tells the default token threshold */ function defaultMaxSlippage() external view returns (uint256); /** * @dev Tells the token out defined for a specific token * @param token Address of the token being queried */ function customTokenOut(address token) external view returns (address); /** * @dev Tells the max slippage defined for a specific token * @param token Address of the token being queried */ function customMaxSlippage(address token) external view returns (uint256); /** * @dev Tells the token out that should be used for a token */ function getTokenOut(address token) external view returns (address); /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) external view returns (uint256); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; /** * @dev Sets the default token out * @param tokenOut Address of the default token out to be set */ function setDefaultTokenOut(address tokenOut) external; /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external; /** * @dev Sets a custom token out * @param token Address of the token to set a custom token out for * @param tokenOut Address of the token out to be set */ function setCustomTokenOut(address token, address tokenOut) external; /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseCurveTask.sol'; /** * @dev Curve 2CRV exiter task interface */ interface ICurve2CrvExiter is IBaseCurveTask { /** * @dev Executes the Curve 2CRV exiter task */ function call(address token, uint256 amount, uint256 slippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseCurveTask.sol'; /** * @dev Curve 2CRV joiner task interface */ interface ICurve2CrvJoiner is IBaseCurveTask { /** * @dev Executes the Curve 2CRV joiner task */ function call(address token, uint256 amount, uint256 slippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../../ITask.sol'; /** * @dev Base ERC4626 task interface */ interface IBaseERC4626Task is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseERC4626Task.sol'; /** * @dev ERC4626 exiter task interface */ interface IERC4626Exiter is IBaseERC4626Task { /** * @dev Executes the ERC4626 exiter task */ function call(address erc4626, uint256 amount, uint256 minAmountOut) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseERC4626Task.sol'; /** * @dev ERC4626 joiner task interface */ interface IERC4626Joiner is IBaseERC4626Task { /** * The ERC4626 reference is zero */ error TaskERC4626Zero(); /** * @dev Executes the ERC4626 joiner task */ function call(address token, uint256 amount, address erc4626, uint256 minAmountOut) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Collector task interface */ interface ICollector is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The tokens source is zero */ error TaskTokensSourceZero(); /** * @dev The previous balance connector is not zero */ error TaskPreviousConnectorNotZero(bytes32 id); /** * @dev Emitted every time the tokens source is set */ event TokensSourceSet(address indexed tokensSource); /** * @dev Sets the tokens source address * @param tokensSource Address of the tokens source to be set */ function setTokensSource(address tokensSource) external; /** * @dev Executes the collector task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Depositor task interface */ interface IDepositor is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The msg value is zero */ error TaskValueZero(); /** * @dev The previous balance connector is not zero */ error TaskPreviousConnectorNotZero(bytes32 id); /** * @dev Executes the withdrawer task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Hand over task interface */ interface IHandleOver is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The tokens source is zero */ error TaskConnectorZero(bytes32 id); /** * @dev Executes the hand over task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Unwrapper task interface */ interface IUnwrapper is ITask { /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The token is not the wrapped native token */ error TaskTokenNotWrapped(); /** * @dev Executes the unwrapper task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Withdrawer task interface */ interface IWithdrawer is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The recipient is zero */ error TaskRecipientZero(); /** * @dev The recipient to be set is the smart vault */ error TaskRecipientEqualsSmartVault(address recipient); /** * @dev The next balance connector is not zero */ error TaskNextConnectorNotZero(bytes32 id); /** * @dev Emitted every time the recipient is set */ event RecipientSet(address indexed recipient); /** * @dev Tells the address of the allowed recipient */ function recipient() external view returns (address); /** * @dev Sets the recipient address * @param recipient Address of the new recipient to be set */ function setRecipient(address recipient) external; /** * @dev Executes the withdrawer task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Wrapper task interface */ interface IWrapper is ITask { /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The token is not the native token */ error TaskTokenNotNative(); /** * @dev Executes the wrapper task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Base relayer fund task interface */ interface IBaseRelayerFundTask is ITask { /** * @dev The relayer is zero */ error TaskRelayerZero(); /** * @dev The task initializer is disabled */ error TaskInitializerDisabled(); /** * @dev There is no threshold set for the given token */ error TaskTokenThresholdNotSet(address token); /** * @dev The deposited amount is above the minimum threshold */ error TaskDepositAboveMinThreshold(uint256 balance, uint256 min); /** * @dev The new amount to be deposited does not cover the used quota */ error TaskDepositBelowUsedQuota(uint256 amount, uint256 quota); /** * @dev The requested amount would result in a new balance below the minimum threshold */ error TaskNewDepositBelowMinThreshold(uint256 balance, uint256 min); /** * @dev The requested amount would result in a new balance above the maximum threshold */ error TaskNewDepositAboveMaxThreshold(uint256 balance, uint256 max); /** * @dev Emitted every time the relayer is set */ event RelayerSet(address indexed relayer); /** * @dev Tells the relayer */ function relayer() external view returns (address); /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function setRelayer(address newRelayer) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Relayer depositor task interface */ interface IRelayerDepositor is ITask { /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The relayer is zero */ error TaskRelayerZero(); /** * @dev Emitted every time the relayer is set */ event RelayerSet(address indexed relayer); /** * @dev Tells the relayer */ function relayer() external view returns (address); /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function setRelayer(address newRelayer) external; /** * @dev Executes the relayer depositor task */ function call(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev Balancer v2 BPT swapper task interface */ interface IBalancerV2BptSwapper is IBaseSwapTask { /** * @dev Execution function */ function call(address tokenIn, uint256 amountIn, uint256 slippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import '../ITask.sol'; /** * @dev Base swap task interface */ interface IBaseSwapTask is ITask { /** * @dev The token is zero */ error TaskTokenZero(); /** * @dev The amount is zero */ error TaskAmountZero(); /** * @dev The connector is zero */ error TaskConnectorZero(); /** * @dev The token out is not set */ error TaskTokenOutNotSet(); /** * @dev The slippage to be set is greater than one */ error TaskSlippageAboveOne(); /** * @dev The slippage is greater than the maximum slippage */ error TaskSlippageAboveMax(uint256 slippage, uint256 maxSlippage); /** * @dev Emitted every time the connector is set */ event ConnectorSet(address indexed connector); /** * @dev Emitted every time the default token out is set */ event DefaultTokenOutSet(address indexed tokenOut); /** * @dev Emitted every time the default max slippage is set */ event DefaultMaxSlippageSet(uint256 maxSlippage); /** * @dev Emitted every time a custom token out is set */ event CustomTokenOutSet(address indexed token, address tokenOut); /** * @dev Emitted every time a custom max slippage is set */ event CustomMaxSlippageSet(address indexed token, uint256 maxSlippage); /** * @dev Tells the connector tied to the task */ function connector() external view returns (address); /** * @dev Tells the default token out */ function defaultTokenOut() external view returns (address); /** * @dev Tells the default max slippage */ function defaultMaxSlippage() external view returns (uint256); /** * @dev Tells the token out defined for a specific token * @param token Address of the token being queried */ function customTokenOut(address token) external view returns (address); /** * @dev Tells the max slippage defined for a specific token * @param token Address of the token being queried */ function customMaxSlippage(address token) external view returns (uint256); /** * @dev Tells the token out that should be used for a token */ function getTokenOut(address token) external view returns (address); /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) external view returns (uint256); /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external; /** * @dev Sets the default token out * @param tokenOut Address of the default token out to be set */ function setDefaultTokenOut(address tokenOut) external; /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external; /** * @dev Sets a custom token out * @param token Address of the token to set a custom token out for * @param tokenOut Address of the token out to be set */ function setCustomTokenOut(address token, address tokenOut) external; /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev L2 Hop swapper task interface */ interface IHopL2Swapper is IBaseSwapTask { /** * @dev The amm for the token is not set */ error TaskMissingHopTokenAmm(); /** * @dev The hToken to be set is not the hToken of the Hop L2 amm to be used */ error TaskHopTokenAmmMismatch(address hToken, address amm); /** * @dev Emitted every time an AMM is set for a token */ event TokenAmmSet(address indexed token, address amm); /** * @dev Tells AMM set for a token */ function tokenAmm(address token) external view returns (address); /** * @dev Sets an AMM for a hToken * @param hToken Address of the hToken to be set * @param amm AMM address to be set for the hToken */ function setTokenAmm(address hToken, address amm) external; /** * @dev Executes the L2 hop swapper task */ function call(address tokenIn, uint256 amountIn, uint256 slippage) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev 1inch v5 swapper task interface */ interface IOneInchV5Swapper is IBaseSwapTask { /** * @dev Execution function */ function call(address tokenIn, uint256 amountIn, uint256 slippage, bytes memory data) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev Paraswap v5 swapper task interface */ interface IParaswapV5Swapper is IBaseSwapTask { /** * @dev The quote signer is zero */ error TaskQuoteSignerZero(); /** * @dev The signer to be set is not the quote signer */ error TaskInvalidQuoteSigner(address signer, address quoteSigner); /** * @dev The deadline is in the past */ error TaskQuoteSignerPastDeadline(uint256 deadline, uint256 currentTimestamp); /** * @dev Emitted every time a quote signer is set */ event QuoteSignerSet(address indexed quoteSigner); /** * @dev Tells the address of the allowed quote signer */ function quoteSigner() external view returns (address); /** * @dev Sets the quote signer address. Sender must be authorized. * @param newQuoteSigner Address of the new quote signer to be set */ function setQuoteSigner(address newQuoteSigner) external; /** * @dev Executes Paraswap V5 swapper task */ function call( address tokenIn, uint256 amountIn, uint256 minAmountOut, uint256 expectedAmountOut, uint256 deadline, bytes memory data, bytes memory sig ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev Uniswap v2 swapper task interface */ interface IUniswapV2Swapper is IBaseSwapTask { /** * @dev Execution function */ function call(address tokenIn, uint256 amountIn, uint256 slippage, address[] memory hopTokens) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity >=0.8.0; import './IBaseSwapTask.sol'; /** * @dev Uniswap v3 swapper task interface */ interface IUniswapV3Swapper is IBaseSwapTask { /** * @dev Execution function */ function call( address tokenIn, uint256 amountIn, uint256 slippage, uint24 fee, address[] memory hopTokens, uint24[] memory hopFees ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2Vault.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2PoolConnector.sol'; import '../../Task.sol'; import '../../interfaces/liquidity/balancer/IBalancerPool.sol'; import '../../interfaces/liquidity/balancer/IBalancerV2PoolExiter.sol'; /** * @title Balancer v2 pool exiter * @dev Task that offers the components to exit Balancer pools */ contract BalancerV2PoolExiter is IBalancerV2PoolExiter, Task { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('BALANCER_V2_POOL_EXITER'); // Task connector address address public override connector; // Default maximum slippage in fixed point uint256 public override defaultMaxSlippage; // Maximum slippage per token address mapping (address => uint256) public override customMaxSlippage; /** * @dev Custom max slippage config. Only used in the initializer. */ struct CustomMaxSlippage { address token; uint256 maxSlippage; } /** * @dev Balancer pool exit config. Only used in the initializer. */ struct BalancerPoolExitConfig { address connector; uint256 maxSlippage; CustomMaxSlippage[] customMaxSlippages; TaskConfig taskConfig; } /** * @dev Initializes a Balancer v2 pool exiter * @param config Balancer pool exit config */ function initialize(BalancerPoolExitConfig memory config) external virtual initializer { __BalancerV2PoolExiter_init(config); } /** * @dev Initializes the Balancer v2 pool exiter. It does call upper contracts initializers. * @param config Balancer pool exit config */ function __BalancerV2PoolExiter_init(BalancerPoolExitConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BalancerV2PoolExiter_init_unchained(config); } /** * @dev Initializes the Balancer v2 pool exiter. It does not call upper contracts initializers. * @param config Balancer pool exit config */ function __BalancerV2PoolExiter_init_unchained(BalancerPoolExitConfig memory config) internal onlyInitializing { _setConnector(config.connector); _setDefaultMaxSlippage(config.maxSlippage); for (uint256 i = 0; i < config.customMaxSlippages.length; i++) { _setCustomMaxSlippage(config.customMaxSlippages[i].token, config.customMaxSlippages[i].maxSlippage); } } /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) public view virtual override returns (uint256) { uint256 maxSlippage = customMaxSlippage[token]; return maxSlippage == 0 ? defaultMaxSlippage : maxSlippage; } /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external override authP(authParams(maxSlippage)) { _setDefaultMaxSlippage(maxSlippage); } /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external override authP(authParams(token, maxSlippage)) { _setCustomMaxSlippage(token, maxSlippage); } /** * @dev Execute Balancer v2 pool exiter * @param tokenIn Address of the Balancer pool token to exit * @param amountIn Amount of Balancer pool tokens to exit * @param slippage Slippage to be applied */ function call(address tokenIn, uint256 amountIn, uint256 slippage) external override authP(authParams(tokenIn, amountIn, slippage)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); _beforeBalancerV2PoolExiter(tokenIn, amountIn, slippage); (address[] memory tokensOut, uint256[] memory minAmountsOut) = _getTokensOut(tokenIn, amountIn, slippage); bytes memory connectorData = abi.encodeWithSelector( IBalancerV2PoolConnector.exit.selector, tokenIn, amountIn, tokensOut, minAmountsOut ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); uint256[] memory amountsOut = abi.decode(result, (uint256[])); _afterBalancerV2PoolExiter(tokenIn, amountIn, tokensOut, amountsOut); } /** * @dev Tells the list of tokens and min amounts out based on a number of BPTs to exit * @param tokenIn Address of the pool being exited * @param amountIn Amount of tokens to exit the pool with * @param slippage Slippage to be used */ function _getTokensOut(address tokenIn, uint256 amountIn, uint256 slippage) internal view returns (address[] memory tokensOut, uint256[] memory minAmountsOut) { uint256 bptTotalSupply = IERC20(tokenIn).totalSupply(); uint256 bptRatio = amountIn.divDown(bptTotalSupply); bytes32 poolId = IBalancerPool(tokenIn).getPoolId(); address balancerV2Vault = IBalancerV2PoolConnector(connector).balancerV2Vault(); (IERC20[] memory tokens, uint256[] memory balances, ) = IBalancerV2Vault(balancerV2Vault).getPoolTokens(poolId); tokensOut = new address[](tokens.length); minAmountsOut = new uint256[](tokens.length); for (uint256 i = 0; i < tokens.length; i++) { tokensOut[i] = address(tokens[i]); uint256 expectedAmountsOut = balances[i].mulDown(bptRatio); minAmountsOut[i] = expectedAmountsOut.mulDown(FixedPoint.ONE - slippage); } } /** * @dev Before Balancer v2 pool exiter hook */ function _beforeBalancerV2PoolExiter(address tokenIn, uint256 amountIn, uint256 slippage) internal virtual { _beforeTask(tokenIn, amountIn); if (tokenIn == address(0)) revert TaskTokenZero(); if (amountIn == 0) revert TaskAmountZero(); uint256 maxSlippage = getMaxSlippage(tokenIn); if (slippage > maxSlippage) revert TaskSlippageAboveMax(slippage, maxSlippage); } /** * @dev After Balancer v2 pool exiter hook */ function _afterBalancerV2PoolExiter( address tokenIn, uint256 amountIn, address[] memory tokensOut, uint256[] memory amountsOut ) internal virtual { for (uint256 i = 0; i < tokensOut.length; i++) _increaseBalanceConnector(tokensOut[i], amountsOut[i]); _afterTask(tokenIn, amountIn); } /** * @dev Sets the task connector * @param newConnector New connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function _setDefaultMaxSlippage(uint256 maxSlippage) internal { if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); defaultMaxSlippage = maxSlippage; emit DefaultMaxSlippageSet(maxSlippage); } /** * @dev Sets a custom max slippage for a token * @param token Address of the token to set the custom max slippage for * @param maxSlippage Max slippage to be set */ function _setCustomMaxSlippage(address token, uint256 maxSlippage) internal { if (token == address(0)) revert TaskTokenZero(); if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); customMaxSlippage[token] = maxSlippage; emit CustomMaxSlippageSet(token, maxSlippage); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '../../Task.sol'; import '../../interfaces/liquidity/convex/IBaseConvexTask.sol'; /** * @title Base Convex task * @dev Task that offers the basic components for more detailed Convex related tasks */ abstract contract BaseConvexTask is IBaseConvexTask, Task { // Task connector address address public override connector; /** * @dev Base Convex config. Only used in the initializer. */ struct BaseConvexConfig { address connector; TaskConfig taskConfig; } /** * @dev Initializes the base Convex task. It does call upper contracts initializers. * @param config Base Convex config */ function __BaseConvexTask_init(BaseConvexConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseConvexTask_init_unchained(config); } /** * @dev Initializes the base Convex task. It does not call upper contracts initializers. * @param config Base Convex config */ function __BaseConvexTask_init_unchained(BaseConvexConfig memory config) internal onlyInitializing { _setConnector(config.connector); } /** * @dev Sets the task connector * @param newConnector Address of the new connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Before base Convex task hook */ function _beforeBaseConvexTask(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); } /** * @dev After base Convex task hook */ function _afterBaseConvexTask(address token, uint256 amount) internal virtual { _afterTask(token, amount); } /** * @dev Sets the task connector * @param newConnector New connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-connectors/contracts/interfaces/convex/IConvexConnector.sol'; import './BaseConvexTask.sol'; import '../../interfaces/liquidity/convex/IConvexClaimer.sol'; /** * @title Convex claimer */ contract ConvexClaimer is IConvexClaimer, BaseConvexTask { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CONVEX_CLAIMER'); /** * @dev Convex claim config. Only used in the initializer. */ struct ConvexClaimConfig { BaseConvexConfig baseConvexConfig; } /** * @dev Initializes a Convex claimer * @param config Convex claim config */ function initialize(ConvexClaimConfig memory config) external virtual initializer { __ConvexClaimer_init(config); } /** * @dev Initializes the Convex claimer. It does call upper contracts initializers. * @param config Convex claim config */ function __ConvexClaimer_init(ConvexClaimConfig memory config) internal onlyInitializing { __BaseConvexTask_init(config.baseConvexConfig); __ConvexClaimer_init_unchained(config); } /** * @dev Initializes the Convex claimer. It does not call upper contracts initializers. * @param config Convex claim config */ function __ConvexClaimer_init_unchained(ConvexClaimConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Tells the address from where the token amounts to execute this task are fetched */ function getTokensSource() external view virtual override(IBaseTask, BaseTask) returns (address) { return IConvexConnector(connector).booster(); } /** * @dev Tells the amount a task should use for a token, in this case always zero since it is not possible to * compute on-chain how many tokens are available to be claimed. */ function getTaskAmount(address) public pure virtual override(IBaseTask, BaseTask) returns (uint256) { return 0; } /** * @dev Execute Convex claimer * @param token Address of the Convex pool token to claim rewards for * @param amount Must be zero, it is not possible to claim a specific number of tokens */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeConvexClaimer(token, amount); bytes memory connectorData = abi.encodeWithSelector(IConvexConnector.claim.selector, token); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); (address[] memory tokens, uint256[] memory amounts) = abi.decode(result, (address[], uint256[])); _afterConvexClaimer(token, amount, tokens, amounts); } /** * @dev Before Convex claimer hook */ function _beforeConvexClaimer(address token, uint256 amount) internal virtual { _beforeBaseConvexTask(token, amount); if (amount != 0) revert TaskAmountNotZero(); } /** * @dev After Convex claimer hook */ function _afterConvexClaimer( address tokenIn, uint256 amountIn, address[] memory tokensOut, uint256[] memory amountsOut ) internal virtual { if (tokensOut.length != amountsOut.length) revert TaskClaimResultLengthMismatch(); for (uint256 i = 0; i < tokensOut.length; i++) _increaseBalanceConnector(tokensOut[i], amountsOut[i]); _afterBaseConvexTask(tokenIn, amountIn); } /** * @dev Sets the balance connectors. Previous balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (previous != bytes32(0)) revert TaskPreviousConnectorNotZero(previous); super._setBalanceConnectors(previous, next); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/convex/IConvexConnector.sol'; import './BaseConvexTask.sol'; import '../../interfaces/liquidity/convex/IConvexExiter.sol'; /** * @title Convex exiter * @dev Task that extends the base Convex task to exit Convex pools */ contract ConvexExiter is IConvexExiter, BaseConvexTask { using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CONVEX_EXITER'); /** * @dev Convex exit config. Only used in the initializer. */ struct ConvexExitConfig { BaseConvexConfig baseConvexConfig; } /** * @dev Initializes a Convex exiter * @param config Convex exit config */ function initialize(ConvexExitConfig memory config) external virtual initializer { __ConvexExiter_init(config); } /** * @dev Initializes the Convex exiter. It does call upper contracts initializers. * @param config Convex exit config */ function __ConvexExiter_init(ConvexExitConfig memory config) internal onlyInitializing { __BaseConvexTask_init(config.baseConvexConfig); __ConvexExiter_init_unchained(config); } /** * @dev Initializes the Convex exiter. It does not call upper contracts initializers. * @param config Convex exit config */ function __ConvexExiter_init_unchained(ConvexExitConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the Convex exiter task * @param token Address of the Convex pool token to be exited with * @param amount Amount of Convex pool tokens to be exited with */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeConvexExiter(token, amount); bytes memory connectorData = abi.encodeWithSelector(IConvexConnector.exit.selector, token, amount); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterConvexExiter(token, amount, IConvexConnector(connector).getCurvePool(token), result.toUint256()); } /** * @dev Before Convex exiter hook */ function _beforeConvexExiter(address token, uint256 amount) internal virtual { _beforeBaseConvexTask(token, amount); if (amount == 0) revert TaskAmountZero(); } /** * @dev After Convex exiter hook */ function _afterConvexExiter(address tokenIn, uint256 amountIn, address tokenOut, uint256 amountOut) internal virtual { _increaseBalanceConnector(tokenOut, amountOut); _afterBaseConvexTask(tokenIn, amountIn); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/convex/IConvexConnector.sol'; import './BaseConvexTask.sol'; import '../../interfaces/liquidity/convex/IConvexJoiner.sol'; /** * @title Convex joiner * @dev Task that extends the base Convex task to join Convex pools */ contract ConvexJoiner is IConvexJoiner, BaseConvexTask { using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CONVEX_JOINER'); /** * @dev Convex join config. Only used in the initializer. */ struct ConvexJoinConfig { BaseConvexConfig baseConvexConfig; } /** * @dev Initializes a Convex joiner * @param config Convex join config */ function initialize(ConvexJoinConfig memory config) external virtual initializer { __ConvexJoiner_init(config); } /** * @dev Initializes the Convex joiner. It does call upper contracts initializers. * @param config Convex join config */ function __ConvexJoiner_init(ConvexJoinConfig memory config) internal onlyInitializing { __BaseConvexTask_init(config.baseConvexConfig); __ConvexJoiner_init_unchained(config); } /** * @dev Initializes the Convex joiner. It does not call upper contracts initializers. * @param config Convex join config */ function __ConvexJoiner_init_unchained(ConvexJoinConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the Convex joiner task * @param token Address of the Curve pool token to be joined with * @param amount Amount of Curve pool tokens to be joined with */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeConvexJoiner(token, amount); bytes memory connectorData = abi.encodeWithSelector(IConvexConnector.join.selector, token, amount); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterConvexJoiner(token, amount, IConvexConnector(connector).getCvxPool(token), result.toUint256()); } /** * @dev Before Convex joiner hook */ function _beforeConvexJoiner(address token, uint256 amount) internal virtual { _beforeBaseConvexTask(token, amount); if (amount == 0) revert TaskAmountZero(); } /** * @dev After Convex joiner hook */ function _afterConvexJoiner(address tokenIn, uint256 amountIn, address tokenOut, uint256 amountOut) internal virtual { _increaseBalanceConnector(tokenOut, amountOut); _afterBaseConvexTask(tokenIn, amountIn); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '../../Task.sol'; import '../../interfaces/liquidity/curve/IBaseCurveTask.sol'; /** * @title Base Curve task * @dev Task that offers the basic components for more detailed Curve related tasks */ abstract contract BaseCurveTask is IBaseCurveTask, Task { using FixedPoint for uint256; // Task connector address address public override connector; // Default token out address public override defaultTokenOut; // Default maximum slippage in fixed point uint256 public override defaultMaxSlippage; // Token out per token mapping (address => address) public override customTokenOut; // Maximum slippage per token address mapping (address => uint256) public override customMaxSlippage; /** * @dev Custom token out config. Only used in the initializer. */ struct CustomTokenOut { address token; address tokenOut; } /** * @dev Custom max slippage config. Only used in the initializer. */ struct CustomMaxSlippage { address token; uint256 maxSlippage; } /** * @dev Base Curve config. Only used in the initializer. */ struct BaseCurveConfig { address connector; address tokenOut; uint256 maxSlippage; CustomTokenOut[] customTokensOut; CustomMaxSlippage[] customMaxSlippages; TaskConfig taskConfig; } /** * @dev Initializes the base Curve task. It does call upper contracts initializers. * @param config Base Curve config */ function __BaseCurveTask_init(BaseCurveConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseCurveTask_init_unchained(config); } /** * @dev Initializes the base Curve task. It does not call upper contracts initializers. * @param config Base Curve config */ function __BaseCurveTask_init_unchained(BaseCurveConfig memory config) internal onlyInitializing { _setConnector(config.connector); _setDefaultTokenOut(config.tokenOut); _setDefaultMaxSlippage(config.maxSlippage); for (uint256 i = 0; i < config.customTokensOut.length; i++) { _setCustomTokenOut(config.customTokensOut[i].token, config.customTokensOut[i].tokenOut); } for (uint256 i = 0; i < config.customMaxSlippages.length; i++) { _setCustomMaxSlippage(config.customMaxSlippages[i].token, config.customMaxSlippages[i].maxSlippage); } } /** * @dev Tells the token out that should be used for a token */ function getTokenOut(address token) public view virtual override returns (address) { address tokenOut = customTokenOut[token]; return tokenOut == address(0) ? defaultTokenOut : tokenOut; } /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) public view virtual override returns (uint256) { uint256 maxSlippage = customMaxSlippage[token]; return maxSlippage == 0 ? defaultMaxSlippage : maxSlippage; } /** * @dev Sets the task connector * @param newConnector Address of the new connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Sets the default token out * @param tokenOut Address of the default token out to be set */ function setDefaultTokenOut(address tokenOut) external override authP(authParams(tokenOut)) { _setDefaultTokenOut(tokenOut); } /** * @dev Sets the default max slippage */ function setDefaultMaxSlippage(uint256 maxSlippage) external override authP(authParams(maxSlippage)) { _setDefaultMaxSlippage(maxSlippage); } /** * @dev Sets a custom token out * @param token Address of the token to set a custom token out for * @param tokenOut Address of the token out to be set */ function setCustomTokenOut(address token, address tokenOut) external override authP(authParams(token, tokenOut)) { _setCustomTokenOut(token, tokenOut); } /** * @dev Sets a a custom max slippage * @param token Address of the token to set a max slippage for * @param maxSlippage Max slippage to be set for the given token */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external override authP(authParams(token, maxSlippage)) { _setCustomMaxSlippage(token, maxSlippage); } /** * @dev Before base Curve task hook */ function _beforeBaseCurveTask(address token, uint256 amount, uint256 slippage) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); if (getTokenOut(token) == address(0)) revert TaskTokenOutNotSet(); uint256 maxSlippage = getMaxSlippage(token); if (slippage > maxSlippage) revert TaskSlippageAboveMax(slippage, maxSlippage); } /** * @dev After base Curve task hook */ function _afterBaseCurveTask(address tokenIn, uint256 amountIn, uint256, address tokenOut, uint256 amountOut) internal virtual { _increaseBalanceConnector(tokenOut, amountOut); _afterTask(tokenIn, amountIn); } /** * @dev Sets the task connector * @param newConnector New connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } /** * @dev Sets the default token out * @param tokenOut Default token out to be set */ function _setDefaultTokenOut(address tokenOut) internal { defaultTokenOut = tokenOut; emit DefaultTokenOutSet(tokenOut); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function _setDefaultMaxSlippage(uint256 maxSlippage) internal { if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); defaultMaxSlippage = maxSlippage; emit DefaultMaxSlippageSet(maxSlippage); } /** * @dev Sets a custom token out for a token * @param token Address of the token to set the custom token out for * @param tokenOut Address of the token out to be set */ function _setCustomTokenOut(address token, address tokenOut) internal { if (token == address(0)) revert TaskTokenZero(); customTokenOut[token] = tokenOut; emit CustomTokenOutSet(token, tokenOut); } /** * @dev Sets a custom max slippage for a token * @param token Address of the token to set the custom max slippage for * @param maxSlippage Max slippage to be set */ function _setCustomMaxSlippage(address token, uint256 maxSlippage) internal { if (token == address(0)) revert TaskTokenZero(); if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); customMaxSlippage[token] = maxSlippage; emit CustomMaxSlippageSet(token, maxSlippage); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/curve/ICurve2CrvConnector.sol'; import './BaseCurveTask.sol'; import '../../interfaces/liquidity/curve/ICurve2CrvExiter.sol'; /** * @title Curve 2CRV exiter * @dev Task that extends the base Curve task to exit 2CRV pools */ contract Curve2CrvExiter is ICurve2CrvExiter, BaseCurveTask { using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CURVE_2CRV_EXITER'); /** * @dev Curve 2CRV exit config. Only used in the initializer. */ struct Curve2CrvExitConfig { BaseCurveConfig baseCurveConfig; } /** * @dev Initializes a Curve 2CRV exiter * @param config Curve 2CRV exit config */ function initialize(Curve2CrvExitConfig memory config) external virtual initializer { __Curve2CrvExiter_init(config); } /** * @dev Initializes the Curve 2CRV exiter. It does call upper contracts initializers. * @param config Curve 2CRV exit config */ function __Curve2CrvExiter_init(Curve2CrvExitConfig memory config) internal onlyInitializing { __BaseCurveTask_init(config.baseCurveConfig); __Curve2CrvExiter_init_unchained(config); } /** * @dev Initializes the Curve 2CRV exiter. It does not call upper contracts initializers. * @param config Curve 2CRV exit config */ function __Curve2CrvExiter_init_unchained(Curve2CrvExitConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Curve 2CRV exiter * @param token Address of the Curve pool token to exit * @param amount Amount of Curve pool tokens to exit */ function call(address token, uint256 amount, uint256 slippage) external override authP(authParams(token, amount, slippage)) { if (amount == 0) amount = getTaskAmount(token); _beforeCurve2CrvExiter(token, amount, slippage); address tokenOut = getTokenOut(token); bytes memory connectorData = abi.encodeWithSelector( ICurve2CrvConnector.exit.selector, token, amount, tokenOut, slippage ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterCurve2CrvExiter(token, amount, slippage, tokenOut, result.toUint256()); } /** * @dev Before Curve 2CRV exiter hook */ function _beforeCurve2CrvExiter(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseCurveTask(token, amount, slippage); } /** * @dev After Curve 2CRV exiter hook */ function _afterCurve2CrvExiter( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseCurveTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/curve/ICurve2CrvConnector.sol'; import './BaseCurveTask.sol'; import '../../interfaces/liquidity/curve/ICurve2CrvJoiner.sol'; /** * @title Curve 2CRV joiner * @dev Task that extends the base Curve task to join 2CRV pools */ contract Curve2CrvJoiner is ICurve2CrvJoiner, BaseCurveTask { using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('CURVE_2CRV_JOINER'); /** * @dev Curve 2CRV join config. Only used in the initializer. */ struct Curve2CrvJoinConfig { BaseCurveConfig baseCurveConfig; } /** * @dev Initializes a Curve 2CRV joiner * @param config Curve 2CRV join config */ function initialize(Curve2CrvJoinConfig memory config) external virtual initializer { __Curve2CrvJoiner_init(config); } /** * @dev Initializes the Curve 2CRV joiner. It does call upper contracts initializers. * @param config Curve 2CRV join config */ function __Curve2CrvJoiner_init(Curve2CrvJoinConfig memory config) internal onlyInitializing { __BaseCurveTask_init(config.baseCurveConfig); __Curve2CrvJoiner_init_unchained(config); } /** * @dev Initializes the Curve 2CRV joiner. It does not call upper contracts initializers. * @param config Curve 2CRV join config */ function __Curve2CrvJoiner_init_unchained(Curve2CrvJoinConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Curve 2CRV joiner * @param token Address of the token to join the Curve pool with * @param amount Amount of tokens to join the Curve pool with */ function call(address token, uint256 amount, uint256 slippage) external override authP(authParams(token, amount, slippage)) { if (amount == 0) amount = getTaskAmount(token); _beforeCurve2CrvJoiner(token, amount, slippage); address tokenOut = getTokenOut(token); bytes memory connectorData = abi.encodeWithSelector( ICurve2CrvConnector.join.selector, tokenOut, token, amount, slippage ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterCurve2CrvJoiner(token, amount, slippage, tokenOut, result.toUint256()); } /** * @dev Before Curve 2CRV joiner hook */ function _beforeCurve2CrvJoiner(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseCurveTask(token, amount, slippage); } /** * @dev After Curve 2CRV joiner hook */ function _afterCurve2CrvJoiner( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseCurveTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '../../Task.sol'; import '../../interfaces/liquidity/erc4626/IBaseERC4626Task.sol'; /** * @title Base ERC4626 task * @dev Task that offers the basic components for more detailed ERC4626 related tasks */ abstract contract BaseERC4626Task is IBaseERC4626Task, Task { // Task connector address address public override connector; /** * @dev Base ERC4626 config. Only used in the initializer. */ struct BaseERC4626Config { address connector; TaskConfig taskConfig; } /** * @dev Initializes the base ERC4626 task. It does call upper contracts initializers. * @param config Base ERC4626 config */ function __BaseERC4626Task_init(BaseERC4626Config memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseERC4626Task_init_unchained(config); } /** * @dev Initializes the base ERC4626 task. It does not call upper contracts initializers. * @param config Base ERC4626 config */ function __BaseERC4626Task_init_unchained(BaseERC4626Config memory config) internal onlyInitializing { _setConnector(config.connector); } /** * @dev Sets the task connector * @param newConnector Address of the new connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Before base ERC4626 task hook */ function _beforeBaseERC4626Task(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After base ERC4626 task hook */ function _afterBaseERC4626Task(address tokenIn, uint256 amountIn, address tokenOut, uint256 amountOut) internal virtual { _increaseBalanceConnector(tokenOut, amountOut); _afterTask(tokenIn, amountIn); } /** * @dev Sets the task connector * @param newConnector New connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-connectors/contracts/interfaces/erc4626/IERC4626Connector.sol'; import './BaseERC4626Task.sol'; import '../../interfaces/liquidity/erc4626/IERC4626Exiter.sol'; /** * @title ERC4626 exiter * @dev Task that extends the base ERC4626 task to exit an ERC4626 vault */ contract ERC4626Exiter is IERC4626Exiter, BaseERC4626Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('ERC4626_EXITER'); /** * @dev ERC4626 exit config. Only used in the initializer. */ struct ERC4626ExitConfig { BaseERC4626Config baseERC4626Config; } /** * @dev Initializes a ERC4626 exiter * @param config ERC4626 exit config */ function initialize(ERC4626ExitConfig memory config) external virtual initializer { __ERC4626Exiter_init(config); } /** * @dev Initializes the ERC4626 exiter. It does call upper contracts initializers. * @param config ERC4626 exit config */ function __ERC4626Exiter_init(ERC4626ExitConfig memory config) internal onlyInitializing { __BaseERC4626Task_init(config.baseERC4626Config); __ERC4626Exiter_init_unchained(config); } /** * @dev Initializes the ERC4626 exiter. It does not call upper contracts initializers. * @param config ERC4626 exit config */ function __ERC4626Exiter_init_unchained(ERC4626ExitConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the ERC4626 exiter task. Note that the ERC4626 is also the token. * @param erc4626 Address of the ERC4626 to be exited * @param amount Amount of shares to be exited with * @param minAmountOut Minimum amount of assets willing to receive */ function call(address erc4626, uint256 amount, uint256 minAmountOut) external override authP(authParams(erc4626, amount, minAmountOut)) { if (amount == 0) amount = getTaskAmount(erc4626); _beforeERC4626Exiter(erc4626, amount); bytes memory connectorData = abi.encodeWithSelector( IERC4626Connector.exit.selector, erc4626, amount, minAmountOut ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); (address tokenOut, uint256 amountOut) = abi.decode(result, (address, uint256)); _afterERC4626Exiter(erc4626, amount, tokenOut, amountOut); } /** * @dev Before ERC4626 exiter hook */ function _beforeERC4626Exiter(address token, uint256 amount) internal virtual { _beforeBaseERC4626Task(token, amount); } /** * @dev After ERC4626 exiter hook */ function _afterERC4626Exiter(address tokenIn, uint256 amountIn, address tokenOut, uint256 amountOut) internal virtual { _afterBaseERC4626Task(tokenIn, amountIn, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-connectors/contracts/interfaces/erc4626/IERC4626Connector.sol'; import './BaseERC4626Task.sol'; import '../../interfaces/liquidity/erc4626/IERC4626Joiner.sol'; /** * @title ERC4626 joiner * @dev Task that extends the base ERC4626 task to join an ERC4626 vault */ contract ERC4626Joiner is IERC4626Joiner, BaseERC4626Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('ERC4626_JOINER'); /** * @dev ERC4626 join config. Only used in the initializer. */ struct ERC4626JoinConfig { BaseERC4626Config baseERC4626Config; } /** * @dev Initializes a ERC4626 joiner * @param config ERC4626 join config */ function initialize(ERC4626JoinConfig memory config) external virtual initializer { __ERC4626Joiner_init(config); } /** * @dev Initializes the ERC4626 joiner. It does call upper contracts initializers. * @param config ERC4626 join config */ function __ERC4626Joiner_init(ERC4626JoinConfig memory config) internal onlyInitializing { __BaseERC4626Task_init(config.baseERC4626Config); __ERC4626Joiner_init_unchained(config); } /** * @dev Initializes the ERC4626 joiner. It does not call upper contracts initializers. * @param config ERC4626 join config */ function __ERC4626Joiner_init_unchained(ERC4626JoinConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the ERC4626 joiner task * @param token Address of the token to be joined with * @param amount Amount of assets to be joined with * @param erc4626 Address of the ERC4626 to be joined * @param minAmountOut Minimum amount of shares willing to receive */ function call(address token, uint256 amount, address erc4626, uint256 minAmountOut) external override authP(authParams(token, amount, erc4626, minAmountOut)) { if (amount == 0) amount = getTaskAmount(token); _beforeERC4626Joiner(token, amount, erc4626); bytes memory connectorData = abi.encodeWithSelector( IERC4626Connector.join.selector, erc4626, token, amount, minAmountOut ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); (address tokenOut, uint256 amountOut) = abi.decode(result, (address, uint256)); _afterERC4626Joiner(token, amount, tokenOut, amountOut); } /** * @dev Before ERC4626 joiner hook */ function _beforeERC4626Joiner(address token, uint256 amount, address erc4626) internal virtual { _beforeBaseERC4626Task(token, amount); if (erc4626 == address(0)) revert TaskERC4626Zero(); } /** * @dev After ERC4626 joiner hook */ function _afterERC4626Joiner(address tokenIn, uint256 amountIn, address tokenOut, uint256 amountOut) internal virtual { _afterBaseERC4626Task(tokenIn, amountIn, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; import '../Task.sol'; import '../interfaces/primitives/ICollector.sol'; /** * @title Collector * @dev Task that offers a source address where funds can be pulled from */ contract Collector is ICollector, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('COLLECTOR'); // Address from where the tokens will be pulled address internal _tokensSource; /** * @dev Collect config. Only used in the initializer. */ struct CollectConfig { address tokensSource; TaskConfig taskConfig; } /** * @dev Initializes the collector * @param config Collect config */ function initialize(CollectConfig memory config) external virtual initializer { __Collector_init(config); } /** * @dev Initializes the collector. It does call upper contracts initializers. * @param config Collect config */ function __Collector_init(CollectConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __Collector_init_unchained(config); } /** * @dev Initializes the collector. It does not call upper contracts initializers. * @param config Collect config */ function __Collector_init_unchained(CollectConfig memory config) internal onlyInitializing { _setTokensSource(config.tokensSource); } /** * @dev Tells the address from where the token amounts to execute this task are fetched */ function getTokensSource() public view virtual override(IBaseTask, BaseTask) returns (address) { return _tokensSource; } /** * @dev Tells the balance of the depositor for a given token * @param token Address of the token being queried */ function getTaskAmount(address token) public view virtual override(IBaseTask, BaseTask) returns (uint256) { return ERC20Helpers.balanceOf(token, getTokensSource()); } /** * @dev Sets the tokens source address. Sender must be authorized. * @param tokensSource Address of the tokens source to be set */ function setTokensSource(address tokensSource) external override authP(authParams(tokensSource)) { _setTokensSource(tokensSource); } /** * @dev Execute Collector */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeCollector(token, amount); ISmartVault(smartVault).collect(token, _tokensSource, amount); _afterCollector(token, amount); } /** * @dev Before collector hook */ function _beforeCollector(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After collector hook */ function _afterCollector(address token, uint256 amount) internal virtual { _increaseBalanceConnector(token, amount); _afterTask(token, amount); } /** * @dev Sets the balance connectors. Previous balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (previous != bytes32(0)) revert TaskPreviousConnectorNotZero(previous); super._setBalanceConnectors(previous, next); } /** * @dev Sets the source address * @param tokensSource Address of the tokens source to be set */ function _setTokensSource(address tokensSource) internal virtual { if (tokensSource == address(0)) revert TaskTokensSourceZero(); _tokensSource = tokensSource; emit TokensSourceSet(tokensSource); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/ERC20Helpers.sol'; import '../Task.sol'; import '../interfaces/primitives/IHandleOver.sol'; /** * @title Hand over task * @dev Task that simply moves tokens from one balance connector to the other */ contract HandleOver is IHandleOver, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('HANDLE_OVER'); /** * @dev Hand over config. Only used in the initializer. */ struct HandleOverConfig { TaskConfig taskConfig; } /** * @dev Initializes the hand over task * @param config Hand over config */ function initialize(HandleOverConfig memory config) external virtual initializer { __HandleOver_init(config); } /** * @dev Initializes the hand over task. It does call upper contracts initializers. * @param config Hand over config */ function __HandleOver_init(HandleOverConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __HandleOver_init_unchained(config); } /** * @dev Initializes the hand over task. It does not call upper contracts initializers. * @param config Hand over config */ function __HandleOver_init_unchained(HandleOverConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute the hand over taks */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeHandleOver(token, amount); _afterHandleOver(token, amount); } /** * @dev Before hand over task hook */ function _beforeHandleOver(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After hand over task hook */ function _afterHandleOver(address token, uint256 amount) internal virtual { _increaseBalanceConnector(token, amount); _afterTask(token, amount); } /** * @dev Sets the balance connectors. Both balance connector must be set. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (previous == bytes32(0)) revert TaskConnectorZero(previous); if (next == bytes32(0)) revert TaskConnectorZero(next); super._setBalanceConnectors(previous, next); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '../Task.sol'; import '../interfaces/primitives/IUnwrapper.sol'; /** * @title Unwrapper * @dev Task that offers facilities to unwrap wrapped native tokens */ contract Unwrapper is IUnwrapper, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('UNWRAPPER'); /** * @dev Unwrap config. Only used in the initializer. * @param taskConfig Task config params */ struct UnwrapConfig { TaskConfig taskConfig; } /** * @dev Initializes the unwrapper * @param config Unwrap config */ function initialize(UnwrapConfig memory config) external virtual initializer { __Unwrapper_init(config); } /** * @dev Initializes the unwrapper. It does call upper contracts initializers. * @param config Unwrap config */ function __Unwrapper_init(UnwrapConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __Unwrapper_init_unchained(config); } /** * @dev Initializes the unwrapper. It does not call upper contracts initializers. * @param config Unwrap config */ function __Unwrapper_init_unchained(UnwrapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Unwrapper */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeUnwrapper(token, amount); ISmartVault(smartVault).unwrap(amount); _afterUnwrapper(token, amount); } /** * @dev Before unwrapper hook */ function _beforeUnwrapper(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token != _wrappedNativeToken()) revert TaskTokenNotWrapped(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After unwrapper hook */ function _afterUnwrapper(address token, uint256 amount) internal virtual { _increaseBalanceConnector(Denominations.NATIVE_TOKEN, amount); _afterTask(token, amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '../Task.sol'; import '../interfaces/primitives/IWithdrawer.sol'; /** * @title Withdrawer * @dev Task that offers a recipient address where funds can be withdrawn */ contract Withdrawer is IWithdrawer, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('WITHDRAWER'); // Address where tokens will be transferred to address public override recipient; /** * @dev Withdraw config. Only used in the initializer. */ struct WithdrawConfig { address recipient; TaskConfig taskConfig; } /** * @dev Initializes the withdrawer * @param config Withdraw config */ function initialize(WithdrawConfig memory config) external virtual initializer { __Withdrawer_init(config); } /** * @dev Initializes the withdrawer. It does call upper contracts initializers. * @param config Withdraw config */ function __Withdrawer_init(WithdrawConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __Withdrawer_init_unchained(config); } /** * @dev Initializes the withdrawer. It does not call upper contracts initializers. * @param config Withdraw config */ function __Withdrawer_init_unchained(WithdrawConfig memory config) internal onlyInitializing { _setRecipient(config.recipient); } /** * @dev Sets the recipient address. Sender must be authorized. * @param newRecipient Address of the new recipient to be set */ function setRecipient(address newRecipient) external override authP(authParams(newRecipient)) { _setRecipient(newRecipient); } /** * @dev Executes the Withdrawer */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeWithdrawer(token, amount); ISmartVault(smartVault).withdraw(token, recipient, amount); _afterWithdrawer(token, amount); } /** * @dev Before withdrawer hook */ function _beforeWithdrawer(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After withdrawer hook */ function _afterWithdrawer(address token, uint256 amount) internal virtual { _afterTask(token, amount); } /** * @dev Sets the recipient address * @param newRecipient Address of the new recipient to be set */ function _setRecipient(address newRecipient) internal { if (newRecipient == address(0)) revert TaskRecipientZero(); if (newRecipient == smartVault) revert TaskRecipientEqualsSmartVault(newRecipient); recipient = newRecipient; emit RecipientSet(newRecipient); } /** * @dev Sets the balance connectors. Next balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal virtual override { if (next != bytes32(0)) revert TaskNextConnectorNotZero(next); super._setBalanceConnectors(previous, next); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/primitives/IWrapper.sol'; /** * @title Wrapper * @dev Task that offers facilities to wrap native tokens */ contract Wrapper is IWrapper, Task { // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('WRAPPER'); /** * @dev Wrap config. Only used in the initializer. */ struct WrapConfig { TaskConfig taskConfig; } /** * @dev Initializes the wrapper * @param config Wrap config */ function initialize(WrapConfig memory config) external virtual initializer { __Wrapper_init(config); } /** * @dev Initializes the wrapper. It does call upper contracts initializers. * @param config Wrap config */ function __Wrapper_init(WrapConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __Wrapper_init_unchained(config); } /** * @dev Initializes the wrapper. It does not call upper contracts initializers. * @param config Wrap config */ function __Wrapper_init_unchained(WrapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Execute Wrapper */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeWrapper(token, amount); ISmartVault(smartVault).wrap(amount); _afterWrapper(token, amount); } /** * @dev Before wrapper hook */ function _beforeWrapper(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (token != Denominations.NATIVE_TOKEN) revert TaskTokenNotNative(); if (amount == 0) revert TaskAmountZero(); } /** * @dev After wrapper hook */ function _afterWrapper(address token, uint256 amount) internal virtual { _increaseBalanceConnector(_wrappedNativeToken(), amount); _afterTask(token, amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-relayer/contracts/interfaces/IRelayer.sol'; import '../Task.sol'; import '../interfaces/relayer/IBaseRelayerFundTask.sol'; /** * @title Base relayer fund task * @dev Task that offers the basic components for more detailed relayer fund tasks */ abstract contract BaseRelayerFundTask is IBaseRelayerFundTask, Task { using FixedPoint for uint256; // Reference to the contract to be funded address public override relayer; /** * @dev Base relayer fund config. Only used in the initializer. */ struct BaseRelayerFundConfig { address relayer; TaskConfig taskConfig; } /** * @dev Initializes the base relayer fund task. It does call upper contracts initializers. * @param config Base relayer fund config */ function __BaseRelayerFundTask_init(BaseRelayerFundConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseRelayerFundTask_init_unchained(config); } /** * @dev Initializes the base relayer fund task. It does not call upper contracts initializers. * @param config Base relayer fund config */ function __BaseRelayerFundTask_init_unchained(BaseRelayerFundConfig memory config) internal onlyInitializing { _setRelayer(config.relayer); } /** * @dev Tells the amount in `token` to be paid to the relayer * @param token Address of the token to be used to pay the relayer */ function getTaskAmount(address token) public view virtual override(IBaseTask, BaseTask) returns (uint256) { Threshold memory threshold = _getTokenThreshold(token); if (threshold.token == address(0)) return 0; uint256 depositedThresholdToken = _getDepositedInThresholdToken(threshold.token); if (depositedThresholdToken >= threshold.min) return 0; uint256 usedQuotaThresholdToken = _getUsedQuotaInThresholdToken(threshold.token); uint256 diff = threshold.max - depositedThresholdToken + usedQuotaThresholdToken; return (token == threshold.token) ? diff : diff.mulUp(_getPrice(threshold.token, token)); } /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function setRelayer(address newRelayer) external override authP(authParams(newRelayer)) { _setRelayer(newRelayer); } /** * @dev Before token threshold task hook */ function _beforeTokenThresholdTask(address token, uint256 amount) internal virtual override { Threshold memory threshold = _getTokenThreshold(token); if (threshold.token == address(0)) revert TaskTokenThresholdNotSet(token); uint256 amountInThresholdToken = amount.mulUp(_getPrice(token, threshold.token)); uint256 depositedInThresholdToken = _getDepositedInThresholdToken(threshold.token); bool isCurrentBalanceAboveMin = depositedInThresholdToken >= threshold.min; if (isCurrentBalanceAboveMin) revert TaskDepositAboveMinThreshold(depositedInThresholdToken, threshold.min); uint256 usedQuotaInThresholdToken = _getUsedQuotaInThresholdToken(threshold.token); bool coversUsedQuota = amountInThresholdToken > usedQuotaInThresholdToken; if (!coversUsedQuota) revert TaskDepositBelowUsedQuota(amountInThresholdToken, usedQuotaInThresholdToken); uint256 balanceAfterDeposit = amountInThresholdToken + depositedInThresholdToken - usedQuotaInThresholdToken; bool isNewBalanceBelowMin = balanceAfterDeposit < threshold.min; if (isNewBalanceBelowMin) revert TaskNewDepositBelowMinThreshold(balanceAfterDeposit, threshold.min); bool isNewBalanceAboveMax = balanceAfterDeposit > threshold.max; if (isNewBalanceAboveMax) revert TaskNewDepositAboveMaxThreshold(balanceAfterDeposit, threshold.max); } /** * @dev Tells the deposited balance in the relayer expressed in another token */ function _getDepositedInThresholdToken(address token) internal view returns (uint256) { // Relayer balance is expressed in ETH uint256 depositedNativeToken = IRelayer(relayer).getSmartVaultBalance(smartVault); return depositedNativeToken.mulUp(_getPrice(_wrappedNativeToken(), token)); } /** * @dev Tells the used quota in the relayer expressed in another token */ function _getUsedQuotaInThresholdToken(address token) internal view returns (uint256) { // Relayer used quota is expressed in ETH uint256 usedQuotaNativeToken = IRelayer(relayer).getSmartVaultUsedQuota(smartVault); return usedQuotaNativeToken.mulUp(_getPrice(_wrappedNativeToken(), token)); } /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function _setRelayer(address newRelayer) internal { if (newRelayer == address(0)) revert TaskRelayerZero(); relayer = newRelayer; emit RelayerSet(newRelayer); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '../primitives/Collector.sol'; import './BaseRelayerFundTask.sol'; /** * @title Collector relayer funder * @dev Task used to convert funds in order to pay relayers using an collector */ contract CollectorRelayerFunder is BaseRelayerFundTask, Collector { /** * @dev Disables the default collector initializer */ function initialize(CollectConfig memory) external pure override { revert TaskInitializerDisabled(); } /** * @dev Initializes the collector relayer funder * @param config Collect config * @param relayer Relayer address */ function initializeCollectorRelayerFunder(CollectConfig memory config, address relayer) external virtual initializer { __CollectorRelayerFunder_init(config, relayer); } /** * @dev Initializes the collector relayer funder. It does call upper contracts initializers. * @param config Collect config * @param relayer Relayer address */ function __CollectorRelayerFunder_init(CollectConfig memory config, address relayer) internal onlyInitializing { __Collector_init(config); __BaseRelayerFundTask_init_unchained(BaseRelayerFundConfig(relayer, config.taskConfig)); __CollectorRelayerFunder_init_unchained(config, relayer); } /** * @dev Initializes the collector relayer funder. It does not call upper contracts initializers. * @param config Collect config * @param relayer Relayer address */ function __CollectorRelayerFunder_init_unchained(CollectConfig memory config, address relayer) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Tells the address from where the token amounts to execute this task are fetched */ function getTokensSource() public view override(Collector, IBaseTask, BaseTask) returns (address) { return Collector.getTokensSource(); } /** * @dev Tells the `token` amount to be funded * @param token Address of the token to be used to fund the relayer */ function getTaskAmount(address token) public view override(BaseRelayerFundTask, Collector) returns (uint256) { return BaseRelayerFundTask.getTaskAmount(token); } /** * @dev Before token threshold task hook */ function _beforeTokenThresholdTask(address token, uint256 amount) internal override(BaseRelayerFundTask, TokenThresholdTask) { BaseRelayerFundTask._beforeTokenThresholdTask(token, amount); } /** * @dev Sets the balance connectors. Previous balance connector must be unset. * @param previous Balance connector id of the previous task in the workflow * @param next Balance connector id of the next task in the workflow */ function _setBalanceConnectors(bytes32 previous, bytes32 next) internal override(Collector, BaseTask) { Collector._setBalanceConnectors(previous, next); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import './BaseRelayerFundTask.sol'; import '../swap/OneInchV5Swapper.sol'; /** * @title 1inch v5 relayer funder * @dev Task used to convert funds in order to pay relayers using a 1inch v5 swapper */ contract OneInchV5RelayerFunder is BaseRelayerFundTask, OneInchV5Swapper { /** * @dev Disables the default 1inch v5 swapper initializer */ function initialize(OneInchV5SwapConfig memory) external pure override { revert TaskInitializerDisabled(); } /** * @dev Initializes the 1inch v5 relayer funder * @param config 1inch v5 swap config * @param relayer Relayer address */ function initializeOneInchV5RelayerFunder(OneInchV5SwapConfig memory config, address relayer) external virtual initializer { __OneInchV5RelayerFunder_init(config, relayer); } /** * @dev Initializes the 1inch v5 relayer funder. It does call upper contracts initializers. * @param config 1inch v5 swap config * @param relayer Relayer address */ function __OneInchV5RelayerFunder_init(OneInchV5SwapConfig memory config, address relayer) internal onlyInitializing { __OneInchV5Swapper_init(config); __BaseRelayerFundTask_init_unchained(BaseRelayerFundConfig(relayer, config.baseSwapConfig.taskConfig)); __OneInchV5RelayerFunder_init_unchained(config, relayer); } /** * @dev Initializes the 1inch v5 relayer funder. It does not call upper contracts initializers. * @param config Unwrap config * @param relayer Relayer address */ function __OneInchV5RelayerFunder_init_unchained(OneInchV5SwapConfig memory config, address relayer) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Tells the amount in `token` to be funded * @param token Address of the token to be used for funding */ function getTaskAmount(address token) public view override(BaseRelayerFundTask, IBaseTask, BaseTask) returns (uint256) { return BaseRelayerFundTask.getTaskAmount(token); } /** * @dev Before token threshold task hook */ function _beforeTokenThresholdTask(address token, uint256 amount) internal override(BaseRelayerFundTask, TokenThresholdTask) { BaseRelayerFundTask._beforeTokenThresholdTask(token, amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-relayer/contracts/interfaces/IRelayer.sol'; import '../Task.sol'; import '../interfaces/relayer/IRelayerDepositor.sol'; /** * @title Relayer depositor * @dev Task that offers facilities to deposit balance for Mimic relayers */ contract RelayerDepositor is IRelayerDepositor, Task { using FixedPoint for uint256; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('RELAYER_DEPOSITOR'); // Reference to the contract to be funded address public override relayer; /** * @dev Initializes the relayer depositor * @param config Task config * @param _relayer Relayer address */ function initialize(TaskConfig memory config, address _relayer) external virtual initializer { __RelayerDepositor_init(config, _relayer); } /** * @dev Initializes the relayer depositor. It does call upper contracts initializers. * @param config Task config * @param _relayer Relayer address */ function __RelayerDepositor_init(TaskConfig memory config, address _relayer) internal onlyInitializing { __Task_init(config); __RelayerDepositor_init_unchained(config, _relayer); } /** * @dev Initializes the relayer depositor. It does not call upper contracts initializers. * @param _relayer Relayer address */ function __RelayerDepositor_init_unchained(TaskConfig memory, address _relayer) internal onlyInitializing { _setRelayer(_relayer); } /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function setRelayer(address newRelayer) external override authP(authParams(newRelayer)) { _setRelayer(newRelayer); } /** * @dev Executes the relayer depositor task */ function call(address token, uint256 amount) external override authP(authParams(token, amount)) { if (amount == 0) amount = getTaskAmount(token); _beforeRelayerDepositor(token, amount); bytes memory relayerData = abi.encodeWithSelector(IRelayer.deposit.selector, smartVault, amount); // solhint-disable-next-line avoid-low-level-calls ISmartVault(smartVault).call(relayer, relayerData, amount); _afterRelayerDepositor(token, amount); } /** * @dev Before relayer depositor hook */ function _beforeRelayerDepositor(address token, uint256 amount) internal virtual { _beforeTask(token, amount); if (amount == 0) revert TaskAmountZero(); } /** * @dev After relayer depositor hook */ function _afterRelayerDepositor(address token, uint256 amount) internal virtual { _afterTask(token, amount); } /** * @dev Sets the relayer * @param newRelayer Address of the relayer to be set */ function _setRelayer(address newRelayer) internal { if (newRelayer == address(0)) revert TaskRelayerZero(); relayer = newRelayer; emit RelayerSet(newRelayer); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import './BaseRelayerFundTask.sol'; import '../primitives/Unwrapper.sol'; /** * @title Unwrapper relayer funder * @dev Task used to convert funds in order to pay relayers using an unwrapper */ contract UnwrapperRelayerFunder is BaseRelayerFundTask, Unwrapper { /** * @dev Disables the default unwrapper initializer */ function initialize(UnwrapConfig memory) external pure override { revert TaskInitializerDisabled(); } /** * @dev Initializes the unwrapper relayer funder * @param config Unwrap config * @param relayer Relayer address */ function initializeUnwrapperRelayerFunder(UnwrapConfig memory config, address relayer) external virtual initializer { __UnwrapperRelayerFunder_init(config, relayer); } /** * @dev Initializes the unwrapper relayer funder. It does call upper contracts initializers. * @param config Unwrap config * @param relayer Relayer address */ function __UnwrapperRelayerFunder_init(UnwrapConfig memory config, address relayer) internal onlyInitializing { __Unwrapper_init(config); __BaseRelayerFundTask_init_unchained(BaseRelayerFundConfig(relayer, config.taskConfig)); __UnwrapperRelayerFunder_init_unchained(config, relayer); } /** * @dev Initializes the unwrapper relayer funder. It does not call upper contracts initializers. * @param config Unwrap config * @param relayer Relayer address */ function __UnwrapperRelayerFunder_init_unchained(UnwrapConfig memory config, address relayer) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Tells the `token` amount to be funded * @param token Address of the token to be used to fund the relayer */ function getTaskAmount(address token) public view override(BaseRelayerFundTask, IBaseTask, BaseTask) returns (uint256) { return BaseRelayerFundTask.getTaskAmount(token); } /** * @dev Before token threshold task hook */ function _beforeTokenThresholdTask(address token, uint256 amount) internal override(BaseRelayerFundTask, TokenThresholdTask) { BaseRelayerFundTask._beforeTokenThresholdTask(token, amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2Vault.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BalancerV2BptSwapper.sol'; import '../interfaces/liquidity/balancer/IBalancerBoostedPool.sol'; /** * @title Balancer v2 boosted swapper task * @dev Task that extends the Balancer v2 BPT swapper task specially for boosted pools */ contract BalancerV2BoostedSwapper is BalancerV2BptSwapper { /** * @dev Tells the token out that should be used for a token. In case there is no token out defined for the * requested token, it will use one of the underlying pool tokens. */ function getTokenOut(address token) public view virtual override(IBaseSwapTask, BaseSwapTask) returns (address) { address tokenOut = BaseSwapTask.getTokenOut(token); if (tokenOut != address(0)) return tokenOut; bytes32 poolId = IBalancerBoostedPool(token).getPoolId(); uint256 bptIndex = IBalancerBoostedPool(token).getBptIndex(); address balancerV2Vault = IBalancerV2SwapConnector(connector).balancerV2Vault(); (IERC20[] memory tokens, , ) = IBalancerV2Vault(balancerV2Vault).getPoolTokens(poolId); return address(bptIndex == 0 ? tokens[1] : tokens[0]); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IBalancerV2BptSwapper.sol'; import '../interfaces/liquidity/balancer/IBalancerPool.sol'; /** * @title Balancer v2 BPT swapper task * @dev Task that extends the swapper task to use Balancer v2 */ contract BalancerV2BptSwapper is IBalancerV2BptSwapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('BALANCER_V2_BPT_SWAPPER'); /** * @dev Balancer v2 BPT swap config. Only used in the initializer. */ struct BalancerV2BptSwapConfig { BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the Balancer v2 BPT swapper * @param config Balancer v2 BPT swap config */ function initialize(BalancerV2BptSwapConfig memory config) external initializer { __BalancerV2BptSwapper_init(config); } /** * @dev Initializes the Balancer v2 BPT swapper. It does call upper contracts. * @param config Balancer v2 BPT swap config */ function __BalancerV2BptSwapper_init(BalancerV2BptSwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __BalancerV2BptSwapper_init_unchained(config); } /** * @dev Initializes the Balancer v2 BPT swapper. It does not call upper contracts. * @param config Balancer v2 BPT swap config */ function __BalancerV2BptSwapper_init_unchained(BalancerV2BptSwapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the Balancer v2 BPT swapper task */ function call(address tokenIn, uint256 amountIn, uint256 slippage) external override authP(authParams(tokenIn, amountIn, slippage)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); _beforeBalancerV2BptSwapper(tokenIn, amountIn, slippage); address tokenOut = getTokenOut(tokenIn); uint256 price = _getPrice(tokenIn, tokenOut); uint256 minAmountOut = amountIn.mulUp(price).mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IBalancerV2SwapConnector.execute.selector, tokenIn, tokenOut, amountIn, minAmountOut, IBalancerPool(tokenIn).getPoolId(), new bytes32[](0), new address[](0) ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterBalancerV2BptSwapper(tokenIn, amountIn, slippage, tokenOut, result.toUint256()); } /** * @dev Before Balancer v2 BPT swapper task */ function _beforeBalancerV2BptSwapper(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseSwapTask(token, amount, slippage); } /** * @dev After Balancer v2 BPT swapper hook */ function _afterBalancerV2BptSwapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/balancer/IBalancerV2SwapConnector.sol'; import './BalancerV2BptSwapper.sol'; import '../interfaces/liquidity/balancer/IBalancerLinearPool.sol'; /** * @title Balancer v2 linear swapper task * @dev Task that extends the Balancer v2 BPT swapper task specially for linear pools */ contract BalancerV2LinearSwapper is BalancerV2BptSwapper { /** * @dev Tells the token out that should be used for a token. In case there is no token out defined for the * requested token, it will use the linear pool main token. */ function getTokenOut(address token) public view virtual override(IBaseSwapTask, BaseSwapTask) returns (address) { address tokenOut = BaseSwapTask.getTokenOut(token); if (tokenOut != address(0)) return tokenOut; return IBalancerLinearPool(token).getMainToken(); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/Denominations.sol'; import '../Task.sol'; import '../interfaces/swap/IBaseSwapTask.sol'; /** * @title Base swap task * @dev Task that offers the basic components for more detailed swap tasks */ abstract contract BaseSwapTask is IBaseSwapTask, Task { using FixedPoint for uint256; // Connector address address public override connector; // Default token out address public override defaultTokenOut; // Default maximum slippage in fixed point uint256 public override defaultMaxSlippage; // Token out per token mapping (address => address) public override customTokenOut; // Maximum slippage per token address mapping (address => uint256) public override customMaxSlippage; /** * @dev Custom token out config. Only used in the initializer. */ struct CustomTokenOut { address token; address tokenOut; } /** * @dev Custom max slippage config. Only used in the initializer. */ struct CustomMaxSlippage { address token; uint256 maxSlippage; } /** * @dev Base swap config. Only used in the initializer. */ struct BaseSwapConfig { address connector; address tokenOut; uint256 maxSlippage; CustomTokenOut[] customTokensOut; CustomMaxSlippage[] customMaxSlippages; TaskConfig taskConfig; } /** * @dev Initializes the base swap task. It does call upper contracts initializers. * @param config Base swap config */ function __BaseSwapTask_init(BaseSwapConfig memory config) internal onlyInitializing { __Task_init(config.taskConfig); __BaseSwapTask_init_unchained(config); } /** * @dev Initializes the base swap task. It does not call upper contracts initializers. * @param config Base swap config */ function __BaseSwapTask_init_unchained(BaseSwapConfig memory config) internal onlyInitializing { _setConnector(config.connector); _setDefaultTokenOut(config.tokenOut); _setDefaultMaxSlippage(config.maxSlippage); for (uint256 i = 0; i < config.customTokensOut.length; i++) { _setCustomTokenOut(config.customTokensOut[i].token, config.customTokensOut[i].tokenOut); } for (uint256 i = 0; i < config.customMaxSlippages.length; i++) { _setCustomMaxSlippage(config.customMaxSlippages[i].token, config.customMaxSlippages[i].maxSlippage); } } /** * @dev Tells the token out that should be used for a token */ function getTokenOut(address token) public view virtual override returns (address) { address tokenOut = customTokenOut[token]; return tokenOut == address(0) ? defaultTokenOut : tokenOut; } /** * @dev Tells the max slippage that should be used for a token */ function getMaxSlippage(address token) public view virtual override returns (uint256) { uint256 maxSlippage = customMaxSlippage[token]; return maxSlippage == 0 ? defaultMaxSlippage : maxSlippage; } /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function setConnector(address newConnector) external override authP(authParams(newConnector)) { _setConnector(newConnector); } /** * @dev Sets the default token out * @param tokenOut Address of the default token out to be set */ function setDefaultTokenOut(address tokenOut) external override authP(authParams(tokenOut)) { _setDefaultTokenOut(tokenOut); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function setDefaultMaxSlippage(uint256 maxSlippage) external override authP(authParams(maxSlippage)) { _setDefaultMaxSlippage(maxSlippage); } /** * @dev Sets a custom token out * @param token Address of the token to set a custom token out for * @param tokenOut Address of the token out to be set */ function setCustomTokenOut(address token, address tokenOut) external override authP(authParams(token, tokenOut)) { _setCustomTokenOut(token, tokenOut); } /** * @dev Sets a custom max slippage * @param token Address of the token to set a custom max slippage for * @param maxSlippage Max slippage to be set */ function setCustomMaxSlippage(address token, uint256 maxSlippage) external override authP(authParams(token, maxSlippage)) { _setCustomMaxSlippage(token, maxSlippage); } /** * @dev Before base swap task hook */ function _beforeBaseSwapTask(address token, uint256 amount, uint256 slippage) internal virtual { _beforeTask(token, amount); if (token == address(0)) revert TaskTokenZero(); if (amount == 0) revert TaskAmountZero(); if (getTokenOut(token) == address(0)) revert TaskTokenOutNotSet(); uint256 maxSlippage = getMaxSlippage(token); if (slippage > maxSlippage) revert TaskSlippageAboveMax(slippage, maxSlippage); } /** * @dev After base swap task hook */ function _afterBaseSwapTask(address tokenIn, uint256 amountIn, uint256, address tokenOut, uint256 amountOut) internal virtual { _increaseBalanceConnector(tokenOut, amountOut); _afterTask(tokenIn, amountIn); } /** * @dev Sets a new connector * @param newConnector Address of the connector to be set */ function _setConnector(address newConnector) internal { if (newConnector == address(0)) revert TaskConnectorZero(); connector = newConnector; emit ConnectorSet(newConnector); } /** * @dev Sets the default token out * @param tokenOut Default token out to be set */ function _setDefaultTokenOut(address tokenOut) internal { defaultTokenOut = tokenOut; emit DefaultTokenOutSet(tokenOut); } /** * @dev Sets the default max slippage * @param maxSlippage Default max slippage to be set */ function _setDefaultMaxSlippage(uint256 maxSlippage) internal { if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); defaultMaxSlippage = maxSlippage; emit DefaultMaxSlippageSet(maxSlippage); } /** * @dev Sets a custom token out for a token * @param token Address of the token to set the custom token out for * @param tokenOut Address of the token out to be set */ function _setCustomTokenOut(address token, address tokenOut) internal { if (token == address(0)) revert TaskTokenZero(); customTokenOut[token] = tokenOut; emit CustomTokenOutSet(token, tokenOut); } /** * @dev Sets a custom max slippage for a token * @param token Address of the token to set the custom max slippage for * @param maxSlippage Max slippage to be set */ function _setCustomMaxSlippage(address token, uint256 maxSlippage) internal { if (token == address(0)) revert TaskTokenZero(); if (maxSlippage > FixedPoint.ONE) revert TaskSlippageAboveOne(); customMaxSlippage[token] = maxSlippage; emit CustomMaxSlippageSet(token, maxSlippage); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopL2Amm.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/hop/IHopSwapConnector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IHopL2Swapper.sol'; /** * @title Hop L2 swapper * @dev Task that extends the base swap task to use Hop */ contract HopL2Swapper is IHopL2Swapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('HOP_L2_SWAPPER'); // List of AMMs per token mapping (address => address) public override tokenAmm; /** * @dev Token amm config. Only used in the initializer. */ struct TokenAmm { address token; address amm; } /** * @dev Hop L2 swap config. Only used in the initializer. */ struct HopL2SwapConfig { TokenAmm[] tokenAmms; BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the Hop L2 swapper * @param config Hop L2 swap config */ function initialize(HopL2SwapConfig memory config) external virtual initializer { __HopL2Swapper_init(config); } /** * @dev Initializes the Hop L2 swapper. It does call upper contracts initializers. * @param config Hop L2 swap config */ function __HopL2Swapper_init(HopL2SwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __HopL2Swapper_init_unchained(config); } /** * @dev Initializes the Hop L2 swapper. It does not call upper contracts initializers. * @param config Hop L2 swap config */ function __HopL2Swapper_init_unchained(HopL2SwapConfig memory config) internal onlyInitializing { for (uint256 i = 0; i < config.tokenAmms.length; i++) { _setTokenAmm(config.tokenAmms[i].token, config.tokenAmms[i].amm); } } /** * @dev Sets an AMM for a hToken * @param hToken Address of the hToken to be set * @param amm AMM address to be set for the hToken */ function setTokenAmm(address hToken, address amm) external authP(authParams(hToken, amm)) { _setTokenAmm(hToken, amm); } /** * @dev Execution function */ function call(address hToken, uint256 amount, uint256 slippage) external override authP(authParams(hToken, amount, slippage)) { if (amount == 0) amount = getTaskAmount(hToken); _beforeHopL2Swapper(hToken, amount, slippage); address tokenOut = getTokenOut(hToken); address dexAddress = IHopL2Amm(tokenAmm[hToken]).exchangeAddress(); uint256 minAmountOut = amount.mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IHopSwapConnector.execute.selector, hToken, tokenOut, amount, minAmountOut, dexAddress ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterHopL2Swapper(hToken, amount, slippage, tokenOut, result.toUint256()); } /** * @dev Before Hop L2 swapper hook */ function _beforeHopL2Swapper(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseSwapTask(token, amount, slippage); if (tokenAmm[token] == address(0)) revert TaskMissingHopTokenAmm(); } /** * @dev After Hop L2 swapper hook */ function _afterHopL2Swapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } /** * @dev Set an AMM for a Hop token * @param hToken Address of the hToken to set an AMM for * @param amm AMM to be set */ function _setTokenAmm(address hToken, address amm) internal { if (hToken == address(0)) revert TaskTokenZero(); if (amm != address(0) && hToken != IHopL2Amm(amm).hToken()) revert TaskHopTokenAmmMismatch(hToken, amm); tokenAmm[hToken] = amm; emit TokenAmmSet(hToken, amm); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/1inch/IOneInchV5Connector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IOneInchV5Swapper.sol'; /** * @title 1inch v5 swapper * @dev Task that extends the base swap task to use 1inch v5 */ contract OneInchV5Swapper is IOneInchV5Swapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('1INCH_V5_SWAPPER'); /** * @dev 1inch v5 swap config. Only used in the initializer. */ struct OneInchV5SwapConfig { BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the 1inch v5 swapper * @param config 1inch v5 swap config */ function initialize(OneInchV5SwapConfig memory config) external virtual initializer { __OneInchV5Swapper_init(config); } /** * @dev Initializes the 1inch v5 swapper. It does call upper contracts initializers. * @param config 1inch v5 swap config */ function __OneInchV5Swapper_init(OneInchV5SwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __OneInchV5Swapper_init_unchained(config); } /** * @dev Initializes the 1inch v5 swapper. It does not call upper contracts initializers. * @param config 1inch v5 swap config */ function __OneInchV5Swapper_init_unchained(OneInchV5SwapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the 1inch V5 swapper task */ function call(address tokenIn, uint256 amountIn, uint256 slippage, bytes memory data) external override authP(authParams(tokenIn, amountIn, slippage)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); _beforeOneInchV5Swapper(tokenIn, amountIn, slippage); address tokenOut = getTokenOut(tokenIn); uint256 price = _getPrice(tokenIn, tokenOut); uint256 minAmountOut = amountIn.mulUp(price).mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IOneInchV5Connector.execute.selector, tokenIn, tokenOut, amountIn, minAmountOut, data ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterOneInchV5Swapper(tokenIn, amountIn, slippage, tokenOut, result.toUint256()); } /** * @dev Before 1inch v5 swapper hook */ function _beforeOneInchV5Swapper(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseSwapTask(token, amount, slippage); } /** * @dev After 1inch v5 swapper hook */ function _afterOneInchV5Swapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/paraswap/IParaswapV5Connector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IParaswapV5Swapper.sol'; /** * @title Paraswap V5 swapper task * @dev Task that extends the swapper task to use Paraswap v5 */ contract ParaswapV5Swapper is IParaswapV5Swapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('PARASWAP_V5_SWAPPER'); // Address of the Paraswap quote signer address public override quoteSigner; /** * @dev Paraswap v5 swap config. Only used in the initializer. */ struct ParaswapV5SwapConfig { address quoteSigner; BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the Paraswap v5 swapper * @param config Paraswap v5 swap config */ function initialize(ParaswapV5SwapConfig memory config) external virtual initializer { __ParaswapV5Swapper_init(config); } /** * @dev Initializes the Paraswap v5 swapper. It does call upper contracts initializers. * @param config Paraswap v5 swap config */ function __ParaswapV5Swapper_init(ParaswapV5SwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __ParaswapV5Swapper_init_unchained(config); } /** * @dev Initializes the Paraswap v5 swapper. It does not call upper contracts initializers. * @param config Paraswap v5 swap config */ function __ParaswapV5Swapper_init_unchained(ParaswapV5SwapConfig memory config) internal onlyInitializing { _setQuoteSigner(config.quoteSigner); } /** * @dev Sets the quote signer address * @param newQuoteSigner Address of the new quote signer to be set */ function setQuoteSigner(address newQuoteSigner) external override authP(authParams(newQuoteSigner)) { _setQuoteSigner(newQuoteSigner); } /** * @dev Execute Paraswap v5 swapper task */ function call( address tokenIn, uint256 amountIn, uint256 minAmountOut, uint256 expectedAmountOut, uint256 deadline, bytes memory data, bytes memory sig ) external override authP(authParams(tokenIn, amountIn, minAmountOut, expectedAmountOut, deadline)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); address tokenOut = getTokenOut(tokenIn); uint256 slippage = FixedPoint.ONE - minAmountOut.divUp(expectedAmountOut); _beforeParaswapV5Swapper( tokenIn, tokenOut, amountIn, slippage, minAmountOut, expectedAmountOut, deadline, data, sig ); bytes memory connectorData = abi.encodeWithSelector( IParaswapV5Connector.execute.selector, tokenIn, tokenOut, amountIn, minAmountOut, data ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterParaswapV5Swapper(tokenIn, amountIn, slippage, tokenOut, result.toUint256()); } /** * @dev Before Paraswap v5 swapper hook */ function _beforeParaswapV5Swapper( address tokenIn, address tokenOut, uint256 amountIn, uint256 slippage, uint256 minAmountOut, uint256 expectedAmountOut, uint256 deadline, bytes memory data, bytes memory sig ) internal virtual { _beforeBaseSwapTask(tokenIn, amountIn, slippage); bool isBuy = false; bytes32 message = keccak256( abi.encodePacked(tokenIn, tokenOut, isBuy, amountIn, minAmountOut, expectedAmountOut, deadline, data) ); address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(message), sig); if (signer != quoteSigner) revert TaskInvalidQuoteSigner(signer, quoteSigner); if (block.timestamp > deadline) revert TaskQuoteSignerPastDeadline(deadline, block.timestamp); } /** * @dev After Paraswap v5 swapper hook */ function _afterParaswapV5Swapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } /** * @dev Sets the quote signer address * @param newQuoteSigner Address of the new quote signer to be set */ function _setQuoteSigner(address newQuoteSigner) internal { if (newQuoteSigner == address(0)) revert TaskQuoteSignerZero(); quoteSigner = newQuoteSigner; emit QuoteSignerSet(newQuoteSigner); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/uniswap/IUniswapV2Connector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IUniswapV2Swapper.sol'; /** * @title Uniswap v2 swapper * @dev Task that extends the base swap task to use Uniswap v2 */ contract UniswapV2Swapper is IUniswapV2Swapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('UNISWAP_V2_SWAPPER'); /** * @dev Uniswap v2 swap config. Only used in the initializer. */ struct UniswapV2SwapConfig { BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the Uniswap v2 swapper * @param config Uniswap v2 swap config */ function initialize(UniswapV2SwapConfig memory config) external initializer { __UniswapV2Swapper_init(config); } /** * @dev Initializes the Uniswap v2 swapper. It does call upper contracts. * @param config Uniswap v2 swap config */ function __UniswapV2Swapper_init(UniswapV2SwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __UniswapV2Swapper_init_unchained(config); } /** * @dev Initializes the Uniswap v2 swapper. It does not call upper contracts. * @param config Uniswap v2 swap config */ function __UniswapV2Swapper_init_unchained(UniswapV2SwapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the Uniswap v2 swapper task */ function call(address tokenIn, uint256 amountIn, uint256 slippage, address[] memory hopTokens) external override authP(authParams(tokenIn, amountIn, slippage)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); _beforeUniswapV2Swapper(tokenIn, amountIn, slippage); address tokenOut = getTokenOut(tokenIn); uint256 price = _getPrice(tokenIn, tokenOut); uint256 minAmountOut = amountIn.mulUp(price).mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IUniswapV2Connector.execute.selector, tokenIn, tokenOut, amountIn, minAmountOut, hopTokens ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterUniswapV2Swapper(tokenIn, amountIn, slippage, tokenOut, result.toUint256()); } /** * @dev Before Uniswap v2 swapper hook */ function _beforeUniswapV2Swapper(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseSwapTask(token, amount, slippage); } /** * @dev After Uniswap v2 swapper hook */ function _afterUniswapV2Swapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/math/FixedPoint.sol'; import '@mimic-fi/v3-helpers/contracts/utils/BytesHelpers.sol'; import '@mimic-fi/v3-connectors/contracts/interfaces/uniswap/IUniswapV3Connector.sol'; import './BaseSwapTask.sol'; import '../interfaces/swap/IUniswapV3Swapper.sol'; /** * @title Uniswap v3 swapper task * @dev Task that extends the swapper task to use Uniswap v3 */ contract UniswapV3Swapper is IUniswapV3Swapper, BaseSwapTask { using FixedPoint for uint256; using BytesHelpers for bytes; // Execution type for relayers bytes32 public constant override EXECUTION_TYPE = keccak256('UNISWAP_V3_SWAPPER'); /** * @dev Uniswap v3 swap config. Only used in the initializer. */ struct UniswapV3SwapConfig { BaseSwapConfig baseSwapConfig; } /** * @dev Initializes the Uniswap v3 swapper * @param config Uniswap v3 swap config */ function initialize(UniswapV3SwapConfig memory config) external initializer { __UniswapV3Swapper_init(config); } /** * @dev Initializes the Uniswap V3 swapper. It does call upper contracts. * @param config Uniswap v3 swap config */ function __UniswapV3Swapper_init(UniswapV3SwapConfig memory config) internal onlyInitializing { __BaseSwapTask_init(config.baseSwapConfig); __UniswapV3Swapper_init_unchained(config); } /** * @dev Initializes the Uniswap V3 swapper. It does not call upper contracts. * @param config Uniswap v3 swap config */ function __UniswapV3Swapper_init_unchained(UniswapV3SwapConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Executes the Uniswap v3 swapper task */ function call( address tokenIn, uint256 amountIn, uint256 slippage, uint24 fee, address[] memory hopTokens, uint24[] memory hopFees ) external override authP(authParams(tokenIn, amountIn, slippage, fee)) { if (amountIn == 0) amountIn = getTaskAmount(tokenIn); _beforeUniswapV3Swapper(tokenIn, amountIn, slippage); address tokenOut = getTokenOut(tokenIn); uint256 price = _getPrice(tokenIn, tokenOut); uint256 minAmountOut = amountIn.mulUp(price).mulUp(FixedPoint.ONE - slippage); bytes memory connectorData = abi.encodeWithSelector( IUniswapV3Connector.execute.selector, tokenIn, tokenOut, amountIn, minAmountOut, fee, hopTokens, hopFees ); bytes memory result = ISmartVault(smartVault).execute(connector, connectorData); _afterUniswapV3Swapper(tokenIn, amountIn, slippage, tokenOut, result.toUint256()); } /** * @dev Before Uniswap v3 swapper task */ function _beforeUniswapV3Swapper(address token, uint256 amount, uint256 slippage) internal virtual { _beforeBaseSwapTask(token, amount, slippage); } /** * @dev After Uniswap v3 swapper hook */ function _afterUniswapV3Swapper( address tokenIn, uint256 amountIn, uint256 slippage, address tokenOut, uint256 amountOut ) internal virtual { _afterBaseSwapTask(tokenIn, amountIn, slippage, tokenOut, amountOut); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import './interfaces/ITask.sol'; import './base/BaseTask.sol'; import './base/PausableTask.sol'; import './base/GasLimitedTask.sol'; import './base/TimeLockedTask.sol'; import './base/TokenIndexedTask.sol'; import './base/TokenThresholdTask.sol'; import './base/VolumeLimitedTask.sol'; /** * @title Task * @dev Shared components across all tasks */ abstract contract Task is ITask, BaseTask, PausableTask, GasLimitedTask, TimeLockedTask, TokenIndexedTask, TokenThresholdTask, VolumeLimitedTask { /** * @dev Task config. Only used in the initializer. */ struct TaskConfig { BaseConfig baseConfig; GasLimitConfig gasLimitConfig; TimeLockConfig timeLockConfig; TokenIndexConfig tokenIndexConfig; TokenThresholdConfig tokenThresholdConfig; VolumeLimitConfig volumeLimitConfig; } /** * @dev Initializes the task. It does call upper contracts initializers. * @param config Task config */ function __Task_init(TaskConfig memory config) internal onlyInitializing { __BaseTask_init(config.baseConfig); __PausableTask_init(); __GasLimitedTask_init(config.gasLimitConfig); __TimeLockedTask_init(config.timeLockConfig); __TokenIndexedTask_init(config.tokenIndexConfig); __TokenThresholdTask_init(config.tokenThresholdConfig); __VolumeLimitedTask_init(config.volumeLimitConfig); __Task_init_unchained(config); } /** * @dev Initializes the task. It does not call upper contracts initializers. * @param config Task config */ function __Task_init_unchained(TaskConfig memory config) internal onlyInitializing { // solhint-disable-previous-line no-empty-blocks } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view override(BaseTask, GasLimitedTask, TokenThresholdTask, VolumeLimitedTask) returns (uint256) { return BaseTask._getPrice(base, quote); } /** * @dev Before task hook */ function _beforeTask(address token, uint256 amount) internal virtual { _beforeBaseTask(token, amount); _beforePausableTask(token, amount); _beforeGasLimitedTask(token, amount); _beforeTimeLockedTask(token, amount); _beforeTokenIndexedTask(token, amount); _beforeTokenThresholdTask(token, amount); _beforeVolumeLimitedTask(token, amount); } /** * @dev After task hook */ function _afterTask(address token, uint256 amount) internal virtual { _afterVolumeLimitedTask(token, amount); _afterTokenThresholdTask(token, amount); _afterTokenIndexedTask(token, amount); _afterTimeLockedTask(token, amount); _afterGasLimitedTask(token, amount); _afterPausableTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; contract BaseTaskMock is BaseTask { bytes32 public constant override EXECUTION_TYPE = keccak256('BASE_TASK'); function initialize(BaseConfig memory config) external virtual initializer { __BaseTask_init(config); } function call(address token, uint256 amount) external { _beforeBaseTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/GasLimitedTask.sol'; contract GasLimitedTaskMock is BaseTask, GasLimitedTask { bytes32 public constant override EXECUTION_TYPE = keccak256('GAS_LIMITED_TASK'); struct GasLimitMockConfig { BaseConfig baseConfig; GasLimitConfig gasLimitConfig; } function initialize(GasLimitMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __GasLimitedTask_init(config.gasLimitConfig); } function call(address token, uint256 amount) external { _beforeGasLimitedTaskMock(token, amount); _afterGasLimitedTaskMock(token, amount); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view override(BaseTask, GasLimitedTask) returns (uint256) { return BaseTask._getPrice(base, quote); } /** * @dev Before gas limited task mock hook */ function _beforeGasLimitedTaskMock(address token, uint256 amount) internal virtual { _beforeBaseTask(token, amount); _beforeGasLimitedTask(token, amount); } /** * @dev After gas limited task mock hook */ function _afterGasLimitedTaskMock(address token, uint256 amount) internal virtual { _afterGasLimitedTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/PausableTask.sol'; contract PausableTaskMock is BaseTask, PausableTask { bytes32 public constant override EXECUTION_TYPE = keccak256('PAUSABLE_TASK'); struct PauseMockConfig { BaseConfig baseConfig; } function initialize(PauseMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __PausableTask_init(); } function call(address token, uint256 amount) external { if (amount == 0) amount = getTaskAmount(token); _beforePausableTaskMock(token, amount); _afterPausableTaskMock(token, amount); } /** * @dev Before pausable task mock hook */ function _beforePausableTaskMock(address token, uint256 amount) internal virtual { _beforeBaseTask(token, amount); _beforePausableTask(token, amount); } /** * @dev After pausable task mock hook */ function _afterPausableTaskMock(address token, uint256 amount) internal virtual { _afterPausableTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/TimeLockedTask.sol'; contract TimeLockedTaskMock is BaseTask, TimeLockedTask { bytes32 public constant override EXECUTION_TYPE = keccak256('TIME_LOCKED_TASK'); struct TimeLockMockConfig { BaseConfig baseConfig; TimeLockConfig timeLockConfig; } function initialize(TimeLockMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __TimeLockedTask_init(config.timeLockConfig); } function call() external { _beforeTimeLockedTaskMock(); _afterTimeLockedTaskMock(); } /** * @dev Before time locked task mock hook */ function _beforeTimeLockedTaskMock() internal virtual { _beforeBaseTask(address(0), 0); _beforeTimeLockedTask(address(0), 0); } /** * @dev After time locked task mock hook */ function _afterTimeLockedTaskMock() internal virtual { _afterTimeLockedTask(address(0), 0); _afterBaseTask(address(0), 0); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/TokenIndexedTask.sol'; contract TokenIndexedTaskMock is BaseTask, TokenIndexedTask { using EnumerableSet for EnumerableSet.AddressSet; bytes32 public constant override EXECUTION_TYPE = keccak256('TOKEN_INDEXED_TASK'); struct TokenIndexMockConfig { BaseConfig baseConfig; TokenIndexConfig tokenIndexConfig; } function initialize(TokenIndexMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __TokenIndexedTask_init(config.tokenIndexConfig); } function call(address token) external { _beforeTokenIndexedTaskMock(token); _afterTokenIndexedTaskMock(token); } /** * @dev Before token indexed task mock hook */ function _beforeTokenIndexedTaskMock(address token) internal virtual { _beforeBaseTask(token, 0); _beforeTokenIndexedTask(token, 0); } /** * @dev After token indexed task mock hook */ function _afterTokenIndexedTaskMock(address token) internal virtual { _afterTokenIndexedTask(token, 0); _afterBaseTask(token, 0); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/TokenThresholdTask.sol'; contract TokenThresholdTaskMock is BaseTask, TokenThresholdTask { bytes32 public constant override EXECUTION_TYPE = keccak256('TOKEN_THRESHOLD_TASK'); struct TokenThresholdMockConfig { BaseConfig baseConfig; TokenThresholdConfig tokenThresholdConfig; } function initialize(TokenThresholdMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __TokenThresholdTask_init(config.tokenThresholdConfig); } function call(address token, uint256 amount) external { _beforeTokenThresholdTask(token, amount); _afterTokenThresholdTask(token, amount); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view override(BaseTask, TokenThresholdTask) returns (uint256) { return BaseTask._getPrice(base, quote); } /** * @dev Before token threshold task mock hook */ function _beforeTokenThresholdTaskMock(address token, uint256 amount) internal virtual { _beforeBaseTask(token, amount); _beforeTokenThresholdTask(token, amount); } /** * @dev After token threshold task mock hook */ function _afterTokenThresholdTaskMock(address token, uint256 amount) internal virtual { _afterTokenThresholdTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../../base/BaseTask.sol'; import '../../base/VolumeLimitedTask.sol'; contract VolumeLimitedTaskMock is BaseTask, VolumeLimitedTask { bytes32 public constant override EXECUTION_TYPE = keccak256('VOLUME_LIMITED_TASK'); struct VolumeLimitMockConfig { BaseConfig baseConfig; VolumeLimitConfig volumeLimitConfig; } function initialize(VolumeLimitMockConfig memory config) external virtual initializer { __BaseTask_init(config.baseConfig); __VolumeLimitedTask_init(config.volumeLimitConfig); } function call(address token, uint256 amount) external { _beforeVolumeLimitedTaskMock(token, amount); _afterVolumeLimitedTaskMock(token, amount); } /** * @dev Fetches a base/quote price */ function _getPrice(address base, address quote) internal view override(BaseTask, VolumeLimitedTask) returns (uint256) { return BaseTask._getPrice(base, quote); } /** * @dev Before volume limited task mock hook */ function _beforeVolumeLimitedTaskMock(address token, uint256 amount) internal virtual { _beforeBaseTask(token, amount); _beforeVolumeLimitedTask(token, amount); } /** * @dev After volume limited task mock hook */ function _afterVolumeLimitedTaskMock(address token, uint256 amount) internal virtual { _afterVolumeLimitedTask(token, amount); _afterBaseTask(token, amount); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract AxelarConnectorMock { event LogExecute(uint256 chainId, address token, uint256 amount, address recipient); function execute(uint256 chainId, address token, uint256 amount, address recipient) external { emit LogExecute(chainId, token, amount, recipient); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract ConnextConnectorMock { event LogExecute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, uint256 relayerFee ); function execute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, uint256 relayerFee ) external { emit LogExecute(chainId, token, amount, minAmountOut, recipient, relayerFee); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract HopBridgeConnectorMock { event LogExecute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, address bridge, uint256 deadline, address relayer, uint256 fee ); function execute( uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient, address bridge, uint256 deadline, address relayer, uint256 fee ) external { emit LogExecute(chainId, token, amount, minAmountOut, recipient, bridge, deadline, relayer, fee); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract WormholeConnectorMock { event LogExecute(uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient); function execute(uint256 chainId, address token, uint256 amount, uint256 minAmountOut, address recipient) external { emit LogExecute(chainId, token, amount, minAmountOut, recipient); } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. pragma solidity ^0.8.0; contract BalancerV2PoolConnectorMock { address public immutable balancerV2Vault; constructor(address _balancerV2Vault) { balancerV2Vault = _balancerV2Vault; } event LogExecute(address tokenIn, uint256 amountIn, address[] tokensOut, uint256[] minAmountsOut); function exit(address tokenIn, uint256 amountIn, address[] memory tokensOut, uint256[] memory minAmountsOut) external returns (uint256[] memory amountsOut) { emit LogExecute(tokenIn, amountIn, tokensOut, minAmountsOut); return minAmountsOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; import '@mimic-fi/v3-helpers/contracts/mocks/TokenMock.sol'; contract ConvexConnectorMock { IERC20 public immutable rewardToken; uint256 public immutable rewardAmount; constructor() { rewardAmount = 5e18; rewardToken = new TokenMock('Convex Claimer Reward', 18); } mapping (address => address) public getCvxPool; mapping (address => address) public getCurvePool; event LogClaim(address cvxPool); event LogJoin(address curvePool, uint256 amount); event LogExit(address cvxPool, uint256 amount); function setCvxPool(address curvePool, address cvxPool) external { getCvxPool[curvePool] = cvxPool; } function setCurvePool(address cvxPool, address curvePool) external { getCurvePool[cvxPool] = curvePool; } function claim(address cvxPool) external returns (address[] memory tokens, uint256[] memory amounts) { tokens = new address[](1); tokens[0] = address(rewardToken); amounts = new uint256[](1); amounts[0] = rewardAmount; emit LogClaim(cvxPool); } function join(address curvePool, uint256 amount) external returns (uint256) { emit LogJoin(curvePool, amount); return amount; } function exit(address cvxPool, uint256 amount) external returns (uint256) { emit LogExit(cvxPool, amount); return amount; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract Curve2CrvConnectorMock { event LogJoin(address pool, address tokenIn, uint256 amountIn, uint256 slippage); event LogExit(address pool, uint256 amountIn, address tokenOut, uint256 slippage); function join(address pool, address tokenIn, uint256 amountIn, uint256 slippage) external returns (uint256) { emit LogJoin(pool, tokenIn, amountIn, slippage); return amountIn; } function exit(address pool, uint256 amountIn, address tokenOut, uint256 slippage) external returns (uint256) { emit LogExit(pool, amountIn, tokenOut, slippage); return amountIn; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract ERC4626ConnectorMock { address public immutable tokenOut; event LogJoin(address erc4626, address token, uint256 amount, uint256 minAmountOut); event LogExit(address erc4626, uint256 amount, uint256 minAmountOut); constructor(address _tokenOut) { tokenOut = _tokenOut; } function join(address erc4626, address token, uint256 assets, uint256 minSharesOut) external returns (address, uint256) { emit LogJoin(erc4626, token, assets, minSharesOut); return (erc4626, minSharesOut); } function exit(address erc4626, uint256 shares, uint256 minAssetsOut) external returns (address, uint256) { emit LogExit(erc4626, shares, minAssetsOut); return (tokenOut, minAssetsOut); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract HopL2AmmMock { address public immutable hToken; address public immutable l2CanonicalToken; constructor(address _token, address _hToken) { l2CanonicalToken = _token; hToken = _hToken; } function exchangeAddress() external view returns (address) { return address(this); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract RelayerMock { event Deposited(address smartVault, uint256 amount); mapping (address => uint256) public getSmartVaultBalance; mapping (address => uint256) public getSmartVaultUsedQuota; function deposit(address smartVault, uint256 amount) external payable { getSmartVaultBalance[smartVault] += amount; emit Deposited(smartVault, amount); } function setSmartVaultUsedQuota(address smartVault, uint256 quota) external { getSmartVaultUsedQuota[smartVault] = quota; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. pragma solidity ^0.8.0; contract BalancerV2SwapConnectorMock { address public immutable balancerV2Vault; constructor(address _balancerV2Vault) { balancerV2Vault = _balancerV2Vault; } event LogExecute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes32 poolId, bytes32[] hopPoolsIds, address[] hopTokens ); function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes32 poolId, bytes32[] memory hopPoolsIds, address[] memory hopTokens ) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, poolId, hopPoolsIds, hopTokens); return minAmountOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract HopSwapConnectorMock { event LogExecute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address hopDexAddress); function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address hopDexAddress) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, hopDexAddress); return minAmountOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract OneInchV5ConnectorMock { event LogExecute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes data); function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes memory data) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, data); return minAmountOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract ParaswapV5ConnectorMock { event LogExecute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes data); function execute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, bytes memory data) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, data); return minAmountOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; contract UniswapV2ConnectorMock { event LogExecute(address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address[] hopTokens); function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address[] memory hopTokens ) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, hopTokens); return minAmountOut; } }
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. pragma solidity ^0.8.0; contract UniswapV3ConnectorMock { event LogExecute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint24 fee, address[] hopTokens, uint24[] hopFees ); function execute( address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint24 fee, address[] memory hopTokens, uint24[] memory hopFees ) external returns (uint256) { emit LogExecute(tokenIn, tokenOut, amountIn, minAmountOut, fee, hopTokens, hopFees); return minAmountOut; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
[{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"bytes4","name":"what","type":"bytes4"},{"internalType":"uint256[]","name":"how","type":"uint256[]"}],"name":"AuthSenderNotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"aInflated","type":"uint256"}],"name":"FixedPointDivInternal","type":"error"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"FixedPointMulOverflow","type":"error"},{"inputs":[],"name":"FixedPointZeroDivision","type":"error"},{"inputs":[],"name":"TaskAcceptanceInputLengthMismatch","type":"error"},{"inputs":[],"name":"TaskAcceptanceTokenZero","type":"error"},{"inputs":[],"name":"TaskAmountZero","type":"error"},{"inputs":[],"name":"TaskGasNotInitialized","type":"error"},{"inputs":[{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"}],"name":"TaskGasPriceLimitExceeded","type":"error"},{"inputs":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"date","type":"uint256"}],"name":"TaskInvalidAllowedDate","type":"error"},{"inputs":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"window","type":"uint256"}],"name":"TaskInvalidAllowedWindow","type":"error"},{"inputs":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"frequency","type":"uint256"}],"name":"TaskInvalidFrequency","type":"error"},{"inputs":[{"internalType":"uint8","name":"mode","type":"uint8"}],"name":"TaskInvalidFrequencyMode","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"TaskInvalidThresholdInput","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"}],"name":"TaskInvalidVolumeLimitInput","type":"error"},{"inputs":[],"name":"TaskPaused","type":"error"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"TaskPreviousConnectorNotZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"priorityFee","type":"uint256"},{"internalType":"uint256","name":"priorityFeeLimit","type":"uint256"}],"name":"TaskPriorityFeeLimitExceeded","type":"error"},{"inputs":[{"internalType":"bytes32","name":"connectorId","type":"bytes32"}],"name":"TaskSameBalanceConnectors","type":"error"},{"inputs":[{"internalType":"address","name":"smartVault","type":"address"}],"name":"TaskSmartVaultPriceOracleNotSet","type":"error"},{"inputs":[],"name":"TaskThresholdTokenZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"TaskTimeLockActive","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"TaskTokenNotAllowed","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"TaskTokenThresholdNotMet","type":"error"},{"inputs":[],"name":"TaskTokenZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"txCost","type":"uint256"},{"internalType":"uint256","name":"txCostLimit","type":"uint256"}],"name":"TaskTxCostLimitExceeded","type":"error"},{"inputs":[],"name":"TaskTxCostLimitPctAboveOne","type":"error"},{"inputs":[{"internalType":"uint256","name":"txCostPct","type":"uint256"},{"internalType":"uint256","name":"txCostLimitPct","type":"uint256"}],"name":"TaskTxCostLimitPctExceeded","type":"error"},{"inputs":[],"name":"TaskUnpaused","type":"error"},{"inputs":[],"name":"TaskValueZero","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"volume","type":"uint256"}],"name":"TaskVolumeLimitExceeded","type":"error"},{"inputs":[],"name":"TaskVolumeLimitTokenZero","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"previous","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"next","type":"bytes32"}],"name":"BalanceConnectorsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"thresholdToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"min","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"}],"name":"CustomTokenThresholdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"limitToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"CustomVolumeLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"min","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"max","type":"uint256"}],"name":"DefaultTokenThresholdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"limitToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"DefaultVolumeLimitSet","type":"event"},{"anonymous":false,"inputs":[],"name":"Executed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priorityFeeLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"txCostLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"txCostLimitPct","type":"uint256"}],"name":"GasLimitsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"allowedAt","type":"uint256"}],"name":"TimeLockAllowedAtSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"mode","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"frequency","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allowedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"window","type":"uint256"}],"name":"TimeLockSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"added","type":"bool"}],"name":"TokensAcceptanceListSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum ITokenIndexedTask.TokensAcceptanceType","name":"acceptanceType","type":"uint8"}],"name":"TokensAcceptanceTypeSet","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpaused","type":"event"},{"inputs":[],"name":"EXECUTION_TYPE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authorizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"call","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"customTokenThreshold","outputs":[{"internalType":"address","name":"thresholdToken","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"customVolumeLimit","outputs":[{"internalType":"address","name":"limitToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"accrued","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"nextResetTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultTokenThreshold","outputs":[{"internalType":"address","name":"thresholdToken","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultVolumeLimit","outputs":[{"internalType":"address","name":"limitToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"accrued","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"nextResetTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalanceConnectors","outputs":[{"internalType":"bytes32","name":"previous","type":"bytes32"},{"internalType":"bytes32","name":"next","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasLimits","outputs":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"priorityFeeLimit","type":"uint256"},{"internalType":"uint256","name":"txCostLimit","type":"uint256"},{"internalType":"uint256","name":"txCostLimitPct","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTaskAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimeLock","outputs":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"frequency","type":"uint256"},{"internalType":"uint256","name":"allowedAt","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTokenThreshold","outputs":[{"internalType":"address","name":"thresholdToken","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensSource","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getVolumeLimit","outputs":[{"internalType":"address","name":"limitToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"accrued","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"nextResetTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"smartVault","type":"address"},{"internalType":"bytes32","name":"previousBalanceConnectorId","type":"bytes32"},{"internalType":"bytes32","name":"nextBalanceConnectorId","type":"bytes32"}],"internalType":"struct BaseTask.BaseConfig","name":"baseConfig","type":"tuple"},{"components":[{"internalType":"uint256","name":"gasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"priorityFeeLimit","type":"uint256"},{"internalType":"uint256","name":"txCostLimit","type":"uint256"},{"internalType":"uint256","name":"txCostLimitPct","type":"uint256"}],"internalType":"struct GasLimitedTask.GasLimitConfig","name":"gasLimitConfig","type":"tuple"},{"components":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"frequency","type":"uint256"},{"internalType":"uint256","name":"allowedAt","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"internalType":"struct TimeLockedTask.TimeLockConfig","name":"timeLockConfig","type":"tuple"},{"components":[{"internalType":"enum ITokenIndexedTask.TokensAcceptanceType","name":"acceptanceType","type":"uint8"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"internalType":"struct TokenIndexedTask.TokenIndexConfig","name":"tokenIndexConfig","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"internalType":"struct TokenThresholdTask.Threshold","name":"defaultThreshold","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"internalType":"struct TokenThresholdTask.Threshold","name":"threshold","type":"tuple"}],"internalType":"struct TokenThresholdTask.CustomThresholdConfig[]","name":"customThresholdConfigs","type":"tuple[]"}],"internalType":"struct TokenThresholdTask.TokenThresholdConfig","name":"tokenThresholdConfig","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"}],"internalType":"struct VolumeLimitedTask.VolumeLimitParams","name":"defaultVolumeLimit","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"}],"internalType":"struct VolumeLimitedTask.VolumeLimitParams","name":"volumeLimit","type":"tuple"}],"internalType":"struct VolumeLimitedTask.CustomVolumeLimitConfig[]","name":"customVolumeLimitConfigs","type":"tuple[]"}],"internalType":"struct VolumeLimitedTask.VolumeLimitConfig","name":"volumeLimitConfig","type":"tuple"}],"internalType":"struct Task.TaskConfig","name":"taskConfig","type":"tuple"}],"internalType":"struct Depositor.DepositConfig","name":"config","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isTokenAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"previous","type":"bytes32"},{"internalType":"bytes32","name":"next","type":"bytes32"}],"name":"setBalanceConnectors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"thresholdToken","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setCustomTokenThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"limitToken","type":"address"},{"internalType":"uint256","name":"limitAmount","type":"uint256"},{"internalType":"uint256","name":"limitPeriod","type":"uint256"}],"name":"setCustomVolumeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"thresholdToken","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setDefaultTokenThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"limitToken","type":"address"},{"internalType":"uint256","name":"limitAmount","type":"uint256"},{"internalType":"uint256","name":"limitPeriod","type":"uint256"}],"name":"setDefaultVolumeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newGasPriceLimit","type":"uint256"},{"internalType":"uint256","name":"newPriorityFeeLimit","type":"uint256"},{"internalType":"uint256","name":"newTxCostLimit","type":"uint256"},{"internalType":"uint256","name":"newTxCostLimitPct","type":"uint256"}],"name":"setGasLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"mode","type":"uint8"},{"internalType":"uint256","name":"frequency","type":"uint256"},{"internalType":"uint256","name":"allowedAt","type":"uint256"},{"internalType":"uint256","name":"window","type":"uint256"}],"name":"setTimeLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bool[]","name":"added","type":"bool[]"}],"name":"setTokensAcceptanceList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum ITokenIndexedTask.TokensAcceptanceType","name":"newTokensAcceptanceType","type":"uint8"}],"name":"setTokensAcceptanceType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensAcceptanceType","outputs":[{"internalType":"enum ITokenIndexedTask.TokensAcceptanceType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Loading...LoadingLoading...Loading
Loading...Loading
Loading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingMultichain Portfolio | 30 Chains
Chain Token Portfolio % Price Amount Value BSC 99.99% $0.004571 191,773,897,925,698.94 $876,624,478,195.1 BSC <0.01% $0.004571 8,330,892,343.0911 $38,081,637.97 BSC <0.01% $0.009053 2,159,831,747.4055 $19,551,876.89 BSC <0.01% <$0.000001 60,963,737,604,163.57 $104,126.06 BSC <0.01% $1.17 27,792.5228 $32,517.25 BSC <0.01% $115.47 164.1329 $18,952.43 BSC <0.01% $2.83 603.7784 $1,709.01 BSC <0.01% $36.11 39.9724 $1,443.46 BSC <0.01% $0.000324 3,477,392.2093 $1,128.17 BSC <0.01% $2.19 306.9802 $673.28 BSC <0.01% <$0.000001 3,768,904,437.3191 $647.24 BSC <0.01% $662.06 0.7825 $518.07 BSC <0.01% $0.045946 9,457.2096 $434.52 BSC <0.01% $0.051477 7,896.5758 $406.49 BSC <0.01% $0.033182 11,069.2646 $367.3 BSC <0.01% $0.998701 302.2139 $301.82 BSC <0.01% <$0.000001 61,102,783,530.7671 $252.9 BSC <0.01% $0.291995 801.1394 $233.93 BSC <0.01% $0.039863 4,803.5256 $191.48 BSC <0.01% $0.002696 65,970.7586 $177.88 BSC <0.01% $0.000316 515,100.3665 $162.72 BSC <0.01% $1.25 118.6596 $148.2 BSC <0.01% $0.141363 806.6874 $114.04 BSC <0.01% $0.898019 122.8686 $110.34 BSC <0.01% $0.034387 3,181.0425 $109.39 BSC <0.01% $0.221551 471.8087 $104.53 BSC <0.01% $0.013766 7,411.794 $102.03 BSC <0.01% $9.39 10.7532 $101.01 BSC <0.01% $0.444069 225.9985 $100.36 BSC <0.01% $0.754607 128.595 $97.04 BSC <0.01% $14.02 6.863 $96.21 BSC <0.01% $0.022124 4,248.9843 $94.01 BSC <0.01% $0.176427 531.3519 $93.74 BSC <0.01% $0.046214 2,002.1336 $92.53 BSC <0.01% $0.452014 201.5697 $91.11 BSC <0.01% $0.450718 201.2029 $90.69 BSC <0.01% $2.38 37.9736 $90.38 BSC <0.01% $346.26 0.2586 $89.53 BSC <0.01% <$0.000001 26,902,157,902.7102 $89.07 BSC <0.01% $0.064142 1,358.0211 $87.11 BSC <0.01% $0.008222 10,590.9836 $87.08 BSC <0.01% $0.267684 323.9124 $86.71 BSC <0.01% $0.684051 124.3049 $85.03 BSC <0.01% $0.000371 223,013.8764 $82.75 BSC <0.01% <$0.000001 6,762,340,861,072.3984 $82.01 BSC <0.01% $444.7 0.1832 $81.49 BSC <0.01% <$0.000001 22,955,126,320.8882 $81.44 BSC <0.01% $0.029732 2,736.993 $81.38 BSC <0.01% $0.010824 7,465.6663 $80.81 BSC <0.01% $95,607.48 0.00081399 $77.82 BSC <0.01% $0.124826 618.2314 $77.17 BSC <0.01% $0.133384 578.4951 $77.16 BSC <0.01% $1.42 54.2087 $77.14 BSC <0.01% $0.002847 26,818.8144 $76.34 BSC <0.01% $0.012004 6,237.2984 $74.87 BSC <0.01% $0.000001 53,759,032.6806 $74.73 BSC <0.01% $10.78 6.8386 $73.72 BSC <0.01% $0.406491 178.918 $72.73 BSC <0.01% $0.03552 2,035.1818 $72.29 BSC <0.01% $0.480317 150.15 $72.12 BSC <0.01% $0.011169 6,426.0747 $71.78 BSC <0.01% $0.999925 71.6748 $71.67 BSC <0.01% $80.56 0.8839 $71.2 BSC <0.01% <$0.000001 430,808,271.6376 $70.84 BSC <0.01% $0.001598 44,207.0511 $70.62 BSC <0.01% $0.100674 694.4538 $69.91 BSC <0.01% $0.018414 3,695.2938 $68.05 BSC <0.01% $0.026384 2,547.8321 $67.22 BSC <0.01% $0.00818 8,203.0765 $67.1 BSC <0.01% $0.000032 2,091,225.9266 $66.86 BSC <0.01% $0.012229 5,456.3041 $66.72 BSC <0.01% $0.603358 108.9139 $65.71 BSC <0.01% $0.145094 450.3358 $65.34 BSC <0.01% $0.000001 124,149,129.4819 $65.04 BSC <0.01% $0.048346 1,342.5416 $64.91 BSC <0.01% $0.000436 148,165.3258 $64.53 BSC <0.01% $0.012315 5,234.8465 $64.47 BSC <0.01% <$0.000001 1,539,132,499.0706 $64.16 BSC <0.01% <$0.000001 5,830,037,554.8336 $64.13 BSC <0.01% $0.99767 63.9656 $63.82 BSC <0.01% $0.087062 732.4048 $63.76 BSC <0.01% $1.47 42.9256 $63.1 BSC <0.01% $0.422832 148.3403 $62.72 BSC <0.01% $0.021102 2,955.2364 $62.36 BSC <0.01% $5.35 11.6347 $62.25 BSC <0.01% $8,708.84 0.00714356 $62.21 BSC <0.01% $6.48 9.585 $62.15 BSC <0.01% <$0.000001 2,377,771,923,391.5938 $62.09 BSC <0.01% $0.10759 573.9282 $61.75 BSC <0.01% $2.9 21.2736 $61.61 BSC <0.01% $0.055703 1,105.8065 $61.6 BSC <0.01% $0.078744 781.7868 $61.56 BSC <0.01% $0.000019 3,268,765.8069 $60.93 BSC <0.01% $0.577268 105.104 $60.67 BSC <0.01% $3.68 16.1946 $59.6 BSC <0.01% $0.025764 2,308.095 $59.47 BSC <0.01% $1.58 37.4859 $59.23 BSC <0.01% $0.050426 1,171.7197 $59.09 BSC <0.01% $1 58.7054 $58.75 BSC <0.01% $326.94 0.1789 $58.5 BSC <0.01% $1.12 52.0664 $58.31 BSC <0.01% $0.000026 2,246,221.7883 $58 BSC <0.01% $0.004541 12,771.1271 $57.99 BSC <0.01% <$0.000001 1,566,620,294.7352 $56.61 BSC <0.01% $0.14593 386.6697 $56.43 BSC <0.01% $0.004678 11,961.0353 $55.95 BSC <0.01% $0.000377 147,347.7339 $55.58 BSC <0.01% $0.568072 97.5613 $55.42 BSC <0.01% $3.3 16.7446 $55.24 BSC <0.01% $0.058089 944.4955 $54.86 BSC <0.01% $0.014451 3,796.2703 $54.86 BSC <0.01% $1.34 40.0325 $53.64 BSC <0.01% $0.140584 380.5366 $53.5 BSC <0.01% $0.006809 7,847.5388 $53.43 BSC <0.01% $34.56 1.5412 $53.26 BSC <0.01% $0.023274 2,275.1827 $52.95 BSC <0.01% $0.016637 3,160.6598 $52.58 BSC <0.01% $0.087954 589.6143 $51.86 BSC <0.01% $0.000049 1,054,963.0544 $51.26 BSC <0.01% $0.012551 4,075.1853 $51.15 BSC <0.01% <$0.000001 63,671,528,756.1871 $51 BSC <0.01% $0.000001 44,244,812.3988 $50.49 BSC <0.01% $0.157316 318.0216 $50.03 BSC <0.01% $0.795827 62.6716 $49.88 BSC <0.01% $0.012463 3,985.6497 $49.68 BSC <0.01% $0.028952 1,711.176 $49.54 BSC <0.01% $0.007752 6,390.8293 $49.54 BSC <0.01% $0.001033 47,853.7259 $49.44 BSC <0.01% $0.000103 478,949.2107 $49.42 BSC <0.01% $0.000036 1,371,970.2596 $49.34 BSC <0.01% $1.37 35.9098 $49.15 BSC <0.01% $1.15 42.6671 $49.14 BSC <0.01% $0.065245 746.8807 $48.73 BSC <0.01% $0.010049 4,845.6354 $48.69 BSC <0.01% $0.348124 139.8046 $48.67 BSC <0.01% $0.000039 1,259,027.1896 $48.62 BSC <0.01% $0.081079 598.4831 $48.52 BSC <0.01% $6.96 6.9158 $48.15 BSC <0.01% $0.04685 1,021.281 $47.85 BSC <0.01% $0.988356 48.1757 $47.61 BSC <0.01% $0.020949 2,264.9881 $47.45 BSC <0.01% $0.266086 177.9474 $47.35 BSC <0.01% $5.11 9.2575 $47.3 BSC <0.01% $0.087368 541.0905 $47.27 BSC <0.01% <$0.000001 2,247,845,603.7477 $47.1 BSC <0.01% $0.037027 1,239.4442 $45.89 BSC <0.01% $0.009492 4,818.4244 $45.74 BSC <0.01% $0.048049 941.4472 $45.24 BSC <0.01% $0.315432 143.3358 $45.21 BSC <0.01% $0.242778 186.1874 $45.2 BSC <0.01% $0.160753 280.5037 $45.09 BSC <0.01% $0.054017 832.7894 $44.98 BSC <0.01% $0.443651 100.8204 $44.73 BSC <0.01% <$0.000001 231,519,350.1962 $44.28 BSC <0.01% $1.3 33.8638 $44.15 BSC <0.01% $0.121355 362.945 $44.05 BSC <0.01% $9.99 4.3942 $43.91 BSC <0.01% $6.13 7.1338 $43.73 BSC <0.01% $4.42 9.8925 $43.72 BSC <0.01% $0.00114 38,313.6138 $43.67 BSC <0.01% $0.116619 370.5884 $43.22 BSC <0.01% $0.029844 1,445.8086 $43.15 BSC <0.01% $0.031388 1,373.7973 $43.12 BSC <0.01% $11.65 3.6827 $42.89 BSC <0.01% $0.000709 60,244.0179 $42.73 BSC <0.01% $0.044468 960.4306 $42.71 BSC <0.01% $0.022503 1,892.2849 $42.58 BSC <0.01% $0.006363 6,678.4501 $42.49 BSC <0.01% $0.000331 127,807.8914 $42.27 BSC <0.01% $0.999589 42.0847 $42.07 BSC <0.01% $0.057866 726.5702 $42.04 BSC <0.01% $0.005843 7,193.4031 $42.03 BSC <0.01% $722.51 0.058 $41.9 BSC <0.01% $1.43 29.0147 $41.49 BSC <0.01% $0.000003 14,153,286.1007 $41.33 BSC <0.01% $0.000001 64,344,545.2577 $41.27 BSC <0.01% $0.018927 2,177.1189 $41.21 BSC <0.01% $0.039138 1,050.3038 $41.11 BSC <0.01% $0.059248 692.9013 $41.05 BSC <0.01% $10.08 4.03 $40.64 BSC <0.01% $3.35 12.0683 $40.46 BSC <0.01% $7.58 5.3368 $40.45 BSC <0.01% $0.000592 67,722.8911 $40.11 BSC <0.01% $0.229207 174.2288 $39.93 BSC <0.01% $0.000798 49,997.2904 $39.89 BSC <0.01% $0.001219 32,369.3086 $39.45 BSC <0.01% $3.48 11.2824 $39.26 BSC <0.01% $0.061017 630.8561 $38.49 BSC <0.01% $0.038889 987.8661 $38.42 BSC <0.01% $0.000009 4,331,064.5188 $38.42 BSC <0.01% $0.200577 191.3742 $38.39 BSC <0.01% $0.0045 8,513.7552 $38.32 BSC <0.01% $0.011042 3,454.5759 $38.15 BSC <0.01% $0.126538 299.8781 $37.95 BSC <0.01% $0.009085 4,176.3072 $37.94 BSC <0.01% $0.000169 223,882.6186 $37.82 BSC <0.01% $1.78 21.1857 $37.71 BSC <0.01% $0.001201 31,342.9144 $37.64 BSC <0.01% $0.020737 1,814.8713 $37.63 BSC <0.01% $0.2575 146.038 $37.6 BSC <0.01% $0.000209 178,476.0135 $37.38 BSC <0.01% $0.000122 305,195.153 $37.29 BSC <0.01% $0.385429 96.4981 $37.19 BSC <0.01% $2.93 12.6455 $37.06 BSC <0.01% $0.799433 46.117 $36.87 BSC <0.01% $0.014256 2,567.5524 $36.6 BSC <0.01% $0.247895 147.3251 $36.52 BSC <0.01% $20.9 1.7346 $36.25 BSC <0.01% $0.000583 62,199.1818 $36.25 BSC <0.01% <$0.000001 36,175,081,861.7673 $36.18 BSC <0.01% $3.51 10.288 $36.11 BSC <0.01% <$0.000001 167,566,829.7807 $36 BSC <0.01% $22.82 1.5699 $35.83 BSC <0.01% $0.000387 92,397.2406 $35.74 BSC <0.01% $0.336871 105.9975 $35.71 BSC <0.01% $0.000765 46,593.1325 $35.66 BSC <0.01% $0.008095 4,387.8608 $35.52 BSC <0.01% $0.298273 119.0534 $35.51 BSC <0.01% <$0.000001 42,451,160,373.6755 $35.16 BSC <0.01% $3.43 10.2039 $35.04 BSC <0.01% $0.000131 266,798.8406 $35.03 BSC <0.01% $2.89 12.0948 $34.92 BSC <0.01% $0.080733 430.054 $34.72 BSC <0.01% $59.1 0.5849 $34.57 BSC <0.01% $0.000656 52,634.7934 $34.5 BSC <0.01% $0.013889 2,482.9095 $34.48 BSC <0.01% $0.03424 988.6468 $33.85 BSC <0.01% $0.001259 26,662.7985 $33.56 BSC <0.01% $0.26971 123.3708 $33.27 BSC <0.01% $0.041475 796.1756 $33.02 BSC <0.01% <$0.000001 8,789,872,354.7045 $32.88 BSC <0.01% $0.147657 220.6491 $32.58 BSC <0.01% $0.000039 837,398.775 $32.45 BSC <0.01% $1.99 16.3026 $32.44 BSC <0.01% $5.45 5.9153 $32.24 BSC <0.01% $0.205618 155.7341 $32.02 BSC <0.01% $26.37 1.2137 $32 BSC <0.01% $0.083065 381.8041 $31.71 BSC <0.01% $0.280668 112.9068 $31.69 BSC <0.01% $0.021099 1,488.4362 $31.4 BSC <0.01% $0.083842 371.4564 $31.14 BSC <0.01% $0.023133 1,343.8158 $31.09 BSC <0.01% $0.000001 28,068,890.4108 $31.03 BSC <0.01% $0.992239 31.2223 $30.98 BSC <0.01% $0.001001 30,885.3349 $30.91 BSC <0.01% $0.006256 4,932.5992 $30.86 BSC <0.01% $1.47 20.87 $30.72 BSC <0.01% $0.026575 1,154.8579 $30.69 BSC <0.01% $0.000294 103,633.0393 $30.52 BSC <0.01% $0.00584 5,202.1393 $30.38 BSC <0.01% $0.005387 5,615.5746 $30.25 BSC <0.01% $0.000036 838,812.2023 $29.88 BSC <0.01% $0.0002 147,911.2664 $29.6 BSC <0.01% $0.193757 152.2456 $29.5 BSC <0.01% $0.217698 134.8174 $29.35 BSC <0.01% $0.040625 720.7144 $29.28 BSC <0.01% $1.5 19.353 $29.02 BSC <0.01% $0.087277 331.0513 $28.89 BSC <0.01% <$0.000001 15,889,089,818.2162 $28.87 BSC <0.01% $10.32 2.7782 $28.67 BSC <0.01% <$0.000001 71,653,981,913.7681 $28.66 BSC <0.01% $0.02348 1,212.5268 $28.47 BSC <0.01% $0.000698 40,522.8263 $28.3 BSC <0.01% $0.563252 50.1158 $28.23 BSC <0.01% $0.000167 167,718.4695 $28.05 BSC <0.01% $0.005176 5,406.0889 $27.98 BSC <0.01% $0.095448 287.658 $27.46 BSC <0.01% $0.00439 6,253.752 $27.45 BSC <0.01% $0.009367 2,925.1021 $27.4 BSC <0.01% $0.000007 4,035,922.6502 $27.28 BSC <0.01% $1.23 22.0405 $27.11 BSC <0.01% $0.00089 30,460.0476 $27.1 BSC <0.01% $0.029695 911.2824 $27.06 BSC <0.01% $36.85 0.7315 $26.95 BSC <0.01% $0.03997 673.5258 $26.92 BSC <0.01% $0.046614 575.6777 $26.83 BSC <0.01% $0.000061 436,273.27 $26.78 BSC <0.01% $0.030167 882.9459 $26.64 BSC <0.01% <$0.000001 115,257,949,298.4528 $26.52 BSC <0.01% <$0.000001 2,188,975,933,671.4365 $26.47 BSC <0.01% $0.01853 1,413.8746 $26.2 BSC <0.01% $0.203851 127.743 $26.04 BSC <0.01% $0.137619 189.1862 $26.04 BSC <0.01% $0.025185 1,031.5141 $25.98 BSC <0.01% $0.003686 7,045.146 $25.97 BSC <0.01% <$0.000001 3,556,450,410.732 $25.56 BSC <0.01% $0.000001 47,614,310.1129 $24.94 BSC <0.01% $0.002576 9,543.4131 $24.58 BSC <0.01% $0.080035 307.029 $24.57 BSC <0.01% $0.030417 806.735 $24.54 BSC <0.01% $0.159951 153.2357 $24.51 BSC <0.01% $0.000207 118,264.907 $24.49 BSC <0.01% $0.003873 6,223.1908 $24.1 BSC <0.01% $0.000329 72,171.6489 $23.71 BSC <0.01% $0.000501 47,337.1546 $23.69 BSC <0.01% <$0.000001 108,370,717,504.4794 $23.53 BSC <0.01% $0.017642 1,323.8005 $23.35 BSC <0.01% <$0.000001 2,259,035,378,224.5371 $23.32 BSC <0.01% $0.000022 1,060,496.2635 $23.07 BSC <0.01% $0.00015 152,226.7327 $22.87 BSC <0.01% $0.0576 392.7884 $22.62 BSC <0.01% $0.179422 124.3838 $22.32 BSC <0.01% $0.018206 1,205.5007 $21.95 BSC <0.01% $0.000209 103,480.3357 $21.67 BSC <0.01% $0.000601 35,994.9279 $21.64 BSC <0.01% $0.195099 109.5855 $21.38 BSC <0.01% $0.023082 923.9288 $21.33 BSC <0.01% <$0.000001 60,301,758,562.9163 $21.3 BSC <0.01% $0.000257 82,767.8861 $21.27 BSC <0.01% $0.022103 956.095 $21.13 BSC <0.01% $0.00114 18,497.6676 $21.09 BSC <0.01% $1.19 17.6236 $20.97 BSC <0.01% $0.004889 4,281.7715 $20.93 BSC <0.01% $0.389702 53.5135 $20.85 BSC <0.01% $0.195276 106.1962 $20.74 BSC <0.01% $0.001866 11,081.2236 $20.67 BSC <0.01% $0.000003 6,118,037.2291 $20.62 BSC <0.01% $0.742098 27.7552 $20.6 BSC <0.01% $0.004098 4,947.3936 $20.27 BSC <0.01% $0.403298 49.847 $20.1 BSC <0.01% $0.063975 313.4965 $20.06 BSC <0.01% $0.997468 20.0039 $19.95 BSC <0.01% $0.001937 10,286.9023 $19.93 BSC <0.01% $0.759858 26.2178 $19.92 BSC <0.01% $0.448047 43.8504 $19.65 BSC <0.01% $0.005232 3,723.5242 $19.48 BSC <0.01% $0.037209 523.2472 $19.47 BSC <0.01% $0.151634 127.2742 $19.3 BSC <0.01% $0.00003 634,246.0969 $19.22 BSC <0.01% $1.51 12.6364 $19.08 BSC <0.01% <$0.000001 323,640,930.36 $19.08 BSC <0.01% $0.09355 203.0526 $19 BSC <0.01% <$0.000001 1,211,850,092.1955 $18.8 BSC <0.01% $0.104751 177.4102 $18.58 BSC <0.01% $0.060416 307.3603 $18.57 BSC <0.01% $3.38 5.4808 $18.53 BSC <0.01% $0.067741 271.2926 $18.38 BSC <0.01% $0.002832 6,469.6597 $18.32 BSC <0.01% $0.078762 230.0265 $18.12 BSC <0.01% $1.5 12.0781 $18.12 BSC <0.01% <$0.000001 25,018,674,024.6472 $18.1 BSC <0.01% $16.25 1.1076 $18 BSC <0.01% <$0.000001 6,252,254,017.4027 $17.99 BSC <0.01% $1,599.52 0.0112 $17.89 BSC <0.01% $0.037742 470.9618 $17.77 BSC <0.01% $0.52559 33.6025 $17.66 BSC <0.01% $0.145279 120.9645 $17.57 BSC <0.01% $0.032063 547.4763 $17.55 BSC <0.01% $5.84 3.0006 $17.53 BSC <0.01% $0.000138 125,826.0833 $17.31 BSC <0.01% $0.005105 3,351.5601 $17.11 BSC <0.01% $0.227835 74.1165 $16.89 BSC <0.01% $0.013225 1,269.1706 $16.79 BSC <0.01% $0.00986 1,689.7432 $16.66 BSC <0.01% $0.997048 16.7032 $16.65 BSC <0.01% $0.302518 55.0421 $16.65 BSC <0.01% $0.227076 71.7597 $16.29 BSC <0.01% $0.070632 230.627 $16.29 BSC <0.01% $0.000029 568,968.7692 $16.29 BSC <0.01% $0.995615 16.1824 $16.11 BSC <0.01% $0.000179 90,080.5865 $16.1 BSC <0.01% $0.128011 123.2802 $15.78 BSC <0.01% $0.000049 320,997.5069 $15.66 BSC <0.01% $0.018488 844.3093 $15.61 BSC <0.01% $0.0003 51,638.1952 $15.51 BSC <0.01% $0.019981 774.3808 $15.47 BSC <0.01% $183.99 0.0838 $15.42 BSC <0.01% $0.001514 10,180.2653 $15.41 BSC <0.01% $0.000779 19,796.6455 $15.41 BSC <0.01% $0.000343 44,703.965 $15.35 BSC <0.01% $0.010481 1,463.7034 $15.34 BSC <0.01% $0.045332 334.2694 $15.15 BSC <0.01% $0.294506 50.8571 $14.98 BSC <0.01% $0.007454 2,004.1473 $14.94 BSC <0.01% $0.744619 20.0489 $14.93 BSC <0.01% $0.007865 1,879.4465 $14.78 BSC <0.01% $0.026476 554.2759 $14.68 BSC <0.01% $2.03 7.2152 $14.67 BSC <0.01% $0.174385 84.0867 $14.66 BSC <0.01% $0.007934 1,847.1263 $14.65 BSC <0.01% $0.069898 209.5538 $14.65 BSC <0.01% $0.017276 846.5587 $14.62 BSC <0.01% $0.033349 436.7728 $14.57 BSC <0.01% $0.00076 18,885.2 $14.35 BSC <0.01% $0.001392 10,270.7265 $14.3 BSC <0.01% $0.00065 21,788.8328 $14.16 BSC <0.01% $0.00261 5,404.2894 $14.1 BSC <0.01% <$0.000001 681,431,063.7986 $13.92 BSC <0.01% $0.000193 71,515.4382 $13.82 BSC <0.01% $0.012462 1,105.4993 $13.78 BSC <0.01% $0.981805 13.9458 $13.69 BSC <0.01% $1.11 12.3061 $13.66 BSC <0.01% $3,313.37 0.00409501 $13.57 BSC <0.01% $0.069498 194.7316 $13.53 BSC <0.01% $0.761034 17.7698 $13.52 BSC <0.01% $1.88 7.1602 $13.45 BSC <0.01% $0.001471 9,124.2054 $13.43 BSC <0.01% $0.020868 636.2579 $13.28 BSC <0.01% $0.005978 2,190.491 $13.1 BSC <0.01% <$0.000001 619,375,953.5891 $13.02 BSC <0.01% $0.000685 18,958.047 $12.99 BSC <0.01% $0.000161 80,230.3045 $12.93 BSC <0.01% $0.43954 29.3 $12.88 BSC <0.01% $0.002824 4,503.4288 $12.72 BSC <0.01% <$0.000001 12,660,137,395,676,246,000 $12.66 BSC <0.01% $0.02185 578.9303 $12.65 BSC <0.01% <$0.000001 142,539,558.5011 $12.61 BSC <0.01% $20.03 0.6296 $12.61 BSC <0.01% $0.999912 12.5803 $12.58 BSC <0.01% $0.000002 5,581,896.5011 $12.56 BSC <0.01% $0.001014 12,351.4942 $12.53 BSC <0.01% $0.935892 13.3765 $12.52 BSC <0.01% $0.000036 341,252.3225 $12.45 BSC <0.01% $0.000018 694,509.5665 $12.42 BSC <0.01% $0.004562 2,717.1631 $12.4 BSC <0.01% $0.179959 68.395 $12.31 BSC <0.01% $0.358605 34.274 $12.29 BSC <0.01% $0.000625 19,540.0792 $12.22 BSC <0.01% $0.005237 2,324.0575 $12.17 BSC <0.01% $0.000369 32,916.3466 $12.13 BSC <0.01% <$0.000001 34,747,094,367.0667 $12.11 BSC <0.01% <$0.000001 38,796,325,871.4071 $12.08 BSC <0.01% $0.078607 152.3577 $11.98 BSC <0.01% $0.034542 344.4525 $11.9 BSC <0.01% $0.000629 18,916.5264 $11.89 BSC <0.01% $4.45 2.6576 $11.84 BSC <0.01% $0.012472 939.952 $11.72 BSC <0.01% $0.009473 1,233.691 $11.69 BSC <0.01% $0.002906 3,990.9996 $11.6 BSC <0.01% $0.001054 10,871.6738 $11.46 BSC <0.01% $0.513594 21.878 $11.24 BSC <0.01% $0.688089 16.2902 $11.21 BSC <0.01% $0.002422 4,624.3434 $11.2 BSC <0.01% $0.091978 121.6651 $11.19 BSC <0.01% $0.057708 188.5809 $10.88 BSC <0.01% $0.03318 325.9064 $10.81 BSC <0.01% <$0.000001 40,720,925.9222 $10.75 BSC <0.01% $40.88 0.2588 $10.58 BSC <0.01% $0.00003 354,595.9141 $10.58 BSC <0.01% $1.54 6.8618 $10.57 BSC <0.01% $0.032039 324.7946 $10.41 BSC <0.01% <$0.000001 2,739,048,928.5832 $10.38 BSC <0.01% $0.110838 93.6196 $10.38 BSC <0.01% $0.001704 6,061.0024 $10.33 BSC <0.01% $0.052286 194.6205 $10.18 BSC <0.01% $0.00226 4,384.7871 $9.91 BSC <0.01% $0.000053 185,612.7143 $9.91 BSC <0.01% <$0.000001 18,474,060,692.8938 $9.82 BSC <0.01% $1.79 5.4806 $9.82 BSC <0.01% $0.013898 698.7075 $9.71 BSC <0.01% $0.003096 3,022.5455 $9.36 BSC <0.01% $0.171646 54.2281 $9.31 BSC <0.01% $0.067078 136.2963 $9.14 BSC <0.01% $0.000019 484,154.9187 $9.04 BSC <0.01% <$0.000001 1,510,737,338.077 $8.91 BSC <0.01% $3.04 2.9294 $8.91 BSC <0.01% $0.000151 59,098.3694 $8.9 BSC <0.01% $0.009411 940.4465 $8.85 BSC <0.01% $0.003825 2,293.729 $8.77 BSC <0.01% $3,288.1 0.00266587 $8.77 BSC <0.01% <$0.000001 2,471,330,302.717 $8.75 BSC <0.01% $0.441918 19.7401 $8.72 BSC <0.01% <$0.000001 3,310,452,619.2352 $8.66 BSC <0.01% $0.000672 12,634.8032 $8.49 BSC <0.01% $0.000385 22,042.9774 $8.48 BSC <0.01% $0.000093 91,247.3122 $8.45 BSC <0.01% $0.00044 19,193.0744 $8.44 BSC <0.01% $0.008359 1,008.123 $8.43 BSC <0.01% $0.001708 4,878.3814 $8.33 BSC <0.01% $0.000105 78,941.9074 $8.32 BSC <0.01% $0.000908 9,141.5874 $8.3 BSC <0.01% $0.200311 41.3623 $8.29 BSC <0.01% $4.93 1.6649 $8.2 BSC <0.01% $0.000001 7,806,614.0856 $8.2 BSC <0.01% $0.003194 2,559.5956 $8.18 BSC <0.01% <$0.000001 4,057,930,311.5225 $8.03 BSC <0.01% $0.000009 835,882.3581 $7.88 BSC <0.01% $0.229207 34.3429 $7.87 BSC <0.01% $0.006921 1,118.4974 $7.74 BSC <0.01% $0.003137 2,460.3869 $7.72 BSC <0.01% $0.002384 3,233.9876 $7.71 BSC <0.01% $0.207271 36.4784 $7.56 BSC <0.01% $0.002329 3,225.5877 $7.51 BSC <0.01% $0.048547 154.5706 $7.5 BSC <0.01% $0.307086 24.4227 $7.5 BSC <0.01% $0.000095 78,997.7397 $7.48 BSC <0.01% $0.194244 37.878 $7.36 BSC <0.01% $0.000373 19,694.4449 $7.34 BSC <0.01% $8.68 0.824 $7.15 BSC <0.01% $0.000704 10,147.8763 $7.14 BSC <0.01% $0.006045 1,177.0066 $7.12 BSC <0.01% $0.000212 32,783.6394 $6.95 BSC <0.01% $0.008195 844.8305 $6.92 BSC <0.01% $0.000403 17,184.0967 $6.92 BSC <0.01% $0.039568 174.7316 $6.91 BSC <0.01% $0.007544 915.7545 $6.91 BSC <0.01% $0.000734 9,371.8826 $6.88 BSC <0.01% $0.011985 571.8318 $6.85 BSC <0.01% $0.034807 193.5749 $6.74 BSC <0.01% $12.83 0.5228 $6.71 BSC <0.01% $0.003998 1,671.3248 $6.68 BSC <0.01% $0.001213 5,502.3766 $6.67 BSC <0.01% <$0.000001 7,476,385,504.8175 $6.67 BSC <0.01% $0.000414 16,110.0814 $6.67 BSC <0.01% $1.3 5.0908 $6.63 BSC <0.01% $0.006406 1,031.7093 $6.61 BSC <0.01% $0.000087 76,099.2842 $6.59 BSC <0.01% $0.261906 24.8906 $6.52 BSC <0.01% $0.007403 867.5771 $6.42 BSC <0.01% $17.17 0.3717 $6.38 BSC <0.01% $0.491309 12.9072 $6.34 BSC <0.01% $0.000009 735,129.1374 $6.33 BSC <0.01% $0.585296 10.692 $6.26 BSC <0.01% $8.98 0.6941 $6.23 BSC <0.01% $0.359408 17.2869 $6.21 BSC <0.01% $0.000244 24,858.7214 $6.07 BSC <0.01% $0.003092 1,925.0465 $5.95 BSC <0.01% $1.17 5.0824 $5.95 BSC <0.01% $0.003151 1,852.2659 $5.84 BSC <0.01% $0.196437 29.4007 $5.78 BSC <0.01% $0.001834 3,144.1711 $5.77 BSC <0.01% $0.057739 99.6791 $5.76 BSC <0.01% $0.014088 402.95 $5.68 BSC <0.01% $0.00008 70,160.192 $5.64 BSC <0.01% $0.01698 327.0513 $5.55 BSC <0.01% $0.000565 9,606.4513 $5.43 BSC <0.01% $0.000003 2,083,010.643 $5.42 BSC <0.01% $0.480173 11.1694 $5.36 BSC <0.01% $0.292614 18.2589 $5.34 BSC <0.01% $0.222578 23.9668 $5.33 BSC <0.01% $0.012902 407.5806 $5.26 BSC <0.01% $102.44 0.0509 $5.22 BSC <0.01% $0.002348 2,220.4256 $5.21 BSC <0.01% $0.965483 5.3948 $5.21 BSC <0.01% <$0.000001 8,699,058,800,124.8867 $5.19 BSC <0.01% <$0.000001 2,627,402,346,198.9878 $5.18 BSC <0.01% $0.00102 5,059.7395 $5.16 BSC <0.01% $0.000016 325,031.0669 $5.1 BSC <0.01% $0.004731 1,074.1206 $5.08 BSC <0.01% $0.008703 583.2764 $5.08 BSC <0.01% $0.049743 102.0223 $5.07 BSC <0.01% $0.001401 3,610.2386 $5.06 BSC <0.01% $69.3 0.0725 $5.02 BSC <0.01% $0.009988 502.0467 $5.01 BSC <0.01% <$0.000001 42,621,937.4132 $5.01 BSC <0.01% $0.000089 55,625.1337 $4.96 BSC <0.01% $0.109763 45.1287 $4.95 BSC <0.01% $0.000551 8,935.0506 $4.92 BSC <0.01% $0.008353 563.5332 $4.71 BSC <0.01% $0.000612 7,675.6864 $4.7 BSC <0.01% $0.000018 267,350.7888 $4.68 BSC <0.01% $0.000277 16,726.3443 $4.63 BSC <0.01% $0.01466 315.691 $4.63 BSC <0.01% $0.00805 573.717 $4.62 BSC <0.01% $0.002577 1,774.778 $4.57 BSC <0.01% $0.017421 260.6361 $4.54 BSC <0.01% $0.009255 489.3431 $4.53 BSC <0.01% $0.12391 36.101 $4.47 BSC <0.01% $0.017561 254.2721 $4.47 BSC <0.01% $0.007182 619.7642 $4.45 BSC <0.01% $0.004995 886.8123 $4.43 BSC <0.01% $0.002343 1,856.6863 $4.35 BSC <0.01% $0.000268 16,210.976 $4.35 BSC <0.01% $0.012413 344.6342 $4.28 BSC <0.01% $0.001019 4,149.7841 $4.23 BSC <0.01% $0.027339 154.2545 $4.22 BSC <0.01% $0.000031 136,841.3306 $4.21 BSC <0.01% $0.028095 149.9262 $4.21 BSC <0.01% <$0.000001 31,513,429.5586 $4.2 BSC <0.01% $0.00403 1,027.2167 $4.14 BSC <0.01% $0.006948 595.2346 $4.14 BSC <0.01% $0.000092 44,669.2009 $4.11 BSC <0.01% $0.000424 9,665.315 $4.1 BSC <0.01% $0.001025 3,982.0426 $4.08 BSC <0.01% $0.121868 33.3275 $4.06 BSC <0.01% $0.000079 51,599.6487 $4.06 BSC <0.01% $0.00029 13,849.5907 $4.02 BSC <0.01% $0.000185 21,673.9533 $4.01 BSC <0.01% $0.007283 549.2601 $4 BSC <0.01% $0.001284 3,112.4456 $3.99 BSC <0.01% $0.001575 2,483.856 $3.91 BSC <0.01% $0.443651 8.8101 $3.91 BSC <0.01% <$0.000001 3,986,544,934.7682 $3.88 BSC <0.01% $0.040467 94.8461 $3.84 BSC <0.01% $0.001993 1,921.1093 $3.83 BSC <0.01% $0.392152 9.7278 $3.81 BSC <0.01% <$0.000001 41,130,825.8254 $3.79 BSC <0.01% $5.35 0.6973 $3.73 BSC <0.01% $0.001999 1,834.1861 $3.67 BSC <0.01% $0.000473 7,592.5143 $3.59 BSC <0.01% $0.000108 33,207.6381 $3.58 BSC <0.01% $0.001103 3,216.9024 $3.55 BSC <0.01% $0.002335 1,474.1464 $3.44 BSC <0.01% $0.011988 286.9715 $3.44 BSC <0.01% $0.002598 1,315.3851 $3.42 BSC <0.01% $0.0037 923.5343 $3.42 BSC <0.01% $0.003762 899.7726 $3.38 BSC <0.01% $0.000004 884,659.3581 $3.37 BSC <0.01% <$0.000001 30,774,899.7886 $3.37 BSC <0.01% $0.009707 345.1443 $3.35 BSC <0.01% $0.541255 6.1681 $3.34 BSC <0.01% <$0.000001 13,786,461,496.477 $3.33 BSC <0.01% $0.00046 7,223.8845 $3.32 BSC <0.01% $0.000633 5,238.2793 $3.32 BSC <0.01% $0.00105 3,135.1285 $3.29 BSC <0.01% $0.000236 13,929.9998 $3.29 BSC <0.01% $0.000011 293,930.651 $3.27 BSC <0.01% $0.003063 1,065.9734 $3.26 BSC <0.01% $0.983988 3.2942 $3.24 BSC <0.01% $0.012892 251.2191 $3.24 BSC <0.01% $0.972385 3.3095 $3.22 BSC <0.01% $0.000002 1,636,077.0699 $3.21 BSC <0.01% $0.000898 3,550.5598 $3.19 BSC <0.01% $0.000105 30,276.8437 $3.17 BSC <0.01% $0.021719 143.0264 $3.11 BSC <0.01% $0.004799 645.9092 $3.1 BSC <0.01% $0.007446 413.8755 $3.08 BSC <0.01% $0.000001 3,954,812.8749 $3.06 BSC <0.01% $1.99 1.5271 $3.04 BSC <0.01% $0.000988 3,060.9506 $3.02 BSC <0.01% $0.026311 113.6911 $2.99 BSC <0.01% <$0.000001 4,170,410,877.0991 $2.97 BSC <0.01% $0.030097 98.5722 $2.97 BSC <0.01% $0.00375 788.644 $2.96 BSC <0.01% $0.000001 3,249,228.8463 $2.92 BSC <0.01% $0.013695 212 $2.9 BSC <0.01% $0.000003 920,995.2379 $2.9 BSC <0.01% $2.1 1.3721 $2.88 BSC <0.01% $0.041088 69.9186 $2.87 BSC <0.01% <$0.000001 55,641,352,331.806 $2.81 BSC <0.01% $0.000102 27,403.9766 $2.8 BSC <0.01% $0.001043 2,647.0821 $2.76 BSC <0.01% $48.22 0.0572 $2.76 BSC <0.01% $0.000005 604,180.8937 $2.74 BSC <0.01% $4.99 0.5473 $2.73 BSC <0.01% $0.00046 5,932.7356 $2.73 BSC <0.01% $0.000073 37,289.3584 $2.73 BSC <0.01% $0.02849 94.8325 $2.7 BSC <0.01% $0.000002 1,127,797.0301 $2.69 BSC <0.01% $0.00215 1,239.8643 $2.67 BSC <0.01% $0.999898 2.6332 $2.63 BSC <0.01% $0.000509 5,103.7104 $2.6 BSC <0.01% <$0.000001 2,540,407,806.1878 $2.59 BSC <0.01% $0.019055 134.8655 $2.57 BSC <0.01% $0.000011 242,120.6562 $2.57 BSC <0.01% $0.17479 14.6205 $2.56 BSC <0.01% $0.000335 7,559.8207 $2.53 BSC <0.01% $0.023286 108.6254 $2.53 BSC <0.01% $0.119914 20.9767 $2.52 BSC <0.01% <$0.000001 1,523,266,163.1627 $2.51 BSC <0.01% $0.103475 24.1733 $2.5 BSC <0.01% $0.449693 5.5611 $2.5 BSC <0.01% $0.171047 14.4412 $2.47 BSC <0.01% <$0.000001 3,260,461,474.3296 $2.47 BSC <0.01% $0.000501 4,837.7095 $2.42 BSC <0.01% <$0.000001 75,780,728,793.6681 $2.42 BSC <0.01% $0.008658 279.0303 $2.42 BSC <0.01% $0.012012 199.8582 $2.4 BSC <0.01% $5.02 0.4764 $2.39 BSC <0.01% $0.000832 2,873.446 $2.39 BSC <0.01% $0.008748 272.4605 $2.38 BSC <0.01% $0.009076 260.3532 $2.36 BSC <0.01% $0.000101 23,369.403 $2.36 BSC <0.01% <$0.000001 20,172,611,099.9743 $2.35 BSC <0.01% $0.000115 20,404.7044 $2.34 BSC <0.01% $0.684465 3.4062 $2.33 BSC <0.01% $0.004489 515.6673 $2.31 BSC <0.01% <$0.000001 7,861,461,828.2313 $2.31 BSC <0.01% $0.001541 1,494.593 $2.3 BSC <0.01% $0.000065 34,974.1159 $2.27 BSC <0.01% $0.001532 1,470.1495 $2.25 BSC <0.01% $2.38 0.9394 $2.24 BSC <0.01% $0.000887 2,515.785 $2.23 BSC <0.01% <$0.000001 11,610,921,239.7508 $2.22 BSC <0.01% $0.002683 829.161 $2.22 BSC <0.01% $0.000158 14,071.229 $2.22 BSC <0.01% <$0.000001 1,862,120,936.826 $2.2 BSC <0.01% $3.93 0.5576 $2.19 BSC <0.01% $0.000075 28,720.6492 $2.16 BSC <0.01% $0.005733 376.4136 $2.16 BSC <0.01% $0.015857 135.8415 $2.15 BSC <0.01% $0.000001 2,361,313.7679 $2.15 BSC <0.01% $0.174219 12.2754 $2.14 BSC <0.01% $0.000026 83,623.2931 $2.13 BSC <0.01% <$0.000001 226,057,723.6422 $2.13 BSC <0.01% $0.000077 27,639.9122 $2.13 BSC <0.01% $0.00051 4,089.1611 $2.09 BSC <0.01% $0.00031 6,620.8585 $2.05 BSC <0.01% $0.07916 25.5295 $2.02 BSC <0.01% $0.004732 421.1496 $1.99 BSC <0.01% <$0.000001 314,177,182.871 $1.94 BSC <0.01% $0.000022 87,649.298 $1.91 BSC <0.01% $0.003942 482.1727 $1.9 BSC <0.01% $0.000293 6,481.9407 $1.9 BSC <0.01% $0.001787 1,044.3545 $1.87 BSC <0.01% $0.003701 503.5687 $1.86 BSC <0.01% $0.01517 122.7158 $1.86 BSC <0.01% $0.001953 951.7064 $1.86 BSC <0.01% $1.09 1.675 $1.83 BSC <0.01% $0.152799 11.9251 $1.82 BSC <0.01% $0.000035 50,831.3319 $1.79 BSC <0.01% $0.002249 792.8409 $1.78 BSC <0.01% $0.077412 22.8622 $1.77 BSC <0.01% $0.148735 11.8842 $1.77 BSC <0.01% $0.000065 27,069.7866 $1.75 BSC <0.01% $116.62 0.0146 $1.71 BSC <0.01% <$0.000001 148,832,787,862.1189 $1.71 BSC <0.01% $0.001352 1,255.0418 $1.7 BSC <0.01% $0.008671 192.904 $1.67 BSC <0.01% $26.62 0.0619 $1.65 BSC <0.01% $0.000006 293,915.7989 $1.65 BSC <0.01% $0.057728 28.5025 $1.65 BSC <0.01% $0.006089 270.1674 $1.65 BSC <0.01% $0.001239 1,319.406 $1.63 BSC <0.01% $0.003228 504.7252 $1.63 BSC <0.01% $0.002695 604.5099 $1.63 BSC <0.01% $0.993388 1.6384 $1.63 BSC <0.01% $0.001596 1,007.9087 $1.61 BSC <0.01% <$0.000001 3,361,615.2293 $1.6 BSC <0.01% $0.004595 344.0016 $1.58 BSC <0.01% $693.76 0.00226788 $1.57 BSC <0.01% $0.000113 13,812.5198 $1.55 BSC <0.01% $0.034356 44.5905 $1.53 BSC <0.01% $0.01188 127.5149 $1.51 BSC <0.01% $85,351.08 0.00001751 $1.49 BSC <0.01% $0.002589 576.5025 $1.49 BSC <0.01% <$0.000001 3,324,981.4684 $1.49 BSC <0.01% $2.81 0.5297 $1.49 BSC <0.01% $0.055959 26.55 $1.49 BSC <0.01% $0.000818 1,791.3755 $1.47 BSC <0.01% $0.00002 71,925.8398 $1.46 BSC <0.01% $0.000768 1,903.0694 $1.46 BSC <0.01% $0.003507 415.2223 $1.46 BSC <0.01% $0.00426 341.5378 $1.46 BSC <0.01% $0.003742 388.447 $1.45 BSC <0.01% $0.000005 313,099.5705 $1.44 BSC <0.01% $0.267571 5.3597 $1.43 BSC <0.01% $0.000064 22,472.5058 $1.43 BSC <0.01% $720.06 0.00196899 $1.42 BSC <0.01% $0.155929 9.0338 $1.41 BSC <0.01% $0.000467 2,998.6187 $1.4 BSC <0.01% $0.189376 7.2309 $1.37 BSC <0.01% <$0.000001 912,198,331.3941 $1.36 BSC <0.01% $0.000001 1,281,124.5947 $1.33 BSC <0.01% $0.005306 247.9201 $1.32 BSC <0.01% $0.01129 115.975 $1.31 BSC <0.01% $0.000002 593,462.1563 $1.29 BSC <0.01% $0.000286 4,428.2542 $1.27 BSC <0.01% $104,474 0.00001207 $1.26 BSC <0.01% $0.003371 366.5431 $1.24 BSC <0.01% <$0.000001 8,640,732,968.9683 $1.24 BSC <0.01% $0.000281 4,390.9511 $1.24 BSC <0.01% $0.019275 63.6865 $1.23 BSC <0.01% $0.003671 332.1686 $1.22 BSC <0.01% $0.000346 3,468.7542 $1.2 BSC <0.01% $0.00071 1,689.763 $1.2 BSC <0.01% $0.00438 272.8669 $1.2 BSC <0.01% $0.00014 8,516.9049 $1.19 BSC <0.01% $0.000001 1,070,810.3659 $1.18 BSC <0.01% $0.00007 16,619.2467 $1.17 BSC <0.01% <$0.000001 31,853,706.547 $1.17 BSC <0.01% $2.16 0.5381 $1.16 BSC <0.01% $0.682316 1.6917 $1.15 BSC <0.01% $1.01 1.1355 $1.14 BSC <0.01% $0.046076 24.769 $1.14 BSC <0.01% $0.000002 598,931.1387 $1.13 BSC <0.01% $0.001415 802.2417 $1.13 BSC <0.01% <$0.000001 54,223,787.6961 $1.13 BSC <0.01% <$0.000001 728,500,591,212.9489 $1.12 BSC <0.01% $0.003789 289.7706 $1.1 BSC <0.01% $0.377866 2.9002 $1.1 BSC <0.01% $0.009233 117.9407 $1.09 BSC <0.01% $0.001577 686.0453 $1.08 BSC <0.01% $0.00148 724.8562 $1.07 BSC <0.01% $0.001716 624.8743 $1.07 BSC <0.01% $0.023062 46.3497 $1.07 BSC <0.01% <$0.000001 304,228,186.0348 $1.06 BSC <0.01% $0.000457 2,289.027 $1.05 BSC <0.01% $0.153079 6.8172 $1.04 BSC <0.01% $2.44 0.424 $1.03 BSC <0.01% $0.995239 1.0348 $1.03 BSC <0.01% $0.000399 2,571.6119 $1.03 BSC <0.01% $0.01549 66.1547 $1.02 BSC <0.01% $0.121062 8.3659 $1.01 BSC <0.01% $0.013953 72.575 $1.01 BSC <0.01% $0.031733 31.6043 $1 BSC <0.01% $0.393225 2.5285 $0.9942 BSC <0.01% $0.002451 401.1538 $0.9833 BSC <0.01% $95,451 0.00001027 $0.9802 BSC <0.01% $0.000353 2,775.9912 $0.9798 BSC <0.01% $0.003502 278.1568 $0.9741 BSC <0.01% <$0.000001 991,886,473,577.864 $0.9725 BSC <0.01% <$0.000001 794,353,906.9678 $0.9723 BSC <0.01% $0.000865 1,112.0886 $0.9615 BSC <0.01% $0.001119 856.7387 $0.9585 BSC <0.01% $0.00185 509.1492 $0.9421 BSC <0.01% $0.00007 13,389.0583 $0.9412 BSC <0.01% $2.34 0.3965 $0.9277 BSC <0.01% $0.983779 0.9323 $0.9171 BSC <0.01% $0.010798 84.7196 $0.9147 BSC <0.01% $9.41 0.0972 $0.9142 BSC <0.01% $0.000204 4,483.0617 $0.9128 BSC <0.01% $0.004399 207.5323 $0.9128 BSC <0.01% <$0.000001 504,023,214.4766 $0.9021 BSC <0.01% $0.002013 443.7209 $0.8933 BSC <0.01% $0.000008 112,377.9199 $0.8846 BSC <0.01% <$0.000001 5,668,924.4623 $0.8796 BSC <0.01% $3,874.06 0.0002201 $0.8526 BSC <0.01% $0.188977 4.4571 $0.8422 BSC <0.01% $0.049715 16.8277 $0.8365 BSC <0.01% $0.002781 300.0779 $0.8344 BSC <0.01% $0.012909 64.3186 $0.8302 BSC <0.01% $0.26971 3.0608 $0.8255 BSC <0.01% $0.000201 4,088.1823 $0.8216 BSC <0.01% <$0.000001 6,328,212,807.5967 $0.8159 BSC <0.01% $0.004568 178.1549 $0.8137 BSC <0.01% $0.000332 2,432.3316 $0.8083 BSC <0.01% $0.027339 29.4841 $0.806 BSC <0.01% $0.096999 8.0274 $0.7786 BSC <0.01% $0.000132 5,881.2239 $0.7762 BSC <0.01% $0.02491 30.9108 $0.7699 BSC <0.01% $0.015424 49.849 $0.7688 BSC <0.01% $0.004608 166.7776 $0.7685 BSC <0.01% <$0.000001 6,103,720.9528 $0.7624 BSC <0.01% <$0.000001 309,976,152.5182 $0.7537 BSC <0.01% <$0.000001 10,713,579,225.4988 $0.7479 BSC <0.01% <$0.000001 794,523,646.4996 $0.7473 BSC <0.01% $0.003159 235.5753 $0.744 BSC <0.01% <$0.000001 6,616,087,876,459.0137 $0.7415 BSC <0.01% $0.035389 20.8403 $0.7375 BSC <0.01% $0.005514 133.5527 $0.7363 BSC <0.01% <$0.000001 1,219,597,220,416.01 $0.7325 BSC <0.01% $0.153837 4.7098 $0.7245 BSC <0.01% $0.001828 385.8934 $0.7052 BSC <0.01% $0.000041 16,749.2261 $0.6919 BSC <0.01% $0.000315 2,192.3667 $0.6911 BSC <0.01% <$0.000001 575,516,841.1385 $0.6906 BSC <0.01% $0.000004 157,879.7742 $0.6763 BSC <0.01% $0.000186 3,608.832 $0.672 BSC <0.01% $0.000021 31,485.4507 $0.6683 BSC <0.01% $0.003147 211.4511 $0.6653 BSC <0.01% $0.003048 217.6956 $0.6634 BSC <0.01% <$0.000001 16,579,911.1173 $0.6625 BSC <0.01% $0.000038 17,084.2403 $0.6557 BSC <0.01% <$0.000001 4,252,954.47 $0.6451 BSC <0.01% $0.003523 178.4929 $0.6289 BSC <0.01% $0.001083 579.6776 $0.6276 BSC <0.01% $0.000932 672.7464 $0.627 BSC <0.01% $0.00294 212.9293 $0.6259 BSC <0.01% <$0.000001 161,107,430,368,180.66 $0.6209 BSC <0.01% <$0.000001 1,420,931,648,526.9609 $0.6175 BSC <0.01% $0.388367 1.5763 $0.6121 BSC <0.01% $1.25 0.4789 $0.5985 BSC <0.01% <$0.000001 32,829,079.8017 $0.5889 BSC <0.01% $0.002996 189.1455 $0.5666 BSC <0.01% <$0.000001 1,763,299.5911 $0.5556 BSC <0.01% $0.008878 62.4476 $0.5544 BSC <0.01% $0.000796 689.1546 $0.5486 BSC <0.01% $0.000057 9,655.4093 $0.5461 BSC <0.01% $0.009258 58.9127 $0.5454 BSC <0.01% $0.006823 79.8321 $0.5446 BSC <0.01% $1.04 0.5163 $0.5379 BSC <0.01% $0.000004 125,966.0134 $0.5366 BSC <0.01% <$0.000001 2,778,485.6495 $0.5352 BSC <0.01% $0.001547 338.8344 $0.5242 BSC <0.01% $0.10525 4.9633 $0.5223 BSC <0.01% $0.004455 117.1825 $0.522 BSC <0.01% $0.001544 333.3638 $0.5147 BSC <0.01% <$0.000001 334,405,150.5755 $0.5098 BSC <0.01% $0.015291 33.3309 $0.5096 BSC <0.01% <$0.000001 1,451,871.0048 $0.5095 BSC <0.01% <$0.000001 846,952,664.6187 $0.5081 BSC <0.01% $0.544684 0.933 $0.5081 BSC <0.01% $0.000515 986.0527 $0.5074 BSC <0.01% <$0.000001 178,921,088.6154 $0.5009 BSC <0.01% <$0.000001 504,165,227.9965 $0.4983 BSC <0.01% $5.95 0.0825 $0.4911 BSC <0.01% $0.06787 7.2181 $0.4898 BSC <0.01% $0.002013 242.4694 $0.4879 BSC <0.01% $0.019288 25.1442 $0.4849 BSC <0.01% <$0.000001 147,470,620,952.9207 $0.4828 BSC <0.01% $0.008696 55.3417 $0.4812 BSC <0.01% $0.001281 372.7 $0.4774 BSC <0.01% $0.10412 4.5674 $0.4755 BSC <0.01% $0.000001 750,657.2963 $0.4754 BSC <0.01% $0.078021 6.0495 $0.4719 BSC <0.01% $0.99996 0.4704 $0.4703 BSC <0.01% $0.012283 38.1688 $0.4688 BSC <0.01% $0.003281 141.6686 $0.4648 BSC <0.01% $0.000266 1,731.8416 $0.4611 BSC <0.01% $0.004464 102.8707 $0.4592 BSC <0.01% $0.001285 342.1255 $0.4394 BSC <0.01% $0.00001 45,668.2971 $0.4393 BSC <0.01% $0.00033 1,299.2548 $0.4289 BSC <0.01% $0.002239 189.184 $0.4235 BSC <0.01% $0.04708 8.9461 $0.4211 BSC <0.01% <$0.000001 12,982,012.5199 $0.4182 BSC <0.01% $1,968.97 0.00021228 $0.4179 BSC <0.01% $0.001487 277.4599 $0.4125 BSC <0.01% $0.000643 640.8247 $0.4122 BSC <0.01% $0.000449 906.2512 $0.4068 BSC <0.01% $0.159816 2.5235 $0.4032 BSC <0.01% $0.002637 151.2054 $0.3987 BSC <0.01% $0.002289 169.7951 $0.3886 BSC <0.01% $0.000002 200,030.2244 $0.3838 BSC <0.01% $0.135483 2.8293 $0.3833 BSC <0.01% $0.010014 38.2595 $0.3831 BSC <0.01% $0.000053 7,227.0054 $0.3802 BSC <0.01% <$0.000001 139,069,012,552.6143 $0.3788 BSC <0.01% $1 0.3729 $0.3735 BSC <0.01% $0.005805 64.2147 $0.3727 BSC <0.01% $0.000049 7,519.6713 $0.37 BSC <0.01% $0.031349 11.6247 $0.3644 BSC <0.01% $0.001702 212.7933 $0.3622 BSC <0.01% $0.002076 173.412 $0.3599 BSC <0.01% $0.000065 5,491.7625 $0.3563 BSC <0.01% $0.375207 0.9342 $0.3505 BSC <0.01% $0.00129 266.9126 $0.3444 BSC <0.01% $0.009066 37.9365 $0.3439 BSC <0.01% $0.033432 10.2302 $0.342 BSC <0.01% $15.53 0.0218 $0.3392 BSC <0.01% $0.066294 5.0477 $0.3346 BSC <0.01% $23.74 0.014 $0.3328 BSC <0.01% $0.004234 76.7247 $0.3248 BSC <0.01% <$0.000001 7,753,705.24 $0.3247 BSC <0.01% $0.019974 15.9843 $0.3192 BSC <0.01% $0.002304 138.3243 $0.3187 BSC <0.01% $0.012615 25.0545 $0.316 BSC <0.01% $0.000052 6,042.674 $0.3139 BSC <0.01% $0.004623 67.5853 $0.3124 BSC <0.01% $0.000453 688.9062 $0.3117 BSC <0.01% $0.000945 327.2916 $0.3091 BSC <0.01% $0.005437 56.0039 $0.3044 BSC <0.01% $0.000001 261,257.149 $0.3011 BSC <0.01% $0.001879 159.3116 $0.2993 BSC <0.01% $0.001691 172.6884 $0.2919 BSC <0.01% $0.001683 172.7011 $0.2906 BSC <0.01% <$0.000001 90,735,729,468.888 $0.287 BSC <0.01% $0.00001 27,338.4449 $0.2862 BSC <0.01% $0.000123 2,306.3974 $0.2847 BSC <0.01% $0.039773 7.1409 $0.284 BSC <0.01% <$0.000001 8,834,520,443.2051 $0.2757 BSC <0.01% $0.005153 53.0251 $0.2732 BSC <0.01% $1 0.2626 $0.263 BSC <0.01% $0.000364 717.1716 $0.2613 BSC <0.01% $0.000085 3,081.7101 $0.2605 BSC <0.01% $0.000012 21,629.4842 $0.2599 BSC <0.01% $0.000153 1,691.0175 $0.2586 BSC <0.01% $0.0002 1,286.3791 $0.2577 BSC <0.01% $0.511156 0.4964 $0.2537 BSC <0.01% $0.001219 204.9372 $0.2498 BSC <0.01% $0.000002 112,145.943 $0.2489 BSC <0.01% $0.001572 157.8196 $0.248 BSC <0.01% $0.001171 210.0506 $0.2459 BSC <0.01% $0.076677 3.1807 $0.2438 BSC <0.01% $0.003328 72.3366 $0.2407 BSC <0.01% $0.005867 40.5029 $0.2376 BSC <0.01% $0.000089 2,610.291 $0.2321 BSC <0.01% $0.080482 2.8508 $0.2294 BSC <0.01% $0.000108 2,116.903 $0.229 BSC <0.01% $0.014279 15.8132 $0.2257 BSC <0.01% <$0.000001 1,937,298,289.2181 $0.2254 BSC <0.01% $0.001037 216.0944 $0.2241 BSC <0.01% $0.00649 32.9388 $0.2137 BSC <0.01% $0.013185 16.1906 $0.2134 BSC <0.01% $0.505826 0.4129 $0.2088 BSC <0.01% $0.046133 4.5029 $0.2077 BSC <0.01% $0.003887 53.3193 $0.2072 BSC <0.01% $1.58 0.13 $0.2054 BSC <0.01% $0.00051 402.2906 $0.2049 BSC <0.01% $0.000314 651.1108 $0.2047 BSC <0.01% <$0.000001 787,858,329.5082 $0.2041 BSC <0.01% $0.003615 56.2119 $0.2032 BSC <0.01% $0.127799 1.589 $0.203 BSC <0.01% $0.288681 0.6922 $0.1998 BSC <0.01% $0.394499 0.5062 $0.1996 BSC <0.01% $0.114301 1.7448 $0.1994 BSC <0.01% $0.000048 4,134.4026 $0.1984 BSC <0.01% $0.000669 296.4082 $0.1982 BSC <0.01% $0.001523 128.9337 $0.1963 BSC <0.01% <$0.000001 61,546,122,092.1425 $0.1956 BSC <0.01% <$0.000001 142,961,981,252.553 $0.1938 BSC <0.01% <$0.000001 4,703,671.3714 $0.1933 BSC <0.01% $0.494659 0.3838 $0.1898 BSC <0.01% $0.002312 80.5016 $0.186 BSC <0.01% $0.000047 3,969.612 $0.1857 BSC <0.01% $0.385184 0.482 $0.1856 BSC <0.01% $0.000001 166,612.4206 $0.1832 BSC <0.01% $0.010445 17.2811 $0.1805 BSC <0.01% $0.000003 54,873.6815 $0.179 BSC <0.01% <$0.000001 107,108,695.8563 $0.1776 BSC <0.01% $0.067928 2.6158 $0.1776 BSC <0.01% $0.000053 3,320.4332 $0.1744 BSC <0.01% $0.005038 34.6144 $0.1743 BSC <0.01% $0.000055 3,184.5254 $0.1742 BSC <0.01% $0.010445 16.3341 $0.1706 BSC <0.01% $0.000572 294.7965 $0.1685 BSC <0.01% $0.00138 119.4951 $0.1648 BSC <0.01% <$0.000001 2,044,046.4128 $0.1638 BSC <0.01% <$0.000001 29,349,705,860,397.902 $0.1635 BSC <0.01% $0.004571 35.6259 $0.1628 BSC <0.01% $0.000788 205.81 $0.1622 BSC <0.01% <$0.000001 1,264,607.4745 $0.1583 BSC <0.01% $0.021946 7.1673 $0.1572 BSC <0.01% $0.000013 11,565.985 $0.1553 BSC <0.01% $0.001603 96.8674 $0.1552 BSC <0.01% $0.000094 1,634.4796 $0.1532 BSC <0.01% $0.000002 88,079.59 $0.1523 BSC <0.01% $0.000771 195.6052 $0.1508 BSC <0.01% $0.000105 1,434.8571 $0.1506 BSC <0.01% $1.45 0.1038 $0.1505 BSC <0.01% $0.011406 13.1203 $0.1496 BSC <0.01% <$0.000001 4,992,842,843.6957 $0.1461 BSC <0.01% $0.001812 80.543 $0.1459 BSC <0.01% $0.012108 12.0551 $0.1459 BSC <0.01% <$0.000001 1,522,769.814 $0.1456 BSC <0.01% $0.024577 5.89 $0.1447 BSC <0.01% <$0.000001 6,623,214,499.3628 $0.1446 BSC <0.01% $0.055655 2.5973 $0.1445 BSC <0.01% $0.000623 228.6794 $0.1423 BSC <0.01% $0.042963 3.2567 $0.1399 BSC <0.01% $0.008386 16.5076 $0.1384 BSC <0.01% $0.000015 9,192.7171 $0.1383 BSC <0.01% $0.000499 275.477 $0.1374 BSC <0.01% $0.007101 19.2239 $0.1365 BSC <0.01% $0.000403 336.7205 $0.1358 BSC <0.01% $0.000407 332.2276 $0.1351 BSC <0.01% $0.000431 313.4938 $0.135 BSC <0.01% $0.133304 1.0126 $0.1349 BSC <0.01% $0.004919 26.706 $0.1313 BSC <0.01% $0.000559 220.3353 $0.1232 BSC <0.01% $0.001667 73.9206 $0.1231 BSC <0.01% $0.008089 15.2063 $0.123 BSC <0.01% $0.065476 1.8513 $0.1212 BSC <0.01% $0.001783 67.47 $0.1203 BSC <0.01% $0.000072 1,671.9062 $0.1197 BSC <0.01% $0.004683 25.2431 $0.1182 BSC <0.01% $0.000273 432.5832 $0.1179 BSC <0.01% $0.000673 173.4258 $0.1167 BSC <0.01% $0.000056 2,024.4777 $0.1137 BSC <0.01% $0.101189 1.1197 $0.1132 BSC <0.01% $0.657897 0.1696 $0.1115 BSC <0.01% $0.002806 39.7198 $0.1114 BSC <0.01% $13,625.43 0.00000814 $0.1108 BSC <0.01% $0.000079 1,402.4085 $0.1105 BSC <0.01% $0.000273 400.839 $0.1094 BSC <0.01% $0.000002 56,106.5784 $0.1091 BSC <0.01% $0.002364 45.7766 $0.1082 BSC <0.01% $0.001026 102.8241 $0.1055 BSC <0.01% $0.003124 33.7508 $0.1054 BSC <0.01% <$0.000001 178,200,621,868.0455 $0.105 BSC <0.01% $3,410.72 0.0000304 $0.1036 BSC <0.01% $0.013575 7.6089 $0.1032 BSC <0.01% $0.000122 847.0424 $0.103 BSC <0.01% $0.020007 5.0928 $0.1018 BSC <0.01% $0.000002 67,773.5898 $0.1017 BSC <0.01% $0.000167 605.8913 $0.1009 BSC <0.01% $0.000043 2,329.5762 $0.1006 BSC <0.01% $658.3 0.00000119 $0.000785 ETH <0.01% $0.999363 17,800.0208 $17,788.68 ETH <0.01% $3,289.77 3.8643 $12,712.68 ETH <0.01% $0.307514 13,213.8259 $4,063.44 ETH <0.01% $1 3,182.5666 $3,185.75 ETH <0.01% $662.12 3.7434 $2,478.57 ETH <0.01% $0.026448 58,468.6526 $1,546.39 ETH <0.01% $0.002147 696,332.5406 $1,495.13 ETH <0.01% $2,644.28 0.5021 $1,327.68 ETH <0.01% $0.094184 11,786.6001 $1,110.1 ETH <0.01% $1 969.9815 $970.95 ETH <0.01% $1 917.5066 $917.51 ETH <0.01% $0.000022 41,751,919.3236 $911.44 ETH <0.01% $1.61 564.584 $908.98 ETH <0.01% $0.134379 6,724.3315 $903.61 ETH <0.01% $2,635.57 0.3153 $831.02 ETH <0.01% $0.247844 3,329.436 $825.18 ETH <0.01% $0.004821 161,762.4767 $779.92 ETH <0.01% $94,235 0.00801002 $754.82 ETH <0.01% $0.000097 7,707,398.9271 $746.15 ETH <0.01% $0.429511 1,722.0359 $739.63 ETH <0.01% $0.028227 25,862.8134 $730.02 ETH <0.01% $1.04 696.4547 $727.1 ETH <0.01% <$0.000001 58,484,107,486.6197 $710.17 ETH <0.01% <$0.000001 7,424,682,688.5518 $702.95 ETH <0.01% $0.004681 148,476.6821 $694.96 ETH <0.01% $2.29 303.0394 $693.96 ETH <0.01% $0.004361 156,610.1802 $683 ETH <0.01% <$0.000001 1,931,667,293.5591 $677.99 ETH <0.01% $0.458652 1,471.4065 $674.86 ETH <0.01% $0.064021 10,423.5731 $667.33 ETH <0.01% $0.023964 27,430.3288 $657.34 ETH <0.01% <$0.000001 31,278,082,283.9798 $654.09 ETH <0.01% $0.013231 49,108.7 $649.77 ETH <0.01% $0.042515 15,280.4681 $649.64 ETH <0.01% $22.82 28.3259 $646.4 ETH <0.01% $3.69 171.2169 $631.79 ETH <0.01% $0.003746 167,209.05 $626.31 ETH <0.01% $0.633361 988.832 $626.29 ETH <0.01% $0.042895 14,551.8129 $624.2 ETH <0.01% $0.937677 660.4743 $619.31 ETH <0.01% $3.7 166.8033 $617.17 ETH <0.01% $0.12218 4,953.9899 $605.28 ETH <0.01% $107.1 5.6335 $603.35 ETH <0.01% $3.51 171.1634 $600.78 ETH <0.01% $0.090019 6,667.6634 $600.22 ETH <0.01% $6.01 99.0411 $595.27 ETH <0.01% $0.000617 965,387.6547 $595.19 ETH <0.01% $184.86 3.2194 $595.13 ETH <0.01% $0.474321 1,217.5145 $577.49 ETH <0.01% $0.153493 3,724.0856 $571.62 ETH <0.01% $1.64 344.7022 $565.31 ETH <0.01% $0.56219 994.6843 $559.2 ETH <0.01% $11.36 48.3984 $549.81 ETH <0.01% $2.39 228.0515 $545.04 ETH <0.01% $0.068467 7,931.942 $543.08 ETH <0.01% $0.000001 831,310,098.8826 $534.47 ETH <0.01% <$0.000001 5,049,866,458.6301 $527.6 ETH <0.01% $1.05 501.4911 $525.39 ETH <0.01% $0.000851 617,025.6163 $524.85 ETH <0.01% $3.08 170.2996 $524.52 ETH <0.01% $0.206326 2,537.306 $523.51 ETH <0.01% $1.59 327.4492 $520.64 ETH <0.01% $0.004545 114,270.7523 $519.39 ETH <0.01% $1.47 353.6514 $519.16 ETH <0.01% $0.030236 16,882.2311 $510.45 ETH <0.01% $0.265539 1,921.3829 $510.2 ETH <0.01% $0.369806 1,375.915 $508.82 ETH <0.01% $0.011359 44,303.1256 $503.23 ETH <0.01% $1.46 344.1568 $502.47 ETH <0.01% $0.221191 2,259.6582 $499.82 ETH <0.01% $0.006017 82,670.3596 $497.44 ETH <0.01% $0.000006 86,578,376.9467 $479.64 ETH <0.01% $0.035522 13,491.6228 $479.25 ETH <0.01% $0.000042 11,205,876.1909 $473.67 ETH <0.01% $0.000156 2,996,904.9068 $467.22 ETH <0.01% $0.000003 158,592,387.2321 $463.09 ETH <0.01% $43.56 10.5677 $460.33 ETH <0.01% $0.008042 56,993.3538 $458.34 ETH <0.01% $0.004264 106,209.1756 $452.9 ETH <0.01% <$0.000001 7,726,393,592.8259 $452.78 ETH <0.01% $6.79 66.4204 $450.99 ETH <0.01% $61.05 7.3657 $449.67 ETH <0.01% $0.972583 461.2932 $448.65 ETH <0.01% $14.03 31.6309 $443.78 ETH <0.01% $1.49 296.5279 $441.83 ETH <0.01% $0.000333 1,316,410.7092 $438.45 ETH <0.01% $0.863532 507.659 $438.38 ETH <0.01% $0.057654 7,532.8471 $434.3 ETH <0.01% $0.000001 378,821,049.0716 $431.91 ETH <0.01% $0.022137 19,504.8604 $431.77 ETH <0.01% $0.110828 3,866.6081 $428.53 ETH <0.01% $1.54 277.6083 $427.52 ETH <0.01% $0.028051 15,239.1019 $427.48 ETH <0.01% $36.99 11.5509 $427.27 ETH <0.01% $0.001023 415,560.525 $425.31 ETH <0.01% $0.398207 1,066.6828 $424.76 ETH <0.01% $17.02 24.9244 $424.21 ETH <0.01% $0.061941 6,787.3249 $420.41 ETH <0.01% $0.578243 726.851 $420.3 ETH <0.01% $460.46 0.911 $419.46 ETH <0.01% $1.46 284.3886 $415.21 ETH <0.01% $0.122068 3,381.9994 $412.83 ETH <0.01% $0.011327 36,384.1157 $412.14 ETH <0.01% $0.000111 3,689,161.8912 $410.37 ETH <0.01% $0.002208 185,518.805 $409.53 ETH <0.01% $0.063871 6,393.5059 $408.36 ETH <0.01% $0.199144 2,042.5848 $406.77 ETH <0.01% $0.307218 1,323.2549 $406.53 ETH <0.01% $0.209051 1,895.0348 $396.16 ETH <0.01% $0.000009 44,478,744.1454 $394.97 ETH <0.01% $0.280958 1,400.5686 $393.5 ETH <0.01% $1 390.5425 $390.93 ETH <0.01% $0.624884 624.4553 $390.21 ETH <0.01% $0.000014 27,768,948.8558 $389.44 ETH <0.01% $0.000023 17,281,763.7076 $389.26 ETH <0.01% $10.27 37.7357 $387.55 ETH <0.01% $0.015806 24,237.4939 $383.1 ETH <0.01% $1.43 267.7827 $382.77 ETH <0.01% $0.490985 779.0113 $382.48 ETH <0.01% $0.001403 269,928.9014 $378.58 ETH <0.01% $8,723.09 0.0434 $378.41 ETH <0.01% $0.119465 3,157.2134 $377.18 ETH <0.01% $0.157212 2,393.1126 $376.23 ETH <0.01% $0.934307 401.5167 $375.14 ETH <0.01% $1.35 278.4256 $374.93 ETH <0.01% $0.000027 13,600,223.5824 $370.33 ETH <0.01% $0.000966 379,913.1234 $366.93 ETH <0.01% <$0.000001 1,584,156,731,803.9934 $364.52 ETH <0.01% $4.34 83.9069 $364.08 ETH <0.01% $0.001012 359,196.2613 $363.59 ETH <0.01% $0.033465 10,849.5969 $363.08 ETH <0.01% $0.116605 3,105.1283 $362.07 ETH <0.01% $1.27 282.9627 $359.36 ETH <0.01% $5.36 66.9586 $358.9 ETH <0.01% $0.258058 1,371.5957 $353.95 ETH <0.01% $0.217697 1,594.5143 $347.12 ETH <0.01% $0.000751 458,477.9835 $344.44 ETH <0.01% $0.019734 17,436.0319 $344.09 ETH <0.01% $0.468511 733.6137 $343.71 ETH <0.01% <$0.000001 977,791,258.8931 $342.53 ETH <0.01% $1.44 236.4595 $340.5 ETH <0.01% $0.760572 446.034 $339.24 ETH <0.01% $0.000354 949,013.5072 $335.82 ETH <0.01% $662.97 0.5041 $334.21 ETH <0.01% $2.48 134.6214 $334.07 ETH <0.01% $0.319 1,039.7082 $331.67 ETH <0.01% $0.150892 2,187.2265 $330.03 ETH <0.01% $0.000202 1,632,084.9435 $329.86 ETH <0.01% $0.054135 6,080.3607 $329.16 ETH <0.01% $0.2662 1,234.4814 $328.62 ETH <0.01% $0.554905 581.1071 $322.46 ETH <0.01% $0.004743 67,447.8776 $319.91 ETH <0.01% $0.041487 7,680.4025 $318.64 ETH <0.01% <$0.000001 4,342,911,138.005 $317.84 ETH <0.01% $0.016341 19,354.4201 $316.27 ETH <0.01% $0.071159 4,434.2697 $315.54 ETH <0.01% $0.845312 371.0147 $313.62 ETH <0.01% $34.39 9.1083 $313.24 ETH <0.01% $0.294509 1,053.5114 $310.27 ETH <0.01% $0.000038 8,221,671.1975 $309.22 ETH <0.01% <$0.000001 17,783,218,671.3286 $307.51 ETH <0.01% $0.003881 78,770.6996 $305.73 ETH <0.01% $0.079243 3,852.9141 $305.32 ETH <0.01% $0.170638 1,786.9203 $304.92 ETH <0.01% $0.001015 298,692.112 $303.09 ETH <0.01% $1.64 184.5385 $302.64 ETH <0.01% $0.264342 1,144.2952 $302.49 ETH <0.01% <$0.000001 33,804,153,575.9912 $302.1 ETH <0.01% $0.000005 62,012,224.6828 $301.46 ETH <0.01% $0.000372 807,210.9267 $300.48 ETH <0.01% $2.22 135.1932 $300.13 ETH <0.01% $0.010766 27,565.1447 $296.78 ETH <0.01% $0.006556 44,940.8738 $294.65 ETH <0.01% $3,315.12 0.0888 $294.54 ETH <0.01% $0.570208 515.1354 $293.73 ETH <0.01% $2.04 142.6773 $290.57 ETH <0.01% $0.978857 295.4496 $289.2 ETH <0.01% $2.02 142.7198 $288.29 ETH <0.01% $0.005385 53,357.27 $287.31 ETH <0.01% <$0.000001 1,530,439,630.6509 $287.28 ETH <0.01% $0.005624 50,880.9445 $286.15 ETH <0.01% $0.000294 969,444.6163 $285.44 ETH <0.01% $0.035608 7,940.083 $282.73 ETH <0.01% $0.090661 3,093.7727 $280.48 ETH <0.01% $290.46 0.9638 $279.96 ETH <0.01% $0.010426 26,771.5633 $279.11 ETH <0.01% $0.007981 34,532.7254 $275.61 ETH <0.01% $0.008338 32,988.8997 $275.06 ETH <0.01% $0.115149 2,388.1216 $274.99 ETH <0.01% $0.005416 50,686.6882 $274.54 ETH <0.01% $0.687015 399.0124 $274.13 ETH <0.01% $0.49034 552.365 $270.85 ETH <0.01% $0.386158 697.1547 $269.21 ETH <0.01% $0.08655 3,098.9602 $268.22 ETH <0.01% $10.29 26.0399 $267.95 ETH <0.01% $0.001793 149,382.7344 $267.79 ETH <0.01% $2.94 90.6115 $266.59 ETH <0.01% $0.130403 2,039.6146 $265.97 ETH <0.01% $2.64 100.3637 $264.96 ETH <0.01% $6.14 43.1512 $264.95 ETH <0.01% $0.072669 3,634.9597 $264.15 ETH <0.01% $0.007386 35,650.8197 $263.3 ETH <0.01% $0.674303 383.4887 $258.59 ETH <0.01% $20.95 12.29 $257.42 ETH <0.01% $1.17 219.2487 $256.52 ETH <0.01% $0.064651 3,927.2273 $253.9 ETH <0.01% $0.000016 15,563,289.6781 $253.71 ETH <0.01% <$0.000001 33,342,870,648.3208 $250.97 ETH <0.01% $0.454099 552.1732 $250.74 ETH <0.01% $0.011496 21,761.6507 $250.17 ETH <0.01% $0.000163 1,528,346.3998 $248.38 ETH <0.01% $0.54666 452.1865 $247.19 ETH <0.01% $0.003439 71,501.0052 $245.88 ETH <0.01% $0.259575 940.3132 $244.08 ETH <0.01% $1.68 145.2859 $244.08 ETH <0.01% $0.107466 2,252.7416 $242.09 ETH <0.01% $0.030526 7,886.6824 $240.75 ETH <0.01% $1.47 163.6202 $240.52 ETH <0.01% $0.07441 3,224.4813 $239.93 ETH <0.01% $2.95 80.8093 $238.27 ETH <0.01% $0.355114 670.7732 $238.2 ETH <0.01% $0.17179 1,375.8023 $236.35 ETH <0.01% $0.030416 7,758.4818 $235.98 ETH <0.01% $80.68 2.9118 $234.92 ETH <0.01% $0.841926 276.6829 $232.95 ETH <0.01% $0.000022 10,216,816.0383 $227.87 ETH <0.01% $0.019783 11,503.0902 $227.57 ETH <0.01% $0.306272 741.5915 $227.13 ETH <0.01% $0.000217 1,043,705.8238 $226.38 ETH <0.01% $0.669668 336.4076 $225.28 ETH <0.01% $1.66 135.2971 $224.58 ETH <0.01% $0.000068 3,279,584.9755 $223.44 ETH <0.01% $1.07 208.6846 $222.88 ETH <0.01% $1.73 128.2055 $221.8 ETH <0.01% $0.000343 636,002.4467 $217.88 ETH <0.01% $0.625516 348.2069 $217.81 ETH <0.01% <$0.000001 10,478,898,076.4503 $217.51 ETH <0.01% $5 43.3418 $216.71 ETH <0.01% $0.155637 1,372.901 $213.67 ETH <0.01% $0.220371 957.5715 $211.02 ETH <0.01% <$0.000001 20,740,758,443.2037 $210.6 ETH <0.01% $0.110484 1,895.2153 $209.39 ETH <0.01% $0.000577 361,822.7887 $208.85 ETH <0.01% $0.016517 12,549.7593 $207.28 ETH <0.01% $0.491532 421.5505 $207.21 ETH <0.01% <$0.000001 100,574,979,224.4075 $205.28 ETH <0.01% $0.778041 263.5116 $205.02 ETH <0.01% $2.59 77.7549 $201.39 ETH <0.01% $0.00227 88,208.5842 $200.2 ETH <0.01% <$0.000001 10,855,009,779.6488 $197.01 ETH <0.01% <$0.000001 1,814,536,785.7269 $195.31 ETH <0.01% $0.039178 4,978.6735 $195.05 ETH <0.01% $0.028079 6,938.2023 $194.82 ETH <0.01% $0.013791 14,124.4362 $194.79 ETH <0.01% <$0.000001 2,229,618,745.044 $194.4 ETH <0.01% $1.32 146.6652 $193.6 ETH <0.01% $0.339401 569.6706 $193.35 ETH <0.01% $0.028028 6,858.4999 $192.23 ETH <0.01% $0.207747 923.4007 $191.83 ETH <0.01% <$0.000001 1,420,291,413,581.5935 $191.65 ETH <0.01% $0.000008 23,224,676.826 $190.67 ETH <0.01% $0.15239 1,249.9114 $190.47 ETH <0.01% $0.268183 706.9149 $189.58 ETH <0.01% $0.000007 27,722,386.4906 $187.4 ETH <0.01% $0.001374 136,246.3201 $187.22 ETH <0.01% $0.03042 6,145.6957 $186.95 ETH <0.01% $0.995194 185.962 $185.07 ETH <0.01% $0.194983 949.1424 $185.07 ETH <0.01% $0.000007 27,788,352.1192 $184.51 ETH <0.01% $0.01009 18,286.638 $184.51 ETH <0.01% $0.034205 5,369.5059 $183.67 ETH <0.01% $10.55 17.3783 $183.34 ETH <0.01% <$0.000001 8,382,844,694,473,654 $182.62 ETH <0.01% $0.284829 638.2265 $181.79 ETH <0.01% $0.023486 7,668.9122 $180.11 ETH <0.01% $1.45 123.5313 $179.12 ETH <0.01% $1.06 168.0298 $177.44 ETH <0.01% $0.086685 2,044.7372 $177.25 ETH <0.01% $0.029532 5,999.8225 $177.19 ETH <0.01% $1.11 158.6 $176.49 ETH <0.01% $0.480539 366.8194 $176.27 ETH <0.01% $0.002408 72,952.3802 $175.64 ETH <0.01% $0.04068 4,311.6599 $175.4 ETH <0.01% $0.000036 4,827,061.4808 $175.27 ETH <0.01% $0.001561 111,951.0476 $174.81 ETH <0.01% <$0.000001 975,185,356.2607 $174.67 ETH <0.01% $0.000425 403,790.632 $171.73 ETH <0.01% $0.000003 51,141,856.9837 $171.11 ETH <0.01% $0.065462 2,607.5785 $170.7 ETH <0.01% $0.04369 3,881.2245 $169.57 ETH <0.01% $0.029445 5,752.8468 $169.39 ETH <0.01% $1 166.58 $166.75 ETH <0.01% $0.124855 1,325.0807 $165.44 ETH <0.01% $0.004851 33,821.3658 $164.06 ETH <0.01% $15.25 10.724 $163.54 ETH <0.01% $2 81.6123 $163.22 ETH <0.01% $0.046635 3,470.6946 $161.86 ETH <0.01% $0.011602 13,931.2532 $161.63 ETH <0.01% <$0.000001 44,882,008,500.851 $161.49 ETH <0.01% $0.00588 27,449.0708 $161.4 ETH <0.01% $0.786723 200.3461 $157.62 ETH <0.01% $21.35 7.3756 $157.47 ETH <0.01% $0.480656 327.1956 $157.27 ETH <0.01% $0.000008 18,636,913.4978 $157.05 ETH <0.01% $0.060692 2,585.4942 $156.92 ETH <0.01% $0.001903 81,902.8851 $155.88 ETH <0.01% $19.75 7.8805 $155.64 ETH <0.01% $0.280557 553.6582 $155.33 ETH <0.01% $0.056812 2,717.2591 $154.37 ETH <0.01% $0.000733 210,106.3797 $154.06 ETH <0.01% <$0.000001 5,825,017,311.4648 $153.48 ETH <0.01% <$0.000001 664,015,716.5917 $152.74 ETH <0.01% $0.090003 1,668.7192 $150.19 ETH <0.01% $0.031165 4,805.8008 $149.77 ETH <0.01% $0.026608 5,607.9593 $149.22 ETH <0.01% <$0.000001 785,783,059.1161 $148.33 ETH <0.01% $10.86 13.5535 $147.19 ETH <0.01% $0.190108 770.0126 $146.39 ETH <0.01% $0.336561 434.6138 $146.27 ETH <0.01% $10.61 13.7516 $145.9 ETH <0.01% $0.001283 113,357.1178 $145.49 ETH <0.01% $40.4 3.5633 $143.96 ETH <0.01% $0.315455 453.679 $143.12 ETH <0.01% $0.300121 473.9174 $142.23 ETH <0.01% $0.050463 2,818.3836 $142.22 ETH <0.01% $73.57 1.9253 $141.64 ETH <0.01% $0.267189 522.6443 $139.64 ETH <0.01% $0.110441 1,262.3371 $139.41 ETH <0.01% $0.018487 7,384.0953 $136.51 ETH <0.01% $0.000012 11,553,000.8418 $135.41 ETH <0.01% $0.756009 178.8551 $135.22 ETH <0.01% $15.14 8.9208 $135.06 ETH <0.01% $0.265108 507.636 $134.58 ETH <0.01% $15.07 8.9013 $134.14 ETH <0.01% $3.05 43.9495 $134.05 ETH <0.01% $0.011889 11,206.3799 $133.23 ETH <0.01% $1 132.6242 $132.76 ETH <0.01% $0.000066 1,983,742.4199 $131.68 ETH <0.01% $0.154114 851.3888 $131.21 ETH <0.01% $0.00128 101,867.685 $130.38 ETH <0.01% $0.877104 147.9616 $129.78 ETH <0.01% $0.013373 9,690.3351 $129.59 ETH <0.01% $0.298669 431.5256 $128.88 ETH <0.01% $1.12 114.8673 $128.65 ETH <0.01% $0.260666 493.4656 $128.63 ETH <0.01% $0.005833 22,015.5221 $128.41 ETH <0.01% $0.284262 450.5499 $128.07 ETH <0.01% $2.02 63.3644 $128 ETH <0.01% $0.000021 6,080,746.8364 $127.34 ETH <0.01% $0.218117 582.2677 $127 ETH <0.01% $0.058768 2,146.2574 $126.13 ETH <0.01% $0.000032 3,967,259.7562 $126.04 ETH <0.01% $0.7314 171.7574 $125.62 ETH <0.01% $60.86 2.0501 $124.77 ETH <0.01% $0.025132 4,944.5375 $124.27 ETH <0.01% $7.11 17.4444 $124.03 ETH <0.01% $1.09 113.7151 $123.61 ETH <0.01% $0.028078 4,401.0335 $123.57 ETH <0.01% $0.005524 22,261.0333 $122.96 ETH <0.01% $704.13 0.1745 $122.89 ETH <0.01% $0.48136 254.625 $122.57 ETH <0.01% $0.000002 49,947,952.8738 $121.82 ETH <0.01% $6.33 19.0821 $120.78 ETH <0.01% $1.11 108.7693 $120.73 ETH <0.01% $0.00033 359,417.1609 $118.68 ETH <0.01% $0.446845 260.9844 $116.62 ETH <0.01% $0.771123 149.9671 $115.64 ETH <0.01% $0.000236 488,570.8666 $115.37 ETH <0.01% $0.142959 802.5252 $114.73 ETH <0.01% $0.007783 14,720.1875 $114.57 ETH <0.01% $0.000001 101,798,412.6102 $114.52 ETH <0.01% $0.02905 3,940.0297 $114.46 ETH <0.01% $0.036876 3,103.1445 $114.43 ETH <0.01% $0.549339 207.572 $114.03 ETH <0.01% $0.237265 480.5012 $114.01 ETH <0.01% $0.160995 705.9826 $113.66 ETH <0.01% $0.02829 4,009.0103 $113.41 ETH <0.01% $0.210729 534.5707 $112.65 ETH <0.01% $0.000006 19,032,844.6616 $112.46 ETH <0.01% $7.59 14.8124 $112.43 ETH <0.01% $0.000001 104,037,152.9912 $112.33 ETH <0.01% $0.001675 66,731.7422 $111.78 ETH <0.01% $2.53 43.755 $110.7 ETH <0.01% $0.007413 14,830.0838 $109.94 ETH <0.01% <$0.000001 2,696,328,555,659.0513 $109.81 ETH <0.01% <$0.000001 3,032,100,495.4453 $109.5 ETH <0.01% $0.017705 6,178.0146 $109.38 ETH <0.01% $0.02476 4,348.2846 $107.66 ETH <0.01% $0.000012 8,635,024.9065 $107.6 ETH <0.01% $1.42 75.5425 $107.27 ETH <0.01% $0.280629 381.4296 $107.04 ETH <0.01% $0.246933 430.4417 $106.29 ETH <0.01% $10.59 10.0219 $106.13 ETH <0.01% $40.92 2.586 $105.82 ETH <0.01% $20.63 5.1288 $105.8 ETH <0.01% $0.002071 50,512.5946 $104.6 ETH <0.01% $0.012416 8,407.6628 $104.39 ETH <0.01% $0.005176 20,142.8777 $104.25 ETH <0.01% $0.448816 232.1315 $104.18 ETH <0.01% $0.080101 1,297.6693 $103.94 ETH <0.01% $0.005238 19,798.1249 $103.7 ETH <0.01% $0.086256 1,191.8848 $102.81 ETH <0.01% $0.026354 3,865.2643 $101.86 ETH <0.01% $0.222497 457.3088 $101.75 ETH <0.01% <$0.000001 6,883,948,068.2577 $101.31 ETH <0.01% $0.000012 8,790,204.6889 $101.26 ETH <0.01% $0.000185 544,203.5844 $100.52 ETH <0.01% $0.009843 10,209.3582 $100.49 ETH <0.01% $0.030027 3,344.0858 $100.41 ETH <0.01% $0.361637 276.2603 $99.91 ETH <0.01% <$0.000001 22,217,318,044.399 $99.67 ETH <0.01% $0.000412 240,610.3987 $99.03 ETH <0.01% $1.08 91.1532 $98.35 ETH <0.01% $0.041642 2,349.8015 $97.85 ETH <0.01% $0.000018 5,418,788.4172 $97.27 ETH <0.01% $0.032424 2,973.8075 $96.42 ETH <0.01% $0.000015 6,393,388.2234 $96.41 ETH <0.01% <$0.000001 6,936,313,046.164 $95.44 ETH <0.01% <$0.000001 222,916,045.4886 $95.24 ETH <0.01% $45.47 2.0889 $94.98 ETH <0.01% $0.005016 18,919.6668 $94.9 ETH <0.01% $0.108112 868.7784 $93.93 ETH <0.01% $0.266458 352.2335 $93.86 ETH <0.01% $0.000404 230,242.1867 $92.96 ETH <0.01% $0.054012 1,713.4308 $92.55 ETH <0.01% $0.059508 1,546.6972 $92.04 ETH <0.01% $5.47 16.7798 $91.79 ETH <0.01% $0.001661 54,970.8063 $91.3 ETH <0.01% $0.000011 8,359,945.3991 $90.81 ETH <0.01% $0.073831 1,226.3598 $90.54 ETH <0.01% $0.026604 3,401.7409 $90.5 ETH <0.01% $1.15 78.6221 $90.42 ETH <0.01% $2.58 34.6502 $89.4 ETH <0.01% $0.000326 274,204.1041 $89.26 ETH <0.01% $0.107359 829.0215 $89 ETH <0.01% $3.35 26.3299 $88.21 ETH <0.01% $7.31 12.042 $88.01 ETH <0.01% $0.006319 13,923.6564 $87.98 ETH <0.01% $388.66 0.2207 $85.8 ETH <0.01% $0.002283 37,579.8115 $85.78 ETH <0.01% $0.145368 589.0115 $85.62 ETH <0.01% $0.134414 636.6961 $85.58 ETH <0.01% $0.365288 233.8198 $85.41 ETH <0.01% $0.018603 4,555.7518 $84.75 ETH <0.01% $0.112629 748.9757 $84.36 ETH <0.01% $0.078674 1,066.5633 $83.91 ETH <0.01% $3,504.51 0.0239 $83.9 ETH <0.01% $0.10228 815.6147 $83.42 ETH <0.01% $0.000847 98,457.2968 $83.35 ETH <0.01% $2.13 38.8124 $82.67 ETH <0.01% $0.02365 3,491.4436 $82.57 ETH <0.01% $0.406158 200.2072 $81.32 ETH <0.01% $0.000003 25,612,149.9274 $80.65 ETH <0.01% $0.000001 102,967,545.4035 $80.4 ETH <0.01% $0.046898 1,703.0511 $79.87 ETH <0.01% $0.021591 3,687.351 $79.61 ETH <0.01% $0.014705 5,411.8954 $79.58 ETH <0.01% <$0.000001 484,734,144.8212 $79.47 ETH <0.01% $0.42363 187.2339 $79.32 ETH <0.01% $0.01916 4,114.9178 $78.84 ETH <0.01% $263.83 0.2984 $78.72 ETH <0.01% $0.006525 12,006.6858 $78.35 ETH <0.01% $0.001034 74,602.3269 $77.11 ETH <0.01% <$0.000001 454,291,476.9439 $77.1 ETH <0.01% $0.000003 26,333,360.5395 $76.37 ETH <0.01% $7.32 10.3936 $76.12 ETH <0.01% $0.15945 476.4484 $75.97 ETH <0.01% <$0.000001 741,369,615.4184 $75.88 ETH <0.01% $5.13 14.7011 $75.42 ETH <0.01% $8.67 8.6868 $75.31 ETH <0.01% $0.036997 2,027.2205 $75 ETH <0.01% $0.001231 60,655.689 $74.67 ETH <0.01% $0.000139 535,110.3234 $74.48 ETH <0.01% <$0.000001 147,372,854,670.7382 $74.42 ETH <0.01% $0.048318 1,537.6136 $74.29 ETH <0.01% $3 24.6891 $74.13 ETH <0.01% $0.292461 251.064 $73.43 ETH <0.01% $0.997261 73.5672 $73.37 ETH <0.01% <$0.000001 30,465,276,053.513 $73.21 ETH <0.01% $0.011029 6,602.0541 $72.81 ETH <0.01% $1.34 54.3784 $72.63 ETH <0.01% $0.002016 35,375.6194 $71.3 ETH <0.01% $0.004735 15,017.9463 $71.11 ETH <0.01% <$0.000001 369,336,114.0739 $70.76 ETH <0.01% $0.328431 214.2905 $70.38 ETH <0.01% $0.002246 31,179.7955 $70.02 ETH <0.01% $0.110861 631.5681 $70.02 ETH <0.01% $0.16155 430.2528 $69.51 ETH <0.01% $0.118184 586.6552 $69.33 ETH <0.01% $1 69.2098 $69.28 ETH <0.01% $0.038864 1,771.6014 $68.85 ETH <0.01% $0.01 6,863.5026 $68.64 ETH <0.01% $0.000001 46,624,596.5406 $67.5 ETH <0.01% $0.128376 523.9167 $67.26 ETH <0.01% $0.107466 622.4607 $66.89 ETH <0.01% $0.000105 635,579.5621 $66.55 ETH <0.01% <$0.000001 4,778,970,363.5719 $66.3 ETH <0.01% $0.000032 2,072,628.2006 $66.28 ETH <0.01% <$0.000001 22,316,195,360.5331 $65.9 ETH <0.01% $0.003127 21,052.309 $65.83 ETH <0.01% $0.000389 167,774.0734 $65.34 ETH <0.01% $0.000908 71,775.2012 $65.2 ETH <0.01% $0.039394 1,653.9374 $65.16 ETH <0.01% <$0.000001 25,582,833,073.3047 $64.14 ETH <0.01% $22.34 2.86 $63.89 ETH <0.01% $0.005054 12,622.0108 $63.79 ETH <0.01% $0.005977 10,605.4606 $63.38 ETH <0.01% $0.824113 76.2702 $62.86 ETH <0.01% $0.999 62.871 $62.81 ETH <0.01% $0.000003 18,000,105.139 $62.21 ETH <0.01% $0.667937 92.9315 $62.07 ETH <0.01% $0.003549 17,433.5938 $61.87 ETH <0.01% $1.15 53.7089 $61.77 ETH <0.01% $0.000012 5,230,285.2164 $61.61 ETH <0.01% $1.35 45.2769 $61.12 ETH <0.01% $0.000034 1,781,344.9401 $60.98 ETH <0.01% $0.025197 2,419.0637 $60.95 ETH <0.01% $1.28 47.5998 $60.93 ETH <0.01% <$0.000001 4,803,190,989.138 $60.86 ETH <0.01% $3,416.28 0.0178 $60.85 ETH <0.01% $0.174584 346.668 $60.52 ETH <0.01% <$0.000001 2,604,150,680.1234 $60.41 ETH <0.01% $0.303025 197.0898 $59.72 ETH <0.01% <$0.000001 11,823,646,295.3092 $59.71 ETH <0.01% $0.002581 23,120.1126 $59.68 ETH <0.01% $0.000001 118,501,912.8329 $59.45 ETH <0.01% <$0.000001 170,813,956,869.3902 $59.26 ETH <0.01% $0.000006 9,603,477.685 $58.68 ETH <0.01% $4.81 12.1474 $58.43 ETH <0.01% $0.005054 11,546.2165 $58.35 ETH <0.01% $0.008813 6,620.8293 $58.35 ETH <0.01% $0.006954 8,382.0563 $58.29 ETH <0.01% $1.52 38.1247 $58.12 ETH <0.01% $0.000001 58,607,968.0689 $57.98 ETH <0.01% $0.008556 6,774.2938 $57.96 ETH <0.01% $0.000002 33,091,219.9098 $57.58 ETH <0.01% $0.992571 57.6123 $57.18 ETH <0.01% $0.000003 16,961,181.1068 $56.99 ETH <0.01% <$0.000001 78,888,854,214.7665 $56.74 ETH <0.01% $0.00449 12,506.4544 $56.16 ETH <0.01% $0.021017 2,668.4405 $56.08 ETH <0.01% <$0.000001 12,210,386,568.5346 $55.69 ETH <0.01% $0.004615 12,012.8112 $55.44 ETH <0.01% $1.2 45.9865 $55.18 ETH <0.01% $1 55.1366 $55.14 ETH <0.01% <$0.000001 164,654,969.6646 $55.11 ETH <0.01% $0.033862 1,614.0716 $54.66 ETH <0.01% <$0.000001 206,767,444.3311 $54.63 ETH <0.01% $0.791774 68.9897 $54.62 ETH <0.01% $0.002924 18,669.8362 $54.59 ETH <0.01% $2 26.9977 $54 ETH <0.01% $0.804337 67.1232 $53.99 ETH <0.01% <$0.000001 28,184,902,711.4112 $53.89 ETH <0.01% <$0.000001 307,434,771.4193 $53.76 ETH <0.01% $27.42 1.9524 $53.53 ETH <0.01% $0.058216 915.9299 $53.32 ETH <0.01% $0.359029 148.3716 $53.27 ETH <0.01% $0.000656 81,121.1658 $53.25 ETH <0.01% $0.001901 27,973.9035 $53.19 ETH <0.01% $0.000024 2,178,699.4902 $52.88 ETH <0.01% $0.004153 12,717.6886 $52.81 ETH <0.01% $0.111066 474.7412 $52.73 ETH <0.01% $2.62 20.0726 $52.59 ETH <0.01% $2.89 18.1894 $52.57 ETH <0.01% $0.000488 106,752.8085 $52.1 ETH <0.01% $196.23 0.264 $51.8 ETH <0.01% $0.029818 1,722.5191 $51.36 ETH <0.01% <$0.000001 138,309,892.6422 $51 ETH <0.01% $0.014206 3,581.7402 $50.88 ETH <0.01% $0.022271 2,278.5093 $50.74 ETH <0.01% <$0.000001 103,452,224.7594 $50.46 ETH <0.01% $0.000892 56,415.3606 $50.33 ETH <0.01% $3.42 14.6488 $50.1 ETH <0.01% $0.00022 226,481.9231 $49.93 ETH <0.01% $0.01179 4,176.216 $49.24 ETH <0.01% $0.000497 98,939.1284 $49.15 ETH <0.01% $0.112118 438.1101 $49.12 ETH <0.01% $0.00068 71,940.8943 $48.92 ETH <0.01% $0.000001 70,234,550.4061 $48.79 ETH <0.01% $0.000185 263,391.4056 $48.61 ETH <0.01% $0.737612 65.8774 $48.59 ETH <0.01% $0.149674 322.5239 $48.27 ETH <0.01% $0.011778 4,093.9022 $48.22 ETH <0.01% $0.026803 1,795.9576 $48.14 ETH <0.01% $0.000066 731,337.955 $48.06 ETH <0.01% $0.002901 16,557.9716 $48.03 ETH <0.01% $0.000305 156,659.9773 $47.86 ETH <0.01% $10.98 4.3577 $47.84 ETH <0.01% $0.002355 20,223.0844 $47.62 ETH <0.01% $0.684225 69.2852 $47.41 ETH <0.01% $0.000002 31,364,598.3839 $47.36 ETH <0.01% $0.120012 394.4689 $47.34 ETH <0.01% $327.11 0.1446 $47.29 ETH <0.01% $0.160124 295.1645 $47.26 ETH <0.01% $0.121658 388.1834 $47.23 ETH <0.01% $0.129728 360.6003 $46.78 ETH <0.01% $0.192708 240.83 $46.41 ETH <0.01% $1.28 36.257 $46.41 ETH <0.01% $1.21 38.3446 $46.4 ETH <0.01% $0.000001 43,259,228.1324 $46.29 ETH <0.01% $41.22 1.1201 $46.17 ETH <0.01% $0.035715 1,289.6762 $46.06 ETH <0.01% <$0.000001 34,830,311,301.1135 $45.84 ETH <0.01% $4.07 11.24 $45.75 ETH <0.01% $0.01523 2,985.6669 $45.47 ETH <0.01% $0.001425 31,877.7333 $45.42 ETH <0.01% $0.000059 770,990.2319 $45.23 ETH <0.01% <$0.000001 616,126,220.9311 $45.13 ETH <0.01% $0.001155 38,910.1488 $44.94 ETH <0.01% <$0.000001 4,111,422,348.7356 $44.86 ETH <0.01% $0.000001 69,187,234.1959 $44.77 ETH <0.01% $0.000077 582,657.9316 $44.7 ETH <0.01% $0.000001 52,751,593.2426 $43.68 ETH <0.01% $1.96 22.2629 $43.64 ETH <0.01% $3.16 13.787 $43.57 ETH <0.01% $0.004687 9,291.241 $43.55 ETH <0.01% $0.005465 7,888.2212 $43.11 ETH <0.01% $0.060333 713.7892 $43.06 ETH <0.01% $0.001812 23,687.5319 $42.91 ETH <0.01% $0.000001 71,099,488.829 $42.62 ETH <0.01% $0.000833 51,078.8926 $42.55 ETH <0.01% $0.030571 1,385.7378 $42.36 ETH <0.01% $0.00001 4,275,171.0004 $42.28 ETH <0.01% $0.000021 2,047,415.696 $42.24 ETH <0.01% $0.189067 222.331 $42.04 ETH <0.01% $0.010889 3,860.2617 $42.03 ETH <0.01% $0.023964 1,751.3993 $41.97 ETH <0.01% $0.919024 45.1228 $41.47 ETH <0.01% $0.014456 2,851.0705 $41.21 ETH <0.01% $0.004332 9,476.1395 $41.05 ETH <0.01% $0.030467 1,345.3572 $40.99 ETH <0.01% $0.000022 1,839,883.2364 $40.93 ETH <0.01% $0.011102 3,680.7769 $40.86 ETH <0.01% $0.011113 3,671.5773 $40.8 ETH <0.01% <$0.000001 3,434,670,857.257 $40.56 ETH <0.01% $0.028095 1,442.2726 $40.52 ETH <0.01% $0.00461 8,655.2992 $39.9 ETH <0.01% $3.4 11.5113 $39.14 ETH <0.01% $0.000559 69,878.3233 $39.05 ETH <0.01% $0.568775 68.323 $38.86 ETH <0.01% $0.066104 587.3617 $38.83 ETH <0.01% $0.000001 71,745,171.6716 $38.77 ETH <0.01% $0.146705 263.3207 $38.63 ETH <0.01% $1.66 23.1754 $38.47 ETH <0.01% $34.39 1.1075 $38.08 ETH <0.01% $0.103001 367.6669 $37.87 ETH <0.01% $0.012183 3,104.4024 $37.82 ETH <0.01% <$0.000001 8,604,881,347.5844 $37.76 ETH <0.01% $0.00425 8,866.6712 $37.68 ETH <0.01% $0.026992 1,394.5966 $37.64 ETH <0.01% $0.420828 89.2256 $37.55 ETH <0.01% <$0.000001 94,806,241,201.907 $37.25 ETH <0.01% $0.068227 545.6358 $37.23 ETH <0.01% $0.434142 85.5516 $37.14 ETH <0.01% $0.001352 27,329.9005 $36.94 ETH <0.01% $9.92 3.7193 $36.9 ETH <0.01% $0.015576 2,366.733 $36.86 ETH <0.01% $0.006545 5,583.1569 $36.54 ETH <0.01% $0.245347 148.4342 $36.42 ETH <0.01% $0.000546 66,062.5034 $36.07 ETH <0.01% $0.063451 567.6252 $36.02 ETH <0.01% $2.16 16.6645 $36 ETH <0.01% <$0.000001 154,860,634.9405 $35.86 ETH <0.01% <$0.000001 10,792,941,079,482.443 $35.75 ETH <0.01% $0.001121 31,862.4792 $35.71 ETH <0.01% $48.33 0.7361 $35.58 ETH <0.01% $0.17444 203.3119 $35.47 ETH <0.01% $0.010195 3,468.344 $35.36 ETH <0.01% $0.103295 338.3635 $34.95 ETH <0.01% $0.001279 27,259.1899 $34.87 ETH <0.01% $0.034527 1,005.1856 $34.71 ETH <0.01% $1.58 21.9388 $34.66 ETH <0.01% $1.51 22.829 $34.47 ETH <0.01% $0.00427 8,035.5877 $34.31 ETH <0.01% $0.182498 187.8374 $34.28 ETH <0.01% $0.006351 5,395.1633 $34.26 ETH <0.01% $0.007667 4,463.7315 $34.22 ETH <0.01% <$0.000001 14,462,051,392.3631 $34.03 ETH <0.01% $0.000007 4,938,534.8594 $33.93 ETH <0.01% $0.066904 506.2897 $33.87 ETH <0.01% $0.001799 18,776.8886 $33.78 ETH <0.01% $0.211754 158.8562 $33.64 ETH <0.01% $0.017407 1,929.5405 $33.59 ETH <0.01% $0.228526 146.8805 $33.57 ETH <0.01% $0.050469 664.7142 $33.55 ETH <0.01% $24.98 1.3295 $33.21 ETH <0.01% $0.000079 415,358.6435 $33.01 ETH <0.01% $0.000001 34,515,389.661 $32.98 ETH <0.01% $25.19 1.3086 $32.96 ETH <0.01% <$0.000001 36,292,244,933.7622 $32.79 ETH <0.01% $0.000017 1,933,795.557 $32.7 ETH <0.01% $2.19 14.9479 $32.68 ETH <0.01% $0.011972 2,724.4512 $32.62 ETH <0.01% $1.16 28.2036 $32.58 ETH <0.01% $0.000002 15,790,072.2766 $32.53 ETH <0.01% $1.06 30.6938 $32.44 ETH <0.01% $95,467 0.00033939 $32.4 ETH <0.01% $0.000709 45,601.0802 $32.35 ETH <0.01% $0.022925 1,408.0247 $32.28 ETH <0.01% $0.001519 21,019.7697 $31.92 ETH <0.01% $0.081982 388.2932 $31.83 ETH <0.01% $0.000003 12,295,641.033 $31.8 ETH <0.01% $0.075567 418.2796 $31.61 ETH <0.01% <$0.000001 15,889,048,507.6094 $31.57 ETH <0.01% $0.000009 3,334,727.1747 $31.48 ETH <0.01% $1.25 24.828 $31.04 ETH <0.01% $47.36 0.6546 $31 ETH <0.01% $0.000005 6,536,779.3944 $30.92 ETH <0.01% $0.000217 142,168.2698 $30.9 ETH <0.01% $0.000001 45,712,887.1382 $30.8 ETH <0.01% <$0.000001 245,619,461.7429 $30.77 ETH <0.01% $0.048319 634.7625 $30.67 ETH <0.01% $0.065164 469.3314 $30.58 ETH <0.01% $0.056211 539.5292 $30.33 ETH <0.01% $309.09 0.0973 $30.07 ETH <0.01% $0.000001 58,369,723.6752 $29.93 ETH <0.01% $0.171838 174.1367 $29.92 ETH <0.01% $0.010545 2,826.5248 $29.81 ETH <0.01% $0.000112 264,117.0561 $29.48 ETH <0.01% $0.914917 32.1161 $29.38 ETH <0.01% $0.008393 3,499.7254 $29.37 ETH <0.01% $0.000988 29,623.2916 $29.27 ETH <0.01% $0.525502 55.6863 $29.26 ETH <0.01% $0.470665 61.828 $29.1 ETH <0.01% $0.992994 29.0616 $28.86 ETH <0.01% $0.872326 32.9847 $28.77 ETH <0.01% $626.36 0.0456 $28.54 ETH <0.01% $0.087928 323.875 $28.48 ETH <0.01% $0.196718 142.8131 $28.09 ETH <0.01% $0.000176 159,809.0014 $28.08 ETH <0.01% $0.108771 257.9764 $28.06 ETH <0.01% $0.054311 516.1351 $28.03 ETH <0.01% $0.001692 16,485.0895 $27.89 ETH <0.01% $0.047366 586.1341 $27.76 ETH <0.01% $0.107473 254.8012 $27.38 ETH <0.01% $3,417.94 0.00793561 $27.12 ETH <0.01% $0.005331 5,086.729 $27.12 ETH <0.01% <$0.000001 45,388,988,286.6733 $26.86 ETH <0.01% $0.004933 5,439.8488 $26.83 ETH <0.01% $0.345613 77.5348 $26.8 ETH <0.01% $0.062762 424.7393 $26.66 ETH <0.01% $0.000001 28,362,582.9011 $26.62 ETH <0.01% $0.00681 3,884.757 $26.45 ETH <0.01% <$0.000001 17,525,448,016.215 $26.42 ETH <0.01% $0.001827 14,461.1224 $26.42 ETH <0.01% $0.026334 999.7768 $26.33 ETH <0.01% $0.004069 6,458.1908 $26.28 ETH <0.01% $0.000121 214,777.9055 $25.95 ETH <0.01% $0.006359 4,080.0104 $25.94 ETH <0.01% $3,507.52 0.00734882 $25.78 ETH <0.01% $0.000674 38,141.4697 $25.72 ETH <0.01% $0.681032 37.7172 $25.69 ETH <0.01% $0.235452 108.9819 $25.66 ETH <0.01% $0.564488 45.0812 $25.45 ETH <0.01% $0.211532 120.1465 $25.41 ETH <0.01% $1.24 20.2752 $25.24 ETH <0.01% $0.000004 5,997,117.5088 $25.19 ETH <0.01% $1.25 20.0766 $25.1 ETH <0.01% $0.998277 24.845 $24.8 ETH <0.01% $0.007054 3,500.0987 $24.69 ETH <0.01% $0.005024 4,911.6427 $24.68 ETH <0.01% $0.119591 204.4095 $24.45 ETH <0.01% $0.004001 6,095.9852 $24.39 ETH <0.01% $0.095427 255.1312 $24.35 ETH <0.01% $0.002211 11,010.9544 $24.34 ETH <0.01% $0.7828 31.0705 $24.32 ETH <0.01% $0.316618 76.5823 $24.25 ETH <0.01% $1.97 12.2913 $24.21 ETH <0.01% $0.000001 40,486,044.5401 $24.04 ETH <0.01% <$0.000001 228,219,082,037.9459 $24.04 ETH <0.01% $0.000161 149,669.9017 $24.03 ETH <0.01% $0.000002 10,820,107.9621 $23.91 ETH <0.01% $0.035654 668.9701 $23.85 ETH <0.01% $0.10991 215.5335 $23.69 ETH <0.01% $0.000001 24,657,950.9225 $23.64 ETH <0.01% $0.038019 618.7896 $23.53 ETH <0.01% $0.430916 54.5005 $23.49 ETH <0.01% $0.135542 173.1579 $23.47 ETH <0.01% $0.766594 30.5413 $23.41 ETH <0.01% $0.000587 39,689.4026 $23.29 ETH <0.01% $33.18 0.7014 $23.27 ETH <0.01% $0.000436 53,267.1389 $23.24 ETH <0.01% <$0.000001 2,534,345,051.4134 $23.2 ETH <0.01% $0.001037 22,351.1795 $23.17 ETH <0.01% $0.002568 8,983.9179 $23.07 ETH <0.01% <$0.000001 6,381,811,204.5974 $22.99 ETH <0.01% $2.85 8.0438 $22.92 ETH <0.01% $0.810267 27.9156 $22.62 ETH <0.01% $0.201745 112.092 $22.61 ETH <0.01% $18.44 1.2259 $22.61 ETH <0.01% $0.031033 727.3706 $22.57 ETH <0.01% <$0.000001 2,686,556,773,963.4805 $22.56 ETH <0.01% $0.000039 574,799.7931 $22.33 ETH <0.01% <$0.000001 6,003,414,615.3235 $22.24 ETH <0.01% $1.15 19.2877 $22.15 ETH <0.01% $0.999463 22.1275 $22.12 ETH <0.01% $3.58 6.1773 $22.11 ETH <0.01% $0.200172 110.4471 $22.11 ETH <0.01% $0.059903 368.7407 $22.09 ETH <0.01% $0.007911 2,748.954 $21.75 ETH <0.01% $0.012603 1,720.1649 $21.68 ETH <0.01% $0.036489 592.7929 $21.63 ETH <0.01% <$0.000001 31,220,735,237.966 $21.52 ETH <0.01% <$0.000001 10,552,455,586.7008 $21.42 ETH <0.01% $0.021173 1,011.0118 $21.41 ETH <0.01% $0.023164 919.5539 $21.3 ETH <0.01% $0.99579 21.3204 $21.23 ETH <0.01% <$0.000001 18,485,262,528.6208 $21.03 ETH <0.01% $0.000329 63,805.3736 $20.97 ETH <0.01% $0.000321 65,182.0879 $20.91 ETH <0.01% <$0.000001 53,557,686,295.2756 $20.88 ETH <0.01% $0.080783 258.2549 $20.86 ETH <0.01% $0.444179 46.9643 $20.86 ETH <0.01% $0.006455 3,229.9132 $20.85 ETH <0.01% $0.010462 1,990.0928 $20.82 ETH <0.01% $0.542391 38.1658 $20.7 ETH <0.01% $0.002105 9,825.4743 $20.68 ETH <0.01% <$0.000001 96,279,135.0527 $20.65 ETH <0.01% $0.028936 710.9584 $20.57 ETH <0.01% $0.000002 8,921,781.3107 $20.52 ETH <0.01% $0.0013 15,774.9025 $20.5 ETH <0.01% $0.374107 54.7202 $20.47 ETH <0.01% $1.17 17.4311 $20.39 ETH <0.01% $0.054519 373.703 $20.37 ETH <0.01% $0.00018 112,624.1094 $20.28 ETH <0.01% $0.067077 302.2288 $20.27 ETH <0.01% $0.068928 292.1779 $20.14 ETH <0.01% $0.000007 3,064,283.0156 $20 ETH <0.01% $0.001487 13,349.0927 $19.86 ETH <0.01% $147.42 0.1346 $19.84 ETH <0.01% $0.001379 14,335.4872 $19.76 ETH <0.01% $0.010238 1,917.0466 $19.63 ETH <0.01% $0.004749 4,109.9578 $19.52 ETH <0.01% $1.31 14.8616 $19.51 ETH <0.01% <$0.000001 243,351,609.6948 $19.41 ETH <0.01% $0.604356 31.6802 $19.15 ETH <0.01% $0.001798 10,427.3191 $18.75 ETH <0.01% $0.000006 3,061,817.0272 $18.72 ETH <0.01% $0.00253 7,354.5147 $18.61 ETH <0.01% $0.084627 218.8787 $18.52 ETH <0.01% $0.000799 23,088.3669 $18.44 ETH <0.01% $0.052858 347.8754 $18.39 ETH <0.01% $0.000346 52,288.4402 $18.11 ETH <0.01% $0.070671 255.431 $18.05 ETH <0.01% $0.000073 247,220.5555 $18.05 ETH <0.01% <$0.000001 24,984,834,587.7441 $17.93 ETH <0.01% $0.044388 401.7912 $17.83 ETH <0.01% $0.000002 8,250,419.4644 $17.76 ETH <0.01% $0.098549 180.0992 $17.75 ETH <0.01% $0.136579 129.917 $17.74 ETH <0.01% $5.93 2.9809 $17.68 ETH <0.01% $0.000253 69,674.3588 $17.66 ETH <0.01% $0.187114 94.0695 $17.6 ETH <0.01% $0.000001 26,397,635.8304 $17.59 ETH <0.01% $0.06174 283.8725 $17.53 ETH <0.01% <$0.000001 56,744,858.9378 $17.5 ETH <0.01% $0.000001 20,962,060.3974 $17.42 ETH <0.01% $0.00023 75,507.1767 $17.38 ETH <0.01% $0.066741 260.1138 $17.36 ETH <0.01% $0.001704 10,185.9496 $17.35 ETH <0.01% $0.00025 69,388.7242 $17.34 ETH <0.01% <$0.000001 36,853,170,108.0196 $17.3 ETH <0.01% <$0.000001 9,484,860,203.5674 $17.26 ETH <0.01% $0.000001 24,136,092.7416 $17.25 ETH <0.01% $1.54 11.19 $17.23 ETH <0.01% $0.000002 8,072,192.9589 $17.11 ETH <0.01% <$0.000001 47,254,741.2492 $16.99 ETH <0.01% $0.046779 361.1733 $16.9 ETH <0.01% $0.256198 65.7368 $16.84 ETH <0.01% $0.012898 1,302.3321 $16.8 ETH <0.01% $0.080328 208.5023 $16.75 ETH <0.01% $0.001115 14,969.0159 $16.69 ETH <0.01% $1.95 8.5515 $16.68 ETH <0.01% $0.001284 12,891.2438 $16.55 ETH <0.01% $0.173803 95.1789 $16.54 ETH <0.01% $0.010435 1,579.9482 $16.49 ETH <0.01% $0.000004 4,118,371.1801 $16.47 ETH <0.01% <$0.000001 43,363,283,776.3952 $16.29 ETH <0.01% $0.243558 66.8535 $16.28 ETH <0.01% $0.035594 453.6213 $16.15 ETH <0.01% $1.45 10.9773 $15.92 ETH <0.01% <$0.000001 34,254,358.4131 $15.85 ETH <0.01% $4.04 3.9209 $15.84 ETH <0.01% $0.035801 440.4053 $15.77 ETH <0.01% $0.088775 177.1686 $15.73 ETH <0.01% <$0.000001 56,067,231.8721 $15.68 ETH <0.01% $0.000002 7,927,775.0185 $15.68 ETH <0.01% $0.000001 11,687,618.9122 $15.66 ETH <0.01% <$0.000001 76,896,568,190.863 $15.61 ETH <0.01% $0.39498 39.4167 $15.57 ETH <0.01% $0.000796 19,531.7487 $15.55 ETH <0.01% <$0.000001 183,480,904.9616 $15.46 ETH <0.01% $0.107114 143.9854 $15.42 ETH <0.01% $0.001895 8,099.0976 $15.35 ETH <0.01% $0.00819 1,864.4114 $15.27 ETH <0.01% $0.000154 99,080.3426 $15.26 ETH <0.01% $0.002731 5,575.1166 $15.23 ETH <0.01% $14.62 1.038 $15.18 ETH <0.01% $0.341933 44.1717 $15.1 ETH <0.01% $0.000003 5,757,333.749 $15.09 ETH <0.01% $18.78 0.7999 $15.02 ETH <0.01% $0.585578 25.4029 $14.88 ETH <0.01% $0.425775 34.773 $14.81 ETH <0.01% $0.000746 19,607.1289 $14.62 ETH <0.01% <$0.000001 37,642,236.3282 $14.53 ETH <0.01% $0.005027 2,863.0052 $14.39 ETH <0.01% $0.122543 116.6528 $14.29 ETH <0.01% $0.005004 2,847.3587 $14.25 ETH <0.01% $0.006373 2,220.9431 $14.15 ETH <0.01% $0.027733 509.7477 $14.14 ETH <0.01% $0.017215 821.0199 $14.13 ETH <0.01% $0.039075 361.2722 $14.12 ETH <0.01% $0.000511 27,553.1941 $14.08 ETH <0.01% $0.056383 249.2608 $14.05 ETH <0.01% $0.000869 15,967.5696 $13.88 ETH <0.01% $12.75 1.082 $13.8 ETH <0.01% $0.039608 346.1176 $13.71 ETH <0.01% $0.000052 262,335.7435 $13.67 ETH <0.01% <$0.000001 21,713,674,295.9715 $13.62 ETH <0.01% $0.329797 41.1445 $13.57 ETH <0.01% $0.215917 62.6951 $13.54 ETH <0.01% $0.207721 65.1502 $13.53 ETH <0.01% $0.000003 4,076,710.2126 $13.49 ETH <0.01% $0.018847 715.3628 $13.48 ETH <0.01% $0.063207 212.9171 $13.46 ETH <0.01% $0.000277 48,275.9612 $13.36 ETH <0.01% <$0.000001 57,052,966,455.7282 $13.32 ETH <0.01% $0.149697 88.9618 $13.32 ETH <0.01% $0.000126 105,388.6692 $13.27 ETH <0.01% $0.005843 2,267.7232 $13.25 ETH <0.01% $0.031473 420.9074 $13.25 ETH <0.01% $0.000166 79,292.8872 $13.18 ETH <0.01% $0.108112 121.8864 $13.18 ETH <0.01% <$0.000001 2,843,617,855.2271 $13.18 ETH <0.01% $0.000003 4,454,527.1718 $13.15 ETH <0.01% $0.575019 22.8562 $13.14 ETH <0.01% $1.05 12.49 $13.05 ETH <0.01% $0.00141 9,226.0533 $13.01 ETH <0.01% $1.97 6.5965 $13 ETH <0.01% $0.031498 408.4609 $12.87 ETH <0.01% $0.017655 725.2343 $12.8 ETH <0.01% $0.378013 33.5972 $12.7 ETH <0.01% $0.039563 320.2607 $12.67 ETH <0.01% $0.124201 101.7067 $12.63 ETH <0.01% $0.010106 1,247.6423 $12.61 ETH <0.01% $0.421001 29.8963 $12.59 ETH <0.01% $0.09433 133.4189 $12.59 ETH <0.01% $0.062435 200.7467 $12.53 ETH <0.01% $0.045128 275.5107 $12.43 ETH <0.01% <$0.000001 105,969,143.6122 $12.43 ETH <0.01% $0.00269 4,609.1389 $12.4 ETH <0.01% $0.019413 636.6617 $12.36 ETH <0.01% $0.007904 1,560.3057 $12.33 ETH <0.01% $0.008891 1,384.8444 $12.31 ETH <0.01% $0.034518 354.1818 $12.23 ETH <0.01% $0.061019 200.033 $12.21 ETH <0.01% $10.7 1.1393 $12.19 ETH <0.01% $1.19 10.2183 $12.16 ETH <0.01% $0.112067 108.1894 $12.12 ETH <0.01% $0.01081 1,121.3407 $12.12 ETH <0.01% $0.003043 3,962.3528 $12.06 ETH <0.01% $0.208837 57.7224 $12.05 ETH <0.01% $3,317.38 0.00362682 $12.03 ETH <0.01% <$0.000001 7,947,114,477.3619 $12.01 ETH <0.01% <$0.000001 8,726,601,944,856.2354 $11.98 ETH <0.01% $0.000601 19,921.6489 $11.98 ETH <0.01% $0.007918 1,506.7628 $11.93 ETH <0.01% $0.000419 28,261.9804 $11.83 ETH <0.01% <$0.000001 27,812,325,031,271.488 $11.78 ETH <0.01% $0.002499 4,686.223 $11.71 ETH <0.01% $0.000002 5,101,151.9481 $11.7 ETH <0.01% $0.000001 14,959,624.8348 $11.61 ETH <0.01% $0.726153 15.9369 $11.57 ETH <0.01% $0.272114 42.5122 $11.57 ETH <0.01% <$0.000001 30,259,800,782.0176 $11.28 ETH <0.01% $0.00076 14,778.0162 $11.24 ETH <0.01% $0.994837 11.2752 $11.22 ETH <0.01% $0.001165 9,598.3065 $11.18 ETH <0.01% $0.002495 4,457.9569 $11.12 ETH <0.01% $3,879.54 0.00284637 $11.04 ETH <0.01% $0.027413 402.499 $11.03 ETH <0.01% <$0.000001 44,110,740.7518 $10.99 ETH <0.01% <$0.000001 25,072,282,607.3673 $10.97 ETH <0.01% $0.001137 9,623.2245 $10.94 ETH <0.01% $7.48 1.4617 $10.93 ETH <0.01% $0.030733 354.9716 $10.91 ETH <0.01% $0.000007 1,617,883.1853 $10.9 ETH <0.01% $0.000607 17,964.742 $10.9 ETH <0.01% $3 3.6311 $10.89 ETH <0.01% <$0.000001 37,644,907,692.3882 $10.87 ETH <0.01% $0.079801 135.9201 $10.85 ETH <0.01% $0.000169 63,997.1809 $10.82 ETH <0.01% $0.018242 593.2568 $10.82 ETH <0.01% $2.3 4.6967 $10.8 ETH <0.01% $261.37 0.0411 $10.73 ETH <0.01% $0.000092 115,878.4324 $10.72 ETH <0.01% $3,564.79 0.0029893 $10.66 ETH <0.01% $0.013441 783.4668 $10.53 ETH <0.01% $0.003354 3,135.0135 $10.52 ETH <0.01% $0.146136 71.8031 $10.49 ETH <0.01% <$0.000001 115,255,319,242.4855 $10.45 ETH <0.01% $0.105387 99.1636 $10.45 ETH <0.01% <$0.000001 49,988,504.0556 $10.37 ETH <0.01% $0.011909 867.1017 $10.33 ETH <0.01% $0.002231 4,620.2283 $10.31 ETH <0.01% $0.002941 3,497.2825 $10.29 ETH <0.01% $0.110656 92.0083 $10.18 ETH <0.01% $2.2 4.6171 $10.16 ETH <0.01% $0.000384 26,448.5666 $10.15 ETH <0.01% $0.000342 29,598.1778 $10.13 ETH <0.01% $0.005368 1,880.2932 $10.09 ETH <0.01% $4.92 2.0429 $10.05 ETH <0.01% $0.000002 5,312,089.6861 $9.99 ETH <0.01% $0.002695 3,699.2209 $9.97 ETH <0.01% <$0.000001 96,871,828.6163 $9.94 ETH <0.01% $0.436741 22.7202 $9.92 ETH <0.01% $0.068427 144.9566 $9.92 ETH <0.01% <$0.000001 9,819,103,551.6829 $9.91 ETH <0.01% $0.393337 25.0742 $9.86 ETH <0.01% $0.000248 39,657.4033 $9.84 ETH <0.01% <$0.000001 70,479,449.726 $9.81 ETH <0.01% $0.016089 609.5148 $9.81 ETH <0.01% <$0.000001 628,596,072.8452 $9.74 ETH <0.01% $0.0187 519.7855 $9.72 ETH <0.01% <$0.000001 7,128,219,240.9478 $9.68 ETH <0.01% $0.000034 285,026.4929 $9.62 ETH <0.01% <$0.000001 197,859,613.0156 $9.61 ETH <0.01% $0.000984 9,656.9351 $9.51 ETH <0.01% $0.000392 24,176.0595 $9.48 ETH <0.01% <$0.000001 25,152,379.1816 $9.39 ETH <0.01% $0.001351 6,913.2011 $9.34 ETH <0.01% $0.022203 419.4154 $9.31 ETH <0.01% $0.011927 765.5513 $9.13 ETH <0.01% $0.013724 664.3707 $9.12 ETH <0.01% $0.000102 89,196.1373 $9.08 ETH <0.01% $0.123525 73.236 $9.05 ETH <0.01% $0.017481 512.9285 $8.97 ETH <0.01% $1.64 5.4433 $8.93 ETH <0.01% $0.000049 181,155.2992 $8.93 ETH <0.01% $0.035494 249.6712 $8.86 ETH <0.01% $0.000404 21,679.8253 $8.75 ETH <0.01% <$0.000001 35,530,136,065.296 $8.72 ETH <0.01% <$0.000001 86,745,848.961 $8.69 ETH <0.01% $2.52 3.4218 $8.63 ETH <0.01% $0.000529 16,305.4045 $8.62 ETH <0.01% $0.406588 21.1108 $8.58 ETH <0.01% $0.000553 15,416.1673 $8.53 ETH <0.01% $3,948.75 0.00215927 $8.53 ETH <0.01% $0.800934 10.6433 $8.52 ETH <0.01% $0.023878 355.4874 $8.49 ETH <0.01% $0.005723 1,482.111 $8.48 ETH <0.01% $0.000147 57,617.1082 $8.47 ETH <0.01% $0.341933 24.6181 $8.42 ETH <0.01% $0.999622 8.4058 $8.4 ETH <0.01% $0.000356 23,504.778 $8.36 ETH <0.01% $0.002348 3,553.7186 $8.34 ETH <0.01% $0.000157 52,909.2118 $8.33 ETH <0.01% $0.004562 1,824.9948 $8.33 ETH <0.01% $0.196358 41.5301 $8.15 ETH <0.01% $0.000661 12,278.2761 $8.11 ETH <0.01% $0.000444 18,241.7217 $8.11 ETH <0.01% $0.002744 2,936.7961 $8.06 ETH <0.01% $0.007492 1,071.3715 $8.03 ETH <0.01% <$0.000001 56,648,363,718,217.3 $7.98 ETH <0.01% $0.000831 9,593.5494 $7.97 ETH <0.01% $0.147945 53.9007 $7.97 ETH <0.01% $0.22986 33.7649 $7.76 ETH <0.01% $0.053193 145.8121 $7.76 ETH <0.01% $0.208153 37.2598 $7.76 ETH <0.01% $0.000002 4,427,995.6495 $7.7 ETH <0.01% $0.000148 52,036.6591 $7.69 ETH <0.01% $0.281508 27.1125 $7.63 ETH <0.01% $0.001084 7,033.5647 $7.62 ETH <0.01% <$0.000001 19,803,996.8034 $7.59 ETH <0.01% $0.82784 9.1674 $7.59 ETH <0.01% $0.000009 802,275.9878 $7.58 ETH <0.01% $0.076736 98.6322 $7.57 ETH <0.01% $0.000001 13,485,155.2512 $7.53 ETH <0.01% $18.18 0.4098 $7.45 ETH <0.01% $0.294369 25.2315 $7.43 ETH <0.01% $5.47 1.3531 $7.41 ETH <0.01% <$0.000001 2,187,173,353.3688 $7.37 ETH <0.01% $6,920.96 0.00105411 $7.3 ETH <0.01% $0.000316 23,011.2506 $7.28 ETH <0.01% $1.12 6.4715 $7.25 ETH <0.01% $0.001514 4,784.973 $7.25 ETH <0.01% $0.000001 6,415,642.9585 $7.12 ETH <0.01% $0.136564 51.9746 $7.1 ETH <0.01% $0.000001 6,673,417.1828 $7.07 ETH <0.01% <$0.000001 33,877,746.5193 $6.97 ETH <0.01% $0.052535 131.9721 $6.93 ETH <0.01% $0.009717 713.1984 $6.93 ETH <0.01% $0.001081 6,387.8435 $6.9 ETH <0.01% $0.000841 8,181.8982 $6.88 ETH <0.01% $0.00619 1,108.5236 $6.86 ETH <0.01% $0.452182 15.0335 $6.8 ETH <0.01% $0.04043 167.6829 $6.78 ETH <0.01% <$0.000001 31,676,888,560.9041 $6.78 ETH <0.01% $0.001804 3,752.6814 $6.77 ETH <0.01% $0.658643 10.2588 $6.76 ETH <0.01% $0.002255 2,993.1918 $6.75 ETH <0.01% <$0.000001 24,148,329.5092 $6.75 ETH <0.01% $155.24 0.0433 $6.72 ETH <0.01% $0.000509 13,169.2808 $6.7 ETH <0.01% $0.037224 177.5969 $6.61 ETH <0.01% <$0.000001 36,946,806.7243 $6.61 ETH <0.01% $0.002343 2,820.56 $6.61 ETH <0.01% $0.08733 75.658 $6.61 ETH <0.01% <$0.000001 21,999,407.6497 $6.59 ETH <0.01% $0.001871 3,496.3321 $6.54 ETH <0.01% $0.000007 940,176.3051 $6.54 ETH <0.01% $0.153091 42.5855 $6.52 ETH <0.01% $1.01 6.4746 $6.51 ETH <0.01% <$0.000001 9,101,493,446.8011 $6.51 ETH <0.01% $0.004306 1,507.264 $6.49 ETH <0.01% $0.188974 34.0844 $6.44 ETH <0.01% <$0.000001 28,448,938.8353 $6.42 ETH <0.01% $0.000001 5,616,547.641 $6.41 ETH <0.01% $0.002807 2,271.9906 $6.38 ETH <0.01% $0.000002 2,953,137.5214 $6.37 ETH <0.01% $0.02604 244.2063 $6.36 ETH <0.01% <$0.000001 5,924,122,560.278 $6.36 ETH <0.01% $0.151823 41.852 $6.35 ETH <0.01% $0.000012 519,519.8489 $6.34 ETH <0.01% $0.000001 11,254,516.5704 $6.33 ETH <0.01% $0.016184 390.2298 $6.32 ETH <0.01% $0.044857 140.4258 $6.3 ETH <0.01% $0.021079 295.0831 $6.22 ETH <0.01% $0.002705 2,274.5928 $6.15 ETH <0.01% $0.000003 1,912,884.826 $6.14 ETH <0.01% $0.44032 13.93 $6.13 ETH <0.01% $66.68 0.0908 $6.05 ETH <0.01% $0.14633 41.3429 $6.05 ETH <0.01% $0.267629 22.4717 $6.01 ETH <0.01% $0.064267 93.1176 $5.98 ETH <0.01% $1.46 4.0918 $5.97 ETH <0.01% $0.001349 4,402.7714 $5.94 ETH <0.01% $0.014455 409.2123 $5.92 ETH <0.01% $0.72335 8.1728 $5.91 ETH <0.01% $0.188698 31.2693 $5.9 ETH <0.01% $3,716.86 0.00158588 $5.89 ETH <0.01% <$0.000001 98,896,848,534.8093 $5.89 ETH <0.01% $0.04778 123.0456 $5.88 ETH <0.01% $0.01745 336.9082 $5.88 ETH <0.01% <$0.000001 2,076,868,094.548 $5.85 ETH <0.01% $0.006122 953.7137 $5.84 ETH <0.01% <$0.000001 18,580,084.5125 $5.82 ETH <0.01% $0.081518 70.978 $5.79 ETH <0.01% $0.060121 95.155 $5.72 ETH <0.01% $0.012286 465.3934 $5.72 ETH <0.01% $0.047639 118.6238 $5.65 ETH <0.01% $0.000004 1,280,907.455 $5.64 ETH <0.01% $0.005818 964.2994 $5.61 ETH <0.01% $0.14086 39.5849 $5.58 ETH <0.01% $0.006346 876.1976 $5.56 ETH <0.01% <$0.000001 1,030,984,321.6085 $5.54 ETH <0.01% $0.000006 878,206.3977 $5.52 ETH <0.01% $0.000794 6,930.8635 $5.5 ETH <0.01% $0.00642 845.2824 $5.43 ETH <0.01% $0.001263 4,272.791 $5.4 ETH <0.01% $0.003224 1,671.8821 $5.39 ETH <0.01% $0.188191 28.5889 $5.38 ETH <0.01% $0.999298 5.3823 $5.38 ETH <0.01% $0.001595 3,349.0053 $5.34 ETH <0.01% <$0.000001 17,298,365,827.7661 $5.34 ETH <0.01% $0.000201 26,343.2488 $5.3 ETH <0.01% $3,488.88 0.00151978 $5.3 ETH <0.01% $0.049168 107.6064 $5.29 ETH <0.01% <$0.000001 105,602,097.4593 $5.28 ETH <0.01% $0.510126 10.3419 $5.28 ETH <0.01% <$0.000001 568,175,221.0745 $5.27 ETH <0.01% $0.00015 35,129.7698 $5.26 ETH <0.01% <$0.000001 10,037,259,972.3222 $5.26 ETH <0.01% <$0.000001 25,813,177,901.0746 $5.23 ETH <0.01% $0.000103 50,252.4088 $5.18 ETH <0.01% $0.004166 1,235.8917 $5.15 ETH <0.01% $0.011804 433.0441 $5.11 ETH <0.01% $0.000609 8,385.5905 $5.11 ETH <0.01% <$0.000001 260,798,081.3211 $5.09 ETH <0.01% $0.051733 98.097 $5.07 ETH <0.01% $0.192494 26.2038 $5.04 ETH <0.01% $1.68 3.0019 $5.04 ETH <0.01% $139.55 0.0361 $5.04 ETH <0.01% $0.000003 1,926,216.7363 $5.03 ETH <0.01% <$0.000001 28,154,611.8931 $4.93 ETH <0.01% $0.000123 39,773.8384 $4.91 ETH <0.01% <$0.000001 234,211,409.2599 $4.9 ETH <0.01% $0.000002 2,664,062.9317 $4.82 ETH <0.01% $0.005839 816.7529 $4.77 ETH <0.01% $0.00564 842.7513 $4.75 ETH <0.01% $0.000168 28,319.7643 $4.75 ETH <0.01% $0.003125 1,517.5855 $4.74 ETH <0.01% $0.000327 14,430.1968 $4.72 ETH <0.01% <$0.000001 59,597,484,488,382.867 $4.72 ETH <0.01% $0.000511 9,214.0245 $4.7 ETH <0.01% $0.006187 756.6681 $4.68 ETH <0.01% $0.425108 10.99 $4.67 ETH <0.01% $0.000001 7,564,608.3125 $4.67 ETH <0.01% $0.002271 2,053.7232 $4.66 ETH <0.01% $0.000217 21,395.8136 $4.64 ETH <0.01% $0.013776 336.6942 $4.64 ETH <0.01% $23.4 0.1973 $4.62 ETH <0.01% <$0.000001 2,601,599,682.6535 $4.6 ETH <0.01% $0.000022 213,138.0751 $4.6 ETH <0.01% $1.13 3.9925 $4.51 ETH <0.01% $0.0024 1,878.9117 $4.51 ETH <0.01% <$0.000001 11,809,471.5655 $4.48 ETH <0.01% $1.07 4.1862 $4.48 ETH <0.01% $0.000216 20,752.8706 $4.47 ETH <0.01% $0.000384 11,607.7573 $4.46 ETH <0.01% $0.009199 484.3544 $4.46 ETH <0.01% $9.38 0.4737 $4.44 ETH <0.01% $1.18 3.763 $4.44 ETH <0.01% $0.000378 11,709.8408 $4.43 ETH <0.01% $0.098187 44.8218 $4.4 ETH <0.01% <$0.000001 74,206,743.1411 $4.37 ETH <0.01% $0.012592 345.3361 $4.35 ETH <0.01% <$0.000001 43,331,327.1174 $4.34 ETH <0.01% <$0.000001 3,507,457,932.3659 $4.33 ETH <0.01% <$0.000001 3,667,549,733.7878 $4.32 ETH <0.01% $0.000033 128,978.7572 $4.31 ETH <0.01% $0.006181 696.4693 $4.3 ETH <0.01% $1.74 2.4712 $4.3 ETH <0.01% $0.001646 2,606.159 $4.29 ETH <0.01% $0.168114 25.4378 $4.28 ETH <0.01% <$0.000001 50,896,733,571.0823 $4.27 ETH <0.01% $0.012491 339.0176 $4.23 ETH <0.01% $0.000147 28,740.6382 $4.22 ETH <0.01% <$0.000001 327,393,619,200.2098 $4.21 ETH <0.01% $1.97 2.1374 $4.21 ETH <0.01% $0.00373 1,127.33 $4.21 ETH <0.01% <$0.000001 2,453,187,450.2241 $4.2 ETH <0.01% <$0.000001 13,375,459.4682 $4.18 ETH <0.01% $0.006508 638.4541 $4.16 ETH <0.01% $0.000104 40,032.7143 $4.15 ETH <0.01% $0.000086 47,919.7131 $4.1 ETH <0.01% $0.000001 7,434,795.7176 $4.1 ETH <0.01% $0.00001 402,459.6481 $4.08 ETH <0.01% $0.001486 2,741.8731 $4.07 ETH <0.01% <$0.000001 237,508,159.8186 $4.07 ETH <0.01% $0.057929 70.287 $4.07 ETH <0.01% $0.000151 26,648.7467 $4.02 ETH <0.01% $0.000001 7,624,194.2304 $4.01 ETH <0.01% <$0.000001 3,327,132,462,632.9292 $4 ETH <0.01% $0.404947 9.8335 $3.98 ETH <0.01% $0.000398 9,975.1668 $3.97 ETH <0.01% $0.000973 4,081.4598 $3.97 ETH <0.01% <$0.000001 38,033,481.3173 $3.96 ETH <0.01% $0.121139 32.5595 $3.94 ETH <0.01% $0.000053 72,366.6137 $3.87 ETH <0.01% <$0.000001 64,525,534.309 $3.86 ETH <0.01% $0.056955 67.627 $3.85 ETH <0.01% $0.719186 5.333 $3.84 ETH <0.01% $0.000001 4,319,570.8283 $3.83 ETH <0.01% $0.000022 170,793.3778 $3.81 ETH <0.01% $0.010281 367.4698 $3.78 ETH <0.01% $23.91 0.1553 $3.71 ETH <0.01% $0.000039 94,502.2945 $3.69 ETH <0.01% <$0.000001 15,091,673,693.1254 $3.67 ETH <0.01% $0.000169 21,272.555 $3.59 ETH <0.01% $0.127248 28.192 $3.59 ETH <0.01% $0.000491 7,297.5939 $3.58 ETH <0.01% $0.000867 4,115.6501 $3.57 ETH <0.01% $0.121162 29.4461 $3.57 ETH <0.01% <$0.000001 553,528,680.9375 $3.54 ETH <0.01% <$0.000001 14,429,081,971.1618 $3.54 ETH <0.01% <$0.000001 6,144,297,366.8298 $3.53 ETH <0.01% <$0.000001 176,579,335.3048 $3.53 ETH <0.01% $1.13 3.12 $3.53 ETH <0.01% $0.01239 279.9208 $3.47 ETH <0.01% $286.15 0.012 $3.44 ETH <0.01% $0.000045 75,562.2037 $3.42 ETH <0.01% $0.002564 1,333.441 $3.42 ETH <0.01% $0.997089 3.4189 $3.41 ETH <0.01% $0.007715 441.5128 $3.41 ETH <0.01% $5.95 0.5697 $3.39 ETH <0.01% $0.010797 313.6339 $3.39 ETH <0.01% $0.197869 16.793 $3.32 ETH <0.01% $0.000171 19,383.8993 $3.32 ETH <0.01% $0.000001 2,354,361.8735 $3.32 ETH <0.01% $0.018746 173.9621 $3.26 ETH <0.01% <$0.000001 32,488,220.1476 $3.25 ETH <0.01% $0.000001 4,776,642.1214 $3.23 ETH <0.01% $0.000878 3,667.638 $3.22 ETH <0.01% $0.002048 1,571.5338 $3.22 ETH <0.01% $8.98 0.357 $3.21 ETH <0.01% $0.00282 1,136.8694 $3.21 ETH <0.01% $0.004051 786.5972 $3.19 ETH <0.01% $0.017746 179.3995 $3.18 ETH <0.01% $0.001333 2,368.1515 $3.16 ETH <0.01% $0.001506 2,073.5021 $3.12 ETH <0.01% $54.69 0.057 $3.12 ETH <0.01% <$0.000001 55,681,240,886.4847 $3.11 ETH <0.01% $0.014112 219.1997 $3.09 ETH <0.01% $0.088657 34.8577 $3.09 ETH <0.01% $0.122256 25.1614 $3.08 ETH <0.01% $6.74 0.4552 $3.07 ETH <0.01% $0.000006 513,061.9834 $3.06 ETH <0.01% $3.98 0.76 $3.02 ETH <0.01% <$0.000001 6,603,518,467.5821 $2.98 ETH <0.01% <$0.000001 12,009,003.3295 $2.98 ETH <0.01% $0.067219 43.9536 $2.95 ETH <0.01% $0.001122 2,629.8261 $2.95 ETH <0.01% $0.042426 69.4557 $2.95 ETH <0.01% $0.022676 128.8165 $2.92 ETH <0.01% $16.83 0.1723 $2.9 ETH <0.01% $0.002071 1,396.8639 $2.89 ETH <0.01% $0.000764 3,785.2708 $2.89 ETH <0.01% $0.095544 30.2547 $2.89 ETH <0.01% $0.040743 70.9019 $2.89 ETH <0.01% $0.555546 5.1957 $2.89 ETH <0.01% <$0.000001 5,261,460,968.215 $2.88 ETH <0.01% $0.00065 4,437.9155 $2.88 ETH <0.01% $0.039589 72.7588 $2.88 ETH <0.01% $0.000003 838,438.7709 $2.87 ETH <0.01% <$0.000001 29,101,411.7865 $2.85 ETH <0.01% $0.71868 3.9195 $2.82 ETH <0.01% <$0.000001 13,768,945.516 $2.81 ETH <0.01% $0.000077 36,504.8023 $2.79 ETH <0.01% $0.000221 12,613.316 $2.79 ETH <0.01% $0.998686 2.7826 $2.78 ETH <0.01% $0.000862 3,216.0729 $2.77 ETH <0.01% $0.121587 22.7749 $2.77 ETH <0.01% <$0.000001 1,323,007,309,512.9697 $2.76 ETH <0.01% $0.000006 458,086.6262 $2.76 ETH <0.01% $0.391994 7.0217 $2.75 ETH <0.01% $0.000024 113,092.551 $2.74 ETH <0.01% $0.007795 348.8407 $2.72 ETH <0.01% $0.000023 115,741.0611 $2.7 ETH <0.01% $0.047134 56.5197 $2.66 ETH <0.01% <$0.000001 26,542,595.8585 $2.62 ETH <0.01% $241,864.98 0.00001068 $2.58 ETH <0.01% $0.001064 2,417.2654 $2.57 ETH <0.01% $0.042872 59.7121 $2.56 ETH <0.01% $0.000156 16,352.0243 $2.55 ETH <0.01% $0.001306 1,943.1429 $2.54 ETH <0.01% $3,311.55 0.00076531 $2.53 ETH <0.01% $0.763278 3.3016 $2.52 ETH <0.01% $0.012496 201.6088 $2.52 ETH <0.01% $0.000002 1,007,449.616 $2.52 ETH <0.01% $0.000589 4,267.0561 $2.51 ETH <0.01% $0.005463 459.3169 $2.51 ETH <0.01% $0.029059 85.9216 $2.5 ETH <0.01% <$0.000001 10,729,113,213.33 $2.48 ETH <0.01% <$0.000001 9,902,839.3755 $2.47 ETH <0.01% $0.002128 1,157.1596 $2.46 ETH <0.01% $0.000804 3,060.7463 $2.46 ETH <0.01% $0.003691 664.7175 $2.45 ETH <0.01% $0.001038 2,340.8289 $2.43 ETH <0.01% $0.001312 1,848.1524 $2.43 ETH <0.01% $0.000078 30,763.4155 $2.41 ETH <0.01% $0.000001 4,208,796.0932 $2.39 ETH <0.01% $0.000576 4,137.171 $2.38 ETH <0.01% $0.0002 11,862.3025 $2.37 ETH <0.01% $0.000003 798,880.2268 $2.37 ETH <0.01% <$0.000001 220,017,222.9466 $2.36 ETH <0.01% <$0.000001 4,245,934,992.0473 $2.35 ETH <0.01% $0.006014 389.1821 $2.34 ETH <0.01% $0.000021 110,100.8276 $2.34 ETH <0.01% $0.002602 898.5739 $2.34 ETH <0.01% $0.000033 70,154.6774 $2.33 ETH <0.01% $23.73 0.098 $2.33 ETH <0.01% <$0.000001 21,013,684.6211 $2.31 ETH <0.01% $1.52 1.5091 $2.3 ETH <0.01% $0.000322 7,093.2391 $2.29 ETH <0.01% $0.010754 212.3067 $2.28 ETH <0.01% $0.513953 4.3848 $2.25 ETH <0.01% $0.001957 1,149.3895 $2.25 ETH <0.01% $0.392765 5.7213 $2.25 ETH <0.01% <$0.000001 13,181,532,198.8198 $2.24 ETH <0.01% $0.199715 11.2196 $2.24 ETH <0.01% $0.000006 354,816.0935 $2.24 ETH <0.01% $0.000254 8,795.4023 $2.23 ETH <0.01% $0.000154 14,402.4083 $2.22 ETH <0.01% $0.984515 2.2577 $2.22 ETH <0.01% $20.03 0.111 $2.22 ETH <0.01% $0.001888 1,174.0269 $2.22 ETH <0.01% $0.000028 79,135.0827 $2.21 ETH <0.01% $0.001065 2,066.2768 $2.2 ETH <0.01% $0.000002 1,007,650.2321 $2.2 ETH <0.01% $0.170984 12.839 $2.2 ETH <0.01% $0.01026 213.4543 $2.19 ETH <0.01% $0.017324 126.1817 $2.19 ETH <0.01% $0.000031 69,034.7189 $2.17 ETH <0.01% $0.532805 4.0542 $2.16 ETH <0.01% $0.000018 116,954.7094 $2.16 ETH <0.01% <$0.000001 446,998,813.9276 $2.14 ETH <0.01% $0.000052 41,220.9533 $2.12 ETH <0.01% $0.095699 22.1406 $2.12 ETH <0.01% $0.00253 831.6456 $2.1 ETH <0.01% $0.069765 30.0393 $2.1 ETH <0.01% $0.029715 70.4901 $2.09 ETH <0.01% <$0.000001 12,434,446.9448 $2.09 ETH <0.01% $0.001672 1,249.1495 $2.09 ETH <0.01% $0.027166 75.866 $2.06 ETH <0.01% $16.16 0.1268 $2.05 ETH <0.01% <$0.000001 2,295,384,215.9168 $2.04 ETH <0.01% $0.004533 449.4858 $2.04 ETH <0.01% $5.62 0.3618 $2.03 ETH <0.01% $0.124854 16.155 $2.02 ETH <0.01% $0.021725 92.7011 $2.01 ETH <0.01% <$0.000001 4,280,326,655.3619 $2.01 ETH <0.01% $0.063198 31.7805 $2.01 ETH <0.01% $0.000874 2,297.4343 $2.01 ETH <0.01% $0.005318 374.3922 $1.99 ETH <0.01% <$0.000001 4,290,844.2889 $1.99 ETH <0.01% $9.32 0.2101 $1.96 ETH <0.01% $0.510126 3.8092 $1.94 ETH <0.01% $0.003704 524.0898 $1.94 ETH <0.01% $21.24 0.091 $1.93 ETH <0.01% $0.000211 9,129.4219 $1.92 ETH <0.01% $0.000459 4,163.3549 $1.91 ETH <0.01% $0.003127 601.6749 $1.88 ETH <0.01% $0.038208 49.0732 $1.87 ETH <0.01% $0.001037 1,804.5028 $1.87 ETH <0.01% <$0.000001 31,243,189,788.6565 $1.86 ETH <0.01% <$0.000001 359,995,947.116 $1.86 ETH <0.01% <$0.000001 5,885,522.9103 $1.84 ETH <0.01% $0.00018 10,209.7473 $1.84 ETH <0.01% $0.000004 509,058.3367 $1.82 ETH <0.01% <$0.000001 19,769,991.919 $1.81 ETH <0.01% $0.000041 44,251.3462 $1.81 ETH <0.01% $0.444179 4.0678 $1.81 ETH <0.01% $0.030796 58.6586 $1.81 ETH <0.01% $0.013922 129.7209 $1.81 ETH <0.01% $0.000142 12,685.1582 $1.8 ETH <0.01% $0.0125 143.3935 $1.79 ETH <0.01% $0.000073 24,686.9187 $1.79 ETH <0.01% $0.000645 2,761.0118 $1.78 ETH <0.01% <$0.000001 357,723,304.3358 $1.77 ETH <0.01% $0.027145 65.168 $1.77 ETH <0.01% $0.184944 9.5494 $1.77 ETH <0.01% <$0.000001 5,311,672.2875 $1.75 ETH <0.01% $0.00161 1,085.9346 $1.75 ETH <0.01% $0.002814 612.1516 $1.72 ETH <0.01% $0.075743 22.5944 $1.71 ETH <0.01% <$0.000001 3,522,982.5465 $1.7 ETH <0.01% $0.003178 531.6471 $1.69 ETH <0.01% <$0.000001 624,832,015.7508 $1.69 ETH <0.01% $0.001023 1,646.0455 $1.68 ETH <0.01% <$0.000001 3,524,913.536 $1.67 ETH <0.01% $0.000017 100,021.3472 $1.67 ETH <0.01% $0.011523 141.979 $1.64 ETH <0.01% <$0.000001 3,249,697,617.7775 $1.63 ETH <0.01% $0.010506 153.1633 $1.61 ETH <0.01% $0.019121 83.7716 $1.6 ETH <0.01% $0.001676 943.7064 $1.58 ETH <0.01% $0.002532 624.2855 $1.58 ETH <0.01% $0.000125 12,570.5328 $1.58 ETH <0.01% $0.000137 11,392.3404 $1.56 ETH <0.01% $0.000412 3,775.6782 $1.56 ETH <0.01% $0.000204 7,624.9124 $1.56 ETH <0.01% $6.67 0.2325 $1.55 ETH <0.01% $0.043841 35.3288 $1.55 ETH <0.01% $0.000107 14,420.2271 $1.54 ETH <0.01% <$0.000001 12,266,101.3869 $1.54 ETH <0.01% $0.02378 63.8531 $1.52 ETH <0.01% $41.5 0.0363 $1.51 ETH <0.01% $0.00006 24,961.4801 $1.5 ETH <0.01% $0.004741 316.3304 $1.5 ETH <0.01% $0.067203 22.3024 $1.5 ETH <0.01% $0.000475 3,139.3652 $1.49 ETH <0.01% $0.386797 3.8395 $1.49 ETH <0.01% $0.007123 206.9094 $1.47 ETH <0.01% $0.000074 19,760.2157 $1.47 ETH <0.01% $0.009137 160.31 $1.46 ETH <0.01% $0.022788 64.0388 $1.46 ETH <0.01% $0.098459 14.5963 $1.44 ETH <0.01% $0.022534 63.5058 $1.43 ETH <0.01% $0.017308 82.2272 $1.42 ETH <0.01% $0.007837 181.0486 $1.42 ETH <0.01% $0.038951 36.4222 $1.42 ETH <0.01% <$0.000001 23,628,818,303.7844 $1.41 ETH <0.01% $0.002447 573.8037 $1.4 ETH <0.01% $0.00005 28,177.0594 $1.4 ETH <0.01% $0.005207 268.1095 $1.4 ETH <0.01% $0.002136 653.3193 $1.4 ETH <0.01% <$0.000001 5,145,095.5296 $1.39 ETH <0.01% $0.229476 6.0603 $1.39 ETH <0.01% <$0.000001 5,936,425.0501 $1.38 ETH <0.01% $0.001529 902.1153 $1.38 ETH <0.01% $0.027189 50.6395 $1.38 ETH <0.01% $0.000001 2,625,224.1677 $1.38 ETH <0.01% $0.000005 288,226.0119 $1.37 ETH <0.01% <$0.000001 5,336,693,935.3316 $1.37 ETH <0.01% $0.000694 1,970.0609 $1.37 ETH <0.01% $0.025779 52.8907 $1.36 ETH <0.01% $0.002695 504.9545 $1.36 ETH <0.01% <$0.000001 389,265,287.3133 $1.36 ETH <0.01% $3.83 0.3506 $1.34 ETH <0.01% $0.032457 41.3181 $1.34 ETH <0.01% $0.000922 1,452.8904 $1.34 ETH <0.01% $0.012048 110.9454 $1.34 ETH <0.01% $0.038177 34.3132 $1.31 ETH <0.01% <$0.000001 1,581,727,760,288.616 $1.31 ETH <0.01% $0.01838 71.0092 $1.31 ETH <0.01% $0.00021 6,207.6938 $1.3 ETH <0.01% $0.000686 1,888.8779 $1.3 ETH <0.01% $0.017764 72.8929 $1.29 ETH <0.01% $0.015451 83.6088 $1.29 ETH <0.01% $0.318445 4.0291 $1.28 ETH <0.01% $0.01957 65.4118 $1.28 ETH <0.01% <$0.000001 7,314,639,096,143,716 $1.27 ETH <0.01% <$0.000001 20,738,159,030.3704 $1.25 ETH <0.01% <$0.000001 7,947,921.2066 $1.25 ETH <0.01% $0.231007 5.3895 $1.25 ETH <0.01% <$0.000001 37,962,284,257.0997 $1.24 ETH <0.01% $0.000665 1,851.2011 $1.23 ETH <0.01% $0.000022 55,484.1296 $1.23 ETH <0.01% $0.004701 256.5824 $1.21 ETH <0.01% $0.004239 282.3262 $1.2 ETH <0.01% $0.005065 234.6427 $1.19 ETH <0.01% $0.000633 1,872.6161 $1.19 ETH <0.01% $0.000052 22,265.4126 $1.16 ETH <0.01% <$0.000001 10,458,726,727.0587 $1.15 ETH <0.01% $3.51 0.3262 $1.15 ETH <0.01% $0.007193 158.4777 $1.14 ETH <0.01% $0.011709 97.1403 $1.14 ETH <0.01% $0.000028 40,214.1395 $1.12 ETH <0.01% $0.147031 7.6159 $1.12 ETH <0.01% $0.00013 8,562.1192 $1.12 ETH <0.01% $0.004333 255.9911 $1.11 ETH <0.01% $0.000088 12,527.5346 $1.1 ETH <0.01% <$0.000001 276,301,265.8843 $1.09 ETH <0.01% $0.00379 288.4469 $1.09 ETH <0.01% $0.007288 149.3967 $1.09 ETH <0.01% $0.001725 623.2473 $1.08 ETH <0.01% $0.000195 5,459.0959 $1.07 ETH <0.01% $0.003999 265.4719 $1.06 ETH <0.01% $0.005451 194.7394 $1.06 ETH <0.01% $0.008824 119.7613 $1.06 ETH <0.01% <$0.000001 5,529,859,420.6317 $1.05 ETH <0.01% $0.000552 1,909.2244 $1.05 ETH <0.01% $0.019767 53.2501 $1.05 ETH <0.01% $0.000002 647,788.871 $1.04 ETH <0.01% $6.79 0.1498 $1.02 ETH <0.01% $0.030383 33.4395 $1.02 ETH <0.01% <$0.000001 403,935,651.2698 $1.01 ETH <0.01% $0.07251 13.9391 $1.01 ETH <0.01% $0.000167 6,041.9479 $1.01 ETH <0.01% <$0.000001 1,449,519,576.6019 $1 ETH <0.01% $0.009822 101.9863 $1 ETH <0.01% <$0.000001 5,640,028,757.435 $0.992 ETH <0.01% $0.000985 1,000.508 $0.9855 ETH <0.01% $0.00002 47,726.2484 $0.9773 ETH <0.01% $0.00037 2,632.7181 $0.975 ETH <0.01% <$0.000001 6,171,776,387.9176 $0.97 ETH <0.01% $0.042026 22.8457 $0.9601 ETH <0.01% $0.000343 2,794.2559 $0.957 ETH <0.01% $0.000097 9,818.7509 $0.9519 ETH <0.01% $0.00685 135.3154 $0.9269 ETH <0.01% $0.0001 9,199.1669 $0.9226 ETH <0.01% $9.55 0.096 $0.9167 ETH <0.01% <$0.000001 298,591,378.9638 $0.9112 ETH <0.01% $0.001067 848.0055 $0.9044 ETH <0.01% $0.000675 1,337.2306 $0.903 ETH <0.01% <$0.000001 808,823,621.5638 $0.8988 ETH <0.01% $0.000252 3,561.6534 $0.8986 ETH <0.01% $0.002163 414.8314 $0.8972 ETH <0.01% $0.001041 857.7191 $0.8932 ETH <0.01% <$0.000001 3,738,171,376.4149 $0.8911 ETH <0.01% <$0.000001 2,395,666.5787 $0.889 ETH <0.01% $0.001006 873.5057 $0.8783 ETH <0.01% <$0.000001 10,021,180.2762 $0.8781 ETH <0.01% $0.001407 621.6202 $0.8746 ETH <0.01% <$0.000001 120,696,921,060.7917 $0.8722 ETH <0.01% <$0.000001 266,471,968.7693 $0.8585 ETH <0.01% $0.094205 9.0863 $0.8559 ETH <0.01% $1.36 0.6219 $0.8488 ETH <0.01% $0.000382 2,218.5524 $0.848 ETH <0.01% $0.004899 172.8394 $0.8466 ETH <0.01% $0.00127 666.5987 $0.8465 ETH <0.01% <$0.000001 10,414,015.0427 $0.8462 ETH <0.01% $0.000048 17,435.3238 $0.8454 ETH <0.01% $0.001883 448.664 $0.8447 ETH <0.01% $0.067315 12.2478 $0.8244 ETH <0.01% $0.072959 11.281 $0.823 ETH <0.01% $0.000038 21,346.1301 $0.8177 ETH <0.01% <$0.000001 2,474,079,385.6125 $0.8163 ETH <0.01% $0.006743 121.0169 $0.8159 ETH <0.01% $0.002992 272.0773 $0.814 ETH <0.01% $0.002335 345.5133 $0.8066 ETH <0.01% $0.114289 7.0539 $0.8061 ETH <0.01% <$0.000001 4,560,263.4326 $0.8027 ETH <0.01% $0.226729 3.4901 $0.7913 ETH <0.01% <$0.000001 5,426,071,194.9999 $0.7899 ETH <0.01% $0.00001 81,723.4835 $0.7886 ETH <0.01% $0.000116 6,757.0702 $0.7864 ETH <0.01% $0.041076 19.1392 $0.7861 ETH <0.01% $0.003779 205.5853 $0.7769 ETH <0.01% <$0.000001 29,308,015.2271 $0.7705 ETH <0.01% $0.02623 29.3204 $0.769 ETH <0.01% $0.001048 730.6735 $0.7658 ETH <0.01% $0.001033 741.2429 $0.7653 ETH <0.01% $0.000469 1,625.2172 $0.762 ETH <0.01% <$0.000001 485,440,505.9813 $0.7606 ETH <0.01% $0.000002 368,864.7938 $0.7598 ETH <0.01% $0.026675 28.1738 $0.7515 ETH <0.01% $0.000169 4,419.8834 $0.7478 ETH <0.01% $94,759 0.00000778 $0.7372 ETH <0.01% <$0.000001 7,969,061,776.4648 $0.7328 ETH <0.01% <$0.000001 12,794,174.6681 $0.7321 ETH <0.01% $0.09079 8.0462 $0.7305 ETH <0.01% $0.003282 221.3156 $0.7264 ETH <0.01% $0.048593 14.9176 $0.7248 ETH <0.01% $0.034349 21.0662 $0.7236 ETH <0.01% $0.001639 437.9093 $0.7177 ETH <0.01% $0.000001 1,110,102.395 $0.7154 ETH <0.01% $0.004903 145.5652 $0.7137 ETH <0.01% $0.000122 5,817.6659 $0.7109 ETH <0.01% $0.501846 1.407 $0.706 ETH <0.01% $0.016236 43.4745 $0.7058 ETH <0.01% $0.087369 8.0363 $0.7021 ETH <0.01% $0.001648 423.9546 $0.6985 ETH <0.01% $0.000046 15,173.1233 $0.6963 ETH <0.01% $0.668182 1.0418 $0.6961 ETH <0.01% $1.97 0.3516 $0.6908 ETH <0.01% <$0.000001 91,375,026.3828 $0.6889 ETH <0.01% $0.000001 897,463.8137 $0.6821 ETH <0.01% <$0.000001 5,943,528.3941 $0.6678 ETH <0.01% $0.014506 45.977 $0.6669 ETH <0.01% $0.013183 50.1631 $0.6612 ETH <0.01% $0.000034 19,161.6283 $0.6539 ETH <0.01% $0.229362 2.8473 $0.653 ETH <0.01% <$0.000001 5,888,735.8606 $0.647 ETH <0.01% <$0.000001 1,727,046.9285 $0.6463 ETH <0.01% $0.173257 3.6811 $0.6377 ETH <0.01% $0.000069 9,111.8458 $0.6323 ETH <0.01% <$0.000001 1,781,733.5809 $0.6184 ETH <0.01% $0.000005 119,585.1834 $0.618 ETH <0.01% $0.000413 1,491.755 $0.6165 ETH <0.01% $0.002783 221.2434 $0.6157 ETH <0.01% $0.008229 74.6143 $0.614 ETH <0.01% $0.001676 355.1258 $0.595 ETH <0.01% $0.001234 479.8762 $0.5921 ETH <0.01% $0.000075 7,800.6684 $0.5871 ETH <0.01% <$0.000001 32,673,237.2896 $0.5868 ETH <0.01% <$0.000001 22,074,651.0403 $0.5774 ETH <0.01% $0.005035 114.5067 $0.5765 ETH <0.01% <$0.000001 7,055,107.8117 $0.5758 ETH <0.01% $0.044007 13.0522 $0.5743 ETH <0.01% $0.000204 2,783.0733 $0.569 ETH <0.01% <$0.000001 8,250,815,910.3917 $0.5601 ETH <0.01% $0.000106 5,268.7713 $0.5599 ETH <0.01% $0.000187 2,986.2456 $0.5591 ETH <0.01% $0.000008 67,851.2477 $0.5577 ETH <0.01% $0.069272 7.8538 $0.544 ETH <0.01% $0.001957 277.5597 $0.5431 ETH <0.01% <$0.000001 1,113,014,255.8145 $0.5397 ETH <0.01% $0.000362 1,473.0255 $0.5336 ETH <0.01% $0.000836 635.5319 $0.5314 ETH <0.01% $0.000526 1,001.8361 $0.5268 ETH <0.01% $0.000441 1,189.6079 $0.5246 ETH <0.01% $95,443 0.00000547 $0.522 ETH <0.01% $0.02068 25.0044 $0.517 ETH <0.01% $3.91 0.132 $0.5157 ETH <0.01% <$0.000001 523,428,570.3656 $0.514 ETH <0.01% $0.000017 29,820.0683 $0.4989 ETH <0.01% $0.010929 45.4293 $0.4964 ETH <0.01% <$0.000001 2,253,757.7191 $0.4944 ETH <0.01% $0.006307 78.1858 $0.4931 ETH <0.01% $0.496902 0.9863 $0.49 ETH <0.01% $0.001618 299.0302 $0.4839 ETH <0.01% $0.01062 45.1178 $0.4791 ETH <0.01% <$0.000001 3,001,428.8329 $0.4733 ETH <0.01% $0.000227 2,073.5957 $0.4706 ETH <0.01% $0.022097 21.2933 $0.4705 ETH <0.01% $0.000147 3,192.3515 $0.4678 ETH <0.01% $0.000007 68,288.2227 $0.467 ETH <0.01% $0.047652 9.6443 $0.4595 ETH <0.01% $0.000048 9,497.1727 $0.4546 ETH <0.01% $0.002256 201.4439 $0.4544 ETH <0.01% $0.004208 107.5038 $0.4523 ETH <0.01% $0.413791 1.0875 $0.45 ETH <0.01% $0.000296 1,515.5228 $0.4489 ETH <0.01% $0.069569 6.396 $0.4449 ETH <0.01% $0.038464 11.5541 $0.4444 ETH <0.01% $0.074072 5.9971 $0.4442 ETH <0.01% $0.022067 19.9943 $0.4412 ETH <0.01% $0.001923 228.3996 $0.4391 ETH <0.01% $0.006565 66.2407 $0.4348 ETH <0.01% <$0.000001 84,423,924,555,465.6 $0.4257 ETH <0.01% $0.000033 12,737.0232 $0.4232 ETH <0.01% $0.000011 37,101.178 $0.4229 ETH <0.01% $0.001148 368.0987 $0.4225 ETH <0.01% $1 0.4197 $0.4213 ETH <0.01% $0.000209 2,009.4106 $0.4197 ETH <0.01% <$0.000001 29,096,792.9115 $0.4185 ETH <0.01% $0.007096 58.6524 $0.4161 ETH <0.01% $0.000001 312,738.1141 $0.4048 ETH <0.01% <$0.000001 1,082,989.3867 $0.4036 ETH <0.01% $0.000192 2,090.9951 $0.4008 ETH <0.01% $0.000016 24,109.1396 $0.3975 ETH <0.01% $0.008798 44.9242 $0.3952 ETH <0.01% $0.202179 1.9383 $0.3918 ETH <0.01% $0.000266 1,468 $0.391 ETH <0.01% $0.125492 3.1156 $0.3909 ETH <0.01% <$0.000001 862,836.3441 $0.3879 ETH <0.01% $0.080841 4.7659 $0.3852 ETH <0.01% $0.989738 0.3722 $0.3683 ETH <0.01% $0.000077 4,745.1064 $0.3675 ETH <0.01% $0.004539 80.646 $0.366 ETH <0.01% $0.000343 1,067.9227 $0.3658 ETH <0.01% $0.000038 9,586.9933 $0.365 ETH <0.01% $0.000244 1,491.9481 $0.3643 ETH <0.01% $0.002461 147.4499 $0.3628 ETH <0.01% <$0.000001 133,649,389.1868 $0.3609 ETH <0.01% $0.001428 251.0263 $0.3584 ETH <0.01% $0.021673 16.5239 $0.3581 ETH <0.01% $0.001345 262.2949 $0.3529 ETH <0.01% <$0.000001 837,878,014.3907 $0.3526 ETH <0.01% $0.000392 896.7149 $0.3515 ETH <0.01% <$0.000001 1,259,334,226.6268 $0.3483 ETH <0.01% $0.00036 964.6697 $0.3475 ETH <0.01% <$0.000001 10,794,940,080,737,304 $0.3454 ETH <0.01% $0.054634 6.3152 $0.345 ETH <0.01% <$0.000001 3,103,332,927.6931 $0.338 ETH <0.01% $0.000247 1,366.0617 $0.3375 ETH <0.01% $0.049794 6.7104 $0.3341 ETH <0.01% $0.507712 0.6557 $0.3329 ETH <0.01% $0.745853 0.4453 $0.3321 ETH <0.01% $0.000055 5,944.5109 $0.3294 ETH <0.01% $0.000001 500,493.7082 $0.3277 ETH <0.01% $0.000073 4,401.8258 $0.3226 ETH <0.01% <$0.000001 174,248,266.6663 $0.316 ETH <0.01% $0.000132 2,377.4585 $0.3142 ETH <0.01% $0.000492 634.9702 $0.3126 ETH <0.01% $1.14 0.2734 $0.3116 ETH <0.01% $12.32 0.0246 $0.303 ETH <0.01% $0.000039 7,640.2741 $0.3008 ETH <0.01% $0.000461 646.5602 $0.2982 ETH <0.01% <$0.000001 242,154,639.854 $0.2977 ETH <0.01% $0.098668 2.9388 $0.2899 ETH <0.01% $0.543553 0.5285 $0.2872 ETH <0.01% $0.00003 9,443.5979 $0.2855 ETH <0.01% <$0.000001 12,439,543.351 $0.2837 ETH <0.01% $0.001226 222.3988 $0.2726 ETH <0.01% $0.057792 4.7011 $0.2716 ETH <0.01% $43.65 0.00618391 $0.2699 ETH <0.01% <$0.000001 6,290,322.3143 $0.2627 ETH <0.01% $0.008802 29.5371 $0.2599 ETH <0.01% $0.003463 74.8353 $0.2591 ETH <0.01% <$0.000001 2,341,196.583 $0.2591 ETH <0.01% <$0.000001 914,904.1944 $0.2573 ETH <0.01% $0.003442 73.3951 $0.2526 ETH <0.01% $0.00135 185.1776 $0.25 ETH <0.01% <$0.000001 2,145,122,487,873.7021 $0.2455 ETH <0.01% $0.008131 29.7962 $0.2422 ETH <0.01% $0.057646 4.1675 $0.2402 ETH <0.01% $33.08 0.00722517 $0.239 ETH <0.01% <$0.000001 4,104,781,824.611 $0.2327 ETH <0.01% $0.060745 3.7873 $0.23 ETH <0.01% $0.006906 33.1404 $0.2288 ETH <0.01% <$0.000001 826,353,372.1459 $0.2276 ETH <0.01% $0.000542 416.5447 $0.2257 ETH <0.01% $0.000105 2,107.7981 $0.2222 ETH <0.01% $0.026662 8.3219 $0.2218 ETH <0.01% $0.022903 9.5628 $0.219 ETH <0.01% $23.12 0.00944467 $0.2183 ETH <0.01% $0.000405 535.4898 $0.2166 ETH <0.01% $0.000392 551.3847 $0.2159 ETH <0.01% $0.005068 42.5912 $0.2158 ETH <0.01% $0.000276 780.3632 $0.2154 ETH <0.01% $0.044993 4.7325 $0.2129 ETH <0.01% $0.000045 4,696.5487 $0.2126 ETH <0.01% <$0.000001 385,790,791,760.5448 $0.2081 ETH <0.01% $94,621 0.00000218 $0.2062 ETH <0.01% $0.180127 1.1321 $0.2039 ETH <0.01% <$0.000001 624,286.5776 $0.2037 ETH <0.01% $0.000006 31,344.008 $0.2024 ETH <0.01% $0.000167 1,213.0632 $0.2021 ETH <0.01% $1.53 0.1319 $0.2017 ETH <0.01% $0.038503 5.2186 $0.2009 ETH <0.01% $0.00001 19,181.215 $0.1991 ETH <0.01% $0.020868 9.1805 $0.1915 ETH <0.01% $0.000022 8,799.5002 $0.1911 ETH <0.01% $0.000202 927.8739 $0.1874 ETH <0.01% $0.024409 7.6214 $0.186 ETH <0.01% $0.624021 0.2959 $0.1846 ETH <0.01% <$0.000001 3,549,276.0116 $0.1821 ETH <0.01% $0.000006 28,795.4155 $0.1793 ETH <0.01% $0.000166 1,071.3034 $0.1778 ETH <0.01% $0.001254 141.3303 $0.1772 ETH <0.01% $0.001486 117.9569 $0.1752 ETH <0.01% $0.639119 0.266 $0.1699 ETH <0.01% <$0.000001 1,445,832.7905 $0.1683 ETH <0.01% $0.203489 0.8244 $0.1677 ETH <0.01% $0.000001 144,764.8718 $0.1668 ETH <0.01% $0.004143 40.0058 $0.1657 ETH <0.01% $0.020993 7.7428 $0.1625 ETH <0.01% $0.999942 0.1618 $0.1617 ETH <0.01% $0.000255 622.9285 $0.1588 ETH <0.01% $0.020815 7.5458 $0.157 ETH <0.01% $0.006831 22.9412 $0.1567 ETH <0.01% $0.000001 140,171.0739 $0.1555 ETH <0.01% $0.021424 7.1739 $0.1536 ETH <0.01% $0.040755 3.7381 $0.1523 ETH <0.01% $0.075593 2 $0.1511 ETH <0.01% $1 0.1499 $0.1503 ETH <0.01% <$0.000001 327,037,992,964.7354 $0.1496 ETH <0.01% $1.02 0.1465 $0.1488 ETH <0.01% <$0.000001 1,387,669.7049 $0.1453 ETH <0.01% <$0.000001 380,504.9603 $0.1448 ETH <0.01% $0.000048 2,963.9464 $0.1436 ETH <0.01% $0.437481 0.3253 $0.1422 ETH <0.01% $0.000001 188,884.4924 $0.1415 ETH <0.01% $0.000321 438.9192 $0.1408 ETH <0.01% <$0.000001 1,583,002,851.599 $0.1349 ETH <0.01% <$0.000001 298,360,423.0509 $0.1301 ETH <0.01% $0.014809 8.6551 $0.1281 ETH <0.01% $0.002479 50.5337 $0.1252 ETH <0.01% $59.17 0.00211695 $0.1252 ETH <0.01% $0.00079 158.218 $0.1249 ETH <0.01% $0.000371 332.7608 $0.1233 ETH <0.01% $0.50144 0.2458 $0.1232 ETH <0.01% $0.003074 39.3005 $0.1208 ETH <0.01% $0.008121 14.6016 $0.1185 ETH <0.01% $0.008231 14.2816 $0.1175 ETH <0.01% $3,320.3 0.000035 $0.1162 ETH <0.01% $0.001376 83.2395 $0.1145 ETH <0.01% $0.000003 43,069.1543 $0.1135 ETH <0.01% $0.021371 5.2567 $0.1123 ETH <0.01% $0.028523 3.8356 $0.1094 ETH <0.01% $0.02062 5.2167 $0.1075 ETH <0.01% $0.048467 2.1887 $0.106 ETH <0.01% $0.015989 6.4348 $0.1028 FTM <0.01% <$0.000001 13,954,983,412.3294 $2,403.05 FTM <0.01% $95,417 0.02 $1,911.11 FTM <0.01% $346.22 3.2449 $1,123.43 FTM <0.01% $3,314.66 0.1766 $585.36 FTM <0.01% $89,985 0.00236731 $213.02 FTM <0.01% $0.065574 1,196.2004 $78.44 FTM <0.01% $0.003455 21,773.8204 $75.24 FTM <0.01% $22.83 3.2883 $75.07 FTM <0.01% $0.008584 8,663.7407 $74.37 FTM <0.01% $0.171621 356.2957 $61.15 FTM <0.01% $0.001208 47,978.6601 $57.98 FTM <0.01% $327.43 0.1687 $55.24 FTM <0.01% $0.039279 1,288.1754 $50.6 FTM <0.01% $8,706.32 0.00577655 $50.29 FTM <0.01% $0.035531 1,191.0847 $42.32 FTM <0.01% $0.302378 138.7878 $41.97 FTM <0.01% $0.037932 1,079.5737 $40.95 FTM <0.01% $1.46 25.3624 $37.03 FTM <0.01% $0.306397 97.6386 $29.92 FTM <0.01% $0.97998 30.0721 $29.47 FTM <0.01% $0.20702 133.6598 $27.67 FTM <0.01% <$0.000001 122,643,525,636.9755 $24.53 FTM <0.01% $0.999296 24.3459 $24.33 FTM <0.01% $0.000276 84,902.5262 $23.43 FTM <0.01% <$0.000001 135,054,741.9053 $22.88 FTM <0.01% $1.05 19.4988 $20.38 FTM <0.01% $0.981503 17.4276 $17.11 FTM <0.01% $1.42 10.9049 $15.48 FTM <0.01% $0.289494 53.0312 $15.35 FTM <0.01% $1.82 8.3951 $15.28 FTM <0.01% $0.000001 9,403,693.7627 $12.6 FTM <0.01% $27.63 0.3364 $9.29 FTM <0.01% $1.14 8.0344 $9.16 FTM <0.01% $0.582382 15.5051 $9.03 FTM <0.01% $0.000331 25,050.3094 $8.29 FTM <0.01% $0.00003 256,692.7093 $7.77 FTM <0.01% $0.479656 12.9269 $6.2 FTM <0.01% $24.69 0.2426 $5.99 FTM <0.01% $0.999334 5.8945 $5.89 FTM <0.01% $0.993024 5.8812 $5.84 FTM <0.01% <$0.000001 24,594,210,750.0157 $4.92 FTM <0.01% $0.000073 54,292.1499 $3.97 FTM <0.01% $0.005038 725.077 $3.65 FTM <0.01% $0.000749 4,401.7632 $3.3 FTM <0.01% $0.77649 3.737 $2.9 FTM <0.01% $0.008386 341.6968 $2.87 FTM <0.01% $0.068206 36.8874 $2.52 FTM <0.01% $3.41 0.6885 $2.35 FTM <0.01% $0.001256 1,638.9962 $2.06 FTM <0.01% $2.02 0.873 $1.76 FTM <0.01% $0.007642 197.7326 $1.51 FTM <0.01% $102.11 0.0146 $1.49 FTM <0.01% $2.51 0.5011 $1.26 FTM <0.01% $0.525364 2.2177 $1.17 FTM <0.01% $0.702018 1.4376 $1.01 FTM <0.01% $0.000073 12,669.1979 $0.9187 FTM <0.01% <$0.000001 7,617,511.2661 $0.8546 FTM <0.01% $1.07 0.7898 $0.8474 FTM <0.01% $3,312.93 0.00019323 $0.6401 FTM <0.01% $0.994875 0.6357 $0.6324 FTM <0.01% $0.000239 2,522.3848 $0.6036 FTM <0.01% $0.021584 27.9449 $0.6031 FTM <0.01% $0.998621 0.4681 $0.4674 FTM <0.01% $0.018546 17.8151 $0.3304 FTM <0.01% $0.225852 1.3799 $0.3116 FTM <0.01% $0.994875 0.2697 $0.2683 FTM <0.01% $0.000154 1,470.6025 $0.2269 FTM <0.01% $0.003806 55.4961 $0.2112 FTM <0.01% <$0.000001 500,107,275.3277 $0.20 FTM <0.01% $0.018349 9.9323 $0.1822 FTM <0.01% $0.000099 1,828.4031 $0.1815 FTM <0.01% $0.011961 14.7591 $0.1765 FTM <0.01% $0.000009 16,356.4495 $0.1542 FTM <0.01% $0.039118 3.1177 $0.1219 FTM <0.01% $0.025185 4.0347 $0.1016 POL <0.01% $0.00375 134,128.6516 $503.04 POL <0.01% $0.004571 109,750.3825 $501.68 POL <0.01% $0.022075 7,300.0845 $161.15 POL <0.01% $346.26 0.3487 $120.76 POL <0.01% $0.013225 7,688.5043 $101.68 POL <0.01% $0.48051 185.0486 $88.92 POL <0.01% $0.999742 87.2589 $87.24 POL <0.01% <$0.000001 6,673,764,822.0134 $86.09 POL <0.01% $0.004857 17,565.3046 $85.32 POL <0.01% $0.973871 85.032 $82.81 POL <0.01% $0.179967 457.9446 $82.41 POL <0.01% $22.84 3.5351 $80.74 POL <0.01% $0.998701 74.9647 $74.87 POL <0.01% $0.736147 100.2581 $73.8 POL <0.01% $0.004075 17,854.3058 $72.76 POL <0.01% $3,313.37 0.0217 $71.83 POL <0.01% $0.042297 1,642.3071 $69.47 POL <0.01% $0.02518 2,546.6434 $64.12 POL <0.01% $183.8 0.3352 $61.62 POL <0.01% $0.999927 60.5662 $60.56 POL <0.01% $0.003093 19,028.8834 $58.86 POL <0.01% $0.208781 257.9283 $53.85 POL <0.01% $0.192246 280.0933 $53.85 POL <0.01% <$0.000001 1,317,160,948.7478 $47.68 POL <0.01% $0.207271 228.5722 $47.38 POL <0.01% $14.03 3.196 $44.84 POL <0.01% $0.013845 3,214.5471 $44.51 POL <0.01% $1.46 30.3863 $44.36 POL <0.01% $0.842213 52.147 $43.92 POL <0.01% $0.002594 16,563.6262 $42.96 POL <0.01% $0.004361 9,670.1521 $42.17 POL <0.01% $3.68 11.4059 $41.97 POL <0.01% $0.133384 311.8661 $41.6 POL <0.01% $1.01 37.6058 $37.79 POL <0.01% $0.173402 214.3811 $37.17 POL <0.01% $0.190609 189.8484 $36.19 POL <0.01% $0.292614 119.7578 $35.04 POL <0.01% $1.83 18.8973 $34.58 POL <0.01% $0.001857 18,591.6702 $34.52 POL <0.01% $2.02 17.0053 $34.35 POL <0.01% $0.00072 44,732.2069 $32.22 POL <0.01% $15.19 2.1153 $32.13 POL <0.01% $0.173425 182.717 $31.69 POL <0.01% $0.000674 45,862.1982 $30.92 POL <0.01% $5.35 5.4646 $29.24 POL <0.01% $0.208802 136.9328 $28.59 POL <0.01% $0.000005 5,926,100.2343 $28.15 POL <0.01% $0.005384 5,194.9 $27.97 POL <0.01% $0.428789 63.8882 $27.39 POL <0.01% $0.061755 440.3032 $27.19 POL <0.01% $0.665486 40.4731 $26.93 POL <0.01% $3 8.6889 $26.07 POL <0.01% $327.44 0.0783 $25.64 POL <0.01% $0.04685 539.2176 $25.26 POL <0.01% $0.010753 2,330.4393 $25.06 POL <0.01% $0.10736 227.514 $24.43 POL <0.01% $0.006238 3,769.503 $23.51 POL <0.01% $0.008338 2,624.9788 $21.89 POL <0.01% $0.149514 132.5524 $19.82 POL <0.01% $0.035546 517.5582 $18.4 POL <0.01% $0.003813 4,733.5176 $18.05 POL <0.01% $0.5693 31.4028 $17.88 POL <0.01% $1.25 13.3976 $16.75 POL <0.01% $0.000009 1,835,491.1016 $16.08 POL <0.01% $6.87 2.3209 $15.94 POL <0.01% $1.63 9.4049 $15.33 POL <0.01% $0.000022 698,412.7567 $15.25 POL <0.01% <$0.000001 76,444,434.3221 $14.43 POL <0.01% $2.52 5.2108 $13.13 POL <0.01% $0.01102 1,116.8003 $12.31 POL <0.01% $0.999742 12.2132 $12.21 POL <0.01% $0.002635 4,597.9146 $12.11 POL <0.01% $0.000032 378,008.7286 $12.06 POL <0.01% $0.026205 453.8055 $11.89 POL <0.01% $0.003054 3,724.4251 $11.37 POL <0.01% $0.000751 14,664.1416 $11.01 POL <0.01% $1.73 6.033 $10.44 POL <0.01% $0.000022 468,727.4728 $10.2 POL <0.01% $1.05 9.6302 $10.12 POL <0.01% $0.5392 18.1184 $9.77 POL <0.01% $2,641.45 0.00345786 $9.13 POL <0.01% $0.042838 205.6025 $8.81 POL <0.01% $0.001086 7,773.8916 $8.45 POL <0.01% $0.010763 777.6132 $8.37 POL <0.01% $0.006047 1,373.5896 $8.31 POL <0.01% $0.013909 588.3083 $8.18 POL <0.01% $0.567616 14.2257 $8.07 POL <0.01% $0.02288 347.4016 $7.95 POL <0.01% $0.302517 24.6268 $7.45 POL <0.01% $0.001341 5,546.8288 $7.44 POL <0.01% $0.006363 1,168.5321 $7.43 POL <0.01% $0.003699 1,915.0809 $7.08 POL <0.01% $0.993012 7.0549 $7.01 POL <0.01% $0.02185 314.4162 $6.87 POL <0.01% $1.17 5.622 $6.58 POL <0.01% $0.2451 25.8448 $6.33 POL <0.01% $0.001749 3,528.916 $6.17 POL <0.01% $0.007708 791.5603 $6.1 POL <0.01% $0.004423 1,321.7005 $5.85 POL <0.01% $0.00499 1,167.1979 $5.82 POL <0.01% $0.000825 6,810.1142 $5.62 POL <0.01% $0.006089 875.1505 $5.33 POL <0.01% $0.17344 30.5886 $5.31 POL <0.01% <$0.000001 19,701,703.7293 $5.2 POL <0.01% $95,451 0.00005435 $5.19 POL <0.01% $0.003957 1,300.2859 $5.14 POL <0.01% $0.037209 134.325 $5 POL <0.01% $0.018963 259.3787 $4.92 POL <0.01% $0.000396 12,303.3886 $4.88 POL <0.01% $0.355104 13.7075 $4.87 POL <0.01% $0.01458 332.3326 $4.85 POL <0.01% <$0.000001 317,050,637.7847 $4.82 POL <0.01% $0.002494 1,859.5842 $4.64 POL <0.01% $0.129717 34.6682 $4.5 POL <0.01% $3.04 1.4368 $4.37 POL <0.01% $0.02798 148.8266 $4.16 POL <0.01% $0.000705 5,828.4273 $4.11 POL <0.01% $0.000407 10,068.3669 $4.1 POL <0.01% $0.027339 143.1559 $3.91 POL <0.01% $0.010523 363.1889 $3.82 POL <0.01% $0.000388 9,588.2545 $3.72 POL <0.01% $0.000001 3,357,613.6974 $3.6 POL <0.01% $0.002603 1,269.7704 $3.31 POL <0.01% $1.01 3.2053 $3.22 POL <0.01% $0.001398 2,265.323 $3.17 POL <0.01% $7.1 0.4253 $3.02 POL <0.01% $0.681299 4.2738 $2.91 POL <0.01% $1.04 2.7869 $2.9 POL <0.01% $0.048049 56.6879 $2.72 POL <0.01% $0.00004 66,049.2736 $2.67 POL <0.01% $0.001278 2,024.106 $2.59 POL <0.01% $1.01 2.5735 $2.59 POL <0.01% $0.553959 4.4412 $2.46 POL <0.01% $0.117752 20.8539 $2.46 POL <0.01% $0.007434 323.9784 $2.41 POL <0.01% $0.014798 160.2303 $2.37 POL <0.01% $0.001176 1,983.0165 $2.33 POL <0.01% $0.480173 4.5632 $2.19 POL <0.01% $0.197716 10.9691 $2.17 POL <0.01% $0.000836 2,438.467 $2.04 POL <0.01% $0.006289 320.2673 $2.01 POL <0.01% $0.002497 789.7861 $1.97 POL <0.01% $0.010454 177.797 $1.86 POL <0.01% $0.000088 20,607.3293 $1.82 POL <0.01% $0.110481 15.7058 $1.74 POL <0.01% $0.000162 10,316.742 $1.67 POL <0.01% $0.00499 326.048 $1.63 POL <0.01% $0.100497 15.9263 $1.6 POL <0.01% $0.295646 5.3596 $1.58 POL <0.01% $0.849209 1.8485 $1.57 POL <0.01% $0.007182 197.1324 $1.42 POL <0.01% $0.10759 12.9503 $1.39 POL <0.01% $36.84 0.0346 $1.27 POL <0.01% $0.001812 691.4906 $1.25 POL <0.01% $23.74 0.0516 $1.22 POL <0.01% $0.039118 30.9862 $1.21 POL <0.01% $0.437182 2.7671 $1.21 POL <0.01% $0.010453 115.6181 $1.21 POL <0.01% $0.0001 11,823.1588 $1.18 POL <0.01% $80.62 0.0145 $1.17 POL <0.01% $0.045563 24.4535 $1.11 POL <0.01% $0.005049 218.3545 $1.1 POL <0.01% $0.0037 293.6019 $1.09 POL <0.01% $0.001092 961.1919 $1.05 POL <0.01% $0.000002 518,186.0942 $1.04 POL <0.01% $0.001 1,033.4779 $1.03 POL <0.01% $0.001023 1,001.2987 $1.02 POL <0.01% $0.002073 462.2194 $0.958 POL <0.01% $0.006356 148.8307 $0.9459 POL <0.01% $0.003644 248.5945 $0.9059 POL <0.01% $0.011335 73.5431 $0.8336 POL <0.01% $0.001067 705.1697 $0.7521 POL <0.01% $0.114036 6.4161 $0.7316 POL <0.01% $0.26658 2.611 $0.696 POL <0.01% $0.000057 12,270.7377 $0.6939 POL <0.01% $0.99996 0.6672 $0.6671 POL <0.01% $0.097025 6.6222 $0.6425 POL <0.01% $0.077539 7.9811 $0.6188 POL <0.01% $0.754607 0.7768 $0.5861 POL <0.01% $0.000238 2,285.97 $0.5449 POL <0.01% $0.001493 362.8155 $0.5418 POL <0.01% $0.001751 308.9757 $0.541 POL <0.01% $0.000351 1,469.731 $0.5158 POL <0.01% $0.000026 19,601.766 $0.5155 POL <0.01% $0.077211 6.5772 $0.5078 POL <0.01% $0.000342 1,478.5453 $0.5061 POL <0.01% $0.009324 53.8251 $0.5018 POL <0.01% $0.002272 210.9877 $0.4793 POL <0.01% $0.02042 23.1309 $0.4723 POL <0.01% $0.004399 105.5899 $0.4644 POL <0.01% $0.000001 412,496.7379 $0.4537 POL <0.01% $0.140704 3.1342 $0.4409 POL <0.01% $0.000194 2,204.8653 $0.4271 POL <0.01% $0.002834 141.5864 $0.4012 POL <0.01% $0.001977 186.5294 $0.3687 POL <0.01% $0.046517 7.654 $0.356 POL <0.01% $1.04 0.34 $0.3549 POL <0.01% $0.079454 4.4276 $0.3517 POL <0.01% $0.999934 0.3354 $0.3353 POL <0.01% $0.001101 303.232 $0.3339 POL <0.01% $0.993388 0.3273 $0.3251 POL <0.01% <$0.000001 1,894,375.3497 $0.3233 POL <0.01% $0.001597 201.9112 $0.3225 POL <0.01% $0.001119 286.6951 $0.3208 POL <0.01% $0.002447 124.3261 $0.3042 POL <0.01% $0.558695 0.4795 $0.2678 POL <0.01% $0.000138 1,929.8292 $0.266 POL <0.01% $0.019114 13.8952 $0.2655 POL <0.01% $0.052358 4.7389 $0.2481 POL <0.01% $1.08 0.2286 $0.2473 POL <0.01% $0.000298 816.0405 $0.2428 POL <0.01% $0.52813 0.4572 $0.2414 POL <0.01% $0.000162 1,488.18 $0.241 POL <0.01% $0.000118 1,977.6194 $0.2337 POL <0.01% $0.014455 15.6773 $0.2266 POL <0.01% $0.006089 36.2646 $0.2208 POL <0.01% $0.000979 216.1936 $0.2117 POL <0.01% $0.141429 1.4739 $0.2084 POL <0.01% $67.2 0.00306559 $0.206 POL <0.01% $0.217129 0.9351 $0.203 POL <0.01% $0.000006 31,706.637 $0.1921 POL <0.01% $0.547317 0.329 $0.18 POL <0.01% $0.000707 253.3506 $0.1789 POL <0.01% $0.000218 747.1141 $0.1627 POL <0.01% $0.00031 508.6217 $0.1577 POL <0.01% $0.001034 150.8251 $0.1559 POL <0.01% $0.003035 51.368 $0.1559 POL <0.01% $0.001314 117.0869 $0.1538 POL <0.01% $0.323358 0.4453 $0.1439 POL <0.01% $0.000011 12,387.7625 $0.142 POL <0.01% $0.005587 23.0447 $0.1287 POL <0.01% $0.00001 11,641.9804 $0.1195 POL <0.01% $0.061402 1.936 $0.1188 POL <0.01% $22.25 0.00523267 $0.1164 POL <0.01% $0.027405 3.7552 $0.1029 ARB <0.01% $344.82 0.8228 $283.73 ARB <0.01% $0.998201 96.2502 $96.08 ARB <0.01% $0.229929 327.2569 $75.25 ARB <0.01% $0.998201 74.5125 $74.38 ARB <0.01% $27.72 2.5765 $71.42 ARB <0.01% $3,308.14 0.0182 $60.17 ARB <0.01% $0.998868 54.1608 $54.1 ARB <0.01% $1.44 37.4745 $53.96 ARB <0.01% $0.103755 469.2099 $48.68 ARB <0.01% $0.080382 598.0159 $48.07 ARB <0.01% $0.068168 690.934 $47.1 ARB <0.01% $0.002952 15,939.6453 $47.05 ARB <0.01% $0.177352 250.7912 $44.48 ARB <0.01% $0.207295 201.732 $41.82 ARB <0.01% $0.011729 3,406.4992 $39.96 ARB <0.01% $1.72 20.4224 $35.13 ARB <0.01% $0.774174 40.0065 $30.97 ARB <0.01% <$0.000001 95,456,068,253.461 $28.64 ARB <0.01% $1.82 14.9767 $27.26 ARB <0.01% $0.057762 458.8358 $26.5 ARB <0.01% $0.042117 620.4814 $26.13 ARB <0.01% $0.023698 1,098.8061 $26.04 ARB <0.01% $0.754483 26.8712 $20.27 ARB <0.01% $0.000009 2,116,781.6132 $18.71 ARB <0.01% $22.66 0.8147 $18.46 ARB <0.01% $0.263209 69.9449 $18.41 ARB <0.01% $0.997952 18.3982 $18.36 ARB <0.01% $1,119.98 0.0151 $16.95 ARB <0.01% $0.000744 21,055.3062 $15.67 ARB <0.01% $0.538574 25.8246 $13.91 ARB <0.01% $13.93 0.9868 $13.75 ARB <0.01% $0.83221 15.8729 $13.21 ARB <0.01% $0.023229 494.1694 $11.48 ARB <0.01% $0.30115 35.7632 $10.77 ARB <0.01% $3.63 2.8125 $10.21 ARB <0.01% $4.96 2.0396 $10.12 ARB <0.01% $0.38738 25.1658 $9.75 ARB <0.01% $0.749948 12.8655 $9.65 ARB <0.01% $0.000018 506,963.1983 $9.02 ARB <0.01% <$0.000001 1,590,568,335.0201 $8.59 ARB <0.01% $4 2.1012 $8.4 ARB <0.01% $0.205703 35.8608 $7.38 ARB <0.01% $0.016925 426.9769 $7.23 ARB <0.01% $0.041312 164.7227 $6.81 ARB <0.01% $0.000861 7,869.0004 $6.77 ARB <0.01% $0.099514 67.1091 $6.68 ARB <0.01% $0.05548 114.9731 $6.38 ARB <0.01% <$0.000001 32,306,444.7325 $6.16 ARB <0.01% $0.121146 45.6342 $5.53 ARB <0.01% $0.005825 867.9291 $5.06 ARB <0.01% $0.000004 1,154,905.1239 $4.89 ARB <0.01% $0.009456 491.869 $4.65 ARB <0.01% $0.002779 1,553.9629 $4.32 ARB <0.01% $0.000016 256,029.3592 $4.21 ARB <0.01% $0.050628 80.6665 $4.08 ARB <0.01% $0.002516 1,433.6157 $3.61 ARB <0.01% $0.416868 7.9047 $3.3 ARB <0.01% <$0.000001 22,543,865.6504 $3.29 ARB <0.01% <$0.000001 11,858,373.3203 $3.12 ARB <0.01% $0.193697 14.8709 $2.88 ARB <0.01% $0.01447 194.8958 $2.82 ARB <0.01% $0.011861 233.6258 $2.77 ARB <0.01% $1.04 2.1193 $2.2 ARB <0.01% $0.008353 261.5389 $2.18 ARB <0.01% $0.522867 4.0008 $2.09 ARB <0.01% $1 1.9401 $1.94 ARB <0.01% $0.991769 1.9324 $1.92 ARB <0.01% $2.51 0.697 $1.75 ARB <0.01% $0.056594 29.7149 $1.68 ARB <0.01% $0.993368 1.6583 $1.65 ARB <0.01% $1.97 0.8148 $1.61 ARB <0.01% $0.003678 421.1647 $1.55 ARB <0.01% $0.032426 45.122 $1.46 ARB <0.01% $0.003276 444.6576 $1.46 ARB <0.01% $0.992923 1.3233 $1.31 ARB <0.01% $43.62 0.03 $1.31 ARB <0.01% $0.028199 34.294 $0.967 ARB <0.01% <$0.000001 13,290,266.2802 $0.9662 ARB <0.01% $0.000023 40,056.2407 $0.9136 ARB <0.01% $0.997751 0.8076 $0.8058 ARB <0.01% $0.0261 28.0233 $0.7314 ARB <0.01% $0.006062 118.6269 $0.7191 ARB <0.01% $0.961313 0.7464 $0.7175 ARB <0.01% $1.54 0.3693 $0.5686 ARB <0.01% $0.194978 2.8312 $0.552 ARB <0.01% $0.079837 6.6917 $0.5342 ARB <0.01% $0.172443 3.0875 $0.5324 ARB <0.01% <$0.000001 1,327,736,085.29 $0.531 ARB <0.01% $0.148184 3.3895 $0.5022 ARB <0.01% $0.001049 461.4691 $0.4838 ARB <0.01% $0.056104 8.5155 $0.4777 ARB <0.01% $95,077 0.00000461 $0.4383 ARB <0.01% $0.144038 2.7992 $0.4031 ARB <0.01% $0.043227 9.2448 $0.3996 ARB <0.01% $0.029222 13.5836 $0.3969 ARB <0.01% $0.000009 39,594.8597 $0.3745 ARB <0.01% $0.029123 9.9103 $0.2886 ARB <0.01% $0.000058 4,965.7938 $0.2881 ARB <0.01% $0.059752 4.5965 $0.2746 ARB <0.01% $2.37 0.1126 $0.2669 ARB <0.01% $0.022937 11.5836 $0.2656 ARB <0.01% $0.002314 103.2439 $0.2389 ARB <0.01% $0.000026 7,728.1513 $0.2037 ARB <0.01% $0.000105 1,433.8633 $0.1506 ARB <0.01% $0.003771 36.2122 $0.1365 ARB <0.01% $0.997481 0.1323 $0.1319 ARB <0.01% <$0.000001 1,166,708,643.6064 $0.1166 ARB <0.01% $0.001279 79.4938 $0.1016 AVAX <0.01% $346.1 0.6358 $220.05 AVAX <0.01% $0.000106 1,845,270.7827 $195.25 AVAX <0.01% $0.00297 54,798.4018 $162.76 AVAX <0.01% $0.999095 95.7295 $95.64 AVAX <0.01% $0.999954 91.1334 $91.13 AVAX <0.01% $327.44 0.2548 $83.44 AVAX <0.01% $0.572163 120.569 $68.99 AVAX <0.01% $95,297.51 0.00068346 $65.13 AVAX <0.01% $0.333678 194.449 $64.88 AVAX <0.01% $36.86 1.5917 $58.67 AVAX <0.01% $0.000002 31,788,264.9638 $49.91 AVAX <0.01% $27.9 1.6817 $46.92 AVAX <0.01% $0.016557 2,147.2011 $35.55 AVAX <0.01% $0.999954 29.2797 $29.28 AVAX <0.01% $0.390433 70.2123 $27.41 AVAX <0.01% $0.008042 3,193.0011 $25.68 AVAX <0.01% $0.036551 697.5703 $25.5 AVAX <0.01% $0.034807 723.1155 $25.17 AVAX <0.01% $0.002463 9,332.2685 $22.98 AVAX <0.01% $1 22.6521 $22.65 AVAX <0.01% $462.56 0.0389 $18 AVAX <0.01% $0.12478 118.2869 $14.76 AVAX <0.01% $1 14.535 $14.55 AVAX <0.01% $43.47 0.307 $13.35 AVAX <0.01% $0.00075 16,098.6175 $12.07 AVAX <0.01% $5 2.3465 $11.73 AVAX <0.01% $0.000003 3,236,160.1679 $9.68 AVAX <0.01% $0.000012 769,192.1731 $9.33 AVAX <0.01% $0.009434 831.2894 $7.84 AVAX <0.01% <$0.000001 113,682,043.9436 $7.59 AVAX <0.01% $0.999095 6.5093 $6.5 AVAX <0.01% $0.064704 83.8411 $5.42 AVAX <0.01% $0.302518 17.6656 $5.34 AVAX <0.01% $0.008 629.0004 $5.03 AVAX <0.01% $0.007182 656.0608 $4.71 AVAX <0.01% $0.000866 5,426.7406 $4.7 AVAX <0.01% $0.99595 4.5257 $4.51 AVAX <0.01% $0.000117 34,511.3357 $4.05 AVAX <0.01% $0.000425 8,680.3173 $3.69 AVAX <0.01% $0.971256 3.6881 $3.58 AVAX <0.01% <$0.000001 200,960,610.8383 $3.58 AVAX <0.01% $0.995857 3.5748 $3.56 AVAX <0.01% $22.85 0.1447 $3.31 AVAX <0.01% $0.000737 3,621.7052 $2.67 AVAX <0.01% $0.001979 1,181.8378 $2.34 AVAX <0.01% $1.46 1.4938 $2.18 AVAX <0.01% $0.020502 105.5094 $2.16 AVAX <0.01% $1 1.7059 $1.71 AVAX <0.01% $0.027339 61.8792 $1.69 AVAX <0.01% $24.91 0.0504 $1.26 AVAX <0.01% $14.03 0.0808 $1.13 AVAX <0.01% $0.140941 6.6148 $0.9322 AVAX <0.01% $0.000003 328,743.8887 $0.858 AVAX <0.01% $0.080845 10.1888 $0.8237 AVAX <0.01% $0.002492 292.5373 $0.7288 AVAX <0.01% $0.001212 589.9913 $0.7151 AVAX <0.01% $5.35 0.1303 $0.6972 AVAX <0.01% $3.43 0.1585 $0.5433 AVAX <0.01% $0.012278 44.0043 $0.5402 AVAX <0.01% $0.000022 23,450.264 $0.5102 AVAX <0.01% $0.065712 5.2545 $0.3452 AVAX <0.01% $0.000019 18,333.4 $0.3437 AVAX <0.01% $0.111668 3.0426 $0.3397 AVAX <0.01% $0.080708 4.1771 $0.3371 AVAX <0.01% $95,474 0.00000344 $0.3284 AVAX <0.01% $0.208869 1.2857 $0.2685 AVAX <0.01% $0.000988 264.305 $0.261 AVAX <0.01% $0.0014 166.4385 $0.2329 AVAX <0.01% $0.000161 1,409.8189 $0.2271 AVAX <0.01% $0.926518 0.213 $0.1973 AVAX <0.01% $0.035546 5.3575 $0.1904 AVAX <0.01% $0.002832 64.3434 $0.1822 AVAX <0.01% $0.000066 2,752.8409 $0.1814 AVAX <0.01% $0.385429 0.464 $0.1788 AVAX <0.01% $0.010761 12.4835 $0.1343 AVAX <0.01% $0.003633 36.5848 $0.1328 AVAX <0.01% $0.526198 0.2012 $0.1058 AVAX <0.01% <$0.000001 635,268.4102 $0.1039 AVAX <0.01% $0.028132 3.6483 $0.1026 OP <0.01% $0.998566 96.7858 $96.65 OP <0.01% $3,309.24 0.0274 $90.82 OP <0.01% $0.998566 76.0564 $75.95 OP <0.01% $0.999308 60.4454 $60.4 OP <0.01% $1.79 27.4033 $49.16 OP <0.01% $0.998328 35.2924 $35.23 OP <0.01% $2.22 14.396 $31.92 OP <0.01% $22.67 1.3357 $30.28 OP <0.01% $2.01 14.8476 $29.84 OP <0.01% $0.800449 36.1308 $28.92 OP <0.01% $0.17416 153.9162 $26.81 OP <0.01% $0.800343 32.5991 $26.09 OP <0.01% $5.31 2.1453 $11.39 OP <0.01% $0.00201 4,592.4681 $9.23 OP <0.01% $2.51 3.1725 $7.96 OP <0.01% $0.016127 470.8319 $7.59 OP <0.01% $0.004571 1,603.5823 $7.33 OP <0.01% $0.997739 6.7755 $6.76 OP <0.01% $3.39 1.6495 $5.59 OP <0.01% $95,133 0.00003401 $3.24 OP <0.01% $27.2 0.0834 $2.27 OP <0.01% $0.006068 370.4663 $2.25 OP <0.01% $13.94 0.1522 $2.12 OP <0.01% $0.988169 1.0871 $1.07 OP <0.01% $0.00338 213.1095 $0.7203 OP <0.01% $325.39 0.0020554 $0.6688 OP <0.01% $0.17416 3.1717 $0.5523 OP <0.01% $0.544769 0.948 $0.5164 OP <0.01% $3,704.32 0.00012037 $0.4458 OP <0.01% $0.538724 0.7045 $0.3795 OP <0.01% $0.001922 187.4643 $0.3603 OP <0.01% $0.00043 836.4244 $0.3599 OP <0.01% <$0.000001 1,341,624.786 $0.3532 OP <0.01% $0.000025 11,157.3047 $0.2841 OP <0.01% $0.048356 5.55 $0.2683 OP <0.01% $0.002062 109.3007 $0.2253 OP <0.01% $0.005718 33.0435 $0.1889 BASE <0.01% $0.007881 6,502 $51.24 BASE <0.01% $0.031074 467.0777 $14.51 BASE <0.01% $0.073711 189.224 $13.95 BASE <0.01% $0.000848 10,563 $8.96 BASE <0.01% $0.000009 200,004.2069 $1.71 BASE <0.01% $0.032312 25 $0.8077 GNO <0.01% $0.199218 4.4495 $0.8864 Loading...Loading[ Download: CSV Export ]A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.
Address QR Code
My Address - Private Name Tag or Note
My Name Tag:
Private Name Tags (up to 35 characters) can be used for easy identification of addressesPrivate Note:
A private note (up to 500 characters) can be attached to this address.
Please DO NOT store any passwords or private keys here.Compiler specific version warnings:
The compiled contract might be susceptible to VerbatimInvalidDeduplication (low-severity), FullInlinerNonExpressionSplitArgumentEvaluationOrder (low-severity), MissingSideEffectsOnSelectorAccess (low-severity) Solidity Compiler Bugs.
Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.SignIn
Address Cards
To use this feature, please login to your Etherscan account and return to this page.Before You Copy
Transaction Private Note
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.