Ready to simplify your web3 experience? Try the all-in-one web3 app trusted by millions worldwide.
Purchase 100+ cryptocurrencies instantly, with Visa/Mastercard, Google/Apple Pay, and a variety of other funding methods.
Everyday giveaways up to 100 ETH, Lucky Spins. Deposit BONUS 300% and Cashbacks!
9 years old Licensed Crypto Casino, Instant Withdraw 24/7, 6000+ Slots available, Paypal Deposit, Instant Live Support 24/7, 30% Rakeback.
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Play 100s of games anonymously with all major cryptos. Join CryptoWins & start winning!
Anonymous play on awesome games - sign up now for 25 free jackpot spins - worth $100s!
Overview
ETH Balance
Eth Value
$0.00Token Holdings
Could not find any matches!
- ERC-20 Tokens (>200)0.32623844 404A404Aliens (404A)$1.35@4.130.3338314 AGLDAdventure Go... (AGLD)$0.30@0.88871,178.39900752 AEGAether Games (AEG)$13.14@0.01111.48723187 ALGOAlgowave (ALGO)$0.05@0.0370.20332778 CLEVCLever Token (CLEV)$1.05@5.171,806.10602412 EMRLDEMERALD (EMRLD)$3.14@0.00179,298,759.43535731 fluffyFluffy (fluffy)187,092,711.991132 FREEFree Coin (FREE)$21.56@0.003,702.51353561 TRUMPFreeTrump (TRUMP)$9.90@0.00273,374,581.22130086 GASGas DAO (GAS)$1.59@0.0020,011.79929623 FlorkHeyFlork (Flork)$3.98@0.0002175,307.72899312 dKUMAKumaDex Toke... (dKUMA)$42.15@0.00029,952.56200465 HERRISKumala Herri... (HERRIS)7,354.5147327 MAZZEMAZZE (MAZZE)$19.56@0.00272.71061952 MILEIMILEI Token (MILEI)$0.03@0.0111,705,718,461,379,510 PEGAPepeMaga (PEGA)$957,860,204.34@0.00147,158,057.674076 PIKAPikachu (PIKA)$3.43@0.0012,235.05997875 PCPlayable Coi... (PC)$2.70@0.00025,271.37153178 QANXQANX Token (QANX)182,454.17209183 $ROARRoaring Kitt... ($ROAR)$321.00@0.0018803,226,730.245269 SHIBAShiba (SHIBA)$0.11@0.00560.74903638 SPXSPX6900 (SPX)$134.31@0.23952.26030157 STRDYSturdy Token (STRDY)$1.46@0.64520.000007 TheDAOTheDAO (TheDAO)$0.00@23.9002112,624.10935484 TIGRATigra (TIGRA)$32.87@0.00035,426,071,194.9999 TRUMPTrump (TRUMP)$2.25@0.00208.09595958 SPARKLETUpland (SPARKL...)$12.03@0.0578218,036.66429079 WSMWall Street ... (WSM)$587.88@0.0027192,602.37752002 WOJAKWojak Coin (WOJAK)$125.24@0.00077,925,558.47862396 $MaxETH$MaxETH ($MaxET...)$0.93@0.00219.99460426 0xBTC0xBitcoin To... (0xBTC)$18.82@0.0855697.15471927 1INCH1INCH Token (1INCH)$177.07@0.254466,236,414,261,766 4CHAN4CHAN (4CHAN)$12.01@0.0026.23481252 ERN@EthernityCh... (ERN)$50.11@1.9121,673,850,290.4925 CAWA Hunters Dr... (CAW)$1,113.77@0.0053.034169 aUSDTAave interes... (aUSDT)$52.99@0.99910.00000778 aWBTCAave interes... (aWBTC)$0.48@61,978.000.00362551 aWETHAave interes... (aWETH)$8.67@2,390.404.75546575 GHSTAavegotchi G... (GHST)$4.48@0.943195.80272144 ADXAdEx (ADX)$13.82@0.144351.97462249 AERGOAergo (AERGO)$4.94@0.0956,044.6753468 ATHAethir Token (ATH)$339.20@0.0561900.90986046 AEVOAevo (AEVO)$296.93@0.3296118.62380197 AGAAgora DEX To... (AGA)$1.39@0.0118282.7747651 AGRSAgoras Token (AGRS)$613.62@2.171,430,379.0271532 AIAiDoge (AI)$0.55@0.001,041.97104828 AIOZAIOZ Network (AIOZ)$497.61@0.477696.1093 ASTAirSwap (AST)$7.45@0.07766,441,957,601.97045 AKITAAkita Inu (AKITA)$461.26@0.007,525.85332945 AKROAkropolis (AKRO)$31.01@0.00410.57418407 ⚗️Alchemist (⚗️)$0.35@0.60517.81246615 ALCXAlchemix (ALCX)$102.97@13.185,969.84026508 ACHAlchemy (ACH)$112.48@0.0188560.52600319 ALEPHaleph.im v2 (ALEPH)$91.21@0.1627295.2342869 ALPHAlephium (Al... (ALPH)$428.09@1.4545.467564 ALICEALICE (ALICE)$44.57@0.98034,351.59138721 NXRAAllianceBloc... (NXRA)$139.85@0.032128.37809186 ALPHAAlphaToken (ALPHA)$1.57@0.05542,491.5612045 ALTAltLayer Tok... (ALT)$254.73@0.10228.61093438 ASIAltSignals (ASI)$0.02@0.002315,369.732936 OMIKAMIAMATERASU OM... (OMIKAM...)$437.21@0.02844,171,327,328.52486 AMCAMC (AMC)$43.46@0.0042,167.87662597 AMERICAAmerica (AMERIC...)20,738,159,030.3704 SHIBAAmerican Shi... (SHIBA)$1.15@0.00149,669.90174041 AMOAmino (AMO)$16.67@0.000139,057.24972341 AMPAmp (AMP)$145.62@0.003735.24833216 AMPLAmpleforth (AMPL)$43.00@1.220.24444924 FORTHAmpleforth G... (FORTH)$0.67@2.75379.15180643 CANDYAndy's C... (CANDY)$0.01@0.0042,069.54552962 ANDYMANAndyman (ANDYMA...)$58.68@0.001413.53696612 ANGLEANGLE (ANGLE)$0.27@0.01993,343.87144819 ANKRAnkr Network (ANKR)$88.15@0.02640.00016191 ankrETHAnkr Staked ... (ankrET...)$0.45@2,788.42194.73944404 MATTERAntimatter.F... (MATTER)$3.05@0.0156233.58797417 APEApeCoin (APE)$163.24@0.69880.03010773 APEXApeX Token (APEX)$0.04@1.45104.29150624 API3API3 (API3)$140.79@1.35416.54468439 APPCAppCoins (APPC)$0.23@0.0005509,058.33673123 APUGURLApu Gurl (APUGUR...)$4.94@0.0085.916837 APYAPY Governan... (APY)$0.09@0.00110.502649 ANTAragon Netwo... (ANT)$3.07@6.100.93453292 AIUSArbius (AIUS)$47.67@51.010725,383.38735566 ARCARC (ARC)$573.23@0.0226251.6610176 ABTArcBlock (ABT)$390.07@1.5521.38684544 ARCXArchitex (ARCX)$9.22@0.43120.28396613 ARIA20ARIANEE (ARIA20)$0.03@0.0953294.60783583 ARKMArkham (ARKM)$406.49@1.3797521.16793588 ARMORArmor (ARMOR)$0.46@0.00090.00510737 arNXMArmor NXM (arNXM)$0.12@23.125,268.33584944 ALIArtificial L... (ALI)$54.85@0.01043.42182644 ASTRAAstraAI (ASTRA)$3.95@1.15411,468 ATRIAtariToken (ATRI)$0.42@0.00031,452.89043707 AUCAuctus (AUC)$1.14@0.00082,279.3444771 AUDIOAudius (AUDIO)$263.05@0.115425.07421598 AURAAura (AURA)$8.63@0.3442422.900195 AURORAAurora (AURORA)$53.83@0.127320.07264796 URUSAurox Token (URUS)$44.96@2.24201.44390689 AVATLYAVATLY (AVATLY)$0.47@0.00231,308.1195875 AVIAviator (AVI)$2.17@0.00171,264.282701 AXLAxelar (AXL)$803.99@0.635912.8540464 AXSAxie Infinit... (AXS)$59.90@4.6612.2477869 AZURAzuro (AZUR)$0.86@0.07045,336,693,935.33161 BMoneyB-money (BMoney)$1.79@0.003,429.64825683 BXXBaanx (BXX)$128.07@0.037337,459.65905791 BAXBABB BAX (BAX)$2.09@0.000110,819,261.8145764 BABYPEPEBaby Pepe (BABYPE...)$75.67@0.00115,255,319,242.486 BABYPEPEBabyPepe (BABYPE...)$9.35@0.0051.01914092 BACBAC (BAC)$0.10@0.0024.21471731 BADGERBadger (BADGER)$11.25@2.67635.53186937 BAGBag (BAG)$1.15@0.001811.90114697 BALBalancer (BAL)$22.61@1.900.44483118 bALPHAbAlpha (bALPHA)$4.08@9.176710.66812278 BANANABanana (BANANA)$496.28@46.520.10495371 BANANABanana (BANANA)$0.03@0.316633,558.5204492 BCATBananaCat (BCAT)$132.08@0.003968.08852756 BANDBandToken (BAND)$75.58@1.11857.7191387 BANKBankless Tok... (BANK)$0.89@0.0011,888.87785867 BAOBao Token V2 (BAO)$0.87@0.0005274,836,945.988093 SOLANABarbieCrashB... (SOLANA)$0.34@0.0016.64201796 BONDBarnBridge G... (BOND)$25.46@1.53154.31028598 BASEBase Protoco... (BASE)$155.08@1.00534.31317073 BSXBasix (BSX)$0.81@0.0236173.48166998 BDPBDPToken (BDP)$20.20@0.116543,937.95508118 BEAMBeam (BEAM)$739.41@0.0168428.65253681 BEARDYBearded Drag... (BEARDY)$0.09@0.0002192,589,791.458886 BEBEBEBE (BEBE)$1.05@0.0069.85036449 BEFEBEFE (BEFE)$0.00@0.0017.24786043 BELBella (BEL)$8.79@0.509964.6452426 BelugaBeluga (Beluga)0.93703664 BETABeta Token (BETA)$0.04@0.04373,614.44177742 BEPROBetProtocolT... (BEPRO)$1.51@0.0004326,235,911,619.244 BEZOGEBezoge Earth (BEZOGE)$1.62@0.009,207.64420108 BIDBidao (BID)$9.75@0.0011624.28552919 BiFiBiFi (BiFi)$1.21@0.001917.32376069 BFCBifrost (BFC)$0.65@0.037617,536,688,258.5832 BUDBig Bud (BUD)$7.77@0.0017,256,246.7790707 $BIGBig Eyes ($BIG)$10.83@0.000.00796563 BBTCBinance Wrap... (BBTC)$483.90@60,748.0030,403,919.7383849 BIRDDOGBird Dog (BIRDDO...)$167.66@0.004.07125789 BIRDBird.Money (BIRD)$9.20@2.2655.99414198 BTCINUBitcoin Inu (BTCINU)$1.20@0.021538.83575727 BITBitDAO (BIT)$26.23@0.67540.02775438 LEOBitfinex LEO... (LEO)$0.17@5.961,734,083.94007657 BRISEBitgert (BRISE)$0.13@0.004.73251625 BITROCKBitrock (BITROC...)$0.32@0.067820.21853156 BITTOBITTO (BITTO)34.58662597 BITTBITTOKEN (BITT)$0.02@0.0006139,011,562.931437 BTTBitTorrent (BTT)$125.47@0.0019,162,084.9622522 FTWBlack Agnus (FTW)$481.54@0.00131.26347662 BPTBlackPool To... (BPT)$4.86@0.0373.73807395 BCDTBlockchain C... (BCDT)$0.11@0.0301309.6561447 BSTBlocksquareT... (BST)$64.44@0.208127,359.58067592 VEEBLOCKv (VEE)$139.65@0.005121,572.95277462 BLOODBloodboy (BLOOD)$8.27@0.0004220.37445168 BLZBluzelle (BLZ)$28.22@0.12810.19631347 $SWIPESBNDR ($SWIPE...)$0.00@0.003314,501,071.0175041 BOBBOB (BOB)$406.26@0.0010,478,898,076.4503 BOBOBobo (BOBO)$6.90@0.004,985,570.97226466 BOBOBOBO (BOBO)$4.87@0.0016.23447655 BONDLYBondly (BONDLY)$0.04@0.0022369,393,355.284808 BONKBonk on ETH (BONK)$0.55@0.005,133,545.91407785 BODBook Of Dona... (BOD)$4.91@0.00226.74592231 BOOEBook of Ethe... (BOOE)$50.50@0.222743,331,327.1173673 BOMBook Of Matt... (BOM)$2.31@0.001,387,669.70492575 BTCBoost Trump ... (BTC)$0.17@0.00626.44092399 BOSONBoson Token (BOSON)$182.80@0.291827.9148876 BOTTOBotto (BOTTO)$8.54@0.30610.12576672 AuctionBounce Token (Auctio...)$1.69@13.407,947,921.20664631 BOYSCLUBBoy's cl... (BOYSCL...)$1.47@0.0067.89065924 MunchyBoys Club Mu... (Munchy)$0.00@0.006,757.07018094 BRAINLETBrainlet (BRAINL...)$0.18@0.00125.3203716 BRETTBrett (BRETT)$1.37@0.0109770.01262531 BRETTBrett (BRETT)$246.53@0.320288.93119064 Brick BlockBRICK (Brick ...)$0.55@0.00627.02165752 BKNBrickken (BKN)$2.02@0.28781,329.28857104 BMIBridge Mutua... (BMI)$3.92@0.002910,021,180.276202 BTCBullish Trum... (BTC)$0.94@0.0058.27235214 BUMPBUMP (BUMP)$0.86@0.0147255.99111508 BFLYButterfly Pr... (BFLY)$1.11@0.004331.26932102 INFRABware (INFRA)$5.97@0.19098.55520715 BYTESBYTES (BYTES)$39.65@4.634940.00577148 BZRXbZx Protocol... (BZRX)$0.55@0.013729.89628847 BZZBZZ (BZZ)$8.19@0.273921.36108486 CADCAD (CAD)$1.84@0.0862178.10956525 wCADAICADAICO (wCADAI)$20.89@0.11731,515.52275953 $JennerCaitlyn Jenn... ($Jenne...)$0.33@0.00029,226.05328998 CARDCardstack (CARD)$4.49@0.00051.13211733 CXOCargoX (CXO)$0.29@0.260442.58552787 CTSICartesi Toke... (CTSI)$5.15@0.1209186,231.45702669 CASINUCasinu Inu (CASINU)$0.48@0.0090,663,142,141.0891 CATAICAT AI (CATAI)$1.11@0.00215.50623537 CATBOYCatboy (CATBOY)$5.49@0.02558,155.50018154 CATECate (CATE)$27.66@0.00343.57039458 CEEKCEEK (CEEK)$0.10@0.02822,756.24182186 CELRCelerToken (CELR)$31.15@0.0113439.81423505 CELLCellframe To... (CELL)$242.74@0.5519887.6317 CELCelsius (CEL)$254.63@0.2869777.48377603 CFGCentrifuge (CFG)$267.42@0.3442,972.76356087 CERECERE Network (CERE)$6.70@0.002310,820,107.9621378 CHADChad (CHAD)$19.15@0.00NFT Tokens (59)claim rewards on agixcoin.netagixcoin.netERC-1155claim rewards on apyusd.netapyusd.netERC-1155claim rewards on clinkevent.comclinkevent.comERC-1155ether-origin.comether-origin.comERC-1155claim rewards on fetchfinance.netfetchfinance.netERC-1155GNUSGenius Token & NFT CollectionsERC-1155claim rewards on graphtoken.orggraphtoken.orgERC-1155claim rewards on oceanprotocol.netoceanprotocol.netERC-1155claim rewards on renderpool.orgrenderpool.orgERC-1155t.me/shibarmy_botShiba Inu Token AirdropERC-1155claim rewards on snxtoken.comsnxtoken.comERC-1155claim rewards on univ4labs.orguniv4labs.orgERC-1155ether-origin.comWithdrawal NFT ether-origin.comERC-1155ERC-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]
- Transactions
- Internal Transactions
- Token Transfers (ERC-20)
- NFT Transfers
- Contract
- Events
- Analytics
- Multichain Portfolio
Latest 1 internal transaction
Advanced mode:Parent Transaction Hash Block From To 19740424 2024-04-26 15:29:23 160 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...LoadingMultichain Portfolio | 27 Chains
Chain Token Portfolio % Price Amount Value BSC 99.71% $0.002523 135,535,669,192,014 $341,936,122,717.26 BSC <0.01% $0.002523 8,330,892,343.0911 $21,017,589.27 BSC <0.01% $0.009053 1,094,199,883.1063 $9,905,244.44 BSC <0.01% $1.17 27,792.5228 $32,517.25 BSC <0.01% $115.47 121.936 $14,079.95 BSC <0.01% $0.998413 2,470.2206 $2,466.3 BSC <0.01% $2.83 603.7784 $1,709.01 BSC <0.01% $37.59 39.9724 $1,502.54 BSC <0.01% $0.000324 3,477,392.2093 $1,128.17 BSC <0.01% <$0.000001 1,132,327,118,152.08 $1,094.05 BSC <0.01% $0.78408 1,085.964 $851.48 BSC <0.01% <$0.000001 3,694,189,062.0969 $332.69 BSC <0.01% $0.044101 7,112.1321 $313.65 BSC <0.01% <$0.000001 61,102,783,530.7671 $252.9 BSC <0.01% $0.157464 1,331.4198 $209.65 BSC <0.01% $0.000316 515,100.3665 $162.72 BSC <0.01% $0.039863 3,975.7632 $158.49 BSC <0.01% $0.002696 50,073.875 $135.02 BSC <0.01% $0.0041 31,349.9638 $128.52 BSC <0.01% $0.742098 162.3544 $120.48 BSC <0.01% $1.85 61.9999 $114.7 BSC <0.01% $0.291995 388.0588 $113.31 BSC <0.01% $0.034387 3,181.0425 $109.39 BSC <0.01% $0.023399 4,456.0669 $104.27 BSC <0.01% $0.759858 134.7188 $102.37 BSC <0.01% $0.002985 33,823.947 $100.97 BSC <0.01% $0.239025 418.7344 $100.09 BSC <0.01% $0.00545 18,096.5817 $98.63 BSC <0.01% $1 96.4523 $96.48 BSC <0.01% $1.28 73.5613 $94.16 BSC <0.01% $0.001993 46,881.2593 $93.44 BSC <0.01% $0.010913 8,536.3658 $93.16 BSC <0.01% <$0.000001 398,994,064.6683 $91.88 BSC <0.01% <$0.000001 71,502,818,117.4633 $88.17 BSC <0.01% $10.99 7.9153 $86.97 BSC <0.01% $0.100674 857.3376 $86.31 BSC <0.01% $1.27 67.6889 $85.96 BSC <0.01% $0.013935 5,995.6724 $83.55 BSC <0.01% $0.046189 1,793.3809 $82.83 BSC <0.01% $0.005272 15,570.354 $82.09 BSC <0.01% $0.350484 233.5208 $81.85 BSC <0.01% $1.07 75.9014 $81.17 BSC <0.01% $0.045927 1,750.6318 $80.4 BSC <0.01% $1.17 68.3203 $79.93 BSC <0.01% $0.097349 816.7574 $79.51 BSC <0.01% $0.0009 87,790.0854 $79.04 BSC <0.01% <$0.000001 41,528,111,536.8413 $78.82 BSC <0.01% $0.00037 210,263.988 $77.78 BSC <0.01% $5.37 14.2336 $76.43 BSC <0.01% $0.003626 20,901.6894 $75.79 BSC <0.01% $0.35082 215.9235 $75.75 BSC <0.01% $0.28964 260.5214 $75.46 BSC <0.01% $0.999913 75.0423 $75.04 BSC <0.01% $6.95 10.6638 $74.08 BSC <0.01% $0.068397 1,080.9062 $73.93 BSC <0.01% $0.472072 155.6203 $73.46 BSC <0.01% $320.34 0.2287 $73.25 BSC <0.01% $0.01064 6,848.0848 $72.87 BSC <0.01% $2.94 24.3838 $71.69 BSC <0.01% $0.014979 4,775.4348 $71.53 BSC <0.01% $0.030316 2,316.365 $70.22 BSC <0.01% $25.4 2.7605 $70.11 BSC <0.01% $0.401647 174.4029 $70.05 BSC <0.01% $0.013359 5,180.7136 $69.21 BSC <0.01% $0.003343 20,566.8536 $68.76 BSC <0.01% <$0.000001 6,325,971,335.7942 $68.31 BSC <0.01% $1.48 45.5456 $67.43 BSC <0.01% $0.034443 1,941.4173 $66.87 BSC <0.01% $0.254185 262.8845 $66.82 BSC <0.01% $0.002205 30,173.1154 $66.52 BSC <0.01% $2.72 24.3957 $66.37 BSC <0.01% $0.4772 138.6855 $66.18 BSC <0.01% $0.001973 33,395.1119 $65.9 BSC <0.01% $0.000319 206,632.8987 $65.82 BSC <0.01% $0.009963 6,605.5632 $65.81 BSC <0.01% $0.379757 170.9019 $64.9 BSC <0.01% $0.150732 429.4285 $64.73 BSC <0.01% $0.026637 2,390.1707 $63.67 BSC <0.01% $1.11 57.3194 $63.67 BSC <0.01% $0.028374 2,227.4906 $63.2 BSC <0.01% $0.000259 244,022.3571 $63.18 BSC <0.01% $0.077329 816.388 $63.13 BSC <0.01% $0.051794 1,198.8271 $62.09 BSC <0.01% $0.068098 911.2531 $62.05 BSC <0.01% $0.290776 213.3171 $62.03 BSC <0.01% $0.152939 402.6674 $61.58 BSC <0.01% $0.037412 1,635.632 $61.19 BSC <0.01% $0.00577 10,507.9148 $60.63 BSC <0.01% $0.027472 2,193.2321 $60.25 BSC <0.01% $0.118422 507.9249 $60.15 BSC <0.01% $2.93 20.3912 $59.76 BSC <0.01% <$0.000001 2,177,567,614,039.47 $59.34 BSC <0.01% <$0.000001 28,215,790,321.165 $58.98 BSC <0.01% $4.47 13.1572 $58.84 BSC <0.01% <$0.000001 787,071,472.3524 $58.64 BSC <0.01% $26.42 2.2149 $58.51 BSC <0.01% $0.000005 11,721,207.9334 $58.23 BSC <0.01% $0.004541 12,771.1271 $57.99 BSC <0.01% $0.060896 949.6768 $57.83 BSC <0.01% $0.000002 24,338,410.0473 $56.95 BSC <0.01% $0.083736 677.4495 $56.73 BSC <0.01% $0.282577 200.6757 $56.71 BSC <0.01% $0.126039 447.989 $56.46 BSC <0.01% <$0.000001 57,261,479,848.6663 $55.77 BSC <0.01% $276.74 0.1993 $55.14 BSC <0.01% $0.011342 4,848.7079 $54.99 BSC <0.01% $0.164569 333.2064 $54.84 BSC <0.01% <$0.000001 473,096,880.0622 $54.26 BSC <0.01% <$0.000001 167,557,070.1292 $53.97 BSC <0.01% $1.48 36.3559 $53.81 BSC <0.01% $44.26 1.2151 $53.78 BSC <0.01% $0.002013 26,233.9568 $52.8 BSC <0.01% $0.000055 960,087.0154 $52.77 BSC <0.01% $0.169222 311.6704 $52.74 BSC <0.01% $0.000084 622,408.9946 $52.43 BSC <0.01% $0.000001 48,545,099.9429 $51.94 BSC <0.01% $0.100916 511.9552 $51.66 BSC <0.01% $0.049647 1,036.4858 $51.46 BSC <0.01% $1.27 40.3367 $51.3 BSC <0.01% $3.61 14.1839 $51.24 BSC <0.01% $0.402453 124.58 $50.14 BSC <0.01% $0.033182 1,508.4677 $50.05 BSC <0.01% $0.011212 4,386.8706 $49.19 BSC <0.01% $6.76 7.2251 $48.86 BSC <0.01% $64.38 0.7494 $48.25 BSC <0.01% $0.444069 108.62 $48.23 BSC <0.01% <$0.000001 46,010,820,196.7238 $47.92 BSC <0.01% $0.008696 5,505.7089 $47.88 BSC <0.01% $0.000244 194,500.2642 $47.37 BSC <0.01% $0.010203 4,588.3323 $46.81 BSC <0.01% $0.549599 85.1152 $46.78 BSC <0.01% $0.026645 1,746.9726 $46.55 BSC <0.01% $0.437215 105.5462 $46.15 BSC <0.01% $0.000472 97,697.6867 $46.08 BSC <0.01% $0.608383 74.9933 $45.62 BSC <0.01% $19.78 2.303 $45.55 BSC <0.01% $0.221776 205.0478 $45.47 BSC <0.01% $0.037309 1,210.6459 $45.17 BSC <0.01% $61,389.96 0.00073482 $45.11 BSC <0.01% $0.000445 101,252.6369 $45.06 BSC <0.01% <$0.000001 126,705,339.4083 $44.85 BSC <0.01% $0.181265 245.1767 $44.44 BSC <0.01% $0.000021 2,103,319.3895 $44.4 BSC <0.01% <$0.000001 188,653,683,567.846 $44.3 BSC <0.01% $1.99 21.9813 $43.74 BSC <0.01% $0.037721 1,155.2123 $43.58 BSC <0.01% $0.174383 248.4023 $43.32 BSC <0.01% $0.018784 2,288.9083 $42.99 BSC <0.01% $0.355432 120.7551 $42.92 BSC <0.01% $0.647363 66.2889 $42.91 BSC <0.01% $0.080719 526.7579 $42.52 BSC <0.01% $0.120632 343.0356 $41.38 BSC <0.01% $0.000914 44,964.0527 $41.08 BSC <0.01% $0.000016 2,608,203.881 $40.87 BSC <0.01% $4.66 8.7704 $40.87 BSC <0.01% $0.174759 233.0622 $40.73 BSC <0.01% $0.029227 1,390.8953 $40.65 BSC <0.01% $0.043729 927.4721 $40.56 BSC <0.01% $3.83 10.5393 $40.37 BSC <0.01% $0.127446 316.075 $40.28 BSC <0.01% $0.001003 39,955.3171 $40.09 BSC <0.01% $0.010614 3,718.9741 $39.47 BSC <0.01% $0.000017 2,346,729.6535 $39.26 BSC <0.01% $0.029125 1,334.0018 $38.85 BSC <0.01% $0.022579 1,715.6627 $38.74 BSC <0.01% $0.546885 70.5724 $38.6 BSC <0.01% $0.000665 58,066.759 $38.59 BSC <0.01% $0.601605 64.0676 $38.54 BSC <0.01% $0.016862 2,283.3707 $38.5 BSC <0.01% $0.000035 1,093,743.3475 $38.28 BSC <0.01% <$0.000001 151,303,230,918.099 $38.27 BSC <0.01% $0.001259 30,333.8045 $38.19 BSC <0.01% $0.010062 3,779.7137 $38.03 BSC <0.01% $0.144901 260.5128 $37.75 BSC <0.01% $0.053771 700.8476 $37.69 BSC <0.01% $0.051477 730.6914 $37.61 BSC <0.01% $0.201323 186.8245 $37.61 BSC <0.01% $0.012081 3,074.1306 $37.14 BSC <0.01% $4.15 8.9155 $36.99 BSC <0.01% $0.000058 630,667.9685 $36.57 BSC <0.01% <$0.000001 13,495,156,443.476 $36.54 BSC <0.01% $0.000177 206,586.3552 $36.52 BSC <0.01% $0.997213 36.4199 $36.32 BSC <0.01% $0.737482 49.1966 $36.28 BSC <0.01% $4.06 8.8947 $36.11 BSC <0.01% <$0.000001 2,371,894,768,224.9 $35.88 BSC <0.01% $0.108096 327.804 $35.43 BSC <0.01% $0.000011 3,314,385.3817 $35.43 BSC <0.01% $2.95 11.9931 $35.37 BSC <0.01% $604.03 0.058 $35.03 BSC <0.01% $3.43 10.1885 $34.95 BSC <0.01% $0.002354 14,835.8294 $34.93 BSC <0.01% $0.000238 146,084.363 $34.73 BSC <0.01% $0.103047 336.9816 $34.72 BSC <0.01% $40.88 0.8471 $34.63 BSC <0.01% $1.82 18.8832 $34.37 BSC <0.01% $0.172021 198.7853 $34.2 BSC <0.01% $0.012893 2,650.4282 $34.17 BSC <0.01% $0.000126 271,606.4745 $34.15 BSC <0.01% <$0.000001 82,022,363.9056 $34.02 BSC <0.01% $0.000824 40,522.8263 $33.38 BSC <0.01% <$0.000001 25,206,468,993.2206 $33.36 BSC <0.01% $1,455.71 0.0227 $33.09 BSC <0.01% $0.000157 210,509.5832 $33.05 BSC <0.01% $0.066958 488.7968 $32.73 BSC <0.01% $0.10355 314.8477 $32.6 BSC <0.01% $2.29 14.0142 $32.06 BSC <0.01% $0.03066 1,035.7571 $31.76 BSC <0.01% $0.021109 1,502.1108 $31.71 BSC <0.01% $0.819407 37.9365 $31.09 BSC <0.01% $1.3 23.8375 $31.05 BSC <0.01% $0.007256 4,260.2711 $30.91 BSC <0.01% $0.049694 621.1349 $30.87 BSC <0.01% $0.000036 838,811.8482 $29.91 BSC <0.01% $0.133304 223.5814 $29.8 BSC <0.01% $0.109369 272.4877 $29.8 BSC <0.01% $0.093675 312.8712 $29.31 BSC <0.01% $1 29.2264 $29.23 BSC <0.01% $0.020979 1,384.5947 $29.05 BSC <0.01% $0.008386 3,455.6048 $28.98 BSC <0.01% $0.298601 95.9602 $28.65 BSC <0.01% <$0.000001 71,237,104,446.5292 $28.49 BSC <0.01% $0.001142 24,943.8319 $28.48 BSC <0.01% $0.000969 29,348.27 $28.45 BSC <0.01% $0.000952 29,410.6827 $27.99 BSC <0.01% <$0.000001 3,454,997,628.3797 $27.86 BSC <0.01% $0.066305 418.6236 $27.76 BSC <0.01% $0.003035 9,049.375 $27.46 BSC <0.01% <$0.000001 652,546,444.9877 $27.2 BSC <0.01% $0.027887 963.5003 $26.87 BSC <0.01% $0.000466 57,556.171 $26.82 BSC <0.01% $0.175134 153.1121 $26.82 BSC <0.01% $0.004637 5,741.1335 $26.62 BSC <0.01% <$0.000001 2,109,629,879.8643 $26.54 BSC <0.01% $0.05518 480.7825 $26.53 BSC <0.01% $0.000088 300,427.9086 $26.49 BSC <0.01% $149.79 0.1745 $26.14 BSC <0.01% $0.000473 55,173.9713 $26.07 BSC <0.01% $0.051559 503.5531 $25.96 BSC <0.01% $0.002655 9,770.1705 $25.94 BSC <0.01% $0.051028 504.9197 $25.77 BSC <0.01% $12.28 2.0704 $25.42 BSC <0.01% $0.010196 2,493.6439 $25.42 BSC <0.01% $0.000001 40,888,647.2211 $25.4 BSC <0.01% $0.009788 2,586.2179 $25.31 BSC <0.01% $0.283229 88.3104 $25.01 BSC <0.01% $0.015836 1,571.3378 $24.88 BSC <0.01% $0.008758 2,788.3035 $24.42 BSC <0.01% $0.032649 743.5117 $24.28 BSC <0.01% $0.006779 3,497.555 $23.71 BSC <0.01% $0.000265 88,650.4155 $23.53 BSC <0.01% $1.14 20.5893 $23.47 BSC <0.01% $0.012133 1,911.7085 $23.19 BSC <0.01% $0.01866 1,210.7285 $22.59 BSC <0.01% <$0.000001 2,037,670,039,150.2 $22.43 BSC <0.01% $0.000149 148,851.0648 $22.22 BSC <0.01% $8.44 2.6263 $22.18 BSC <0.01% $0.451506 48.9191 $22.09 BSC <0.01% $0.001267 17,295.411 $21.92 BSC <0.01% $0.009268 2,338.4629 $21.67 BSC <0.01% $0.002622 8,248.4066 $21.63 BSC <0.01% $0.087736 245.4805 $21.54 BSC <0.01% <$0.000001 25,018,674,024.6472 $21.45 BSC <0.01% $0.195099 109.5855 $21.38 BSC <0.01% $0.416909 51.1135 $21.31 BSC <0.01% $0.139325 151.7336 $21.14 BSC <0.01% $0.000013 1,553,122.8883 $20.89 BSC <0.01% $0.058173 354.0898 $20.6 BSC <0.01% $0.000003 6,107,259.3188 $20.58 BSC <0.01% <$0.000001 169,654,533.5707 $20.57 BSC <0.01% $0.016271 1,250.8963 $20.35 BSC <0.01% $0.043176 470.9618 $20.33 BSC <0.01% $0.183161 110.7685 $20.29 BSC <0.01% $0.019937 1,011.5591 $20.17 BSC <0.01% <$0.000001 859,787,526.3872 $20.05 BSC <0.01% $3.81 5.2043 $19.83 BSC <0.01% $0.006265 3,142.3529 $19.69 BSC <0.01% $0.003135 6,259.4547 $19.63 BSC <0.01% $0.00316 6,137.6017 $19.39 BSC <0.01% <$0.000001 58,828,900,379.3634 $19.22 BSC <0.01% $0.000253 75,600.5241 $19.11 BSC <0.01% $0.630253 30.3199 $19.11 BSC <0.01% $0.022601 843.8596 $19.07 BSC <0.01% <$0.000001 18,796,606,209.3971 $18.8 BSC <0.01% $1.62 11.5982 $18.79 BSC <0.01% $0.098364 189.9204 $18.68 BSC <0.01% $0.00105 17,770.2113 $18.65 BSC <0.01% <$0.000001 44,645,133.1688 $18.52 BSC <0.01% $0.545205 33.8641 $18.46 BSC <0.01% $0.082934 222.3178 $18.44 BSC <0.01% $0.469424 39.1597 $18.38 BSC <0.01% $0.001037 17,714.0117 $18.37 BSC <0.01% $0.001784 10,126.9132 $18.07 BSC <0.01% $0.118027 152.7342 $18.03 BSC <0.01% $0.001798 10,011.1683 $18 BSC <0.01% $0.000514 34,996.6241 $17.99 BSC <0.01% $0.022707 788.7791 $17.91 BSC <0.01% $2.15 8.2558 $17.71 BSC <0.01% $0.000009 1,941,391.7486 $17.71 BSC <0.01% $1.09 16.1693 $17.67 BSC <0.01% $0.039793 441.3687 $17.56 BSC <0.01% $0.000291 60,145.5012 $17.51 BSC <0.01% $0.152741 114.3829 $17.47 BSC <0.01% $0.006665 2,591.3733 $17.27 BSC <0.01% $0.008281 2,080.3289 $17.23 BSC <0.01% $0.000314 54,635.7497 $17.14 BSC <0.01% $0.000657 25,958.8838 $17.06 BSC <0.01% $0.000232 73,341.9932 $17.01 BSC <0.01% $0.000134 126,301.9951 $16.96 BSC <0.01% $0.037583 446.6759 $16.79 BSC <0.01% $0.000051 329,819.553 $16.76 BSC <0.01% $0.983317 17.0488 $16.76 BSC <0.01% $0.574624 29.0238 $16.68 BSC <0.01% $0.000621 26,832.9101 $16.67 BSC <0.01% $0.998959 16.444 $16.43 BSC <0.01% $0.000432 37,856.5661 $16.36 BSC <0.01% $0.000029 568,968.7692 $16.29 BSC <0.01% $0.996615 16.1824 $16.13 BSC <0.01% $0.01811 884.2398 $16.01 BSC <0.01% $0.262962 59.7835 $15.72 BSC <0.01% $0.016454 937.421 $15.42 BSC <0.01% $0.319675 47.9457 $15.33 BSC <0.01% $0.076144 199.1442 $15.16 BSC <0.01% $0.440654 34.1068 $15.03 BSC <0.01% $1 14.9845 $15 BSC <0.01% $2.6 5.7492 $14.97 BSC <0.01% $0.025817 569.9049 $14.71 BSC <0.01% $0.000026 559,975.9189 $14.58 BSC <0.01% $0.152697 94.5125 $14.43 BSC <0.01% $0.051471 279.2763 $14.37 BSC <0.01% $0.00065 21,758.2759 $14.14 BSC <0.01% $0.016544 844.8305 $13.98 BSC <0.01% $0.154223 89.4359 $13.79 BSC <0.01% $0.004736 2,840.399 $13.45 BSC <0.01% $0.000978 13,760.9946 $13.45 BSC <0.01% <$0.000001 60,449,140,118.0612 $13.28 BSC <0.01% $0.003472 3,809.512 $13.23 BSC <0.01% $0.119589 108.5687 $12.98 BSC <0.01% $0.000138 93,411.5339 $12.88 BSC <0.01% <$0.000001 12,619,551,680,969,500,000 $12.62 BSC <0.01% $0.998614 12.5971 $12.58 BSC <0.01% $0.019141 651.1387 $12.46 BSC <0.01% $0.009063 1,357.5666 $12.3 BSC <0.01% $0.003778 3,239.7761 $12.24 BSC <0.01% <$0.000001 1,107,615,312.2887 $12.18 BSC <0.01% <$0.000001 38,796,325,871.4071 $12.08 BSC <0.01% $0.028309 419.3615 $11.87 BSC <0.01% $2.64 4.4407 $11.72 BSC <0.01% $0.002479 4,717.6649 $11.7 BSC <0.01% $0.460185 25.3964 $11.69 BSC <0.01% $0.316142 36.7854 $11.63 BSC <0.01% <$0.000001 247,427,312.7338 $11.61 BSC <0.01% $0.01156 1,001.6004 $11.58 BSC <0.01% $0.233097 49.1553 $11.46 BSC <0.01% $4,946.82 0.00231504 $11.45 BSC <0.01% $0.000881 12,789.1733 $11.27 BSC <0.01% $0.003257 3,395.7691 $11.06 BSC <0.01% $0.030609 360.9588 $11.05 BSC <0.01% $0.001815 6,061.0024 $11 BSC <0.01% $0.019733 554.9561 $10.95 BSC <0.01% $0.002645 4,138.2409 $10.95 BSC <0.01% $0.014058 771.0867 $10.84 BSC <0.01% $0.000247 43,617.1121 $10.78 BSC <0.01% $0.231545 46.5246 $10.77 BSC <0.01% $0.023604 454.5213 $10.73 BSC <0.01% $0.017941 588.684 $10.56 BSC <0.01% $0.001584 6,581.3031 $10.43 BSC <0.01% $1.07 9.7114 $10.4 BSC <0.01% $551.44 0.0179 $9.86 BSC <0.01% $0.078253 123.844 $9.69 BSC <0.01% $0.002722 3,522.2754 $9.59 BSC <0.01% $0.983071 9.7477 $9.58 BSC <0.01% $0.000065 144,735.51 $9.35 BSC <0.01% $0.074216 125.7395 $9.33 BSC <0.01% $0.011335 818.2019 $9.27 BSC <0.01% $0.167017 54.9007 $9.17 BSC <0.01% $0.000003 2,695,084.128 $9 BSC <0.01% $0.000272 32,916.3466 $8.96 BSC <0.01% $0.004555 1,957.0403 $8.92 BSC <0.01% $0.000151 59,018.7887 $8.89 BSC <0.01% $0.013137 669.0611 $8.79 BSC <0.01% $0.088288 99.5389 $8.79 BSC <0.01% $0.019786 434.0445 $8.59 BSC <0.01% $7.65 1.1077 $8.47 BSC <0.01% $0.003571 2,358.176 $8.42 BSC <0.01% $0.000028 302,043.6129 $8.38 BSC <0.01% $0.031412 266.4961 $8.37 BSC <0.01% $0.000036 221,125.8674 $8.07 BSC <0.01% $2.47 3.2297 $7.97 BSC <0.01% $0.01124 707.2785 $7.95 BSC <0.01% $1.31 6.0639 $7.93 BSC <0.01% $0.000087 90,597.5538 $7.9 BSC <0.01% $0.289774 26.7332 $7.75 BSC <0.01% <$0.000001 2,468,417,603.8802 $7.7 BSC <0.01% $18.54 0.4095 $7.59 BSC <0.01% $0.187642 40.4118 $7.58 BSC <0.01% $0.000018 421,414.9938 $7.5 BSC <0.01% $0.000001 5,316,093.7248 $7.39 BSC <0.01% $0.08056 90.5204 $7.29 BSC <0.01% <$0.000001 400,298,143.9109 $7.25 BSC <0.01% $0.00301 2,388.0987 $7.19 BSC <0.01% $0.021901 319.7277 $7 BSC <0.01% $0.000128 54,021.0387 $6.94 BSC <0.01% $0.173432 39.8094 $6.9 BSC <0.01% $0.030535 225.8328 $6.9 BSC <0.01% $0.046741 147.4834 $6.89 BSC <0.01% $0.055221 123.4458 $6.82 BSC <0.01% $0.005872 1,156.0777 $6.79 BSC <0.01% $0.018927 355.4061 $6.73 BSC <0.01% <$0.000001 110,538,086.9577 $6.71 BSC <0.01% $0.001213 5,502.3766 $6.67 BSC <0.01% <$0.000001 2,492,760,082.1898 $6.52 BSC <0.01% $0.147657 44.046 $6.5 BSC <0.01% $0.001217 5,336.8711 $6.5 BSC <0.01% $0.011985 539.0859 $6.46 BSC <0.01% $0.003645 1,771.0868 $6.46 BSC <0.01% $0.00033 19,528.3193 $6.45 BSC <0.01% $0.010676 598.4588 $6.39 BSC <0.01% $0.506903 12.4142 $6.29 BSC <0.01% $0.015376 407.5806 $6.27 BSC <0.01% $0.081022 76.8952 $6.23 BSC <0.01% $0.359408 17.2572 $6.2 BSC <0.01% $0.398703 15.5301 $6.19 BSC <0.01% $0.01312 458.2537 $6.01 BSC <0.01% $0.007403 809.1761 $5.99 BSC <0.01% <$0.000001 1,211,427,845.1404 $5.96 BSC <0.01% $0.000425 13,849.5907 $5.88 BSC <0.01% $0.004196 1,398.1418 $5.87 BSC <0.01% $0.019515 297.9465 $5.81 BSC <0.01% $0.005514 1,038.0926 $5.72 BSC <0.01% $4.72 1.2015 $5.67 BSC <0.01% $0.002942 1,921.1093 $5.65 BSC <0.01% <$0.000001 42,621,937.4132 $5.65 BSC <0.01% $0.143961 38.7557 $5.58 BSC <0.01% $0.001471 3,786.4215 $5.57 BSC <0.01% $0.002591 2,118.5024 $5.49 BSC <0.01% $0.019794 272.8669 $5.4 BSC <0.01% $0.01155 465.3626 $5.37 BSC <0.01% $0.222578 23.9668 $5.33 BSC <0.01% $0.013044 402.95 $5.26 BSC <0.01% <$0.000001 198,888,303.2823 $5.17 BSC <0.01% $0.004731 1,074.1206 $5.08 BSC <0.01% $0.009988 502.0467 $5.01 BSC <0.01% <$0.000001 3,986,544,934.7682 $4.96 BSC <0.01% $0.00026 19,006.7088 $4.94 BSC <0.01% $1.07 4.6119 $4.93 BSC <0.01% $0.000823 5,990.599 $4.93 BSC <0.01% $0.281966 17.3382 $4.89 BSC <0.01% $0.00019 25,632.9951 $4.88 BSC <0.01% $0.0171 283.5846 $4.85 BSC <0.01% $0.060189 80.019 $4.82 BSC <0.01% $0.037061 129.9201 $4.81 BSC <0.01% $2,390.14 0.00200181 $4.78 BSC <0.01% $0.008703 549.7406 $4.78 BSC <0.01% $0.458748 10.416 $4.78 BSC <0.01% $0.002683 1,774.778 $4.76 BSC <0.01% $0.02453 193.5749 $4.75 BSC <0.01% $0.0036 1,315.3851 $4.73 BSC <0.01% <$0.000001 4,459,353,299.3808 $4.71 BSC <0.01% $0.336049 13.8443 $4.65 BSC <0.01% $0.000099 46,424.7561 $4.59 BSC <0.01% <$0.000001 2,540,407,806.1878 $4.46 BSC <0.01% $0.000108 41,050.5494 $4.42 BSC <0.01% $0.00495 887.8303 $4.39 BSC <0.01% $1.65 2.6576 $4.39 BSC <0.01% $0.001435 3,054.8436 $4.39 BSC <0.01% $0.013407 327.0513 $4.38 BSC <0.01% $0.064948 67.4204 $4.38 BSC <0.01% $0.000268 16,210.976 $4.35 BSC <0.01% $0.000578 7,482.122 $4.33 BSC <0.01% $0.145813 29.6716 $4.33 BSC <0.01% $0.003998 1,080.8678 $4.32 BSC <0.01% $11.76 0.3665 $4.31 BSC <0.01% $1.08 3.9781 $4.28 BSC <0.01% $0.02635 160.922 $4.24 BSC <0.01% <$0.000001 31,513,429.5586 $4.2 BSC <0.01% $0.102553 40.8467 $4.19 BSC <0.01% $12.97 0.3194 $4.14 BSC <0.01% $0.015818 260.6361 $4.12 BSC <0.01% $0.000424 9,665.315 $4.1 BSC <0.01% <$0.000001 2,627,402,346,198.99 $4.05 BSC <0.01% $0.002392 1,680.722 $4.02 BSC <0.01% $0.042391 93.7035 $3.97 BSC <0.01% $0.028301 139.8276 $3.96 BSC <0.01% $0.046092 85.489 $3.94 BSC <0.01% $0.024714 158.245 $3.91 BSC <0.01% $0.004371 894.3105 $3.91 BSC <0.01% $0.000125 31,269.737 $3.91 BSC <0.01% <$0.000001 16,517,387.0073 $3.89 BSC <0.01% $6.14 0.6315 $3.88 BSC <0.01% $0.008328 463.267 $3.86 BSC <0.01% $0.11507 33.4603 $3.85 BSC <0.01% $0.000075 50,831.3319 $3.79 BSC <0.01% $0.001177 3,216.9024 $3.79 BSC <0.01% $0.000612 6,089.8495 $3.73 BSC <0.01% $0.000563 6,613.0853 $3.72 BSC <0.01% $0.00144 2,565.9093 $3.7 BSC <0.01% $1.79 2.0551 $3.67 BSC <0.01% $0.179211 20.3847 $3.65 BSC <0.01% $0.007463 489.3431 $3.65 BSC <0.01% $0.001423 2,559.5956 $3.64 BSC <0.01% $0.000388 9,353.2185 $3.63 BSC <0.01% $0.00008 44,681.1362 $3.59 BSC <0.01% $49.45 0.0725 $3.59 BSC <0.01% $1.94 1.8441 $3.58 BSC <0.01% $0.698967 5.0824 $3.55 BSC <0.01% $1.2 2.9524 $3.54 BSC <0.01% $0.001434 2,460.3112 $3.53 BSC <0.01% $0.284421 12.2754 $3.49 BSC <0.01% $0.006216 561.3631 $3.49 BSC <0.01% $0.701366 4.9288 $3.46 BSC <0.01% $0.002237 1,532.7435 $3.43 BSC <0.01% $0.039239 87.3008 $3.43 BSC <0.01% $0.000989 3,433.734 $3.39 BSC <0.01% $0.015866 212.2284 $3.37 BSC <0.01% $3.8 0.879 $3.34 BSC <0.01% $0.000805 4,133.3198 $3.33 BSC <0.01% $0.006541 505.9193 $3.31 BSC <0.01% $0.005263 624.9516 $3.29 BSC <0.01% $0.007918 413.8755 $3.28 BSC <0.01% $0.983988 3.2942 $3.24 BSC <0.01% $0.012892 251.2191 $3.24 BSC <0.01% $0.001121 2,865.3849 $3.21 BSC <0.01% $0.011725 269.9902 $3.17 BSC <0.01% $0.015502 199.8582 $3.1 BSC <0.01% $0.009946 311.4128 $3.1 BSC <0.01% $0.000005 596,191.887 $3.09 BSC <0.01% $0.000378 7,817.2512 $2.96 BSC <0.01% $0.00037 7,903.994 $2.92 BSC <0.01% $199.42 0.0146 $2.92 BSC <0.01% $0.000001 3,248,889.6574 $2.92 BSC <0.01% $0.013695 212 $2.9 BSC <0.01% $0.290776 9.8044 $2.85 BSC <0.01% $2.06 1.365 $2.81 BSC <0.01% $0.003454 796.3305 $2.75 BSC <0.01% $0.000002 1,151,923.9928 $2.74 BSC <0.01% <$0.000001 334,405,150.5755 $2.74 BSC <0.01% <$0.000001 4,170,410,877.0991 $2.72 BSC <0.01% $0.000434 6,254.9898 $2.72 BSC <0.01% $0.0001 26,386.3588 $2.64 BSC <0.01% $0.999898 2.6332 $2.63 BSC <0.01% <$0.000001 48,931,899,641.2698 $2.63 BSC <0.01% $0.370354 7.0996 $2.63 BSC <0.01% $0.000186 14,027.1276 $2.62 BSC <0.01% $0.012849 201.6258 $2.59 BSC <0.01% <$0.000001 13,786,461,496.477 $2.57 BSC <0.01% $2.45 1.0459 $2.56 BSC <0.01% $0.00375 683.0461 $2.56 BSC <0.01% <$0.000001 1,493,225,306.6683 $2.55 BSC <0.01% $0.000026 98,441.2714 $2.53 BSC <0.01% $0.000403 6,280.9714 $2.53 BSC <0.01% <$0.000001 1,523,266,163.1627 $2.51 BSC <0.01% <$0.000001 3,260,461,474.3296 $2.5 BSC <0.01% $0.016751 146.9194 $2.46 BSC <0.01% $0.002574 951.7064 $2.45 BSC <0.01% $0.000077 31,609.9528 $2.42 BSC <0.01% $0.440003 5.4492 $2.4 BSC <0.01% <$0.000001 146,726,437,816.874 $2.39 BSC <0.01% $2.53 0.9394 $2.38 BSC <0.01% $0.370354 6.3987 $2.37 BSC <0.01% $0.000849 2,765.8047 $2.35 BSC <0.01% $0.001595 1,466.9631 $2.34 BSC <0.01% <$0.000001 1,510,737,338.077 $2.32 BSC <0.01% $40.57 0.0572 $2.32 BSC <0.01% $0.002928 789.1013 $2.31 BSC <0.01% $0.000061 37,289.3584 $2.28 BSC <0.01% $0.003063 742.6312 $2.27 BSC <0.01% $0.001173 1,936.05 $2.27 BSC <0.01% <$0.000001 20,594,277.1977 $2.25 BSC <0.01% $0.002329 960.7174 $2.24 BSC <0.01% <$0.000001 7,861,461,828.2314 $2.22 BSC <0.01% $0.039638 55.7577 $2.21 BSC <0.01% $3.93 0.5576 $2.19 BSC <0.01% $0.000001 2,361,313.7679 $2.19 BSC <0.01% <$0.000001 224,000,209.8546 $2.16 BSC <0.01% $0.00009 23,936.3875 $2.16 BSC <0.01% $0.000422 5,102.4365 $2.15 BSC <0.01% $0.001834 1,170.8572 $2.15 BSC <0.01% $0.002822 759.9107 $2.14 BSC <0.01% $0.00656 326.3095 $2.14 BSC <0.01% $0.003949 539.3401 $2.13 BSC <0.01% $0.001793 1,176.5537 $2.11 BSC <0.01% $0.041486 50.4616 $2.09 BSC <0.01% $0.00496 421.1496 $2.09 BSC <0.01% $0.000222 9,392.1977 $2.09 BSC <0.01% $0.000002 1,294,657.5519 $2.08 BSC <0.01% $0.003702 562.7743 $2.08 BSC <0.01% $0.232438 8.8101 $2.05 BSC <0.01% $0.071158 28.721 $2.04 BSC <0.01% $0.001383 1,465.4645 $2.03 BSC <0.01% $0.000288 6,812.5381 $1.96 BSC <0.01% $0.00163 1,194.8939 $1.95 BSC <0.01% $0.000005 407,804.9825 $1.93 BSC <0.01% $0.00046 4,148.2686 $1.91 BSC <0.01% $0.000293 6,481.9407 $1.9 BSC <0.01% $0.134928 13.9132 $1.88 BSC <0.01% $0.000019 98,058.6879 $1.84 BSC <0.01% $0.000006 293,915.7989 $1.83 BSC <0.01% $0.000078 23,369.403 $1.83 BSC <0.01% $0.000038 47,567.4911 $1.82 BSC <0.01% $0.040464 44.5762 $1.8 BSC <0.01% $0.02725 65.5743 $1.79 BSC <0.01% $0.015334 115.975 $1.78 BSC <0.01% $0.000133 13,345.0322 $1.78 BSC <0.01% $0.027543 64.3186 $1.77 BSC <0.01% $0.013201 132.5598 $1.75 BSC <0.01% $0.005082 340.7823 $1.73 BSC <0.01% $0.012819 133.5527 $1.71 BSC <0.01% $0.001297 1,319.406 $1.71 BSC <0.01% $0.001046 1,621.2584 $1.7 BSC <0.01% $0.100433 16.8277 $1.69 BSC <0.01% <$0.000001 11,610,921,239.7508 $1.67 BSC <0.01% $0.102959 16.2603 $1.67 BSC <0.01% <$0.000001 314,115,283.0311 $1.65 BSC <0.01% $0.024918 65.6601 $1.64 BSC <0.01% $0.000001 1,636,077.0699 $1.64 BSC <0.01% $0.995842 1.6384 $1.63 BSC <0.01% $0.069294 23.4173 $1.62 BSC <0.01% $0.000101 15,918.0502 $1.62 BSC <0.01% $0.002656 606.5102 $1.61 BSC <0.01% $0.000072 22,181.9644 $1.6 BSC <0.01% $0.004601 344.0016 $1.58 BSC <0.01% $0.008773 177.8443 $1.56 BSC <0.01% $0.00079 1,970.6602 $1.56 BSC <0.01% $0.007106 216.7961 $1.54 BSC <0.01% $0.104605 14.4953 $1.52 BSC <0.01% $0.505685 2.9969 $1.52 BSC <0.01% $0.004012 375.3251 $1.51 BSC <0.01% $0.009232 162.0338 $1.5 BSC <0.01% $0.002589 576.5025 $1.49 BSC <0.01% $0.055959 26.5383 $1.49 BSC <0.01% $0.000516 2,862.336 $1.48 BSC <0.01% $0.005455 268.8738 $1.47 BSC <0.01% $1.13 1.2551 $1.42 BSC <0.01% $0.005065 278.1568 $1.41 BSC <0.01% $0.091089 15.2911 $1.39 BSC <0.01% $18.1 0.0759 $1.37 BSC <0.01% $0.000005 293,930.651 $1.36 BSC <0.01% $0.030369 44.5905 $1.35 BSC <0.01% $0.001682 802.2417 $1.35 BSC <0.01% $0.0003 4,476.0294 $1.34 BSC <0.01% $0.000024 54,873.6815 $1.34 BSC <0.01% $0.018932 69.8356 $1.32 BSC <0.01% $0.007865 167.2764 $1.32 BSC <0.01% $572.77 0.00226788 $1.3 BSC <0.01% $15.96 0.0807 $1.29 BSC <0.01% $0.000464 2,760.9805 $1.28 BSC <0.01% $0.005412 235.5753 $1.28 BSC <0.01% $0.136908 9.3122 $1.27 BSC <0.01% $0.004694 268.9588 $1.26 BSC <0.01% $0.000856 1,469.9076 $1.26 BSC <0.01% $0.00088 1,423.9532 $1.25 BSC <0.01% $0.000001 1,281,124.5947 $1.25 BSC <0.01% $4.85 0.2578 $1.25 BSC <0.01% $0.000004 309,512.7232 $1.24 BSC <0.01% $0.005981 207.5323 $1.24 BSC <0.01% $0.00587 211.4511 $1.24 BSC <0.01% $0.003333 370.5515 $1.24 BSC <0.01% $0.000235 5,211.8671 $1.22 BSC <0.01% <$0.000001 31,853,706.547 $1.17 BSC <0.01% $0.021683 53.8503 $1.17 BSC <0.01% $0.012202 94.8461 $1.16 BSC <0.01% $0.01791 63.7992 $1.14 BSC <0.01% $0.000906 1,239.8643 $1.12 BSC <0.01% $0.097336 11.4883 $1.12 BSC <0.01% <$0.000001 323,556,955.5846 $1.11 BSC <0.01% $0.000129 8,516.9049 $1.1 BSC <0.01% $0.002184 501.7467 $1.1 BSC <0.01% $0.000002 598,931.1387 $1.09 BSC <0.01% $0.001635 653.5418 $1.07 BSC <0.01% <$0.000001 304,228,186.0348 $1.06 BSC <0.01% <$0.000001 54,211,816.0226 $1.06 BSC <0.01% $0.000025 42,163.8941 $1.06 BSC <0.01% $0.001218 856.7387 $1.04 BSC <0.01% $0.003663 282.3698 $1.03 BSC <0.01% $0.998703 1.0348 $1.03 BSC <0.01% $0.000372 2,775.9912 $1.03 BSC <0.01% $0.000235 4,390.9511 $1.03 BSC <0.01% $0.01501 67.8656 $1.02 BSC <0.01% <$0.000001 1,156,276,700,295.93 $1.01 BSC <0.01% $0.000075 13,233.6143 $0.9951 BSC <0.01% $0.541402 1.8167 $0.9835 BSC <0.01% $0.000109 8,935.0506 $0.9751 BSC <0.01% $1.15 0.8445 $0.9749 BSC <0.01% <$0.000001 8,573,893,278.4135 $0.9705 BSC <0.01% $0.013071 72.575 $0.9486 BSC <0.01% $0.000308 3,062.9084 $0.9427 BSC <0.01% $0.001899 491.6217 $0.9334 BSC <0.01% <$0.000001 147,470,620,952.921 $0.9253 BSC <0.01% $0.001592 578.4162 $0.9207 BSC <0.01% $0.001791 509.1492 $0.9119 BSC <0.01% $0.00001 89,155.1016 $0.9041 BSC <0.01% <$0.000001 504,023,214.4766 $0.902 BSC <0.01% <$0.000001 728,500,591,212.949 $0.8909 BSC <0.01% $0.00045 1,969.226 $0.8863 BSC <0.01% $0.000009 93,851.4974 $0.885 BSC <0.01% $0.014645 59.8964 $0.8771 BSC <0.01% $0.000148 5,881.2239 $0.8717 BSC <0.01% $0.000333 2,617.7088 $0.8705 BSC <0.01% <$0.000001 5,668,924.4623 $0.8696 BSC <0.01% $2.09 0.3965 $0.8286 BSC <0.01% $0.121303 6.8172 $0.8269 BSC <0.01% <$0.000001 788,652,029.6326 $0.8241 BSC <0.01% $0.00028 2,938.6811 $0.8238 BSC <0.01% $0.004325 188.4179 $0.8149 BSC <0.01% $0.004568 178.1549 $0.8137 BSC <0.01% <$0.000001 6,616,087,876,459.01 $0.8059 BSC <0.01% $0.000379 2,128.2102 $0.8057 BSC <0.01% $0.007626 105.2401 $0.8026 BSC <0.01% $0.000301 2,571.6119 $0.7739 BSC <0.01% <$0.000001 6,103,720.9528 $0.7624 BSC <0.01% $0.000045 16,749.2261 $0.7619 BSC <0.01% $2.44 0.3118 $0.7608 BSC <0.01% $601.49 0.00125934 $0.7574 BSC <0.01% $0.000037 20,376.2892 $0.7494 BSC <0.01% $0.000801 935.7012 $0.7494 BSC <0.01% <$0.000001 794,269,718.3806 $0.7446 BSC <0.01% $0.015321 48.4703 $0.7426 BSC <0.01% $0.004608 158.7056 $0.7313 BSC <0.01% $0.002421 300.0779 $0.7265 BSC <0.01% $2.16 0.3362 $0.7253 BSC <0.01% $0.000217 3,320.4332 $0.7194 BSC <0.01% <$0.000001 1,420,931,648,526.96 $0.7157 BSC <0.01% $0.013075 54.5079 $0.7126 BSC <0.01% $0.005142 138.3243 $0.7112 BSC <0.01% $0.004262 166.569 $0.7099 BSC <0.01% $0.760112 0.933 $0.7091 BSC <0.01% $0.056316 12.5501 $0.7067 BSC <0.01% <$0.000001 1,183,133,008.6258 $0.7056 BSC <0.01% $0.00007 9,880.5379 $0.6946 BSC <0.01% $0.000315 2,192.3667 $0.6911 BSC <0.01% <$0.000001 573,257,418.4411 $0.6879 BSC <0.01% $0.005789 118.4129 $0.6855 BSC <0.01% $0.00104 654.0512 $0.6803 BSC <0.01% $0.003194 212.9293 $0.68 BSC <0.01% $0.144166 4.7098 $0.6789 BSC <0.01% $0.000951 713.1657 $0.6782 BSC <0.01% $0.000038 17,084.2403 $0.6557 BSC <0.01% $0.017022 38.4692 $0.6548 BSC <0.01% $0.000456 1,432.7096 $0.6535 BSC <0.01% <$0.000001 309,344,143.419 $0.6514 BSC <0.01% $0.000452 1,432.9472 $0.6471 BSC <0.01% <$0.000001 5,530,704,955.7161 $0.6445 BSC <0.01% $0.00303 210.3897 $0.6373 BSC <0.01% $1.33 0.4789 $0.6368 BSC <0.01% $0.035389 17.8484 $0.6316 BSC <0.01% $0.000007 95,247.9219 $0.6307 BSC <0.01% $0.028301 22.1718 $0.6274 BSC <0.01% $0.005338 117.1825 $0.6255 BSC <0.01% $0.163013 3.8114 $0.6213 BSC <0.01% <$0.000001 10,694,216,529.3792 $0.6168 BSC <0.01% $0.002893 212.7933 $0.6155 BSC <0.01% $0.012285 49.849 $0.6123 BSC <0.01% $0.000413 1,472.9596 $0.6088 BSC <0.01% $0.000001 665,359.0231 $0.5978 BSC <0.01% $0.004656 126.8439 $0.5906 BSC <0.01% <$0.000001 1,235,757.5757 $0.5876 BSC <0.01% $0.003404 169.7951 $0.5779 BSC <0.01% $0.000285 2,022.4219 $0.577 BSC <0.01% $0.187642 3.0608 $0.5743 BSC <0.01% $1.11 0.5163 $0.573 BSC <0.01% $0.001717 333.3638 $0.5725 BSC <0.01% $0.100425 5.6269 $0.565 BSC <0.01% $0.000434 1,286.3791 $0.5588 BSC <0.01% $0.000002 261,257.149 $0.557 BSC <0.01% <$0.000001 1,763,299.5911 $0.5556 BSC <0.01% $0.014556 38.1688 $0.5555 BSC <0.01% $0.000006 91,806.9545 $0.5535 BSC <0.01% <$0.000001 982,643,821,941.132 $0.5408 BSC <0.01% $0.000917 570.1121 $0.523 BSC <0.01% $0.000054 9,655.4093 $0.5208 BSC <0.01% $13.47 0.0387 $0.5207 BSC <0.01% $0.00134 388.447 $0.5204 BSC <0.01% $0.203389 2.5235 $0.5132 BSC <0.01% $0.001994 256.8224 $0.512 BSC <0.01% <$0.000001 1,451,871.0048 $0.5095 BSC <0.01% $0.000012 42,254.0751 $0.5019 BSC <0.01% <$0.000001 178,574,910.211 $0.50 BSC <0.01% $0.139567 3.5787 $0.4994 BSC <0.01% <$0.000001 1,579,765.686 $0.4978 BSC <0.01% $0.06787 7.2181 $0.4898 BSC <0.01% $0.001217 401.5909 $0.4888 BSC <0.01% $0.191426 2.5285 $0.484 BSC <0.01% $0.005991 79.8321 $0.4782 BSC <0.01% $0.001281 372.7 $0.4774 BSC <0.01% $0.00043 1,107.7203 $0.4763 BSC <0.01% $0.000515 924.4135 $0.4757 BSC <0.01% $1 0.4704 $0.4722 BSC <0.01% <$0.000001 841,332,026.4239 $0.4694 BSC <0.01% $0.002071 224.3899 $0.4646 BSC <0.01% $0.003361 137.8692 $0.4634 BSC <0.01% $0.270795 1.7073 $0.4623 BSC <0.01% $0.000269 1,691.0175 $0.4556 BSC <0.01% <$0.000001 7,753,705.24 $0.4551 BSC <0.01% <$0.000001 138,072,948,868.251 $0.4436 BSC <0.01% $0.003047 141.6686 $0.4316 BSC <0.01% $0.000013 34,253.9254 $0.4288 BSC <0.01% $0.000617 688.9062 $0.4248 BSC <0.01% $0.00112 377.2328 $0.4225 BSC <0.01% $0.04708 8.9461 $0.4211 BSC <0.01% $0.00263 159.3116 $0.4189 BSC <0.01% $1.22 0.3434 $0.4188 BSC <0.01% $0.012533 33.3309 $0.4177 BSC <0.01% $0.082501 5.0477 $0.4164 BSC <0.01% $0.001584 261.8425 $0.4148 BSC <0.01% $0.000643 640.8247 $0.4122 BSC <0.01% $0.000449 906.2512 $0.4068 BSC <0.01% $0.257509 1.5763 $0.4059 BSC <0.01% $0.204232 1.9852 $0.4054 BSC <0.01% $17.33 0.0233 $0.4042 BSC <0.01% $0.002637 151.2054 $0.3987 BSC <0.01% $0.022907 17.2811 $0.3958 BSC <0.01% $0.024208 15.8132 $0.3828 BSC <0.01% $2.25 0.1696 $0.3816 BSC <0.01% $0.002208 172.6884 $0.3812 BSC <0.01% $0.022907 16.3341 $0.3741 BSC <0.01% $0.000002 200,030.2244 $0.3697 BSC <0.01% $0.003593 102.8707 $0.3696 BSC <0.01% $0.014472 25.0545 $0.3625 BSC <0.01% $0.037472 9.614 $0.3602 BSC <0.01% $6.67 0.0527 $0.3516 BSC <0.01% $0.375207 0.9342 $0.3505 BSC <0.01% $0.000165 2,116.903 $0.3502 BSC <0.01% $0.000566 605.8913 $0.3432 BSC <0.01% $0.003227 105.7883 $0.3413 BSC <0.01% <$0.000001 750,657.2963 $0.3388 BSC <0.01% $0.020963 15.9843 $0.335 BSC <0.01% $0.829219 0.3896 $0.323 BSC <0.01% $0.006912 45.7706 $0.3163 BSC <0.01% <$0.000001 257,390,157.9527 $0.316 BSC <0.01% $0.000057 5,462.3587 $0.3103 BSC <0.01% $0.223601 1.3674 $0.3057 BSC <0.01% $0.001791 166.8215 $0.2987 BSC <0.01% $0.004799 60.7897 $0.2917 BSC <0.01% $0.000081 3,605.4151 $0.2913 BSC <0.01% $0.007607 38.2595 $0.291 BSC <0.01% $13.23 0.0218 $0.289 BSC <0.01% $1.84 0.1562 $0.2873 BSC <0.01% $0.00001 27,329.419 $0.2861 BSC <0.01% $0.000398 717.1716 $0.2857 BSC <0.01% <$0.000001 787,858,329.5082 $0.2811 BSC <0.01% $0.000038 7,317.0161 $0.2744 BSC <0.01% $0.000191 1,434.8571 $0.2743 BSC <0.01% $0.000795 342.1255 $0.2718 BSC <0.01% $1,248.21 0.00021228 $0.2649 BSC <0.01% $0.548664 0.482 $0.2644 BSC <0.01% $0.000004 62,039.0947 $0.2642 BSC <0.01% $1 0.2626 $0.2632 BSC <0.01% $0.000012 21,629.4842 $0.2599 BSC <0.01% $0.028226 9.0333 $0.2549 BSC <0.01% $0.001752 145.0864 $0.2542 BSC <0.01% $0.004531 56.0039 $0.2537 BSC <0.01% <$0.000001 4,703,671.3714 $0.2504 BSC <0.01% $0.000224 1,118.5155 $0.25 BSC <0.01% $0.001171 210.0506 $0.2459 BSC <0.01% $0.003227 75.5973 $0.2439 BSC <0.01% <$0.000001 4,992,842,843.6957 $0.2416 BSC <0.01% $0.001098 214.8404 $0.2359 BSC <0.01% <$0.000001 8,834,520,443.2051 $0.2353 BSC <0.01% $0.020789 11.2125 $0.2331 BSC <0.01% $0.003222 72.3366 $0.233 BSC <0.01% $0.000089 2,610.291 $0.2321 BSC <0.01% $0.080482 2.8508 $0.2294 BSC <0.01% $0.01188 19.2248 $0.2283 BSC <0.01% <$0.000001 1,937,298,289.2182 $0.2254 BSC <0.01% $0.000732 306.8061 $0.2246 BSC <0.01% <$0.000001 89,116,640,878.5803 $0.2197 BSC <0.01% $0.001119 195.6052 $0.2189 BSC <0.01% $0.013185 16.1906 $0.2134 BSC <0.01% <$0.000001 352,138,483.4114 $0.2112 BSC <0.01% $0.04649 4.5029 $0.2093 BSC <0.01% $0.505826 0.4129 $0.2088 BSC <0.01% $0.003887 53.3193 $0.2072 BSC <0.01% $0.000314 651.1108 $0.2047 BSC <0.01% $0.000107 1,883.4656 $0.202 BSC <0.01% $0.000049 4,130.7618 $0.2019 BSC <0.01% $0.000022 9,192.7171 $0.1998 BSC <0.01% $0.288681 0.6922 $0.1998 BSC <0.01% $0.004335 45.7766 $0.1984 BSC <0.01% $0.000669 296.4082 $0.1982 BSC <0.01% $0.001143 172.7011 $0.1974 BSC <0.01% <$0.000001 60,902,941,942.0754 $0.1935 BSC <0.01% $0.000924 205.81 $0.1901 BSC <0.01% $0.494659 0.3838 $0.1898 BSC <0.01% $0.001865 101.7774 $0.1898 BSC <0.01% $0.000065 2,807.903 $0.1821 BSC <0.01% $0.004399 40.5029 $0.1781 BSC <0.01% <$0.000001 504,165,227.9965 $0.1763 BSC <0.01% $0.000064 2,706.9593 $0.1738 BSC <0.01% $0.000433 399.5578 $0.1729 BSC <0.01% <$0.000001 142,910,929,482.458 $0.1697 BSC <0.01% $0.002714 61.3348 $0.1664 BSC <0.01% <$0.000001 100,327,415.8153 $0.1641 BSC <0.01% $0.08543 1.8513 $0.1581 BSC <0.01% $0.009514 16.5076 $0.157 BSC <0.01% $0.000705 220.3353 $0.1554 BSC <0.01% $0.000711 216.0944 $0.1537 BSC <0.01% $0.00023 666.7898 $0.1531 BSC <0.01% $0.000002 87,689.4 $0.1517 BSC <0.01% $0.041579 3.6278 $0.1508 BSC <0.01% $0.011406 13.1203 $0.1496 BSC <0.01% $0.006593 22.609 $0.149 BSC <0.01% <$0.000001 29,349,705,860,397.9 $0.1483 BSC <0.01% $0.000343 432.5832 $0.1482 BSC <0.01% $0.001481 96.8674 $0.1434 BSC <0.01% $0.000087 1,634.4796 $0.1428 BSC <0.01% $0.000926 153.5014 $0.1421 BSC <0.01% $0.05427 2.5973 $0.1409 BSC <0.01% $0.829519 0.1681 $0.1394 BSC <0.01% $0.000064 2,190.9267 $0.1393 BSC <0.01% $0.000002 56,004.6791 $0.1393 BSC <0.01% $1.46 0.0945 $0.1384 BSC <0.01% $0.02406 5.6879 $0.1368 BSC <0.01% $0.000016 8,243.929 $0.1352 BSC <0.01% $0.00164 80.543 $0.132 BSC <0.01% $0.004919 26.706 $0.1313 BSC <0.01% $0.000002 66,184.315 $0.1303 BSC <0.01% <$0.000001 1,060,039,370.7462 $0.1273 BSC <0.01% $0.000139 908.11 $0.1263 BSC <0.01% $0.001869 67.47 $0.126 BSC <0.01% $0.128738 0.9657 $0.1243 BSC <0.01% $0.001667 73.9206 $0.1231 BSC <0.01% $0.008089 15.2063 $0.123 BSC <0.01% $0.000499 246.2252 $0.1228 BSC <0.01% $0.003632 33.7508 $0.1225 BSC <0.01% $0.000072 1,671.9062 $0.1197 BSC <0.01% $0.000521 228.6794 $0.1192 BSC <0.01% $2,389.98 0.00004943 $0.1181 BSC <0.01% <$0.000001 6,623,214,499.3628 $0.118 BSC <0.01% $0.000673 173.4258 $0.1167 BSC <0.01% $2,786.43 0.0000416 $0.1159 BSC <0.01% $0.000002 67,773.5898 $0.1134 BSC <0.01% $0.004447 25.2431 $0.1122 BSC <0.01% $0.00032 347.8623 $0.1112 BSC <0.01% $0.000053 2,024.4777 $0.1082 BSC <0.01% $0.000342 313.4938 $0.1072 BSC <0.01% <$0.000001 10,771,888,199.5593 $0.1069 BSC <0.01% <$0.000001 1,522,769.814 $0.1067 BSC <0.01% $0.008807 12.0551 $0.1061 BSC <0.01% $0.000137 772.5011 $0.1056 BSC <0.01% $0.002804 37.3984 $0.1048 BSC <0.01% $0.001006 103.1162 $0.1037 BSC <0.01% $0.020007 5.0928 $0.1018 BSC <0.01% $0.000043 2,329.5762 $0.1006 BSC <0.01% $553.44 0.00000010912 $0.00006 ETH 0.28% $0.000001 1,705,718,461,379,510 $957,860,204.34 ETH <0.01% $1 22,232.7223 $22,232.72 ETH <0.01% $2,390.77 6.4426 $15,402.84 ETH <0.01% <$0.000001 59,598,332,367.1343 $9,883.51 ETH <0.01% $0.000258 13,174,991.3968 $3,395.59 ETH <0.01% <$0.000001 9,556,857,735.0185 $1,583 ETH <0.01% $1 1,504.402 $1,505.91 ETH <0.01% $0.231936 6,162.1734 $1,429.23 ETH <0.01% $0.000009 138,068,087.6614 $1,257.8 ETH <0.01% <$0.000001 16,002,607,228.5464 $1,225.16 ETH <0.01% <$0.000001 12,759,929,037.7771 $1,186.16 ETH <0.01% $552.85 2.1175 $1,170.67 ETH <0.01% <$0.000001 21,673,850,290.4925 $1,113.77 ETH <0.01% $1 917.5066 $918.42 ETH <0.01% $0.997792 872.4155 $870.49 ETH <0.01% $0.005233 155,597.4056 $814.25 ETH <0.01% $1.69 481.6531 $813.99 ETH <0.01% $0.635926 1,264.2827 $803.99 ETH <0.01% $61,394 0.013 $799.24 ETH <0.01% $0.005296 149,108.096 $789.69 ETH <0.01% $0.997382 787.2195 $785.16 ETH <0.01% $0.156913 4,987.2108 $782.56 ETH <0.01% $0.000126 6,199,389.6975 $781.06 ETH <0.01% $1,456 0.5359 $780.32 ETH <0.01% $0.00016 4,846,258.7608 $773.36 ETH <0.01% $2.2 341.6762 $751.69 ETH <0.01% $4,951.88 0.1516 $750.58 ETH <0.01% $44.28 16.8386 $745.61 ETH <0.01% $3.79 196.5854 $745.06 ETH <0.01% $0.016829 43,937.9551 $739.41 ETH <0.01% $0.091532 7,817.3848 $715.54 ETH <0.01% $5.55 128.5861 $713.65 ETH <0.01% $0.157328 4,504.9536 $708.76 ETH <0.01% $16.83 39.8079 $669.97 ETH <0.01% $0.74155 903.0807 $669.68 ETH <0.01% <$0.000001 1,896,852,773.1986 $665.77 ETH <0.01% <$0.000001 60,800,247,909.4272 $664.12 ETH <0.01% $6.14 104.8687 $643.89 ETH <0.01% $0.003755 165,400.6555 $621.15 ETH <0.01% $2.17 282.7748 $613.62 ETH <0.01% $0.004887 125,432.6979 $612.99 ETH <0.01% $0.028774 21,088.0754 $606.78 ETH <0.01% $2.58 232.7294 $600.44 ETH <0.01% $1.17 513.0859 $600.31 ETH <0.01% <$0.000001 43,311,808,518.1708 $591.12 ETH <0.01% $0.639729 920.3121 $588.75 ETH <0.01% $0.002696 218,036.6643 $587.88 ETH <0.01% $0.165146 3,543.1151 $585.13 ETH <0.01% $0.576204 998.8967 $575.57 ETH <0.01% $0.022583 25,383.3874 $573.23 ETH <0.01% $2,663.68 0.2122 $565.28 ETH <0.01% $0.109588 5,147.1263 $564.06 ETH <0.01% $0.000134 4,187,112.6753 $561.83 ETH <0.01% $1 554.3004 $554.85 ETH <0.01% $0.006382 86,687.8268 $553.22 ETH <0.01% $0.002454 223,869.8468 $549.28 ETH <0.01% $2.92 187.9168 $548.99 ETH <0.01% $0.400849 1,342.664 $538.21 ETH <0.01% $0.123487 4,347.1143 $536.81 ETH <0.01% $0.294683 1,805.2002 $531.96 ETH <0.01% $0.189974 2,780.3323 $528.19 ETH <0.01% $9.95 51.939 $516.79 ETH <0.01% $0.000013 38,543,870.235 $515.09 ETH <0.01% $0.542207 942.2919 $510.92 ETH <0.01% $0.136132 3,742.3487 $509.45 ETH <0.01% $1.1 459.4293 $507.37 ETH <0.01% $0.00471 106,205.967 $500.27 ETH <0.01% $0.477566 1,041.971 $497.61 ETH <0.01% $46.52 10.6681 $496.28 ETH <0.01% $0.000001 621,492,770.3599 $486.07 ETH <0.01% $0.000052 9,354,356.2087 $484.18 ETH <0.01% $60,748 0.00796563 $483.9 ETH <0.01% $0.000025 19,162,084.9623 $481.54 ETH <0.01% $267.16 1.7948 $479.49 ETH <0.01% $0.002359 201,275.0767 $474.76 ETH <0.01% $0.01965 24,030.5586 $472.2 ETH <0.01% $0.604542 764.5851 $462.22 ETH <0.01% <$0.000001 6,441,957,601.9705 $461.26 ETH <0.01% $0.630043 729.7498 $459.77 ETH <0.01% $0.323271 1,418.7385 $458.64 ETH <0.01% $0.029912 15,153.8994 $453.29 ETH <0.01% $0.003798 118,236.3189 $449.07 ETH <0.01% $0.003041 146,322.6033 $445.01 ETH <0.01% $0.023724 18,659.5307 $442.68 ETH <0.01% $0.028446 15,369.7329 $437.21 ETH <0.01% $1.45 295.2343 $428.09 ETH <0.01% $17.04 24.8728 $423.83 ETH <0.01% $0.368536 1,137.7423 $419.3 ETH <0.01% $0.507124 817.8114 $414.73 ETH <0.01% $0.007056 58,526.365 $412.97 ETH <0.01% $0.000017 24,214,831.3852 $408.02 ETH <0.01% $1.38 294.6078 $406.49 ETH <0.01% $0.000028 14,501,071.0175 $406.26 ETH <0.01% $1.85 219.3434 $405.79 ETH <0.01% $0.003087 129,613.4747 $400.09 ETH <0.01% $0.306151 1,304.6929 $399.43 ETH <0.01% $1 390.5425 $390.54 ETH <0.01% $0.011172 34,925.8089 $390.19 ETH <0.01% $1.55 251.661 $390.07 ETH <0.01% $0.000005 69,714,361.3382 $380.64 ETH <0.01% $0.080672 4,487.6509 $362.03 ETH <0.01% $0.160049 2,236.0648 $357.88 ETH <0.01% <$0.000001 31,965,441,786.8842 $356.38 ETH <0.01% $0.003196 109,953.1651 $351.46 ETH <0.01% $0.102505 3,390.132 $347.51 ETH <0.01% $0.123108 2,799.6639 $344.66 ETH <0.01% <$0.000001 5,827,287,789.3702 $340.54 ETH <0.01% $0.073159 4,653.2915 $340.43 ETH <0.01% $0.056116 6,044.6753 $339.2 ETH <0.01% $0.019295 17,498.1748 $337.63 ETH <0.01% $0.15178 2,186.173 $331.82 ETH <0.01% $9.91 32.5186 $322.26 ETH <0.01% $0.001759 182,454.1721 $321 ETH <0.01% $0.017532 18,283.7792 $320.55 ETH <0.01% $1.09 294.1963 $320.38 ETH <0.01% $0.269101 1,162.4516 $312.82 ETH <0.01% $0.000002 132,175,194.8757 $310.61 ETH <0.01% $0.260943 1,189.77 $310.46 ETH <0.01% $33.9 8.9474 $303.32 ETH <0.01% $0.018191 16,451.3202 $299.26 ETH <0.01% $0.329584 900.9099 $296.93 ETH <0.01% $0.001551 190,957.4 $296.08 ETH <0.01% $1.97 145.4947 $285.91 ETH <0.01% $3.47 82.2497 $285.67 ETH <0.01% <$0.000001 1,116,567,613,066.1 $285.46 ETH <0.01% $0.388023 730.6413 $283.51 ETH <0.01% $0.100051 2,827.9494 $282.94 ETH <0.01% $0.000016 16,910,787.2128 $278.86 ETH <0.01% $0.335765 809.6829 $271.86 ETH <0.01% $0.000001 390,101,406.0989 $267.76 ETH <0.01% $0.34395 777.4838 $267.42 ETH <0.01% $0.086411 3,081.0817 $266.24 ETH <0.01% $0.115404 2,279.3445 $263.05 ETH <0.01% $0.000101 2,601,945.5166 $262.48 ETH <0.01% $3.47 74.7948 $259.54 ETH <0.01% $0.011268 22,937.3182 $258.46 ETH <0.01% $0.090768 2,812.7138 $255.3 ETH <0.01% $0.409218 623.869 $255.3 ETH <0.01% $0.102237 2,491.5612 $254.73 ETH <0.01% $0.286861 887.6317 $254.63 ETH <0.01% $553.61 0.4598 $254.57 ETH <0.01% $3.83 65.9567 $252.61 ETH <0.01% $2.99 83.7204 $250.32 ETH <0.01% <$0.000001 19,619,011,499.5114 $247.4 ETH <0.01% $0.320165 770.0126 $246.53 ETH <0.01% $0.400893 614.2454 $246.25 ETH <0.01% $0.551907 439.8142 $242.74 ETH <0.01% $0.000005 46,010,089.6942 $242.29 ETH <0.01% $0.084558 2,856.0504 $241.5 ETH <0.01% $0.193293 1,247.8779 $241.21 ETH <0.01% $520.35 0.4549 $236.72 ETH <0.01% $0.000016 14,259,878.8414 $233.09 ETH <0.01% $3.18 72.3567 $230.09 ETH <0.01% $0.022839 10,032.6118 $229.13 ETH <0.01% $0.008338 27,346.8402 $228.02 ETH <0.01% $0.06319 3,585.0472 $226.54 ETH <0.01% $0.262726 860.9047 $226.18 ETH <0.01% $0.080102 2,821.8996 $226.04 ETH <0.01% $0.435548 517.6515 $225.46 ETH <0.01% $0.000004 55,139,263.9043 $224.97 ETH <0.01% $0.000005 47,971,835.1747 $223.46 ETH <0.01% $0.000867 256,844.4091 $222.64 ETH <0.01% $5.37 41.2789 $221.67 ETH <0.01% $0.249702 880.4153 $219.84 ETH <0.01% $0.37953 578.5286 $219.57 ETH <0.01% $0.207557 1,044.3533 $216.76 ETH <0.01% $0.562126 383.4887 $215.57 ETH <0.01% $0.094184 2,253.5763 $212.25 ETH <0.01% $3.01 70.237 $211.71 ETH <0.01% $0.282622 743.6233 $210.16 ETH <0.01% $0.000001 139,755,559.5008 $206.36 ETH <0.01% <$0.000001 539,191,942.7143 $204.7 ETH <0.01% $0.114747 1,769.4562 $203.04 ETH <0.01% $0.146981 1,379.3493 $202.74 ETH <0.01% $0.000011 18,580,084.5125 $201.22 ETH <0.01% $0.02423 8,210.3816 $198.93 ETH <0.01% $11.05 17.977 $198.65 ETH <0.01% <$0.000001 15,792,852,165.2484 $197.2 ETH <0.01% $0.380839 517.161 $196.96 ETH <0.01% $0.154846 1,268.8639 $196.48 ETH <0.01% $0.000002 91,974,134.8873 $196.1 ETH <0.01% $0.40696 479.7735 $195.25 ETH <0.01% <$0.000001 2,152,878,291.4468 $194.68 ETH <0.01% $0.206666 940.3132 $194.33 ETH <0.01% $0.877911 213.9685 $187.85 ETH <0.01% $0.321562 580.8238 $186.77 ETH <0.01% $0.000001 222,916,045.4886 $183.68 ETH <0.01% $0.291808 626.4409 $182.8 ETH <0.01% $10.92 16.6903 $182.34 ETH <0.01% $0.006358 28,640.1267 $182.11 ETH <0.01% <$0.000001 5,825,017,311.4648 $181.33 ETH <0.01% $0.14617 1,217.0822 $177.9 ETH <0.01% $0.253994 697.1547 $177.07 ETH <0.01% $0.098721 1,793.5523 $177.06 ETH <0.01% $0.08366 2,089.2752 $174.79 ETH <0.01% $1.89 91.8703 $173.37 ETH <0.01% $0.094397 1,835.7279 $173.29 ETH <0.01% $0.000384 448,706.391 $172.39 ETH <0.01% $0.010733 16,039.5008 $172.14 ETH <0.01% $0.002591 66,281.1097 $171.71 ETH <0.01% $0.000825 206,136.8941 $170.1 ETH <0.01% $0.250347 670.4256 $167.84 ETH <0.01% $0.000006 30,403,919.7384 $167.66 ETH <0.01% $0.999753 166.47 $166.43 ETH <0.01% $0.033951 4,898.6056 $166.31 ETH <0.01% $0.001244 133,424.2466 $165.99 ETH <0.01% $0.000021 7,814,112.1074 $163.94 ETH <0.01% $0.022393 7,309.7471 $163.69 ETH <0.01% $0.698839 233.588 $163.24 ETH <0.01% <$0.000001 30,855,054,594.8265 $162.82 ETH <0.01% $0.009617 16,676.497 $160.38 ETH <0.01% $0.034142 4,672.8038 $159.54 ETH <0.01% $0.00106 149,934.5624 $158.87 ETH <0.01% $2,668.31 0.0594 $158.37 ETH <0.01% $5,238,358.25 0.00003014 $157.87 ETH <0.01% $0.007983 19,592.1254 $156.4 ETH <0.01% $0.000006 24,348,852.6102 $155.83 ETH <0.01% $1.01 154.3103 $155.08 ETH <0.01% $0.118448 1,294.0917 $153.28 ETH <0.01% <$0.000001 94,806,241,201.907 $149.83 ETH <0.01% $0.062077 2,412.2522 $149.75 ETH <0.01% $0.013944 10,703.2371 $149.24 ETH <0.01% $0.000085 1,751,498.1792 $148.67 ETH <0.01% $0.380329 390.2732 $148.43 ETH <0.01% $0.003728 39,057.2497 $145.62 ETH <0.01% <$0.000001 13,864,079,762.9631 $143.71 ETH <0.01% $0.05822 2,448.9734 $142.58 ETH <0.01% $1.9 74.6748 $141.88 ETH <0.01% $0.005375 26,360.0126 $141.69 ETH <0.01% $1.35 104.2915 $140.79 ETH <0.01% <$0.000001 13,674,643,861.3582 $140.77 ETH <0.01% $0.032137 4,351.5914 $139.85 ETH <0.01% $0.005104 27,359.5807 $139.65 ETH <0.01% $0.00037 371,129.5495 $137.2 ETH <0.01% $0.049582 2,744.5737 $136.08 ETH <0.01% $0.000021 6,435,763.6691 $135.15 ETH <0.01% $0.003988 33,794.6778 $134.79 ETH <0.01% $0.060069 2,242.7098 $134.72 ETH <0.01% $0.23951 560.749 $134.31 ETH <0.01% $0.046665 2,867.5076 $133.81 ETH <0.01% $0.147506 900.8666 $132.88 ETH <0.01% $0.003936 33,558.5204 $132.08 ETH <0.01% $0.849625 152.8775 $129.89 ETH <0.01% $0.037341 3,429.6483 $128.07 ETH <0.01% $0.375225 339.5347 $127.4 ETH <0.01% $0.002579 49,050.8301 $126.51 ETH <0.01% $0.006604 19,151.8307 $126.49 ETH <0.01% $0.607451 207.8597 $126.26 ETH <0.01% $1 126.0138 $126.06 ETH <0.01% $0.000001 139,011,562.9314 $125.47 ETH <0.01% $0.011525 10,876.8652 $125.36 ETH <0.01% $0.083299 1,504.2455 $125.3 ETH <0.01% $0.00065 192,602.3775 $125.24 ETH <0.01% $0.000033 3,789,748.9085 $124.64 ETH <0.01% $0.000525 235,746.3817 $123.69 ETH <0.01% $0.021127 5,777.9609 $122.07 ETH <0.01% $25.24 4.8137 $121.5 ETH <0.01% $0.000002 53,552,992.5294 $120.91 ETH <0.01% $14.1 8.4477 $119.11 ETH <0.01% $0.001747 67,764.8895 $118.39 ETH <0.01% $0.097195 1,213.075 $117.91 ETH <0.01% $0.167387 701.3737 $117.4 ETH <0.01% $0.00005 2,328,478.231 $115.31 ETH <0.01% $0.018841 5,969.8403 $112.48 ETH <0.01% $0.125831 893.52 $112.43 ETH <0.01% $0.822492 135.2971 $111.28 ETH <0.01% $0.037473 2,965.2035 $111.12 ETH <0.01% $15.95 6.9205 $110.38 ETH <0.01% $0.000005 21,979,771.7956 $109.39 ETH <0.01% <$0.000001 24,504,106,927.3908 $109.07 ETH <0.01% $0.265504 409.775 $108.8 ETH <0.01% $69.9 1.5527 $108.54 ETH <0.01% $0.000013 8,635,024.9065 $108.28 ETH <0.01% $0.219192 493.4656 $108.16 ETH <0.01% $0.471308 226.3623 $106.69 ETH <0.01% $0.081017 1,303.5304 $105.61 ETH <0.01% $0.035481 2,955.2088 $104.85 ETH <0.01% <$0.000001 41,580,900,253.4615 $104.08 ETH <0.01% $36.8 2.8192 $103.75 ETH <0.01% $13.18 7.8125 $102.97 ETH <0.01% $0.000167 615,780.1815 $102.95 ETH <0.01% $12.21 8.3958 $102.51 ETH <0.01% $0.395969 257.889 $102.12 ETH <0.01% $0.000268 378,102.065 $101.27 ETH <0.01% $0.111952 894.1298 $100.1 ETH <0.01% $1.41 70.8954 $99.96 ETH <0.01% $0.173201 576.1276 $99.79 ETH <0.01% <$0.000001 156,939,352,460.861 $99.48 ETH <0.01% $0.000412 240,610.3987 $99.12 ETH <0.01% <$0.000001 101,854,170,990.881 $97.6 ETH <0.01% $0.311577 313.2232 $97.59 ETH <0.01% $0.035 2,739.4873 $95.88 ETH <0.01% $1.48 64.5275 $95.57 ETH <0.01% $59.89 1.5818 $94.73 ETH <0.01% <$0.000001 8,541,159,524.6026 $92.35 ETH <0.01% $1.26 73.1909 $92.22 ETH <0.01% $0.004142 22,261.0333 $92.21 ETH <0.01% $0.02891 3,187.0521 $92.14 ETH <0.01% $0.000444 206,636.1037 $91.71 ETH <0.01% $0.15178 602.6223 $91.47 ETH <0.01% $0.697852 130.8099 $91.29 ETH <0.01% $0.162723 560.526 $91.21 ETH <0.01% $0.077587 1,164.3569 $90.34 ETH <0.01% $1.48 60.6068 $89.7 ETH <0.01% $1.28 69.6806 $89.19 ETH <0.01% $0.0044 20,131.8407 $88.59 ETH <0.01% $0.028847 3,070.59 $88.58 ETH <0.01% $0.026362 3,343.8714 $88.15 ETH <0.01% $0.026639 3,292.1925 $87.7 ETH <0.01% $0.000618 140,597.2417 $86.88 ETH <0.01% $0.204035 424.3367 $86.58 ETH <0.01% $0.815071 105.9656 $86.37 ETH <0.01% $0.004775 18,082.698 $86.35 ETH <0.01% $0.013793 6,245.0665 $86.14 ETH <0.01% $0.001339 64,193.56 $85.93 ETH <0.01% $0.00001 8,343,681.3639 $85.44 ETH <0.01% $0.005869 14,511.8016 $85.17 ETH <0.01% $0.169853 493.5102 $83.82 ETH <0.01% $1.56 53.545 $83.53 ETH <0.01% $0.024446 3,349.8941 $81.89 ETH <0.01% $0.002546 31,902.9392 $81.24 ETH <0.01% $0.000003 29,974,708.8138 $77.93 ETH <0.01% $0.019806 3,933.745 $77.91 ETH <0.01% $0.013796 5,631.113 $77.68 ETH <0.01% $0.005444 14,266.857 $77.67 ETH <0.01% $0.02612 2,962.0126 $77.37 ETH <0.01% $41.38 1.8614 $77.02 ETH <0.01% $0.250445 307.3433 $76.97 ETH <0.01% $6.79 11.3304 $76.93 ETH <0.01% $0.328742 233.8198 $76.87 ETH <0.01% $0.000001 93,604,234.7768 $76.83 ETH <0.01% <$0.000001 39,830,510,564.3256 $76.04 ETH <0.01% $0.000007 10,819,261.8146 $75.67 ETH <0.01% $1.11 68.0885 $75.58 ETH <0.01% <$0.000001 938,985,914,256.237 $75.21 ETH <0.01% $5.19 14.4856 $75.18 ETH <0.01% $1.38 54.4736 $75.17 ETH <0.01% $1.2 61.7659 $74.12 ETH <0.01% $0.583829 125.1411 $73.06 ETH <0.01% $0.167828 434.3665 $72.9 ETH <0.01% $0.060797 1,188.6685 $72.27 ETH <0.01% $0.000023 3,140,502.546 $71.38 ETH <0.01% $0.027595 2,575.1154 $71.06 ETH <0.01% <$0.000001 22,016,162,278.7512 $70.87 ETH <0.01% <$0.000001 278,342,175.5503 $70.64 ETH <0.01% $0.288739 243.1291 $70.2 ETH <0.01% $446.73 0.156 $69.7 ETH <0.01% $0.000013 5,160,296.3861 $69.35 ETH <0.01% $0.00302 22,953.826 $69.33 ETH <0.01% $17.19 4.0258 $69.2 ETH <0.01% $0.282355 241.2754 $68.13 ETH <0.01% $1.03 66.4204 $68.08 ETH <0.01% $1.07 62.8567 $67.38 ETH <0.01% $0.57604 115.3566 $66.45 ETH <0.01% $0.115697 572.5229 $66.24 ETH <0.01% $0.152283 431.5256 $65.71 ETH <0.01% $4.83 13.5535 $65.46 ETH <0.01% $0.001068 61,083.0745 $65.21 ETH <0.01% $0.000001 118,501,912.8329 $65.01 ETH <0.01% $0.208092 309.6561 $64.44 ETH <0.01% $0.003596 17,666.7844 $63.52 ETH <0.01% $0.037156 1,703.0511 $63.28 ETH <0.01% $0.002347 26,710.1769 $62.69 ETH <0.01% $0.403628 154.886 $62.52 ETH <0.01% <$0.000001 133,190,485.887 $61.96 ETH <0.01% $0.000004 14,481,907.523 $61.55 ETH <0.01% $0.224624 270.1854 $60.69 ETH <0.01% $0.053864 1,125.7842 $60.64 ETH <0.01% $0.017686 3,426.0893 $60.59 ETH <0.01% $0.019768 3,042.611 $60.14 ETH <0.01% $4.66 12.854 $59.9 ETH <0.01% $0.001395 42,069.5455 $58.68 ETH <0.01% $0.068081 853.5024 $58.11 ETH <0.01% $0.208789 277.9945 $58.04 ETH <0.01% $0.00001 5,771,612.5235 $58.01 ETH <0.01% $0.118236 488.3012 $57.73 ETH <0.01% $0.001552 36,698.2031 $56.97 ETH <0.01% $0.002401 23,668.2443 $56.83 ETH <0.01% $0.389915 145.1032 $56.58 ETH <0.01% $0.001223 46,231.5377 $56.54 ETH <0.01% $0.047099 1,186.7443 $55.89 ETH <0.01% $0.000031 1,804,214.6324 $55.8 ETH <0.01% $0.039507 1,408.0247 $55.63 ETH <0.01% <$0.000001 228,219,082,037.946 $55.27 ETH <0.01% $0.010412 5,268.3358 $54.85 ETH <0.01% <$0.000001 154,234,709.8728 $54.42 ETH <0.01% $0.000016 3,366,640.0199 $53.84 ETH <0.01% $0.127288 422.9002 $53.83 ETH <0.01% $0.11257 476.3296 $53.62 ETH <0.01% $360.87 0.1485 $53.58 ETH <0.01% $0.118911 448 $53.27 ETH <0.01% $0.020451 2,603.2048 $53.24 ETH <0.01% $0.988113 53.7089 $53.07 ETH <0.01% $0.999099 53.0342 $52.99 ETH <0.01% $0.000065 807,310.6064 $52.78 ETH <0.01% $0.017565 2,985.6669 $52.44 ETH <0.01% $0.051731 1,003.8503 $51.93 ETH <0.01% $0.08344 621.9544 $51.9 ETH <0.01% $0.080714 634.4819 $51.21 ETH <0.01% $0.035054 1,452.3398 $50.91 ETH <0.01% $0.771828 65.8774 $50.85 ETH <0.01% $0.222712 226.7459 $50.5 ETH <0.01% $0.002178 23,155.5343 $50.44 ETH <0.01% $1.91 26.2348 $50.11 ETH <0.01% $0.04619 1,077.7583 $49.78 ETH <0.01% $0.054743 906.7302 $49.64 ETH <0.01% $0.014791 3,305.7462 $48.9 ETH <0.01% $0.288636 168.5617 $48.65 ETH <0.01% $2,508.64 0.0192 $48.14 ETH <0.01% $0.00821 5,863.7775 $48.14 ETH <0.01% $51.01 0.9345 $47.67 ETH <0.01% $7.64 6.2144 $47.48 ETH <0.01% $2.31 20.4545 $47.25 ETH <0.01% $0.034976 1,324.3811 $46.32 ETH <0.01% $0.00001 4,816,716.8227 $45.86 ETH <0.01% $2.2 20.8019 $45.76 ETH <0.01% $0.024543 1,844.6274 $45.27 ETH <0.01% $1.4 32.3412 $45.22 ETH <0.01% <$0.000001 5,542,549,450.069 $45.18 ETH <0.01% $2.24 20.0726 $44.96 ETH <0.01% $0.000122 367,889.6285 $44.75 ETH <0.01% $0.074309 602.1687 $44.75 ETH <0.01% $0.980285 45.4676 $44.57 ETH <0.01% $2.44 18.2663 $44.57 ETH <0.01% $0.041035 1,064.4943 $43.68 ETH <0.01% <$0.000001 4,171,327,328.5249 $43.46 ETH <0.01% $0.001094 39,689.4026 $43.42 ETH <0.01% $0.004693 9,233.8417 $43.33 ETH <0.01% $0.052087 827.2882 $43.09 ETH <0.01% $1.22 35.2483 $43 ETH <0.01% <$0.000001 17,321,682,109.5706 $42.73 ETH <0.01% $0.016999 2,497.4345 $42.45 ETH <0.01% $0.000021 2,047,415.696 $42.24 ETH <0.01% $0.000003 12,340,905.656 $42.21 ETH <0.01% $0.00024 175,307.729 $42.15 ETH <0.01% $0.008564 4,898.2409 $41.95 ETH <0.01% $0.003791 10,934.6646 $41.46 ETH <0.01% $0.005818 7,005.2857 $40.76 ETH <0.01% $0.000656 62,065.3879 $40.74 ETH <0.01% $0.204392 198.5175 $40.58 ETH <0.01% $0.011033 3,671.9444 $40.51 ETH <0.01% $0.000774 52,288.4402 $40.48 ETH <0.01% $0.021366 1,885.8588 $40.29 ETH <0.01% $0.000661 60,655.689 $40.09 ETH <0.01% $4.63 8.5552 $39.65 ETH <0.01% $0.003887 10,193.634 $39.62 ETH <0.01% $0.019963 1,957.1767 $39.07 ETH <0.01% $0.043374 899.3178 $39.01 ETH <0.01% $0.538307 71.2809 $38.37 ETH <0.01% <$0.000001 154,860,634.9405 $38.17 ETH <0.01% $0.000908 42,021.0344 $38.16 ETH <0.01% $44.3 0.8479 $37.56 ETH <0.01% $1.62 23.1754 $37.54 ETH <0.01% <$0.000001 2,301,343,407.5106 $36.18 ETH <0.01% $0.00079 45,745.2826 $36.15 ETH <0.01% $0.536876 67.1232 $36.04 ETH <0.01% $0.010271 3,508.3063 $36.03 ETH <0.01% $0.029866 1,195.2945 $35.7 ETH <0.01% $0.603219 59.0788 $35.64 ETH <0.01% <$0.000001 2,294,116,414.8563 $35.26 ETH <0.01% $26.93 1.3086 $35.24 ETH <0.01% $0.000684 51,078.8926 $34.93 ETH <0.01% $1.27 27.3441 $34.73 ETH <0.01% $0.127771 271.5734 $34.7 ETH <0.01% $0.112012 308.6289 $34.57 ETH <0.01% $0.000526 65,626.2299 $34.49 ETH <0.01% $1.04 33.228 $34.49 ETH <0.01% $1.16 29.58 $34.4 ETH <0.01% $0.023751 1,423.8632 $33.82 ETH <0.01% $0.088156 379.3239 $33.44 ETH <0.01% $0.236703 140.6063 $33.28 ETH <0.01% $0.54995 60.4651 $33.25 ETH <0.01% $2.88 11.5113 $33.15 ETH <0.01% $0.000292 112,624.1094 $32.87 ETH <0.01% $0.000002 14,027,753.7132 $32.82 ETH <0.01% $0.223614 144.2688 $32.26 ETH <0.01% $0.000032 1,011,333.1795 $31.89 ETH <0.01% $0.460363 68.9897 $31.76 ETH <0.01% $1.18 26.8493 $31.63 ETH <0.01% $0.001152 27,329.9005 $31.48 ETH <0.01% $0.011471 2,738.8414 $31.42 ETH <0.01% $0.008206 3,820.8426 $31.35 ETH <0.01% $0.011654 2,687.4119 $31.32 ETH <0.01% <$0.000001 16,851,586,722.5845 $31.31 ETH <0.01% $0.000114 272,831.4413 $31.21 ETH <0.01% $0.037919 822.6913 $31.2 ETH <0.01% $0.011303 2,756.2418 $31.15 ETH <0.01% $0.363423 85.5516 $31.09 ETH <0.01% $0.004121 7,525.8533 $31.01 ETH <0.01% <$0.000001 17,525,448,016.215 $31 ETH <0.01% $0.000005 5,757,333.749 $30.7 ETH <0.01% $0.016258 1,884.0136 $30.63 ETH <0.01% $0.055374 552.1021 $30.57 ETH <0.01% $0.029993 1,005.1856 $30.15 ETH <0.01% $0.013423 2,210.0579 $29.67 ETH <0.01% $0.193342 152.6361 $29.51 ETH <0.01% $0.182498 161.1374 $29.41 ETH <0.01% $0.269815 108.9819 $29.4 ETH <0.01% $0.001175 24,997.3746 $29.37 ETH <0.01% $0.000002 18,391,098.4997 $29.29 ETH <0.01% $40.57 0.7194 $29.19 ETH <0.01% $0.000011 2,731,369.856 $29.17 ETH <0.01% $2.64 11.0242 $29.08 ETH <0.01% $0.000882 32,923.6887 $29.03 ETH <0.01% $0.000394 73,475.9915 $28.96 ETH <0.01% $0.002342 12,278.2761 $28.75 ETH <0.01% $108.76 0.264 $28.71 ETH <0.01% $0.002698 10,559.9501 $28.49 ETH <0.01% $0.612882 46.0942 $28.25 ETH <0.01% $0.128076 220.3745 $28.22 ETH <0.01% $0.000022 1,288,941.3522 $27.98 ETH <0.01% $0.000001 46,065,161.3948 $27.95 ETH <0.01% $0.927636 30.0067 $27.84 ETH <0.01% $0.003391 8,155.5002 $27.66 ETH <0.01% $0.013275 2,072.8692 $27.52 ETH <0.01% $0.171892 159.0903 $27.35 ETH <0.01% $7.9 3.4483 $27.24 ETH <0.01% $0.841969 31.9559 $26.91 ETH <0.01% <$0.000001 408,128,568,002.059 $26.85 ETH <0.01% $25.94 1.0346 $26.84 ETH <0.01% $0.006209 4,272.791 $26.53 ETH <0.01% $0.70296 37.577 $26.42 ETH <0.01% $0.0167 1,575.3693 $26.31 ETH <0.01% $0.236263 111.3472 $26.31 ETH <0.01% $0.675369 38.8358 $26.23 ETH <0.01% $0.010216 2,560.7277 $26.16 ETH <0.01% $0.007188 3,565.5192 $25.63 ETH <0.01% $0.188217 136.1573 $25.63 ETH <0.01% $2.95 8.6595 $25.51 ETH <0.01% $0.884451 28.8096 $25.48 ETH <0.01% $0.116943 217.8589 $25.48 ETH <0.01% $1.53 16.642 $25.46 ETH <0.01% <$0.000001 6,251,678,759.5281 $25.04 ETH <0.01% $0.114764 217.7629 $24.99 ETH <0.01% $277.1 0.0896 $24.84 ETH <0.01% $0.998466 24.845 $24.81 ETH <0.01% <$0.000001 80,326,635.4864 $24.63 ETH <0.01% <$0.000001 6,146,706,082.8697 $24.57 ETH <0.01% $0.006354 3,854.1707 $24.49 ETH <0.01% $0.183394 132.4597 $24.29 ETH <0.01% $0.08033 302.2022 $24.28 ETH <0.01% $0.016638 1,442.2726 $24 ETH <0.01% $2,434.81 0.00985137 $23.99 ETH <0.01% $1.89 12.6759 $23.96 ETH <0.01% $0.00838 2,851.0705 $23.89 ETH <0.01% $0.000936 25,390.0301 $23.76 ETH <0.01% $0.033413 710.9584 $23.76 ETH <0.01% $0.005326 4,457.9569 $23.74 ETH <0.01% $2.97 7.9178 $23.52 ETH <0.01% $0.000109 214,777.9055 $23.49 ETH <0.01% <$0.000001 86,940,358.7067 $23.43 ETH <0.01% $0.023289 1,000.508 $23.3 ETH <0.01% $0.298865 77.8069 $23.25 ETH <0.01% $0.000342 67,851.2477 $23.22 ETH <0.01% $0.35405 65.5806 $23.22 ETH <0.01% $0.04244 546.026 $23.17 ETH <0.01% $0.000001 45,272,622.3852 $23.13 ETH <0.01% $4.06 5.6648 $23 ETH <0.01% $0.970819 23.6482 $22.96 ETH <0.01% $0.000052 442,650.934 $22.9 ETH <0.01% $0.009165 2,497.1974 $22.89 ETH <0.01% $0.000003 6,536,779.3944 $22.81 ETH <0.01% $0.000007 3,181,131.033 $22.78 ETH <0.01% $0.336686 67.4209 $22.7 ETH <0.01% $1.9 11.9011 $22.61 ETH <0.01% $0.000021 1,063,796.5675 $22.57 ETH <0.01% $0.044879 502.7971 $22.57 ETH <0.01% $140.72 0.1594 $22.43 ETH <0.01% $0.36376 61.6484 $22.43 ETH <0.01% $0.000303 73,901.7742 $22.41 ETH <0.01% $0.164491 135.894 $22.35 ETH <0.01% $0.005401 4,138.1086 $22.35 ETH <0.01% $0.197688 112.092 $22.16 ETH <0.01% <$0.000001 11,987,857,247.2301 $22.14 ETH <0.01% $0.005622 3,924.5503 $22.06 ETH <0.01% $0.995426 22.1275 $22.03 ETH <0.01% $0.000117 186,358.4283 $21.83 ETH <0.01% <$0.000001 187,092,711.9911 $21.56 ETH <0.01% $0.2798 76.5823 $21.43 ETH <0.01% $0.159753 134.0685 $21.42 ETH <0.01% $0.532806 40.1373 $21.39 ETH <0.01% $0.998342 21.3204 $21.29 ETH <0.01% $0.000087 241,835.8289 $20.98 ETH <0.01% $0.117308 178.1096 $20.89 ETH <0.01% <$0.000001 1,904,215,658.915 $20.55 ETH <0.01% $0.000001 37,433,788.1912 $20.5 ETH <0.01% $0.018537 1,092.4488 $20.25 ETH <0.01% $0.116463 173.4817 $20.2 ETH <0.01% $0.000368 54,426.6823 $20.03 ETH <0.01% $0.65208 30.6434 $19.98 ETH <0.01% $0.504699 39.4167 $19.89 ETH <0.01% $0.000001 27,570,073.1226 $19.81 ETH <0.01% $0.000006 3,197,482.4237 $19.76 ETH <0.01% $0.354897 55.4936 $19.69 ETH <0.01% $0.00266 7,354.5147 $19.56 ETH <0.01% $0.176107 110.3301 $19.43 ETH <0.01% $0.069381 279.9174 $19.42 ETH <0.01% $0.000002 11,687,618.9122 $19.4 ETH <0.01% $0.067917 284.2688 $19.31 ETH <0.01% <$0.000001 7,745,431,562.1627 $19.28 ETH <0.01% $0.000002 10,820,107.9621 $19.15 ETH <0.01% $0.013766 1,388.892 $19.12 ETH <0.01% $0.000186 101,911.8327 $18.95 ETH <0.01% $1.1 17.1338 $18.85 ETH <0.01% $0.085531 219.9946 $18.82 ETH <0.01% $0.003173 5,888.0894 $18.68 ETH <0.01% $35.23 0.5292 $18.65 ETH <0.01% $1.33 13.9941 $18.61 ETH <0.01% $0.000088 211,002.0087 $18.53 ETH <0.01% $0.036219 509.7477 $18.46 ETH <0.01% $2,511.3 0.00734882 $18.46 ETH <0.01% $0.000003 5,525,359.9487 $18.34 ETH <0.01% $0.064293 283.2492 $18.21 ETH <0.01% $0.030587 593.9454 $18.17 ETH <0.01% $0.014511 1,247.6423 $18.1 ETH <0.01% $0.523997 33.8766 $17.75 ETH <0.01% $0.066079 268.4926 $17.74 ETH <0.01% $0.284722 62.0507 $17.67 ETH <0.01% <$0.000001 36,021,345,040.4602 $17.08 ETH <0.01% $0.000111 149,669.9017 $16.67 ETH <0.01% $0.002798 5,908.6888 $16.53 ETH <0.01% $0.036429 453.6213 $16.53 ETH <0.01% $23.8 0.682 $16.23 ETH <0.01% $0.090209 178.6273 $16.11 ETH <0.01% $0.000061 262,335.7435 $15.99 ETH <0.01% $0.027186 587.3617 $15.97 ETH <0.01% <$0.000001 71,229,864,704.4504 $15.79 ETH <0.01% $2.15 7.3428 $15.79 ETH <0.01% $0.000387 40,524.7412 $15.68 ETH <0.01% $0.036554 428.4181 $15.66 ETH <0.01% $0.004416 3,521.7363 $15.55 ETH <0.01% $1.09 14.2671 $15.52 ETH <0.01% $0.137034 113.2067 $15.51 ETH <0.01% $0.014933 1,034.7857 $15.45 ETH <0.01% <$0.000001 53,024,705,506.4423 $15.41 ETH <0.01% $0.144673 106.0861 $15.35 ETH <0.01% $0.054065 283.8725 $15.35 ETH <0.01% <$0.000001 628,596,072.8452 $15.18 ETH <0.01% $0.001499 10,051.0518 $15.07 ETH <0.01% $0.000001 13,439,538.0242 $14.98 ETH <0.01% $0.068226 217.574 $14.84 ETH <0.01% $0.001435 10,338.7969 $14.84 ETH <0.01% $2.88 5.1207 $14.75 ETH <0.01% <$0.000001 5,372,982,435,538.81 $14.73 ETH <0.01% $0.000003 4,566,885.2972 $14.64 ETH <0.01% $0.003022 4,805.2224 $14.52 ETH <0.01% $0.272558 52.9534 $14.43 ETH <0.01% $0.041457 346.1176 $14.35 ETH <0.01% $21.88 0.6546 $14.32 ETH <0.01% $0.000202 70,803.0882 $14.31 ETH <0.01% $0.000002 5,773,267.8293 $14.26 ETH <0.01% $0.006594 2,142.8299 $14.13 ETH <0.01% $0.000139 101,463.7918 $14.11 ETH <0.01% $0.037306 374.9803 $13.99 ETH <0.01% $0.000001 24,940,235.3682 $13.84 ETH <0.01% $0.14429 95.8027 $13.82 ETH <0.01% $0.003628 3,806.6601 $13.81 ETH <0.01% $0.000139 99,080.3426 $13.8 ETH <0.01% $1.1 12.39 $13.63 ETH <0.01% $1.61 8.4346 $13.58 ETH <0.01% <$0.000001 37,938,831,143.2463 $13.5 ETH <0.01% <$0.000001 30,820,849,481.059 $13.46 ETH <0.01% $0.266904 49.9918 $13.34 ETH <0.01% $0.034528 386.0607 $13.33 ETH <0.01% $0.008925 1,492.9876 $13.33 ETH <0.01% $0.034374 387.3223 $13.31 ETH <0.01% $0.000773 17,184.0956 $13.29 ETH <0.01% $0.394536 33.3689 $13.17 ETH <0.01% $0.011149 1,178.399 $13.14 ETH <0.01% $0.005004 2,619.7532 $13.11 ETH <0.01% $0.005739 2,267.7232 $13.01 ETH <0.01% <$0.000001 57,052,966,455.7282 $12.9 ETH <0.01% $0.001144 11,271.5183 $12.89 ETH <0.01% $0.564041 22.8562 $12.89 ETH <0.01% <$0.000001 9,803,539,632.7081 $12.73 ETH <0.01% $0.004598 2,738.7561 $12.59 ETH <0.01% $0.000002 7,450,841.3697 $12.59 ETH <0.01% $0.006744 1,866.3478 $12.59 ETH <0.01% $0.358904 34.773 $12.48 ETH <0.01% $0.069543 177.9222 $12.37 ETH <0.01% $0.000003 4,278,463.0559 $12.28 ETH <0.01% <$0.000001 6,936,229,607.5352 $12.22 ETH <0.01% $0.015832 770.5974 $12.2 ETH <0.01% $0.072159 167.6829 $12.1 ETH <0.01% $0.057819 208.096 $12.03 ETH <0.01% $0.02352 511.0838 $12.02 ETH <0.01% <$0.000001 466,236,414,261,766 $12.01 ETH <0.01% $0.000601 19,921.6489 $11.98 ETH <0.01% <$0.000001 30,079,732,110.1578 $11.97 ETH <0.01% <$0.000001 9,819,103,551.6829 $11.89 ETH <0.01% $0.002624 4,500.1058 $11.81 ETH <0.01% $0.001639 7,203.0923 $11.8 ETH <0.01% $0.004843 2,428.7786 $11.76 ETH <0.01% <$0.000001 229,013,570.2019 $11.71 ETH <0.01% $0.45815 25.4029 $11.64 ETH <0.01% $0.000003 4,319,570.8283 $11.62 ETH <0.01% $0.001519 7,644.1334 $11.61 ETH <0.01% $0.032477 357.2632 $11.6 ETH <0.01% <$0.000001 35,530,136,065.296 $11.52 ETH <0.01% $0.000903 12,676.8872 $11.45 ETH <0.01% $0.001756 6,508.2447 $11.43 ETH <0.01% <$0.000001 96,871,828.6163 $11.42 ETH <0.01% $0.000807 14,138.4369 $11.42 ETH <0.01% $0.028319 402.499 $11.4 ETH <0.01% <$0.000001 1,794,305,658.535 $11.38 ETH <0.01% $0.000018 623,204.3464 $11.35 ETH <0.01% $2.67 4.2147 $11.25 ETH <0.01% $0.000283 39,799.9117 $11.25 ETH <0.01% $0.000977 11,451.8484 $11.19 ETH <0.01% $0.000199 56,172.7523 $11.17 ETH <0.01% $1.72 6.4822 $11.13 ETH <0.01% $0.000005 2,070,426.2795 $11.12 ETH <0.01% <$0.000001 49,988,504.0556 $11.09 ETH <0.01% <$0.000001 32,600,513.2887 $11.06 ETH <0.01% $0.030525 361.1733 $11.02 ETH <0.01% $0.998001 11.0018 $10.98 ETH <0.01% $0.233533 46.9643 $10.97 ETH <0.01% <$0.000001 1,372,646,107.8494 $10.86 ETH <0.01% $0.003097 3,500.0987 $10.84 ETH <0.01% $0.000001 17,256,246.7791 $10.83 ETH <0.01% <$0.000001 91,606,957.5918 $10.83 ETH <0.01% $0.000011 992,296.9225 $10.83 ETH <0.01% $0.000069 155,691.681 $10.77 ETH <0.01% $0.003791 2,840.2084 $10.77 ETH <0.01% $0.027423 390.3242 $10.7 ETH <0.01% $0.00646 1,656.9062 $10.7 ETH <0.01% $0.383339 27.9156 $10.7 ETH <0.01% $3.02 3.4951 $10.56 ETH <0.01% $0.000266 39,657.4033 $10.54 ETH <0.01% <$0.000001 26,301,015.6778 $10.46 ETH <0.01% $7.67 1.3602 $10.43 ETH <0.01% $2 5.2134 $10.43 ETH <0.01% $0.039545 261.6559 $10.35 ETH <0.01% $0.111777 92.2381 $10.31 ETH <0.01% $0.006724 1,523.8198 $10.25 ETH <0.01% $0.000011 918,442.2926 $10.01 ETH <0.01% $0.013026 765.3018 $9.97 ETH <0.01% $0.002674 3,702.5135 $9.9 ETH <0.01% <$0.000001 1,987,248,605.3083 $9.9 ETH <0.01% <$0.000001 31,998,879.4532 $9.88 ETH <0.01% $0.027604 355.4874 $9.81 ETH <0.01% $0.000502 19,531.7487 $9.81 ETH <0.01% $0.032411 302.2288 $9.8 ETH <0.01% $0.016936 577.76 $9.79 ETH <0.01% $0.048229 202.52 $9.77 ETH <0.01% <$0.000001 78,153,637.0235 $9.77 ETH <0.01% $0.001059 9,207.6442 $9.75 ETH <0.01% $0.011687 828.0783 $9.68 ETH <0.01% $0.000446 21,679.8253 $9.67 ETH <0.01% $0.001661 5,786.2781 $9.61 ETH <0.01% $0.007309 1,302.3321 $9.52 ETH <0.01% $1.04 9.0383 $9.42 ETH <0.01% $0.00426 2,209.9221 $9.41 ETH <0.01% <$0.000001 11,004,263,966.4721 $9.41 ETH <0.01% <$0.000001 115,255,319,242.486 $9.35 ETH <0.01% $0.037888 246.1838 $9.33 ETH <0.01% $10.79 0.8642 $9.32 ETH <0.01% $0.431202 21.3868 $9.22 ETH <0.01% $2.26 4.0713 $9.2 ETH <0.01% <$0.000001 8,119,788,970,521.17 $9.16 ETH <0.01% $0.061683 147.7548 $9.11 ETH <0.01% $0.002685 3,325.2259 $8.93 ETH <0.01% $0.02996 297.5755 $8.92 ETH <0.01% $2,404.4 0.0036637 $8.81 ETH <0.01% $0.509891 17.2479 $8.79 ETH <0.01% $2,390.4 0.00362551 $8.67 ETH <0.01% $0.000429 20,134.8579 $8.64 ETH <0.01% $0.344212 25.0742 $8.63 ETH <0.01% $0.306076 27.9149 $8.54 ETH <0.01% $0.049983 170.5502 $8.52 ETH <0.01% $0.052858 160.7852 $8.5 ETH <0.01% $0.003605 2,351.5846 $8.48 ETH <0.01% $0.471481 17.9524 $8.46 ETH <0.01% $1 8.4058 $8.41 ETH <0.01% $0.003776 2,220.9431 $8.39 ETH <0.01% $0.000036 228,782.5669 $8.32 ETH <0.01% $0.056987 145.8121 $8.31 ETH <0.01% $0.025898 319.9797 $8.29 ETH <0.01% $0.000383 21,572.9528 $8.27 ETH <0.01% $0.00001 802,275.9878 $8.22 ETH <0.01% $0.022686 361.2722 $8.2 ETH <0.01% $0.273909 29.8963 $8.19 ETH <0.01% $0.00172 4,752.8275 $8.17 ETH <0.01% $0.023444 347.8754 $8.16 ETH <0.01% $0.002651 3,074.8705 $8.15 ETH <0.01% $0.000716 11,342.5277 $8.12 ETH <0.01% $0.015824 512.9285 $8.12 ETH <0.01% <$0.000001 56,260,314,506,245.3 $8.08 ETH <0.01% $0.03933 205.3321 $8.08 ETH <0.01% $0.000183 43,790.1663 $8.02 ETH <0.01% $0.439874 18.219 $8.01 ETH <0.01% $0.00083 9,598.3065 $7.96 ETH <0.01% $0.01121 698.4227 $7.83 ETH <0.01% $0.067339 115.8107 $7.8 ETH <0.01% <$0.000001 17,536,688,258.5832 $7.77 ETH <0.01% $0.000211 36,056.1082 $7.59 ETH <0.01% $0.000855 8,869.5262 $7.58 ETH <0.01% $0.237843 31.4438 $7.48 ETH <0.01% $6.51 1.146 $7.46 ETH <0.01% $0.077566 96.1093 $7.45 ETH <0.01% $0.011408 649.5998 $7.41 ETH <0.01% $0.014462 512.2399 $7.41 ETH <0.01% $0.006682 1,108.5236 $7.41 ETH <0.01% $0.068743 107.6064 $7.4 ETH <0.01% $0.005813 1,267.2904 $7.37 ETH <0.01% $0.00229 3,203.7381 $7.34 ETH <0.01% $0.000476 15,416.1673 $7.33 ETH <0.01% $0.071847 101.7067 $7.31 ETH <0.01% $0.19677 36.9856 $7.28 ETH <0.01% $0.000756 9,623.2245 $7.28 ETH <0.01% $1.12 6.4715 $7.25 ETH <0.01% $0.120037 59.7112 $7.17 ETH <0.01% $0.001587 4,469.0877 $7.09 ETH <0.01% $0.005459 1,295.2348 $7.07 ETH <0.01% $0.000004 1,710,380.9854 $7.01 ETH <0.01% $2,389.33 0.0029002 $6.93 ETH <0.01% <$0.000001 10,478,898,076.4503 $6.9 ETH <0.01% $0.044977 152.2037 $6.85 ETH <0.01% $0.117984 57.737 $6.81 ETH <0.01% $0.000962 7,033.5647 $6.77 ETH <0.01% $0.003747 1,804.5028 $6.76 ETH <0.01% $0.194074 34.7415 $6.74 ETH <0.01% <$0.000001 37,644,907,692.3882 $6.74 ETH <0.01% $0.002253 2,972.7636 $6.7 ETH <0.01% $0.254187 26.2038 $6.66 ETH <0.01% $0.00898 739.7707 $6.64 ETH <0.01% $0.26042 25.5009 $6.64 ETH <0.01% $0.000401 16,485.0895 $6.61 ETH <0.01% $0.004448 1,482.111 $6.59 ETH <0.01% $0.057352 114.3491 $6.56 ETH <0.01% $0.028537 229.7578 $6.56 ETH <0.01% $0.001521 4,272.8476 $6.5 ETH <0.01% $0.000002 2,831,441.0276 $6.48 ETH <0.01% $0.166998 38.4443 $6.42 ETH <0.01% <$0.000001 4,407,080,539.8318 $6.4 ETH <0.01% $0.261022 24.4543 $6.38 ETH <0.01% <$0.000001 43,033,295.3471 $6.32 ETH <0.01% $0.000236 26,727.9757 $6.31 ETH <0.01% $154.23 0.0408 $6.29 ETH <0.01% $0.000603 10,388.289 $6.27 ETH <0.01% $0.000002 3,547,733.3182 $6.27 ETH <0.01% $0.00375 1,651.799 $6.19 ETH <0.01% $0.005509 1,120.2574 $6.17 ETH <0.01% $1.92 3.2079 $6.16 ETH <0.01% $0.012081 507.8832 $6.14 ETH <0.01% $2,818.82 0.00215927 $6.09 ETH <0.01% $0.000105 57,617.1082 $6.07 ETH <0.01% $0.000653 9,214.0245 $6.02 ETH <0.01% $0.000001 9,051,808.1527 $5.99 ETH <0.01% $0.39815 15.0335 $5.99 ETH <0.01% $0.190941 31.2693 $5.97 ETH <0.01% $0.000067 88,822.6266 $5.94 ETH <0.01% <$0.000001 24,902,554.2083 $5.94 ETH <0.01% $0.150031 39.5849 $5.94 ETH <0.01% $0.047267 123.9556 $5.86 ETH <0.01% $0.014674 395.1829 $5.8 ETH <0.01% <$0.000001 197,859,613.0156 $5.77 ETH <0.01% $0.047341 121.8864 $5.77 ETH <0.01% $0.015648 367.4698 $5.75 ETH <0.01% $0.000045 127,937.407 $5.7 ETH <0.01% <$0.000001 19,803,996.8034 $5.66 ETH <0.01% $0.255025 22.1945 $5.66 ETH <0.01% $0.001026 5,489.606 $5.63 ETH <0.01% $0.006479 867.1017 $5.62 ETH <0.01% $0.001532 3,605.0527 $5.52 ETH <0.01% $0.025465 215.5062 $5.49 ETH <0.01% $0.000896 6,117.9123 $5.48 ETH <0.01% $0.006445 845.2824 $5.45 ETH <0.01% $0.043973 123.5646 $5.43 ETH <0.01% $0.00261 2,073.5021 $5.41 ETH <0.01% $0.000218 24,818.5547 $5.4 ETH <0.01% $1.94 2.7811 $5.4 ETH <0.01% $1 5.3823 $5.38 ETH <0.01% $0.004784 1,122.7869 $5.37 ETH <0.01% $0.029475 181.8906 $5.36 ETH <0.01% <$0.000001 10,037,259,972.3222 $5.33 ETH <0.01% $0.001708 3,114.1568 $5.32 ETH <0.01% $0.00001 519,519.8489 $5.29 ETH <0.01% $0.000051 103,095.7683 $5.28 ETH <0.01% $0.001005 5,204.1308 $5.23 ETH <0.01% $0.000003 1,934,614.5609 $5.22 ETH <0.01% $0.162527 32.021 $5.2 ETH <0.01% $0.021721 239.4059 $5.2 ETH <0.01% $0.013274 390.4384 $5.18 ETH <0.01% $0.024604 210.4765 $5.18 ETH <0.01% $0.000002 2,953,137.5214 $5.15 ETH <0.01% $0.120917 42.5855 $5.15 ETH <0.01% $0.18165 28.192 $5.12 ETH <0.01% $0.043884 116.6528 $5.12 ETH <0.01% $0.012713 401.3549 $5.1 ETH <0.01% $0.011765 433.0441 $5.09 ETH <0.01% $0.001856 2,741.8731 $5.09 ETH <0.01% $0.000617 8,239.5973 $5.08 ETH <0.01% $7.48 0.6787 $5.08 ETH <0.01% $0.226693 21.8553 $4.95 ETH <0.01% $0.00001 509,058.3367 $4.94 ETH <0.01% $0.094977 51.9746 $4.94 ETH <0.01% $0.000001 5,133,545.9141 $4.91 ETH <0.01% $0.000001 4,985,570.9723 $4.87 ETH <0.01% $0.001866 2,606.159 $4.86 ETH <0.01% $0.037027 131.2635 $4.86 ETH <0.01% $0.000003 1,613,441.2544 $4.84 ETH <0.01% $0.004447 1,082.7239 $4.81 ETH <0.01% $0.051733 92.9755 $4.81 ETH <0.01% $0.000967 4,968.4142 $4.8 ETH <0.01% $0.066173 72.5011 $4.8 ETH <0.01% $0.107838 44.1696 $4.76 ETH <0.01% <$0.000001 57,206,209.1182 $4.75 ETH <0.01% <$0.000001 32,488,220.1476 $4.73 ETH <0.01% $0.00496 953.7137 $4.73 ETH <0.01% $4.84 0.9762 $4.72 ETH <0.01% <$0.000001 21,999,407.6497 $4.69 ETH <0.01% $0.000178 26,343.2488 $4.68 ETH <0.01% $0.003219 1,454.4962 $4.68 ETH <0.01% $0.984348 4.6967 $4.62 ETH <0.01% $0.005532 831.6456 $4.6 ETH <0.01% <$0.000001 26,542,595.8585 $4.6 ETH <0.01% $0.000001 7,275,685.7085 $4.6 ETH <0.01% $0.002008 2,287.1904 $4.59 ETH <0.01% <$0.000001 2,131,883,066.2352 $4.59 ETH <0.01% $0.000004 1,280,907.455 $4.59 ETH <0.01% $0.29026 15.7437 $4.57 ETH <0.01% <$0.000001 17,173,232,758.0575 $4.51 ETH <0.01% <$0.000001 21,013,684.6211 $4.51 ETH <0.01% $0.000487 9,226.0533 $4.49 ETH <0.01% $0.943074 4.7555 $4.48 ETH <0.01% $4.48 1 $4.48 ETH <0.01% $0.725131 6.1773 $4.48 ETH <0.01% $0.28979 15.3373 $4.44 ETH <0.01% $0.036009 123.0456 $4.43 ETH <0.01% $0.06338 69.4557 $4.4 ETH <0.01% $1.14 3.8311 $4.37 ETH <0.01% $48.04 0.0908 $4.36 ETH <0.01% $1.11 3.9195 $4.35 ETH <0.01% $0.000002 2,091,516.9958 $4.35 ETH <0.01% $0.000087 50,252.4088 $4.35 ETH <0.01% $0.063311 68.1541 $4.31 ETH <0.01% <$0.000001 88,961,243,357.2316 $4.14 ETH <0.01% $0.003492 1,183.667 $4.13 ETH <0.01% <$0.000001 1,599,606,655.6019 $4.11 ETH <0.01% $9.18 0.4448 $4.08 ETH <0.01% <$0.000001 462,437,140.7233 $4.06 ETH <0.01% $0.000344 11,709.8408 $4.03 ETH <0.01% $0.000005 792,266.4375 $4.02 ETH <0.01% <$0.000001 15,925,505,527.0257 $4.01 ETH <0.01% $0.000255 15,718.5078 $4.01 ETH <0.01% $0.000199 20,011.7993 $3.98 ETH <0.01% $0.000149 26,648.7467 $3.98 ETH <0.01% $1.15 3.4218 $3.95 ETH <0.01% $0.00617 638.4541 $3.94 ETH <0.01% $0.087769 44.7608 $3.93 ETH <0.01% $0.911137 4.3055 $3.92 ETH <0.01% $0.002946 1,329.2886 $3.92 ETH <0.01% $0.000268 14,430.1968 $3.86 ETH <0.01% $0.000043 88,963.393 $3.83 ETH <0.01% $0.140088 27.1125 $3.8 ETH <0.01% $2,492.12 0.00151978 $3.79 ETH <0.01% $2.79 1.3531 $3.78 ETH <0.01% $0.000009 401,085.4106 $3.77 ETH <0.01% $127.87 0.0293 $3.75 ETH <0.01% <$0.000001 237,508,159.8186 $3.68 ETH <0.01% $0.006794 542.3417 $3.68 ETH <0.01% $0.005503 668.9701 $3.68 ETH <0.01% $0.082465 43.9536 $3.62 ETH <0.01% $0.020805 170.2634 $3.54 ETH <0.01% $22.69 0.1553 $3.52 ETH <0.01% $14.95 0.2325 $3.48 ETH <0.01% <$0.000001 14,429,081,971.1618 $3.44 ETH <0.01% $285.88 0.012 $3.44 ETH <0.01% <$0.000001 147,158,057.6741 $3.43 ETH <0.01% $0.000001 4,826,673.8936 $3.38 ETH <0.01% $14.21 0.2342 $3.33 ETH <0.01% $0.000965 3,446.6999 $3.33 ETH <0.01% $0.112202 29.4461 $3.3 ETH <0.01% $0.174528 18.8844 $3.3 ETH <0.01% $1.19 2.7551 $3.28 ETH <0.01% $0.002174 1,497.6942 $3.26 ETH <0.01% <$0.000001 6,603,518,467.5821 $3.24 ETH <0.01% <$0.000001 1,449,519,576.6019 $3.2 ETH <0.01% $0.005216 613.0543 $3.2 ETH <0.01% <$0.000001 13,375,459.4682 $3.18 ETH <0.01% $0.312315 10.1124 $3.16 ETH <0.01% $0.50817 6.1881 $3.14 ETH <0.01% $0.00174 1,806.106 $3.14 ETH <0.01% $3.38 0.9266 $3.13 ETH <0.01% $0.011595 268.6997 $3.12 ETH <0.01% $0.033426 93.1176 $3.11 ETH <0.01% $0.041217 74.6143 $3.08 ETH <0.01% $6.1 0.5026 $3.07 ETH <0.01% $2.71 1.1304 $3.06 ETH <0.01% $0.015643 194.7394 $3.05 ETH <0.01% $0.000338 8,998.3762 $3.04 ETH <0.01% $3.98 0.76 $3.02 ETH <0.01% <$0.000001 314,980,903.444 $3.02 ETH <0.01% $0.000005 647,788.871 $3 ETH <0.01% $8.36 0.357 $2.98 ETH <0.01% <$0.000001 14,274,591,605.2652 $2.98 ETH <0.01% <$0.000001 234,211,409.2599 $2.95 ETH <0.01% <$0.000001 11,809,471.5655 $2.93 ETH <0.01% $0.282953 10.3419 $2.93 ETH <0.01% $0.000037 79,135.0827 $2.92 ETH <0.01% $1.07 2.6572 $2.85 ETH <0.01% $0.001202 2,368.1515 $2.85 ETH <0.01% $0.006316 446.3435 $2.82 ETH <0.01% $0.000145 19,383.8993 $2.81 ETH <0.01% $0.998861 2.7826 $2.78 ETH <0.01% $0.000349 7,874.6663 $2.75 ETH <0.01% <$0.000001 152,582,099.0781 $2.75 ETH <0.01% $0.000067 41,220.9533 $2.74 ETH <0.01% $0.000221 12,235.06 $2.7 ETH <0.01% $0.000717 3,753.5487 $2.69 ETH <0.01% $0.010563 251.6582 $2.66 ETH <0.01% $0.037108 70.4901 $2.62 ETH <0.01% <$0.000001 58,055,382,280,979 $2.61 ETH <0.01% $0.042538 61.1197 $2.6 ETH <0.01% $0.000001 3,522,982.5465 $2.6 ETH <0.01% $0.00026 9,913.0392 $2.58 ETH <0.01% $0.013121 193.3433 $2.54 ETH <0.01% <$0.000001 12,434,446.9448 $2.52 ETH <0.01% <$0.000001 869,837,436,179.786 $2.52 ETH <0.01% $0.038603 65.1028 $2.51 ETH <0.01% $0.155477 16.155 $2.51 ETH <0.01% $0.005786 428.3864 $2.48 ETH <0.01% $0.536324 4.6171 $2.48 ETH <0.01% <$0.000001 359,995,947.116 $2.47 ETH <0.01% <$0.000001 553,528,680.9375 $2.46 ETH <0.01% $0.000033 74,507.0805 $2.45 ETH <0.01% $1.14 2.1374 $2.44 ETH <0.01% $0.000044 55,484.1296 $2.43 ETH <0.01% <$0.000001 19,769,991.919 $2.42 ETH <0.01% $0.018587 130.0635 $2.42 ETH <0.01% $0.000576 4,176.0422 $2.4 ETH <0.01% $0.660395 3.6328 $2.4 ETH <0.01% $0.060181 39.7945 $2.39 ETH <0.01% $0.000202 11,862.3025 $2.39 ETH <0.01% $0.000013 181,590.9706 $2.36 ETH <0.01% $0.002303 1,021.777 $2.35 ETH <0.01% $0.000138 16,985.8498 $2.34 ETH <0.01% $0.000021 110,100.8276 $2.34 ETH <0.01% $0.001312 1,778.3267 $2.33 ETH <0.01% $0.013052 177.5969 $2.32 ETH <0.01% <$0.000001 43,331,327.1174 $2.31 ETH <0.01% <$0.000001 11,505,840,726.6338 $2.31 ETH <0.01% $0.000277 8,181.8982 $2.26 ETH <0.01% $0.006042 374.3922 $2.26 ETH <0.01% <$0.000001 5,426,071,194.9999 $2.25 ETH <0.01% <$0.000001 170,344,573,002.013 $2.23 ETH <0.01% $0.000423 5,268.7713 $2.23 ETH <0.01% $0.173614 12.8033 $2.22 ETH <0.01% $0.000071 30,763.4155 $2.19 ETH <0.01% $0.015351 141.979 $2.18 ETH <0.01% $0.028367 76.8198 $2.18 ETH <0.01% $0.001658 1,308.1196 $2.17 ETH <0.01% <$0.000001 30,767,805.5587 $2.17 ETH <0.01% <$0.000001 4,719,133,567.1923 $2.16 ETH <0.01% <$0.000001 1,448,050,412.9935 $2.14 ETH <0.01% $0.019262 110.9454 $2.14 ETH <0.01% $0.000019 113,092.551 $2.13 ETH <0.01% $0.010891 194.4298 $2.12 ETH <0.01% $0.000056 37,459.6591 $2.09 ETH <0.01% <$0.000001 4,280,326,655.3619 $2.08 ETH <0.01% <$0.000001 162,982,527.7607 $2.08 ETH <0.01% $0.000623 3,300.2432 $2.06 ETH <0.01% $0.868117 2.3624 $2.05 ETH <0.01% $0.051088 40.0832 $2.05 ETH <0.01% $0.000002 1,007,449.616 $2.03 ETH <0.01% $0.000002 822,646.1574 $2.03 ETH <0.01% $0.136468 14.836 $2.02 ETH <0.01% $0.287764 7.0217 $2.02 ETH <0.01% $0.001034 1,943.1429 $2.01 ETH <0.01% $0.740677 2.6551 $1.97 ETH <0.01% $0.000013 147,438.8276 $1.96 ETH <0.01% $4.3 0.4552 $1.96 ETH <0.01% <$0.000001 2,157,368,781.1676 $1.93 ETH <0.01% $0.000001 2,139,006.2322 $1.92 ETH <0.01% $0.013216 143.3935 $1.9 ETH <0.01% $0.015513 121.3626 $1.88 ETH <0.01% $0.458243 4.0542 $1.86 ETH <0.01% $1.73 1.0722 $1.86 ETH <0.01% $0.086183 21.3611 $1.84 ETH <0.01% $2,554.65 0.00072059 $1.84 ETH <0.01% $0.045942 39.497 $1.81 ETH <0.01% $0.000435 4,163.3549 $1.81 ETH <0.01% $0.000967 1,858.4763 $1.8 ETH <0.01% <$0.000001 5,336,693,935.3316 $1.79 ETH <0.01% $0.05325 33.4395 $1.78 ETH <0.01% $0.310499 5.7213 $1.78 ETH <0.01% $0.001512 1,174.0269 $1.78 ETH <0.01% $0.004814 368.0987 $1.77 ETH <0.01% $0.000674 2,629.8261 $1.77 ETH <0.01% <$0.000001 5,885,522.9103 $1.77 ETH <0.01% $0.00004 44,251.3462 $1.77 ETH <0.01% $15.94 0.111 $1.77 ETH <0.01% $0.02889 61.2244 $1.77 ETH <0.01% $2,384.97 0.00073939 $1.76 ETH <0.01% $0.024144 72.8929 $1.76 ETH <0.01% $0.000009 193,931.0026 $1.76 ETH <0.01% $0.136515 12.839 $1.75 ETH <0.01% $0.005106 336.4483 $1.72 ETH <0.01% $0.012104 139.6781 $1.69 ETH <0.01% $13.4 0.1258 $1.69 ETH <0.01% $3.72 0.4498 $1.68 ETH <0.01% $0.074151 22.3024 $1.65 ETH <0.01% $0.000471 3,495.5238 $1.65 ETH <0.01% $0.003661 449.4858 $1.65 ETH <0.01% <$0.000001 438,260,503.8926 $1.64 ETH <0.01% <$0.000001 326,235,911,619.244 $1.62 ETH <0.01% $0.001803 896.4625 $1.62 ETH <0.01% $0.022664 71.0092 $1.61 ETH <0.01% $0.003344 479.8762 $1.6 ETH <0.01% $0.000023 70,154.6774 $1.6 ETH <0.01% <$0.000001 3,374,581.2213 $1.59 ETH <0.01% $1.11 1.4245 $1.58 ETH <0.01% <$0.000001 9,533,319,550.5604 $1.57 ETH <0.01% $0.055439 28.3781 $1.57 ETH <0.01% $0.000006 266,741.9891 $1.56 ETH <0.01% $15.75 0.0978 $1.54 ETH <0.01% <$0.000001 36,350,993,744,439.6 $1.52 ETH <0.01% $0.017082 88.8689 $1.52 ETH <0.01% <$0.000001 24,316,684,264.2401 $1.51 ETH <0.01% $0.006843 221.3156 $1.51 ETH <0.01% $16.14 0.0935 $1.51 ETH <0.01% $0.013144 114.7702 $1.51 ETH <0.01% $0.000417 3,614.4418 $1.51 ETH <0.01% $0.000002 726,876.9869 $1.5 ETH <0.01% $0.067561 22.1406 $1.5 ETH <0.01% $0.000475 3,139.3652 $1.49 ETH <0.01% <$0.000001 7,947,921.2066 $1.47 ETH <0.01% $0.130984 11.2196 $1.47 ETH <0.01% $0.001728 848.0055 $1.47 ETH <0.01% <$0.000001 5,529,859,420.6317 $1.46 ETH <0.01% $0.645214 2.2603 $1.46 ETH <0.01% <$0.000001 10,729,113,213.33 $1.46 ETH <0.01% $0.006856 212.4514 $1.46 ETH <0.01% $0.00371 386.1113 $1.43 ETH <0.01% $1.05 1.3522 $1.41 ETH <0.01% $0.001978 711.82 $1.41 ETH <0.01% $0.164158 8.5598 $1.41 ETH <0.01% $0.01176 118.6238 $1.39 ETH <0.01% $0.070909 19.6287 $1.39 ETH <0.01% $0.000962 1,446.0846 $1.39 ETH <0.01% $0.000035 40,214.1395 $1.39 ETH <0.01% $0.001898 730.6735 $1.39 ETH <0.01% $0.000062 22,387.6663 $1.39 ETH <0.01% $0.000197 7,032.8124 $1.38 ETH <0.01% $0.010931 125.3204 $1.37 ETH <0.01% $0.006573 206.9094 $1.36 ETH <0.01% $0.087892 15.3867 $1.35 ETH <0.01% $0.006048 223.3794 $1.35 ETH <0.01% $4.13 0.3262 $1.35 ETH <0.01% $0.001202 1,107.3084 $1.33 ETH <0.01% <$0.000001 8,136,391,451,554.98 $1.32 ETH <0.01% $0.022064 59.7121 $1.32 ETH <0.01% $0.041281 30.9632 $1.28 ETH <0.01% $0.003108 409.2123 $1.27 ETH <0.01% $0.017901 70.7803 $1.27 ETH <0.01% $0.003183 395.0053 $1.26 ETH <0.01% $0.000161 7,800.6684 $1.25 ETH <0.01% $0.000562 2,218.5524 $1.25 ETH <0.01% $0.088213 14.0719 $1.24 ETH <0.01% $0.00031 4,007.2627 $1.24 ETH <0.01% $0.953275 1.2987 $1.24 ETH <0.01% $0.005935 205.5853 $1.22 ETH <0.01% $0.050446 24.0569 $1.21 ETH <0.01% $0.001935 624.2855 $1.21 ETH <0.01% $0.021469 55.9941 $1.2 ETH <0.01% <$0.000001 2,295,384,215.9168 $1.2 ETH <0.01% $0.004239 282.3262 $1.2 ETH <0.01% <$0.000001 808,823,621.5638 $1.19 ETH <0.01% $0.004913 242.8746 $1.19 ETH <0.01% $0.001066 1,114.205 $1.19 ETH <0.01% $0.124065 9.5494 $1.18 ETH <0.01% $0.007334 160.31 $1.18 ETH <0.01% $0.025295 45.9661 $1.16 ETH <0.01% $0.001863 623.2473 $1.16 ETH <0.01% $0.001813 635.5319 $1.15 ETH <0.01% <$0.000001 20,738,159,030.3704 $1.15 ETH <0.01% $0.000786 1,452.8904 $1.14 ETH <0.01% $1.09 1.0437 $1.14 ETH <0.01% $0.00013 8,795.4023 $1.14 ETH <0.01% $0.000125 9,111.8458 $1.14 ETH <0.01% <$0.000001 29,101,411.7865 $1.14 ETH <0.01% $0.004333 255.9911 $1.11 ETH <0.01% <$0.000001 90,663,142,141.0891 $1.11 ETH <0.01% $0.004439 248.7096 $1.1 ETH <0.01% $0.015382 71.6284 $1.1 ETH <0.01% $0.060304 18.216 $1.1 ETH <0.01% $0.007333 149.3967 $1.1 ETH <0.01% $0.272481 3.9428 $1.07 ETH <0.01% $0.132936 8.0363 $1.07 ETH <0.01% $16.05 0.0658 $1.06 ETH <0.01% $0.000553 1,909.2244 $1.06 ETH <0.01% <$0.000001 192,589,791.4589 $1.05 ETH <0.01% $5.17 0.2033 $1.05 ETH <0.01% $0.004475 234.6427 $1.05 ETH <0.01% $0.026778 39.1097 $1.05 ETH <0.01% <$0.000001 12,943,199.3179 $1.04 ETH <0.01% <$0.000001 276,301,265.8843 $1.04 ETH <0.01% <$0.000001 2,379,602,005.9666 $1.03 ETH <0.01% $0.007479 135.8348 $1.02 ETH <0.01% $0.000167 6,041.9479 $1.01 ETH <0.01% $0.00409 244.2063 $0.9987 ETH <0.01% <$0.000001 7,767,231.3007 $0.9966 ETH <0.01% $0.284553 3.4901 $0.9931 ETH <0.01% $0.005403 181.6939 $0.9817 ETH <0.01% $0.013002 75.3245 $0.9793 ETH <0.01% $0.000106 9,129.4219 $0.9664 ETH <0.01% $0.000097 9,861.5259 $0.9553 ETH <0.01% $0.00327 292.1779 $0.9553 ETH <0.01% $0.010082 94.5838 $0.9536 ETH <0.01% <$0.000001 27,836,083,015.9609 $0.9534 ETH <0.01% $0.000067 14,218.0998 $0.9455 ETH <0.01% $0.001249 753.9958 $0.9415 ETH <0.01% <$0.000001 12,266,101.3869 $0.9403 ETH <0.01% $0.000033 28,237.8125 $0.9395 ETH <0.01% $0.003527 265.4719 $0.9362 ETH <0.01% <$0.000001 10,021,180.2762 $0.9351 ETH <0.01% <$0.000001 7,925,558.4786 $0.928 ETH <0.01% <$0.000001 3,837,315.5335 $0.92 ETH <0.01% $0.019952 45.977 $0.9173 ETH <0.01% <$0.000001 46,490,961,797.3905 $0.9078 ETH <0.01% $0.001008 896.1931 $0.9036 ETH <0.01% $0.000196 4,594.0657 $0.9008 ETH <0.01% $0.002163 414.8314 $0.8972 ETH <0.01% $0.001041 857.7191 $0.8932 ETH <0.01% $0.021511 41.3181 $0.8887 ETH <0.01% $0.27636 3.2147 $0.8884 ETH <0.01% <$0.000001 3,562,820.3135 $0.8855 ETH <0.01% $0.037314 23.681 $0.8836 ETH <0.01% <$0.000001 266,471,968.7693 $0.8822 ETH <0.01% $0.013724 63.8531 $0.8763 ETH <0.01% $0.000458 1,888.8779 $0.8658 ETH <0.01% $0.070375 12.2478 $0.8619 ETH <0.01% $0.112815 7.6159 $0.8591 ETH <0.01% $0.014696 58.2724 $0.8563 ETH <0.01% $0.282953 3.0047 $0.8501 ETH <0.01% $0.042782 19.8235 $0.848 ETH <0.01% $0.476812 1.7743 $0.8459 ETH <0.01% <$0.000001 5,400,906,770,502,430 $0.8317 ETH <0.01% <$0.000001 9,075,893.5249 $0.8235 ETH <0.01% $0.000729 1,127.33 $0.8216 ETH <0.01% $0.001616 504.9545 $0.8162 ETH <0.01% $0.023618 34.3132 $0.8104 ETH <0.01% $0.000044 18,250.6903 $0.8101 ETH <0.01% $0.000225 3,561.6534 $0.8014 ETH <0.01% $0.000144 5,554.6175 $0.7977 ETH <0.01% $0.008897 89.4111 $0.7955 ETH <0.01% $0.003445 222.3988 $0.7662 ETH <0.01% $0.025898 29.3204 $0.7593 ETH <0.01% $0.006278 119.7613 $0.7518 ETH <0.01% $0.001669 448.664 $0.7487 ETH <0.01% $5.89 0.1268 $0.7469 ETH <0.01% $0.005582 133.7417 $0.7465 ETH <0.01% $0.526532 1.407 $0.7408 ETH <0.01% $5.58 0.132 $0.7358 ETH <0.01% $4.89 0.1498 $0.7323 ETH <0.01% $0.001178 621.6202 $0.7321 ETH <0.01% $0.000136 5,370.5238 $0.7281 ETH <0.01% $0.03076 23.644 $0.7272 ETH <0.01% <$0.000001 4,104,781,824.611 $0.7249 ETH <0.01% $0.009812 73.8672 $0.7247 ETH <0.01% $0.763114 0.9417 $0.7186 ETH <0.01% $0.000001 621,328.5494 $0.7179 ETH <0.01% $0.031424 22.8457 $0.7179 ETH <0.01% $0.019377 36.7747 $0.7125 ETH <0.01% $0.000355 2,005.6963 $0.711 ETH <0.01% $0.00205 345.5133 $0.7082 ETH <0.01% $0.002621 268.0257 $0.7024 ETH <0.01% $0.001982 354.0909 $0.7018 ETH <0.01% $0.000001 554,016.2592 $0.6966 ETH <0.01% $0.008912 77.2966 $0.6888 ETH <0.01% $0.049276 13.9391 $0.6868 ETH <0.01% $0.002615 262.2949 $0.6859 ETH <0.01% $0.000962 706.6356 $0.6795 ETH <0.01% <$0.000001 480,581,866.4682 $0.679 ETH <0.01% <$0.000001 523,428,570.3656 $0.6776 ETH <0.01% $0.00027 2,503.5408 $0.6768 ETH <0.01% $0.000183 3,691.3834 $0.6763 ETH <0.01% <$0.000001 4,134,026.5439 $0.6742 ETH <0.01% $2.75 0.2444 $0.6722 ETH <0.01% <$0.000001 29,308,015.2271 $0.67 ETH <0.01% $0.001878 355.1258 $0.6667 ETH <0.01% $0.00099 669.8428 $0.6633 ETH <0.01% $0.037581 17.3238 $0.651 ETH <0.01% $0.000002 351,591.3221 $0.6507 ETH <0.01% $0.153368 4.2409 $0.6504 ETH <0.01% $0.000833 770.294 $0.6417 ETH <0.01% <$0.000001 3,738,171,376.4149 $0.6417 ETH <0.01% <$0.000001 4,560,263.4326 $0.6399 ETH <0.01% <$0.000001 639,121,419.0152 $0.6397 ETH <0.01% $0.00021 2,986.2456 $0.6274 ETH <0.01% $215,361.31 0.00000291 $0.6274 ETH <0.01% <$0.000001 4,347,198,324.3082 $0.6203 ETH <0.01% $0.002255 273.8363 $0.6174 ETH <0.01% $0.15296 4.0291 $0.6162 ETH <0.01% $0.208938 2.9388 $0.614 ETH <0.01% <$0.000001 12,794,174.6681 $0.6111 ETH <0.01% <$0.000001 74,206,743.1411 $0.5935 ETH <0.01% $0.00398 145.5652 $0.5794 ETH <0.01% $0.09023 6.396 $0.5771 ETH <0.01% $0.008299 69.3451 $0.5755 ETH <0.01% $0.000241 2,377.4585 $0.5734 ETH <0.01% $0.000114 4,983.3409 $0.5673 ETH <0.01% $0.000842 663.446 $0.5586 ETH <0.01% $0.001088 512.9657 $0.5583 ETH <0.01% $0.073451 7.5557 $0.5549 ETH <0.01% <$0.000001 369,393,355.2848 $0.5512 ETH <0.01% $0.006169 88.9312 $0.5485 ETH <0.01% $0.013706 40.0058 $0.5483 ETH <0.01% <$0.000001 1,430,379.0272 $0.547 ETH <0.01% $0.000334 1,625.2172 $0.5432 ETH <0.01% <$0.000001 713,380,972,852.269 $0.5425 ETH <0.01% $0.00167 323.15 $0.5396 ETH <0.01% $0.009693 55.3661 $0.5366 ETH <0.01% $0.002416 221.2434 $0.5344 ETH <0.01% $0.000441 1,189.6079 $0.5248 ETH <0.01% $0.069555 7.5035 $0.5219 ETH <0.01% $0.069654 7.4417 $0.5183 ETH <0.01% $2.97 0.1733 $0.5145 ETH <0.01% $0.010171 50.1631 $0.5101 ETH <0.01% $0.063198 8.0682 $0.5098 ETH <0.01% $0.000115 4,419.8834 $0.5062 ETH <0.01% $0.00751 66.2407 $0.4974 ETH <0.01% <$0.000001 3,001,428.8329 $0.4934 ETH <0.01% $0.001648 299.0302 $0.4928 ETH <0.01% $0.000176 2,770.9245 $0.4873 ETH <0.01% $61,978 0.00000778 $0.4821 ETH <0.01% <$0.000001 160,554,378.3632 $0.481 ETH <0.01% $0.250444 1.908 $0.4778 ETH <0.01% $0.000003 186,231.457 $0.4777 ETH <0.01% $0.090721 5.2186 $0.4734 ETH <0.01% $0.002341 201.4439 $0.4715 ETH <0.01% $0.072473 6.4825 $0.4698 ETH <0.01% <$0.000001 10,458,726,727.0587 $0.4685 ETH <0.01% $13,868.25 0.00003377 $0.4683 ETH <0.01% $4,162.75 0.00011251 $0.4683 ETH <0.01% $0.000595 786.5972 $0.4677 ETH <0.01% <$0.000001 1,110,102.395 $0.4642 ETH <0.01% $0.000004 113,972.7791 $0.4638 ETH <0.01% $0.000889 521.1679 $0.4633 ETH <0.01% <$0.000001 84,852,547.9246 $0.4618 ETH <0.01% <$0.000001 1,082,989.3867 $0.4552 ETH <0.01% $2,788.42 0.00016191 $0.4514 ETH <0.01% $0.310607 1.4255 $0.4427 ETH <0.01% <$0.000001 231,132,603.6624 $0.4407 ETH <0.01% <$0.000001 5,248,617,609,835.57 $0.4377 ETH <0.01% $0.017423 25.0044 $0.4356 ETH <0.01% $0.000215 2,009.4106 $0.432 ETH <0.01% <$0.000001 8,250,815,910.3917 $0.4315 ETH <0.01% $0.220998 1.9383 $0.4283 ETH <0.01% $0.000072 5,944.5109 $0.4258 ETH <0.01% $0.000287 1,468 $0.4213 ETH <0.01% $0.999207 0.4197 $0.4193 ETH <0.01% $0.031546 13.2115 $0.4167 ETH <0.01% $0.043208 9.6443 $0.4167 ETH <0.01% $1.49 0.2734 $0.4073 ETH <0.01% $1.17 0.3443 $0.4028 ETH <0.01% <$0.000001 242,154,639.854 $0.3997 ETH <0.01% $0.000138 2,871.213 $0.396 ETH <0.01% <$0.000001 5,888,735.8606 $0.3958 ETH <0.01% <$0.000001 5,049,203.162 $0.3944 ETH <0.01% $0.000001 463,997.2044 $0.3935 ETH <0.01% <$0.000001 2,145,122,487,873.7 $0.3913 ETH <0.01% $0.000192 2,033.1985 $0.3907 ETH <0.01% <$0.000001 885,077,759.0757 $0.39 ETH <0.01% $0.064456 5.9971 $0.3865 ETH <0.01% $0.003552 107.5038 $0.3818 ETH <0.01% $0.000081 4,618.3968 $0.3757 ETH <0.01% $0.000344 1,067.9227 $0.3669 ETH <0.01% $0.000024 15,201.0962 $0.3636 ETH <0.01% $0.002461 147.4499 $0.3628 ETH <0.01% $0.033777 10.7064 $0.3616 ETH <0.01% <$0.000001 174,248,266.6663 $0.3584 ETH <0.01% $0.021673 16.5239 $0.3581 ETH <0.01% <$0.000001 6,290,322.3143 $0.3574 ETH <0.01% $0.000457 780.3632 $0.3562 ETH <0.01% <$0.000001 1,069,218,963.2467 $0.356 ETH <0.01% $0.025052 14.2067 $0.3559 ETH <0.01% $0.000019 19,161.6283 $0.3546 ETH <0.01% $0.000002 157,991.6953 $0.3539 ETH <0.01% <$0.000001 1,259,334,226.6268 $0.3483 ETH <0.01% $0.605125 0.5742 $0.3474 ETH <0.01% <$0.000001 10,790,583,467,087,500 $0.3452 ETH <0.01% $0.000166 2,073.5957 $0.3447 ETH <0.01% <$0.000001 29,096,792.9115 $0.3445 ETH <0.01% <$0.000001 274,836,945.9881 $0.341 ETH <0.01% <$0.000001 91,645,932.7869 $0.3376 ETH <0.01% <$0.000001 3,103,332,927.6931 $0.3345 ETH <0.01% $61,157 0.00000547 $0.3345 ETH <0.01% $0.00022 1,515.5228 $0.3332 ETH <0.01% $0.000002 192,219.7348 $0.3325 ETH <0.01% $0.000158 2,090.9951 $0.3312 ETH <0.01% $0.000001 500,493.7082 $0.3277 ETH <0.01% $0.048629 6.7104 $0.3263 ETH <0.01% $0.067796 4.7325 $0.3208 ETH <0.01% $0.000043 7,507.096 $0.32 ETH <0.01% $0.000002 193,674.79 $0.3137 ETH <0.01% $0.001118 277.5597 $0.3101 ETH <0.01% $0.000002 144,764.8718 $0.3087 ETH <0.01% <$0.000001 6,890,420.4374 $0.3069 ETH <0.01% $0.000483 634.9702 $0.3068 ETH <0.01% <$0.000001 13,919,230,045,800.4 $0.3067 ETH <0.01% $12.32 0.0246 $0.303 ETH <0.01% $0.096692 3.1156 $0.3012 ETH <0.01% $0.888692 0.3338 $0.2966 ETH <0.01% $0.260402 1.1321 $0.2948 ETH <0.01% $0.014256 20.3891 $0.2906 ETH <0.01% $0.647603 0.4453 $0.2884 ETH <0.01% $0.000001 318,008.0886 $0.2877 ETH <0.01% <$0.000001 799,690,190,599.049 $0.2795 ETH <0.01% $0.000086 3,212.7331 $0.2762 ETH <0.01% $0.000001 199,037.2352 $0.2751 ETH <0.01% $0.000002 119,585.1834 $0.2749 ETH <0.01% $0.000226 1,213.0632 $0.2742 ETH <0.01% $0.019877 13.537 $0.269 ETH <0.01% $0.000265 1,001.8361 $0.2655 ETH <0.01% $42.74 0.00618391 $0.2643 ETH <0.01% $0.031649 8.3219 $0.2633 ETH <0.01% <$0.000001 385,790,791,760.545 $0.2623 ETH <0.01% $0.000176 1,473.0255 $0.2585 ETH <0.01% $0.00843 30.6216 $0.2581 ETH <0.01% <$0.000001 914,904.1944 $0.2573 ETH <0.01% $0.007512 34.012 $0.2555 ETH <0.01% $0.000027 9,586.9933 $0.2553 ETH <0.01% <$0.000001 7,055,107.8117 $0.2546 ETH <0.01% $0.000058 4,401.8258 $0.2537 ETH <0.01% $0.008585 29.5371 $0.2535 ETH <0.01% $0.00004 6,324.7042 $0.2529 ETH <0.01% $0.000019 12,737.0232 $0.2448 ETH <0.01% $0.008131 29.7962 $0.2422 ETH <0.01% $0.170041 1.4119 $0.24 ETH <0.01% $0.051037 4.7011 $0.2399 ETH <0.01% $0.000427 551.3847 $0.2356 ETH <0.01% $0.036164 6.4348 $0.2327 ETH <0.01% $0.439416 0.5285 $0.2322 ETH <0.01% $0.000801 288.4469 $0.2309 ETH <0.01% $0.000543 416.5447 $0.2262 ETH <0.01% $0.000024 9,443.5979 $0.2221 ETH <0.01% <$0.000001 566,087,113.4619 $0.2198 ETH <0.01% $0.340781 0.642 $0.2187 ETH <0.01% $0.076642 2.8366 $0.2173 ETH <0.01% $0.000397 535.4898 $0.2127 ETH <0.01% $0.000916 228.3996 $0.2092 ETH <0.01% $0.00007 2,963.9464 $0.2083 ETH <0.01% $0.047134 4.1675 $0.1964 ETH <0.01% <$0.000001 826,353,372.1459 $0.1963 ETH <0.01% $0.000137 1,428.2113 $0.1951 ETH <0.01% $26.89 0.00722517 $0.1942 ETH <0.01% $0.655381 0.2959 $0.1939 ETH <0.01% $0.005551 34.1453 $0.1895 ETH <0.01% $0.000027 6,757.0702 $0.183 ETH <0.01% $0.000132 1,366.0617 $0.1805 ETH <0.01% $0.000006 28,795.4155 $0.1793 ETH <0.01% $0.004042 42.5912 $0.1721 ETH <0.01% <$0.000001 1,387,669.7049 $0.1669 ETH <0.01% $1.26 0.1319 $0.1661 ETH <0.01% $0.028908 5.7345 $0.1657 ETH <0.01% $5.96 0.0278 $0.1654 ETH <0.01% $0.411277 0.3993 $0.1642 ETH <0.01% $1.12 0.1465 $0.1641 ETH <0.01% $0.998984 0.1618 $0.1615 ETH <0.01% $5,163.8 0.00003055 $0.1577 ETH <0.01% $0.036404 4.2768 $0.1556 ETH <0.01% $0.553455 0.2808 $0.1554 ETH <0.01% <$0.000001 33,101,080.5806 $0.1542 ETH <0.01% <$0.000001 1,350,635.0577 $0.1517 ETH <0.01% $0.000958 158.218 $0.1515 ETH <0.01% $71.55 0.00211695 $0.1514 ETH <0.01% <$0.000001 28,115,475.3887 $0.1425 ETH <0.01% <$0.000001 327,037,992,964.735 $0.1411 ETH <0.01% $0.001145 122.6469 $0.1403 ETH <0.01% $10.68 0.013 $0.1392 ETH <0.01% $0.000046 2,942.4882 $0.1366 ETH <0.01% <$0.000001 105,169,672.0614 $0.1358 ETH <0.01% $0.060614 2.2313 $0.1352 ETH <0.01% <$0.000001 26,767,055,806,733.1 $0.1349 ETH <0.01% $0.002778 48.345 $0.1342 ETH <0.01% $0.000212 622.9285 $0.1323 ETH <0.01% <$0.000001 1,734,083.9401 $0.129 ETH <0.01% <$0.000001 14,911,466.1093 $0.1285 ETH <0.01% $0.307346 0.4151 $0.1275 ETH <0.01% $0.001504 83.2395 $0.1251 ETH <0.01% $0.226475 0.5474 $0.1239 ETH <0.01% $0.012124 10.1852 $0.1234 ETH <0.01% $0.000371 332.7608 $0.1233 ETH <0.01% <$0.000001 1,583,002,851.599 $0.1226 ETH <0.01% $0.026131 4.6859 $0.1224 ETH <0.01% $0.000001 188,884.4924 $0.1204 ETH <0.01% <$0.000001 1,573,122,346.9221 $0.1195 ETH <0.01% $0.143454 0.8244 $0.1182 ETH <0.01% $0.000006 19,349.5132 $0.1182 ETH <0.01% $23.12 0.00510737 $0.118 ETH <0.01% $0.000214 544.617 $0.1167 ETH <0.01% $0.022881 4.9514 $0.1132 ETH <0.01% $0.030136 3.7381 $0.1126 ETH <0.01% <$0.000001 803,226,730.2453 $0.1122 ETH <0.01% $0.055136 2 $0.1102 ETH <0.01% <$0.000001 380,504.9603 $0.1101 ETH <0.01% $0.008121 13.5033 $0.1096 ETH <0.01% $0.007669 14.2816 $0.1095 ETH <0.01% <$0.000001 1,892,398.9743 $0.1062 ETH <0.01% $0.002045 51.0191 $0.1043 ETH <0.01% $0.028244 3.5704 $0.1008 POL <0.01% $1.31 210,000 $275,573.61 POL <0.01% <$0.000001 72,775,020,223.9034 $836.91 POL <0.01% $0.00375 134,128.6516 $503.04 POL <0.01% $0.002523 109,750.3825 $276.88 POL <0.01% $0.018997 6,299.6763 $119.67 POL <0.01% $0.999847 89.8485 $89.83 POL <0.01% $0.004857 17,565.3046 $85.32 POL <0.01% $6.8 11.5111 $78.28 POL <0.01% $0.004195 17,952.77 $75.31 POL <0.01% $0.003144 23,722.86 $74.59 POL <0.01% $0.322109 228.6078 $73.64 POL <0.01% $0.0007 90,886.9216 $63.59 POL <0.01% $0.25523 248.7738 $63.49 POL <0.01% $276.93 0.2283 $63.22 POL <0.01% $0.256785 237.8058 $61.06 POL <0.01% $1.15 52.8168 $60.74 POL <0.01% $2,670.32 0.0217 $58.02 POL <0.01% $0.011349 5,102.1433 $57.9 POL <0.01% $5.56 9.9814 $55.5 POL <0.01% $0.029281 1,819.4127 $53.27 POL <0.01% $11.03 4.7056 $51.9 POL <0.01% $0.001542 28,874.76 $44.54 POL <0.01% $0.013416 3,316.6787 $44.5 POL <0.01% $2.64 16.6489 $43.95 POL <0.01% $0.001634 25,663.9281 $41.94 POL <0.01% $0.012746 3,214.5471 $40.97 POL <0.01% $0.280216 144.8739 $40.6 POL <0.01% $0.260965 152.1156 $39.7 POL <0.01% $0.999742 33.7192 $33.71 POL <0.01% $0.206809 147.295 $30.46 POL <0.01% $0.999648 29.9981 $29.99 POL <0.01% $0.000012 2,238,394.4533 $26.59 POL <0.01% $0.165012 154.7888 $25.54 POL <0.01% $2,391.96 0.0105 $25.13 POL <0.01% $1.38 16.6923 $23.04 POL <0.01% $0.010117 2,248.8821 $22.75 POL <0.01% $0.000024 934,186.3279 $22.64 POL <0.01% $0.742658 30.3863 $22.57 POL <0.01% $0.006484 3,434.1158 $22.27 POL <0.01% $0.207963 105.5954 $21.96 POL <0.01% $150.37 0.1412 $21.23 POL <0.01% $0.035976 571.4951 $20.56 POL <0.01% $0.57653 35.1712 $20.28 POL <0.01% $0.379347 49.5072 $18.78 POL <0.01% $0.152719 122.8206 $18.76 POL <0.01% $140.61 0.127 $17.85 POL <0.01% $1.33 13.3442 $17.75 POL <0.01% $0.119327 147.4286 $17.59 POL <0.01% $0.126886 131.2469 $16.65 POL <0.01% $0.00347 4,733.5176 $16.42 POL <0.01% <$0.000001 1,306,668,718.6506 $14.11 POL <0.01% $0.006702 1,988.8231 $13.33 POL <0.01% $1.94 6.8421 $13.27 POL <0.01% $1.28 9.8593 $12.62 POL <0.01% $1.33 9.3126 $12.39 POL <0.01% $1.2 8.1409 $9.77 POL <0.01% $0.037474 258.1097 $9.67 POL <0.01% $0.15693 56.9164 $8.93 POL <0.01% $0.033972 258.9271 $8.8 POL <0.01% $0.151343 55.6875 $8.43 POL <0.01% $0.085586 95.2584 $8.15 POL <0.01% $61,396 0.00013199 $8.1 POL <0.01% $0.013568 596.1486 $8.09 POL <0.01% $0.007656 1,032.947 $7.91 POL <0.01% $0.447148 17.6626 $7.9 POL <0.01% $0.000364 20,803.2663 $7.57 POL <0.01% $0.009265 780.664 $7.23 POL <0.01% $0.001314 5,457.3984 $7.17 POL <0.01% $0.288874 23.0737 $6.67 POL <0.01% $0.000456 13,756.9947 $6.28 POL <0.01% $0.649094 9.6302 $6.25 POL <0.01% $1.04 5.9916 $6.21 POL <0.01% $0.017628 326.048 $5.75 POL <0.01% $0.02639 213.6979 $5.64 POL <0.01% $0.993012 5.629 $5.59 POL <0.01% $20.54 0.2599 $5.34 POL <0.01% $0.000818 6,465.9717 $5.29 POL <0.01% $0.000556 9,164.4028 $5.09 POL <0.01% $0.999847 5.0914 $5.09 POL <0.01% $0.002869 1,774.5245 $5.09 POL <0.01% $0.00041 12,303.3886 $5.04 POL <0.01% $0.010401 475.0602 $4.94 POL <0.01% $0.003593 1,293.5318 $4.65 POL <0.01% $0.023518 177.797 $4.18 POL <0.01% $0.037556 108.9517 $4.09 POL <0.01% $0.699809 5.6193 $3.93 POL <0.01% $0.00217 1,776.4445 $3.85 POL <0.01% <$0.000001 191,954,613.1574 $3.84 POL <0.01% $0.237134 15.7264 $3.73 POL <0.01% $0.001056 3,528.916 $3.73 POL <0.01% $0.148151 25.1322 $3.72 POL <0.01% $0.001227 2,979.99 $3.66 POL <0.01% <$0.000001 28,496,022.0438 $3.44 POL <0.01% $0.010982 306.1052 $3.36 POL <0.01% $0.001461 2,265.323 $3.31 POL <0.01% $4.06 0.8077 $3.28 POL <0.01% $1.1 2.7742 $3.05 POL <0.01% $0.091365 32.4288 $2.96 POL <0.01% $0.000272 10,068.3669 $2.74 POL <0.01% $0.609572 4.3625 $2.66 POL <0.01% $0.000017 154,720.4444 $2.61 POL <0.01% $0.000001 2,603,108.3279 $2.43 POL <0.01% $0.000002 1,154,653.9903 $2.33 POL <0.01% $0.942153 2.4014 $2.26 POL <0.01% $1.91 1.1351 $2.17 POL <0.01% $0.771793 2.7781 $2.14 POL <0.01% $0.028349 73.8145 $2.09 POL <0.01% $0.01457 141.589 $2.06 POL <0.01% $0.00017 11,823.1588 $2.01 POL <0.01% $0.000021 93,905.1253 $2 POL <0.01% $0.000034 58,027.7084 $1.95 POL <0.01% $0.034383 56.6879 $1.95 POL <0.01% $0.007558 236.5857 $1.79 POL <0.01% $0.006962 248.5945 $1.73 POL <0.01% $0.706617 2.3855 $1.69 POL <0.01% $2.44 0.6565 $1.6 POL <0.01% $0.001104 1,450.0059 $1.6 POL <0.01% $0.000681 2,336.1993 $1.59 POL <0.01% $0.291619 5.3596 $1.56 POL <0.01% $0.000069 20,607.3293 $1.42 POL <0.01% $0.002713 494.2406 $1.34 POL <0.01% $0.00361 369.2399 $1.33 POL <0.01% $1.15 1.1183 $1.29 POL <0.01% $0.008504 148.8307 $1.27 POL <0.01% $0.018314 65.5039 $1.2 POL <0.01% $0.005811 203.5865 $1.18 POL <0.01% $0.005257 210.0394 $1.1 POL <0.01% $0.001637 637.4892 $1.04 POL <0.01% $0.002809 362.8155 $1.02 POL <0.01% $0.000976 996.6229 $0.9731 POL <0.01% $0.142815 6.5772 $0.9393 POL <0.01% $0.005026 183.5541 $0.9225 POL <0.01% $0.000002 455,002.8757 $0.91 POL <0.01% $0.175967 4.5755 $0.8051 POL <0.01% $0.001044 756.9225 $0.79 POL <0.01% $0.011154 68.2451 $0.7611 POL <0.01% $0.000675 1,033.4779 $0.6978 POL <0.01% $0.020466 33.0818 $0.677 POL <0.01% $1 0.6672 $0.6678 POL <0.01% $0.000945 705.1697 $0.6661 POL <0.01% $44.43 0.0145 $0.6455 POL <0.01% $0.004376 147.4107 $0.645 POL <0.01% $0.002594 247.1614 $0.641 POL <0.01% $16.19 0.0393 $0.636 POL <0.01% $0.002002 308.9757 $0.6184 POL <0.01% $0.09585 6.4161 $0.6149 POL <0.01% $0.003662 154.1599 $0.5645 POL <0.01% $0.005109 109.744 $0.5607 POL <0.01% $0.008832 63.4431 $0.5603 POL <0.01% $0.030559 17.5322 $0.5357 POL <0.01% $0.000344 1,478.5453 $0.5083 POL <0.01% $0.250579 2.0054 $0.5025 POL <0.01% $0.000674 735.73 $0.4957 POL <0.01% $0.636353 0.7768 $0.4943 POL <0.01% $0.005973 78.5787 $0.4693 POL <0.01% $0.153064 2.8624 $0.4381 POL <0.01% $0.00799 51.368 $0.4104 POL <0.01% $0.000057 6,864.6274 $0.3881 POL <0.01% $0.013733 28.2101 $0.3874 POL <0.01% $0.00205 186.5294 $0.3823 POL <0.01% $1.1 0.34 $0.374 POL <0.01% $0.007084 52.4799 $0.3717 POL <0.01% $0.001771 201.9112 $0.3575 POL <0.01% $0.019699 16.7378 $0.3297 POL <0.01% $0.995378 0.3246 $0.3231 POL <0.01% $0.699414 0.4572 $0.3197 POL <0.01% $0.014706 21.4423 $0.3153 POL <0.01% $0.000015 19,601.766 $0.2887 POL <0.01% $0.002942 94.9303 $0.2793 POL <0.01% $0.605433 0.437 $0.2645 POL <0.01% $0.00013 1,929.8292 $0.2503 POL <0.01% $0.001846 134.465 $0.2481 POL <0.01% <$0.000001 1,890,463.5141 $0.2364 POL <0.01% $0.000117 2,010.998 $0.2355 POL <0.01% $0.000118 1,977.6194 $0.2337 POL <0.01% <$0.000001 1,011,110.0688 $0.2328 POL <0.01% $0.282582 0.7822 $0.221 POL <0.01% $0.015489 13.7189 $0.2124 POL <0.01% $0.087943 2.2687 $0.1995 POL <0.01% $0.000851 231.8379 $0.1972 POL <0.01% $0.000006 31,706.637 $0.1921 POL <0.01% $0.008001 23.0447 $0.1843 POL <0.01% $0.217129 0.8295 $0.1801 POL <0.01% $0.000138 1,272.672 $0.1755 POL <0.01% $0.000335 508.6217 $0.1702 POL <0.01% $0.000117 1,449.0632 $0.1694 POL <0.01% $0.001095 150.8251 $0.1651 POL <0.01% $0.140992 1.0646 $0.15 POL <0.01% $0.001245 113.0122 $0.1407 POL <0.01% $0.001139 122.1408 $0.1391 POL <0.01% $0.429733 0.3105 $0.1334 POL <0.01% $0.008368 15.6773 $0.1311 POL <0.01% $0.0014 87.7406 $0.1228 POL <0.01% $1 0.1181 $0.118 POL <0.01% $0.000731 149.5707 $0.1093 POL <0.01% $0.027638 3.7552 $0.1037 FTM <0.01% $61,394 0.0262 $1,610.9 FTM <0.01% $276.69 1.9943 $551.79 FTM <0.01% <$0.000001 5,236,808,324.844 $473.41 FTM <0.01% $11.05 7.5903 $83.87 FTM <0.01% $1.25 64.1147 $80.14 FTM <0.01% $1 76.1128 $76.19 FTM <0.01% $150.14 0.478 $71.77 FTM <0.01% $0.003455 19,634.2563 $67.84 FTM <0.01% $4,951.88 0.0135 $66.77 FTM <0.01% $21.96 2.809 $61.68 FTM <0.01% $61,360 0.00099868 $61.28 FTM <0.01% $0.002222 24,306.9032 $54.02 FTM <0.01% $0.000001 65,443,861.5378 $50.93 FTM <0.01% $0.74155 53.8045 $39.9 FTM <0.01% $0.000525 62,585.7379 $32.84 FTM <0.01% $0.015457 2,106.4588 $32.56 FTM <0.01% $0.022715 1,418.4952 $32.22 FTM <0.01% $0.288636 101.6044 $29.33 FTM <0.01% $10.43 2.6124 $27.25 FTM <0.01% $2,390.22 0.0105 $25.15 FTM <0.01% $0.997382 23.4661 $23.4 FTM <0.01% $0.004536 3,944.2686 $17.89 FTM <0.01% $0.026362 601.2085 $15.85 FTM <0.01% $0.000006 2,485,637.595 $14.96 FTM <0.01% $0.630012 19.6202 $12.36 FTM <0.01% $0.154235 68.9429 $10.63 FTM <0.01% $1.11 9.1763 $10.19 FTM <0.01% $0.023021 410.3809 $9.45 FTM <0.01% $0.260394 29.5619 $7.7 FTM <0.01% $0.485263 13.3344 $6.47 FTM <0.01% $0.994401 5.8641 $5.83 FTM <0.01% $0.719133 8.0344 $5.78 FTM <0.01% $732.56 0.00741346 $5.43 FTM <0.01% <$0.000001 16,693,828,936.4926 $5.01 FTM <0.01% $2,391.57 0.00185953 $4.45 FTM <0.01% $0.379576 10.9802 $4.17 FTM <0.01% $0.00963 400.2136 $3.85 FTM <0.01% $0.000266 14,065.1453 $3.74 FTM <0.01% $0.000076 47,539.017 $3.62 FTM <0.01% $0.004958 686.2784 $3.4 FTM <0.01% <$0.000001 12,810,520,458.3223 $2.56 FTM <0.01% $5 0.5011 $2.51 FTM <0.01% $0.133663 18.0649 $2.41 FTM <0.01% $0.324488 7.3222 $2.38 FTM <0.01% $0.630043 2.7403 $1.73 FTM <0.01% $1.94 0.6881 $1.33 FTM <0.01% $0.009539 136.6752 $1.3 FTM <0.01% <$0.000001 1,711,985,793.6693 $1.2 FTM <0.01% $60.71 0.0146 $0.8842 FTM <0.01% $0.000072 11,926.058 $0.8593 FTM <0.01% <$0.000001 7,587,373.8569 $0.8513 FTM <0.01% $0.00668 84.3077 $0.5631 FTM <0.01% $0.018549 27.9449 $0.5183 FTM <0.01% $0.789336 0.6528 $0.5152 FTM <0.01% $0.998001 0.4856 $0.4845 FTM <0.01% $0.069869 6.003 $0.4194 FTM <0.01% $0.282839 1.3799 $0.3902 FTM <0.01% $0.165146 2.1503 $0.3551 FTM <0.01% $0.400849 0.8127 $0.3257 FTM <0.01% $0.998001 0.188 $0.1876 FTM <0.01% $0.000125 1,470.6025 $0.184 FTM <0.01% $0.022664 7.8247 $0.1773 FTM <0.01% $0.000011 16,356.4495 $0.1746 FTM <0.01% $1 0.1536 $0.1535 FTM <0.01% $0.002562 47.3195 $0.1212 FTM <0.01% $0.000903 133.7609 $0.1207 ARB <0.01% $276.68 0.4109 $113.7 ARB <0.01% $6.79 9.7919 $66.49 ARB <0.01% $2,387.36 0.0232 $55.44 ARB <0.01% $0.190158 288.1993 $54.8 ARB <0.01% $0.070952 739.6346 $52.48 ARB <0.01% $0.021971 2,336.6185 $51.34 ARB <0.01% $4.06 12.4225 $50.44 ARB <0.01% $11.02 4.4468 $49 ARB <0.01% $0.156761 301.6552 $47.29 ARB <0.01% $0.999427 45.4907 $45.46 ARB <0.01% $0.280541 155.141 $43.52 ARB <0.01% $0.999587 41.5189 $41.5 ARB <0.01% $61,350 0.00063414 $38.9 ARB <0.01% $40.99 0.9396 $38.51 ARB <0.01% $0.552815 57.1718 $31.61 ARB <0.01% $3.8 8.2106 $31.2 ARB <0.01% $21.41 1.3638 $29.2 ARB <0.01% $1.94 14.9767 $29.05 ARB <0.01% $0.000013 2,116,781.6132 $28.47 ARB <0.01% <$0.000001 92,811,777,462.2274 $27.84 ARB <0.01% $0.999587 26.633 $26.62 ARB <0.01% $0.002267 11,080.9341 $25.13 ARB <0.01% $0.026619 920.7122 $24.51 ARB <0.01% $1.04 22.037 $22.83 ARB <0.01% $0.340547 61.394 $20.91 ARB <0.01% $0.322162 54.3952 $17.52 ARB <0.01% $0.068102 242.3857 $16.51 ARB <0.01% <$0.000001 1,387,745,085.5981 $15.54 ARB <0.01% $0.024555 620.6609 $15.24 ARB <0.01% $1.83 8.252 $15.1 ARB <0.01% $906.64 0.0151 $13.72 ARB <0.01% $0.271353 40.0065 $10.86 ARB <0.01% $0.091953 114.9731 $10.57 ARB <0.01% $0.439557 22.4087 $9.85 ARB <0.01% $0.635049 12.8655 $8.17 ARB <0.01% $0.742138 10.5593 $7.84 ARB <0.01% $0.31722 22.579 $7.16 ARB <0.01% $0.004169 1,409.6433 $5.88 ARB <0.01% $0.164951 32.1877 $5.31 ARB <0.01% $0.056082 94.6488 $5.31 ARB <0.01% $0.056965 88.6123 $5.05 ARB <0.01% $0.000525 9,615.5979 $5.04 ARB <0.01% $0.042894 105.5957 $4.53 ARB <0.01% $0.288882 15.1558 $4.38 ARB <0.01% $0.000004 1,154,905.1239 $4.26 ARB <0.01% $0.26085 15.8128 $4.12 ARB <0.01% $0.294773 12.7743 $3.77 ARB <0.01% $0.074226 50.3547 $3.74 ARB <0.01% $0.00002 166,086.443 $3.27 ARB <0.01% $0.01342 226.1795 $3.04 ARB <0.01% $0.171811 15.8239 $2.72 ARB <0.01% $2.67 0.8037 $2.15 ARB <0.01% $3.63 0.5103 $1.85 ARB <0.01% $0.996621 1.6561 $1.65 ARB <0.01% <$0.000001 6,468,444.7946 $1.49 ARB <0.01% $0.005228 261.5389 $1.37 ARB <0.01% $0.165176 7.3406 $1.21 ARB <0.01% $0.006603 183.0391 $1.21 ARB <0.01% $0.00322 367.6124 $1.18 ARB <0.01% $0.000009 127,139.948 $1.16 ARB <0.01% $0.009235 108.0624 $0.9979 ARB <0.01% $0.036708 24.715 $0.9072 ARB <0.01% $0.994484 0.8116 $0.8071 ARB <0.01% $1 0.7897 $0.7896 ARB <0.01% $0.011519 49.1603 $0.5662 ARB <0.01% $0.080533 6.6917 $0.5389 ARB <0.01% $1.45 0.3693 $0.5354 ARB <0.01% <$0.000001 6,931,116.8136 $0.5309 ARB <0.01% $0.014766 34.294 $0.5063 ARB <0.01% $1.91 0.2344 $0.4476 ARB <0.01% $0.400466 0.9811 $0.3928 ARB <0.01% $0.048176 7.413 $0.3571 ARB <0.01% $0.025409 13.5836 $0.3451 ARB <0.01% $0.999625 0.3169 $0.3168 ARB <0.01% $0.002961 87.3966 $0.2587 ARB <0.01% $0.024379 9.9103 $0.2416 ARB <0.01% $0.06872 3.3895 $0.2329 ARB <0.01% $1 0.211 $0.211 ARB <0.01% <$0.000001 572,500,886.9521 $0.1717 ARB <0.01% <$0.000001 1,411,113.171 $0.1601 ARB <0.01% <$0.000001 315,593.4357 $0.1113 ARB <0.01% $0.017739 6.2166 $0.1102 AVAX <0.01% $276.76 0.4706 $130.24 AVAX <0.01% $0.000095 1,356,531.064 $129.25 AVAX <0.01% $0.249225 328.0983 $81.77 AVAX <0.01% <$0.000001 4,155,316,595.6136 $62.33 AVAX <0.01% $0.999966 62.0297 $62.03 AVAX <0.01% $0.999909 50.4013 $50.4 AVAX <0.01% $61,429 0.00081206 $49.88 AVAX <0.01% $0.013007 3,245.7862 $42.22 AVAX <0.01% <$0.000001 1,101,157,190.9572 $38.98 AVAX <0.01% $0.090039 365.2131 $32.88 AVAX <0.01% $0.008042 3,193.0011 $25.68 AVAX <0.01% $21.46 1.1285 $24.22 AVAX <0.01% $0.317983 62.2173 $19.78 AVAX <0.01% $0.024585 720.5981 $17.72 AVAX <0.01% $0.999966 15.1026 $15.1 AVAX <0.01% $0.999991 14.8427 $14.84 AVAX <0.01% $0.995807 14.535 $14.47 AVAX <0.01% $0.000004 2,838,011.6731 $12.6 AVAX <0.01% $0.372984 32.7967 $12.23 AVAX <0.01% $11.04 1.048 $11.57 AVAX <0.01% $3.79 2.3465 $8.9 AVAX <0.01% $0.000001 6,778,659.0115 $8.88 AVAX <0.01% $149.84 0.0503 $7.54 AVAX <0.01% $0.000526 13,214.5264 $6.95 AVAX <0.01% $29.89 0.2255 $6.74 AVAX <0.01% $61,377.3 0.00009839 $6.04 AVAX <0.01% $0.00297 1,869.3814 $5.55 AVAX <0.01% $0.000027 203,057.8699 $5.48 AVAX <0.01% $25.53 0.2077 $5.3 AVAX <0.01% $0.000165 30,292.3478 $5 AVAX <0.01% $0.288796 16.2893 $4.7 AVAX <0.01% $0.99595 4.5257 $4.51 AVAX <0.01% $0.99729 3.5748 $3.57 AVAX <0.01% $0.002786 1,181.8378 $3.29 AVAX <0.01% $0.000621 5,271.6712 $3.27 AVAX <0.01% $0.007112 446.5012 $3.18 AVAX <0.01% $0.999909 2.8905 $2.89 AVAX <0.01% $0.020495 105.5094 $2.16 AVAX <0.01% $0.032065 59.9906 $1.92 AVAX <0.01% <$0.000001 26,712,068.0155 $1.78 AVAX <0.01% $0.003431 513.0273 $1.76 AVAX <0.01% $0.000501 3,355.0347 $1.68 AVAX <0.01% $31.93 0.0504 $1.61 AVAX <0.01% $0.741934 1.4938 $1.11 AVAX <0.01% $0.004865 203.1872 $0.9885 AVAX <0.01% $406.91 0.00160918 $0.6547 AVAX <0.01% $0.002417 263.9981 $0.638 AVAX <0.01% $0.014371 44.0043 $0.6324 AVAX <0.01% $0.000555 1,101.0832 $0.6111 AVAX <0.01% $0.055608 9.2338 $0.5134 AVAX <0.01% $0.095455 5.2545 $0.5015 AVAX <0.01% $0.308435 1.3056 $0.4026 AVAX <0.01% $0.000017 23,450.264 $0.3965 AVAX <0.01% $6.8 0.0531 $0.3613 AVAX <0.01% $0.081208 4.1771 $0.3392 AVAX <0.01% $0.108371 3.0426 $0.3297 AVAX <0.01% $1.94 0.1585 $0.3077 AVAX <0.01% $0.000015 18,265.4212 $0.265 AVAX <0.01% $1 0.2074 $0.2075 AVAX <0.01% $0.003164 64.3434 $0.2035 AVAX <0.01% $0.004784 42.1895 $0.2018 AVAX <0.01% $0.156784 1.2857 $0.2015 AVAX <0.01% $0.026394 5.3575 $0.1414 AVAX <0.01% $0.000464 264.305 $0.1225 AVAX <0.01% $0.254181 0.464 $0.1179 AVAX <0.01% $0.029321 3.6483 $0.1069 AVAX <0.01% $0.008117 12.4835 $0.1013 OP <0.01% $2,816.92 0.0304 $85.75 OP <0.01% $0.094332 742.6442 $70.06 OP <0.01% $0.999776 58.4248 $58.41 OP <0.01% $0.999464 57.4647 $57.43 OP <0.01% $0.00929 4,436.5852 $41.21 OP <0.01% $0.999776 35.0385 $35.03 OP <0.01% $1.56 18.1687 $28.41 OP <0.01% $2,388.53 0.0109 $26.03 OP <0.01% $1.38 14.7905 $20.41 OP <0.01% $0.537479 31.6897 $17.03 OP <0.01% $11.04 0.6079 $6.71 OP <0.01% $1 6.5875 $6.59 OP <0.01% $0.015168 375.6849 $5.7 OP <0.01% $1.69 2.8795 $4.87 OP <0.01% $0.002523 1,603.5823 $4.05 OP <0.01% $1.91 1.9466 $3.72 OP <0.01% $34.33 0.049 $1.68 OP <0.01% $0.009229 182.2991 $1.68 OP <0.01% $2.82 0.5223 $1.47 OP <0.01% $0.999782 1.2404 $1.24 OP <0.01% $6.8 0.1522 $1.04 OP <0.01% $0.000493 832.936 $0.4108 OP <0.01% $2,673.97 0.00012037 $0.3218 OP <0.01% $0.439948 0.7045 $0.3099 OP <0.01% $4.07 0.0746 $0.3034 OP <0.01% $0.094332 3.1717 $0.2991 OP <0.01% $0.000916 187.4643 $0.1717 OP <0.01% $0.997352 0.1639 $0.1634 OP <0.01% $0.026156 5.55 $0.1451 OP <0.01% $0.000025 4,699.7664 $0.1197 BASE <0.01% $0.046472 189.224 $8.79 BASE <0.01% $0.002655 2,073.5021 $5.5 BASE <0.01% $0.000003 200,004.2069 $0.606 BASE <0.01% $0.011017 11 $0.1211 GNO <0.01% $0.107425 4.4495 $0.4779 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.Address Cards
To use this feature, please login to your Etherscan account and return to this page.Before You Copy
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.