Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FlashLoanArbitrageV3
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/*───────────────────────────────────────────────────────────────
🧠 FlashLoanArbitrageV3 — Mainnet-Ready Aave v3 Arbitrage Executor
─────────────────────────────────────────────────────────────────
✓ Executes Uniswap ↔ SushiSwap swaps for any token pair
✓ Repays Aave + fee automatically
✓ Routes profit to treasury wallet
✓ Emits detailed events for bot monitoring
✓ Fixes silent “execution reverted” errors with enhanced checks
───────────────────────────────────────────────────────────────*/
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol";
import "@aave/core-v3/contracts/interfaces/IPool.sol";
import "@aave/core-v3/contracts/interfaces/IPoolDataProvider.sol";
import "@aave/core-v3/contracts/flashloan/interfaces/IFlashLoanSimpleReceiver.sol";
interface IRouter {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function getAmountsOut(
uint256 amountIn,
address[] calldata path
) external view returns (uint256[] memory amounts);
}
contract FlashLoanArbitrageV3 is Ownable, ReentrancyGuard, IFlashLoanSimpleReceiver {
IPoolAddressesProvider public override ADDRESSES_PROVIDER;
IPool public override POOL;
IPoolDataProvider public POOL_DATA_PROVIDER;
address public uniswapRouter;
address public sushiSwapRouter;
address public treasury;
// Config
uint256 public minProfitBps = 30; // 0.3%
uint256 public treasuryBps = 500; // 5%
uint256 public slippageBps = 50; // 0.5% slippage tolerance
uint256 public deadlineExtension = 300; // 5 minutes
// Events
event FlashLoanRequested(address indexed asset, uint256 amount, address indexed tokenOut);
event FlashLoanExecuted(address indexed asset, uint256 profit, uint256 timestamp);
event FlashLoanFailed(address indexed asset, string reason);
event TreasuryPaid(address indexed treasury, uint256 amount);
event Swapped(address indexed router, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut);
event Approval(address indexed token, address indexed spender, uint256 amount);
event PoolUpdated(address newPool);
constructor(
address _provider,
address _uniswapRouter,
address _sushiSwapRouter,
address _treasury
) {
require(_provider != address(0), "Invalid provider");
require(_uniswapRouter != address(0), "Invalid Uniswap router");
require(_sushiSwapRouter != address(0), "Invalid SushiSwap router");
require(_treasury != address(0), "Invalid treasury");
ADDRESSES_PROVIDER = IPoolAddressesProvider(_provider);
POOL = IPool(ADDRESSES_PROVIDER.getPool());
POOL_DATA_PROVIDER = IPoolDataProvider(ADDRESSES_PROVIDER.getPoolDataProvider());
uniswapRouter = _uniswapRouter;
sushiSwapRouter = _sushiSwapRouter;
treasury = _treasury;
}
// Admin Controls
function setPool(address poolAddr) external onlyOwner {
require(poolAddr != address(0), "Invalid pool");
POOL = IPool(poolAddr);
emit PoolUpdated(poolAddr);
}
function setRouters(address _uni, address _sushi) external onlyOwner {
require(_uni != address(0) && _sushi != address(0), "Invalid routers");
uniswapRouter = _uni;
sushiSwapRouter = _sushi;
}
function setTreasury(address _treasury) external onlyOwner {
require(_treasury != address(0), "Invalid treasury");
treasury = _treasury;
}
function setProfitParams(uint256 _minProfitBps, uint256 _treasuryBps, uint256 _slippageBps) external onlyOwner {
require(_minProfitBps <= 1000, "Min profit too high"); // ≤ 10%
require(_treasuryBps <= 2000, "Treasury cut too high"); // ≤ 20%
require(_slippageBps <= 500, "Slippage too high"); // ≤ 5%
minProfitBps = _minProfitBps;
treasuryBps = _treasuryBps;
slippageBps = _slippageBps;
}
function setDeadlineExtension(uint256 _extension) external onlyOwner {
require(_extension <= 3600, "Extension too long"); // ≤ 1 hour
deadlineExtension = _extension;
}
// Flash-Loan Entry
function requestFlashLoan(
address asset,
uint256 amount,
address tokenOut,
bool direction // true = Uni→Sushi, false = Sushi→Uni
) external onlyOwner nonReentrant {
require(asset != address(0) && tokenOut != address(0), "Invalid tokens");
require(asset != tokenOut, "Same token pair");
require(amount > 0, "Invalid amount");
(,,,,,bool isActive,,,,) = POOL_DATA_PROVIDER.getReserveConfigurationData(asset);
require(isActive, "Asset not supported by Aave");
emit FlashLoanRequested(asset, amount, tokenOut);
bytes memory params = abi.encode(asset, tokenOut, direction);
try POOL.flashLoanSimple(address(this), asset, amount, params, 0) {
// Success
} catch {
emit FlashLoanFailed(asset, "flashLoanSimple() reverted");
revert("flashLoanSimple failed");
}
}
// Helper Functions
function _createPath(address tokenIn, address tokenOut) private pure returns (address[] memory path) {
path = new address[](2);
path[0] = tokenIn;
path[1] = tokenOut;
}
function _calculateAmountOutMin(address router, uint256 amountIn, address[] memory path) private view returns (uint256) {
try IRouter(router).getAmountsOut(amountIn, path) returns (uint256[] memory amounts) {
return (amounts[1] * (10000 - slippageBps)) / 10000;
} catch {
return 0;
}
}
function _executeSwap(
address router,
address tokenIn,
address tokenOut,
uint256 amountIn,
uint256 amountOutMin
) private returns (uint256 amountOut) {
address[] memory path = _createPath(tokenIn, tokenOut);
IERC20(tokenIn).approve(router, amountIn);
emit Approval(tokenIn, router, amountIn);
try IRouter(router).swapExactTokensForTokens(
amountIn,
amountOutMin,
path,
address(this),
block.timestamp + deadlineExtension
) returns (uint256[] memory amounts) {
amountOut = amounts[1];
emit Swapped(router, tokenIn, tokenOut, amountIn, amountOut);
} catch {
amountOut = 0;
}
}
function _handleProfitAndRepayment(address tokenIn, uint256 amount, uint256 premium, uint256 finalReturn) private returns (bool) {
uint256 repayAmount = amount + premium;
if (finalReturn < repayAmount) {
emit FlashLoanFailed(tokenIn, "Unprofitable trade");
return false;
}
uint256 profit = finalReturn - repayAmount;
if (profit < (amount * minProfitBps) / 10000) {
emit FlashLoanFailed(tokenIn, "Below profit threshold");
return false;
}
IERC20(tokenIn).approve(address(POOL), repayAmount);
emit Approval(tokenIn, address(POOL), repayAmount);
try IERC20(tokenIn).transfer(address(POOL), repayAmount) {
// Success
} catch {
emit FlashLoanFailed(tokenIn, "Aave repayment failed");
return false;
}
uint256 treasuryCut = (profit * treasuryBps) / 10000;
if (treasuryCut > 0) {
try IERC20(tokenIn).transfer(treasury, treasuryCut) {
emit TreasuryPaid(treasury, treasuryCut);
} catch {
emit FlashLoanFailed(tokenIn, "Treasury transfer failed");
}
}
emit FlashLoanExecuted(tokenIn, profit, block.timestamp);
return true;
}
// Aave v3 Callback
function executeOperation(
address asset,
uint256 amount,
uint256 premium,
address initiator,
bytes calldata params
) external override returns (bool) {
require(msg.sender == address(POOL), "Not Aave pool");
require(initiator == address(this), "Bad initiator");
require(amount > 0, "Zero loan");
(address tokenIn, address tokenOut, bool direction) = abi.decode(params, (address, address, bool));
require(tokenIn == asset, "Token mismatch");
address routerA = direction ? uniswapRouter : sushiSwapRouter;
address routerB = direction ? sushiSwapRouter : uniswapRouter;
if (IERC20(tokenIn).balanceOf(address(this)) < amount) {
emit FlashLoanFailed(tokenIn, "Missing funds");
return false;
}
// First Swap
address[] memory pathA = _createPath(tokenIn, tokenOut);
uint256 amountOutMinA = _calculateAmountOutMin(routerA, amount, pathA);
if (amountOutMinA == 0) {
emit FlashLoanFailed(tokenIn, "Failed to get expected output for first swap");
return false;
}
uint256 receivedOut = _executeSwap(routerA, tokenIn, tokenOut, amount, amountOutMinA);
if (receivedOut == 0) {
emit FlashLoanFailed(tokenIn, "First swap reverted");
return false;
}
// Second Swap
address[] memory pathB = _createPath(tokenOut, tokenIn);
uint256 amountOutMinB = _calculateAmountOutMin(routerB, receivedOut, pathB);
if (amountOutMinB == 0) {
emit FlashLoanFailed(tokenIn, "Failed to get expected output for second swap");
return false;
}
uint256 finalReturn = _executeSwap(routerB, tokenOut, tokenIn, receivedOut, amountOutMinB);
if (finalReturn == 0) {
emit FlashLoanFailed(tokenIn, "Second swap reverted");
return false;
}
// Profit and Repayment
return _handleProfitAndRepayment(tokenIn, amount, premium, finalReturn);
}
// Rescue Tokens
function rescueTokens(address token, address to) external onlyOwner {
require(to != address(0), "Invalid to");
uint256 bal = IERC20(token).balanceOf(address(this));
require(bal > 0, "No tokens");
IERC20(token).transfer(to, bal);
}
// Check Trade Profitability
function checkTradeProfitability(
address tokenIn,
uint256 amountIn,
address tokenOut,
bool direction
) external view returns (bool isProfitable, uint256 estimatedProfit) {
address routerA = direction ? uniswapRouter : sushiSwapRouter;
address routerB = direction ? sushiSwapRouter : uniswapRouter;
address[] memory pathA = _createPath(tokenIn, tokenOut);
address[] memory pathB = _createPath(tokenOut, tokenIn);
uint256 amountOut;
try IRouter(routerA).getAmountsOut(amountIn, pathA) returns (uint256[] memory amounts) {
amountOut = amounts[1];
} catch {
return (false, 0);
}
uint256 finalReturn;
try IRouter(routerB).getAmountsOut(amountOut, pathB) returns (uint256[] memory amounts) {
finalReturn = amounts[1];
} catch {
return (false, 0);
}
uint256 premium = (amountIn * 9) / 10000; // 0.09% Aave fee
uint256 repayAmount = amountIn + premium;
if (finalReturn <= repayAmount) {
return (false, 0);
}
uint256 profit = finalReturn - repayAmount;
uint256 minProfit = (amountIn * minProfitBps) / 10000;
isProfitable = profit >= minProfit;
estimatedProfit = profit;
}
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol';
import {IPool} from '../../interfaces/IPool.sol';
/**
* @title IFlashLoanSimpleReceiver
* @author Aave
* @notice Defines the basic interface of a flashloan-receiver contract.
* @dev Implement this interface to develop a flashloan-compatible flashLoanReceiver contract
*/
interface IFlashLoanSimpleReceiver {
/**
* @notice Executes an operation after receiving the flash-borrowed asset
* @dev Ensure that the contract can return the debt + premium, e.g., has
* enough funds to repay and has approved the Pool to pull the total amount
* @param asset The address of the flash-borrowed asset
* @param amount The amount of the flash-borrowed asset
* @param premium The fee of the flash-borrowed asset
* @param initiator The address of the flashloan initiator
* @param params The byte-encoded params passed when initiating the flashloan
* @return True if the execution of the operation succeeds, false otherwise
*/
function executeOperation(
address asset,
uint256 amount,
uint256 premium,
address initiator,
bytes calldata params
) external returns (bool);
function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);
function POOL() external view returns (IPool);
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';
import {DataTypes} from '../protocol/libraries/types/DataTypes.sol';
/**
* @title IPool
* @author Aave
* @notice Defines the basic interface for an Aave Pool.
*/
interface IPool {
/**
* @dev Emitted on mintUnbacked()
* @param reserve The address of the underlying asset of the reserve
* @param user The address initiating the supply
* @param onBehalfOf The beneficiary of the supplied assets, receiving the aTokens
* @param amount The amount of supplied assets
* @param referralCode The referral code used
*/
event MintUnbacked(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
uint16 indexed referralCode
);
/**
* @dev Emitted on backUnbacked()
* @param reserve The address of the underlying asset of the reserve
* @param backer The address paying for the backing
* @param amount The amount added as backing
* @param fee The amount paid in fees
*/
event BackUnbacked(address indexed reserve, address indexed backer, uint256 amount, uint256 fee);
/**
* @dev Emitted on supply()
* @param reserve The address of the underlying asset of the reserve
* @param user The address initiating the supply
* @param onBehalfOf The beneficiary of the supply, receiving the aTokens
* @param amount The amount supplied
* @param referralCode The referral code used
*/
event Supply(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
uint16 indexed referralCode
);
/**
* @dev Emitted on withdraw()
* @param reserve The address of the underlying asset being withdrawn
* @param user The address initiating the withdrawal, owner of aTokens
* @param to The address that will receive the underlying
* @param amount The amount to be withdrawn
*/
event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);
/**
* @dev Emitted on borrow() and flashLoan() when debt needs to be opened
* @param reserve The address of the underlying asset being borrowed
* @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just
* initiator of the transaction on flashLoan()
* @param onBehalfOf The address that will be getting the debt
* @param amount The amount borrowed out
* @param interestRateMode The rate mode: 1 for Stable, 2 for Variable
* @param borrowRate The numeric rate at which the user has borrowed, expressed in ray
* @param referralCode The referral code used
*/
event Borrow(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
DataTypes.InterestRateMode interestRateMode,
uint256 borrowRate,
uint16 indexed referralCode
);
/**
* @dev Emitted on repay()
* @param reserve The address of the underlying asset of the reserve
* @param user The beneficiary of the repayment, getting his debt reduced
* @param repayer The address of the user initiating the repay(), providing the funds
* @param amount The amount repaid
* @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly
*/
event Repay(
address indexed reserve,
address indexed user,
address indexed repayer,
uint256 amount,
bool useATokens
);
/**
* @dev Emitted on swapBorrowRateMode()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user swapping his rate mode
* @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable
*/
event SwapBorrowRateMode(
address indexed reserve,
address indexed user,
DataTypes.InterestRateMode interestRateMode
);
/**
* @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets
* @param asset The address of the underlying asset of the reserve
* @param totalDebt The total isolation mode debt for the reserve
*/
event IsolationModeTotalDebtUpdated(address indexed asset, uint256 totalDebt);
/**
* @dev Emitted when the user selects a certain asset category for eMode
* @param user The address of the user
* @param categoryId The category id
*/
event UserEModeSet(address indexed user, uint8 categoryId);
/**
* @dev Emitted on setUserUseReserveAsCollateral()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user enabling the usage as collateral
*/
event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);
/**
* @dev Emitted on setUserUseReserveAsCollateral()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user enabling the usage as collateral
*/
event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);
/**
* @dev Emitted on rebalanceStableBorrowRate()
* @param reserve The address of the underlying asset of the reserve
* @param user The address of the user for which the rebalance has been executed
*/
event RebalanceStableBorrowRate(address indexed reserve, address indexed user);
/**
* @dev Emitted on flashLoan()
* @param target The address of the flash loan receiver contract
* @param initiator The address initiating the flash loan
* @param asset The address of the asset being flash borrowed
* @param amount The amount flash borrowed
* @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt
* @param premium The fee flash borrowed
* @param referralCode The referral code used
*/
event FlashLoan(
address indexed target,
address initiator,
address indexed asset,
uint256 amount,
DataTypes.InterestRateMode interestRateMode,
uint256 premium,
uint16 indexed referralCode
);
/**
* @dev Emitted when a borrower is liquidated.
* @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
* @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
* @param user The address of the borrower getting liquidated
* @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
* @param liquidatedCollateralAmount The amount of collateral received by the liquidator
* @param liquidator The address of the liquidator
* @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants
* to receive the underlying collateral asset directly
*/
event LiquidationCall(
address indexed collateralAsset,
address indexed debtAsset,
address indexed user,
uint256 debtToCover,
uint256 liquidatedCollateralAmount,
address liquidator,
bool receiveAToken
);
/**
* @dev Emitted when the state of a reserve is updated.
* @param reserve The address of the underlying asset of the reserve
* @param liquidityRate The next liquidity rate
* @param stableBorrowRate The next stable borrow rate
* @param variableBorrowRate The next variable borrow rate
* @param liquidityIndex The next liquidity index
* @param variableBorrowIndex The next variable borrow index
*/
event ReserveDataUpdated(
address indexed reserve,
uint256 liquidityRate,
uint256 stableBorrowRate,
uint256 variableBorrowRate,
uint256 liquidityIndex,
uint256 variableBorrowIndex
);
/**
* @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest.
* @param reserve The address of the reserve
* @param amountMinted The amount minted to the treasury
*/
event MintedToTreasury(address indexed reserve, uint256 amountMinted);
/**
* @notice Mints an `amount` of aTokens to the `onBehalfOf`
* @param asset The address of the underlying asset to mint
* @param amount The amount to mint
* @param onBehalfOf The address that will receive the aTokens
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*/
function mintUnbacked(
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode
) external;
/**
* @notice Back the current unbacked underlying with `amount` and pay `fee`.
* @param asset The address of the underlying asset to back
* @param amount The amount to back
* @param fee The amount paid in fees
* @return The backed amount
*/
function backUnbacked(address asset, uint256 amount, uint256 fee) external returns (uint256);
/**
* @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* - E.g. User supplies 100 USDC and gets in return 100 aUSDC
* @param asset The address of the underlying asset to supply
* @param amount The amount to be supplied
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
* is a different wallet
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*/
function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
/**
* @notice Supply with transfer approval of asset to be supplied done via permit function
* see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
* @param asset The address of the underlying asset to supply
* @param amount The amount to be supplied
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
* is a different wallet
* @param deadline The deadline timestamp that the permit is valid
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
* @param permitV The V parameter of ERC712 permit sig
* @param permitR The R parameter of ERC712 permit sig
* @param permitS The S parameter of ERC712 permit sig
*/
function supplyWithPermit(
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode,
uint256 deadline,
uint8 permitV,
bytes32 permitR,
bytes32 permitS
) external;
/**
* @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
* E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
* @param asset The address of the underlying asset to withdraw
* @param amount The underlying amount to be withdrawn
* - Send the value type(uint256).max in order to withdraw the whole aToken balance
* @param to The address that will receive the underlying, same as msg.sender if the user
* wants to receive it on his own wallet, or a different address if the beneficiary is a
* different wallet
* @return The final amount withdrawn
*/
function withdraw(address asset, uint256 amount, address to) external returns (uint256);
/**
* @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
* already supplied enough collateral, or he was given enough allowance by a credit delegator on the
* corresponding debt token (StableDebtToken or VariableDebtToken)
* - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
* and 100 stable/variable debt tokens, depending on the `interestRateMode`
* @param asset The address of the underlying asset to borrow
* @param amount The amount to be borrowed
* @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
* @param referralCode The code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
* @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself
* calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
* if he has been given credit delegation allowance
*/
function borrow(
address asset,
uint256 amount,
uint256 interestRateMode,
uint16 referralCode,
address onBehalfOf
) external;
/**
* @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
* - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the
* user calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed
* @return The final amount repaid
*/
function repay(
address asset,
uint256 amount,
uint256 interestRateMode,
address onBehalfOf
) external returns (uint256);
/**
* @notice Repay with transfer approval of asset to be repaid done via permit function
* see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
* user calling the function if he wants to reduce/remove his own debt, or the address of any other
* other borrower whose debt should be removed
* @param deadline The deadline timestamp that the permit is valid
* @param permitV The V parameter of ERC712 permit sig
* @param permitR The R parameter of ERC712 permit sig
* @param permitS The S parameter of ERC712 permit sig
* @return The final amount repaid
*/
function repayWithPermit(
address asset,
uint256 amount,
uint256 interestRateMode,
address onBehalfOf,
uint256 deadline,
uint8 permitV,
bytes32 permitR,
bytes32 permitS
) external returns (uint256);
/**
* @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the
* equivalent debt tokens
* - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens
* @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken
* balance is not enough to cover the whole debt
* @param asset The address of the borrowed underlying asset previously borrowed
* @param amount The amount to repay
* - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
* @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
* @return The final amount repaid
*/
function repayWithATokens(
address asset,
uint256 amount,
uint256 interestRateMode
) external returns (uint256);
/**
* @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa
* @param asset The address of the underlying asset borrowed
* @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable
*/
function swapBorrowRateMode(address asset, uint256 interestRateMode) external;
/**
* @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.
* - Users can be rebalanced if the following conditions are satisfied:
* 1. Usage ratio is above 95%
* 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too
* much has been borrowed at a stable rate and suppliers are not earning enough
* @param asset The address of the underlying asset borrowed
* @param user The address of the user to be rebalanced
*/
function rebalanceStableBorrowRate(address asset, address user) external;
/**
* @notice Allows suppliers to enable/disable a specific supplied asset as collateral
* @param asset The address of the underlying asset supplied
* @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise
*/
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;
/**
* @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1
* - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives
* a proportionally amount of the `collateralAsset` plus a bonus to cover market risk
* @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
* @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
* @param user The address of the borrower getting liquidated
* @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
* @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants
* to receive the underlying collateral asset directly
*/
function liquidationCall(
address collateralAsset,
address debtAsset,
address user,
uint256 debtToCover,
bool receiveAToken
) external;
/**
* @notice Allows smartcontracts to access the liquidity of the pool within one transaction,
* as long as the amount taken plus a fee is returned.
* @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept
* into consideration. For further details please visit https://docs.aave.com/developers/
* @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface
* @param assets The addresses of the assets being flash-borrowed
* @param amounts The amounts of the assets being flash-borrowed
* @param interestRateModes Types of the debt to open if the flash loan is not returned:
* 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver
* 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
* 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
* @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2
* @param params Variadic packed params to pass to the receiver as extra information
* @param referralCode The code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*/
function flashLoan(
address receiverAddress,
address[] calldata assets,
uint256[] calldata amounts,
uint256[] calldata interestRateModes,
address onBehalfOf,
bytes calldata params,
uint16 referralCode
) external;
/**
* @notice Allows smartcontracts to access the liquidity of the pool within one transaction,
* as long as the amount taken plus a fee is returned.
* @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept
* into consideration. For further details please visit https://docs.aave.com/developers/
* @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface
* @param asset The address of the asset being flash-borrowed
* @param amount The amount of the asset being flash-borrowed
* @param params Variadic packed params to pass to the receiver as extra information
* @param referralCode The code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*/
function flashLoanSimple(
address receiverAddress,
address asset,
uint256 amount,
bytes calldata params,
uint16 referralCode
) external;
/**
* @notice Returns the user account data across all the reserves
* @param user The address of the user
* @return totalCollateralBase The total collateral of the user in the base currency used by the price feed
* @return totalDebtBase The total debt of the user in the base currency used by the price feed
* @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed
* @return currentLiquidationThreshold The liquidation threshold of the user
* @return ltv The loan to value of The user
* @return healthFactor The current health factor of the user
*/
function getUserAccountData(
address user
)
external
view
returns (
uint256 totalCollateralBase,
uint256 totalDebtBase,
uint256 availableBorrowsBase,
uint256 currentLiquidationThreshold,
uint256 ltv,
uint256 healthFactor
);
/**
* @notice Initializes a reserve, activating it, assigning an aToken and debt tokens and an
* interest rate strategy
* @dev Only callable by the PoolConfigurator contract
* @param asset The address of the underlying asset of the reserve
* @param aTokenAddress The address of the aToken that will be assigned to the reserve
* @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve
* @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve
* @param interestRateStrategyAddress The address of the interest rate strategy contract
*/
function initReserve(
address asset,
address aTokenAddress,
address stableDebtAddress,
address variableDebtAddress,
address interestRateStrategyAddress
) external;
/**
* @notice Drop a reserve
* @dev Only callable by the PoolConfigurator contract
* @param asset The address of the underlying asset of the reserve
*/
function dropReserve(address asset) external;
/**
* @notice Updates the address of the interest rate strategy contract
* @dev Only callable by the PoolConfigurator contract
* @param asset The address of the underlying asset of the reserve
* @param rateStrategyAddress The address of the interest rate strategy contract
*/
function setReserveInterestRateStrategyAddress(
address asset,
address rateStrategyAddress
) external;
/**
* @notice Sets the configuration bitmap of the reserve as a whole
* @dev Only callable by the PoolConfigurator contract
* @param asset The address of the underlying asset of the reserve
* @param configuration The new configuration bitmap
*/
function setConfiguration(
address asset,
DataTypes.ReserveConfigurationMap calldata configuration
) external;
/**
* @notice Returns the configuration of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The configuration of the reserve
*/
function getConfiguration(
address asset
) external view returns (DataTypes.ReserveConfigurationMap memory);
/**
* @notice Returns the configuration of the user across all the reserves
* @param user The user address
* @return The configuration of the user
*/
function getUserConfiguration(
address user
) external view returns (DataTypes.UserConfigurationMap memory);
/**
* @notice Returns the normalized income of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The reserve's normalized income
*/
function getReserveNormalizedIncome(address asset) external view returns (uint256);
/**
* @notice Returns the normalized variable debt per unit of asset
* @dev WARNING: This function is intended to be used primarily by the protocol itself to get a
* "dynamic" variable index based on time, current stored index and virtual rate at the current
* moment (approx. a borrower would get if opening a position). This means that is always used in
* combination with variable debt supply/balances.
* If using this function externally, consider that is possible to have an increasing normalized
* variable debt that is not equivalent to how the variable debt index would be updated in storage
* (e.g. only updates with non-zero variable debt supply)
* @param asset The address of the underlying asset of the reserve
* @return The reserve normalized variable debt
*/
function getReserveNormalizedVariableDebt(address asset) external view returns (uint256);
/**
* @notice Returns the state and configuration of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The state and configuration data of the reserve
*/
function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);
/**
* @notice Validates and finalizes an aToken transfer
* @dev Only callable by the overlying aToken of the `asset`
* @param asset The address of the underlying asset of the aToken
* @param from The user from which the aTokens are transferred
* @param to The user receiving the aTokens
* @param amount The amount being transferred/withdrawn
* @param balanceFromBefore The aToken balance of the `from` user before the transfer
* @param balanceToBefore The aToken balance of the `to` user before the transfer
*/
function finalizeTransfer(
address asset,
address from,
address to,
uint256 amount,
uint256 balanceFromBefore,
uint256 balanceToBefore
) external;
/**
* @notice Returns the list of the underlying assets of all the initialized reserves
* @dev It does not include dropped reserves
* @return The addresses of the underlying assets of the initialized reserves
*/
function getReservesList() external view returns (address[] memory);
/**
* @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct
* @param id The id of the reserve as stored in the DataTypes.ReserveData struct
* @return The address of the reserve associated with id
*/
function getReserveAddressById(uint16 id) external view returns (address);
/**
* @notice Returns the PoolAddressesProvider connected to this contract
* @return The address of the PoolAddressesProvider
*/
function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);
/**
* @notice Updates the protocol fee on the bridging
* @param bridgeProtocolFee The part of the premium sent to the protocol treasury
*/
function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external;
/**
* @notice Updates flash loan premiums. Flash loan premium consists of two parts:
* - A part is sent to aToken holders as extra, one time accumulated interest
* - A part is collected by the protocol treasury
* @dev The total premium is calculated on the total borrowed amount
* @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`
* @dev Only callable by the PoolConfigurator contract
* @param flashLoanPremiumTotal The total premium, expressed in bps
* @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps
*/
function updateFlashloanPremiums(
uint128 flashLoanPremiumTotal,
uint128 flashLoanPremiumToProtocol
) external;
/**
* @notice Configures a new category for the eMode.
* @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category.
* The category 0 is reserved as it's the default for volatile assets
* @param id The id of the category
* @param config The configuration of the category
*/
function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external;
/**
* @notice Returns the data of an eMode category
* @param id The id of the category
* @return The configuration data of the category
*/
function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory);
/**
* @notice Allows a user to use the protocol in eMode
* @param categoryId The id of the category
*/
function setUserEMode(uint8 categoryId) external;
/**
* @notice Returns the eMode the user is using
* @param user The address of the user
* @return The eMode id
*/
function getUserEMode(address user) external view returns (uint256);
/**
* @notice Resets the isolation mode total debt of the given asset to zero
* @dev It requires the given asset has zero debt ceiling
* @param asset The address of the underlying asset to reset the isolationModeTotalDebt
*/
function resetIsolationModeTotalDebt(address asset) external;
/**
* @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate
* @return The percentage of available liquidity to borrow, expressed in bps
*/
function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256);
/**
* @notice Returns the total fee on flash loans
* @return The total fee on flashloans
*/
function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128);
/**
* @notice Returns the part of the bridge fees sent to protocol
* @return The bridge fee sent to the protocol treasury
*/
function BRIDGE_PROTOCOL_FEE() external view returns (uint256);
/**
* @notice Returns the part of the flashloan fees sent to protocol
* @return The flashloan fee sent to the protocol treasury
*/
function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128);
/**
* @notice Returns the maximum number of reserves supported to be listed in this Pool
* @return The maximum number of reserves supported
*/
function MAX_NUMBER_RESERVES() external view returns (uint16);
/**
* @notice Mints the assets accrued through the reserve factor to the treasury in the form of aTokens
* @param assets The list of reserves for which the minting needs to be executed
*/
function mintToTreasury(address[] calldata assets) external;
/**
* @notice Rescue and transfer tokens locked in this contract
* @param token The address of the token
* @param to The address of the recipient
* @param amount The amount of token to transfer
*/
function rescueTokens(address token, address to, uint256 amount) external;
/**
* @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* - E.g. User supplies 100 USDC and gets in return 100 aUSDC
* @dev Deprecated: Use the `supply` function instead
* @param asset The address of the underlying asset to supply
* @param amount The amount to be supplied
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
* is a different wallet
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*/
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
/**
* @title IPoolAddressesProvider
* @author Aave
* @notice Defines the basic interface for a Pool Addresses Provider.
*/
interface IPoolAddressesProvider {
/**
* @dev Emitted when the market identifier is updated.
* @param oldMarketId The old id of the market
* @param newMarketId The new id of the market
*/
event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);
/**
* @dev Emitted when the pool is updated.
* @param oldAddress The old address of the Pool
* @param newAddress The new address of the Pool
*/
event PoolUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the pool configurator is updated.
* @param oldAddress The old address of the PoolConfigurator
* @param newAddress The new address of the PoolConfigurator
*/
event PoolConfiguratorUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the price oracle is updated.
* @param oldAddress The old address of the PriceOracle
* @param newAddress The new address of the PriceOracle
*/
event PriceOracleUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the ACL manager is updated.
* @param oldAddress The old address of the ACLManager
* @param newAddress The new address of the ACLManager
*/
event ACLManagerUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the ACL admin is updated.
* @param oldAddress The old address of the ACLAdmin
* @param newAddress The new address of the ACLAdmin
*/
event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the price oracle sentinel is updated.
* @param oldAddress The old address of the PriceOracleSentinel
* @param newAddress The new address of the PriceOracleSentinel
*/
event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the pool data provider is updated.
* @param oldAddress The old address of the PoolDataProvider
* @param newAddress The new address of the PoolDataProvider
*/
event PoolDataProviderUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when a new proxy is created.
* @param id The identifier of the proxy
* @param proxyAddress The address of the created proxy contract
* @param implementationAddress The address of the implementation contract
*/
event ProxyCreated(
bytes32 indexed id,
address indexed proxyAddress,
address indexed implementationAddress
);
/**
* @dev Emitted when a new non-proxied contract address is registered.
* @param id The identifier of the contract
* @param oldAddress The address of the old contract
* @param newAddress The address of the new contract
*/
event AddressSet(bytes32 indexed id, address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the implementation of the proxy registered with id is updated
* @param id The identifier of the contract
* @param proxyAddress The address of the proxy contract
* @param oldImplementationAddress The address of the old implementation contract
* @param newImplementationAddress The address of the new implementation contract
*/
event AddressSetAsProxy(
bytes32 indexed id,
address indexed proxyAddress,
address oldImplementationAddress,
address indexed newImplementationAddress
);
/**
* @notice Returns the id of the Aave market to which this contract points to.
* @return The market id
*/
function getMarketId() external view returns (string memory);
/**
* @notice Associates an id with a specific PoolAddressesProvider.
* @dev This can be used to create an onchain registry of PoolAddressesProviders to
* identify and validate multiple Aave markets.
* @param newMarketId The market id
*/
function setMarketId(string calldata newMarketId) external;
/**
* @notice Returns an address by its identifier.
* @dev The returned address might be an EOA or a contract, potentially proxied
* @dev It returns ZERO if there is no registered address with the given id
* @param id The id
* @return The address of the registered for the specified id
*/
function getAddress(bytes32 id) external view returns (address);
/**
* @notice General function to update the implementation of a proxy registered with
* certain `id`. If there is no proxy registered, it will instantiate one and
* set as implementation the `newImplementationAddress`.
* @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit
* setter function, in order to avoid unexpected consequences
* @param id The id
* @param newImplementationAddress The address of the new implementation
*/
function setAddressAsProxy(bytes32 id, address newImplementationAddress) external;
/**
* @notice Sets an address for an id replacing the address saved in the addresses map.
* @dev IMPORTANT Use this function carefully, as it will do a hard replacement
* @param id The id
* @param newAddress The address to set
*/
function setAddress(bytes32 id, address newAddress) external;
/**
* @notice Returns the address of the Pool proxy.
* @return The Pool proxy address
*/
function getPool() external view returns (address);
/**
* @notice Updates the implementation of the Pool, or creates a proxy
* setting the new `pool` implementation when the function is called for the first time.
* @param newPoolImpl The new Pool implementation
*/
function setPoolImpl(address newPoolImpl) external;
/**
* @notice Returns the address of the PoolConfigurator proxy.
* @return The PoolConfigurator proxy address
*/
function getPoolConfigurator() external view returns (address);
/**
* @notice Updates the implementation of the PoolConfigurator, or creates a proxy
* setting the new `PoolConfigurator` implementation when the function is called for the first time.
* @param newPoolConfiguratorImpl The new PoolConfigurator implementation
*/
function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;
/**
* @notice Returns the address of the price oracle.
* @return The address of the PriceOracle
*/
function getPriceOracle() external view returns (address);
/**
* @notice Updates the address of the price oracle.
* @param newPriceOracle The address of the new PriceOracle
*/
function setPriceOracle(address newPriceOracle) external;
/**
* @notice Returns the address of the ACL manager.
* @return The address of the ACLManager
*/
function getACLManager() external view returns (address);
/**
* @notice Updates the address of the ACL manager.
* @param newAclManager The address of the new ACLManager
*/
function setACLManager(address newAclManager) external;
/**
* @notice Returns the address of the ACL admin.
* @return The address of the ACL admin
*/
function getACLAdmin() external view returns (address);
/**
* @notice Updates the address of the ACL admin.
* @param newAclAdmin The address of the new ACL admin
*/
function setACLAdmin(address newAclAdmin) external;
/**
* @notice Returns the address of the price oracle sentinel.
* @return The address of the PriceOracleSentinel
*/
function getPriceOracleSentinel() external view returns (address);
/**
* @notice Updates the address of the price oracle sentinel.
* @param newPriceOracleSentinel The address of the new PriceOracleSentinel
*/
function setPriceOracleSentinel(address newPriceOracleSentinel) external;
/**
* @notice Returns the address of the data provider.
* @return The address of the DataProvider
*/
function getPoolDataProvider() external view returns (address);
/**
* @notice Updates the address of the data provider.
* @param newDataProvider The address of the new DataProvider
*/
function setPoolDataProvider(address newDataProvider) external;
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';
/**
* @title IPoolDataProvider
* @author Aave
* @notice Defines the basic interface of a PoolDataProvider
*/
interface IPoolDataProvider {
struct TokenData {
string symbol;
address tokenAddress;
}
/**
* @notice Returns the address for the PoolAddressesProvider contract.
* @return The address for the PoolAddressesProvider contract
*/
function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);
/**
* @notice Returns the list of the existing reserves in the pool.
* @dev Handling MKR and ETH in a different way since they do not have standard `symbol` functions.
* @return The list of reserves, pairs of symbols and addresses
*/
function getAllReservesTokens() external view returns (TokenData[] memory);
/**
* @notice Returns the list of the existing ATokens in the pool.
* @return The list of ATokens, pairs of symbols and addresses
*/
function getAllATokens() external view returns (TokenData[] memory);
/**
* @notice Returns the configuration data of the reserve
* @dev Not returning borrow and supply caps for compatibility, nor pause flag
* @param asset The address of the underlying asset of the reserve
* @return decimals The number of decimals of the reserve
* @return ltv The ltv of the reserve
* @return liquidationThreshold The liquidationThreshold of the reserve
* @return liquidationBonus The liquidationBonus of the reserve
* @return reserveFactor The reserveFactor of the reserve
* @return usageAsCollateralEnabled True if the usage as collateral is enabled, false otherwise
* @return borrowingEnabled True if borrowing is enabled, false otherwise
* @return stableBorrowRateEnabled True if stable rate borrowing is enabled, false otherwise
* @return isActive True if it is active, false otherwise
* @return isFrozen True if it is frozen, false otherwise
*/
function getReserveConfigurationData(
address asset
)
external
view
returns (
uint256 decimals,
uint256 ltv,
uint256 liquidationThreshold,
uint256 liquidationBonus,
uint256 reserveFactor,
bool usageAsCollateralEnabled,
bool borrowingEnabled,
bool stableBorrowRateEnabled,
bool isActive,
bool isFrozen
);
/**
* @notice Returns the efficiency mode category of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The eMode id of the reserve
*/
function getReserveEModeCategory(address asset) external view returns (uint256);
/**
* @notice Returns the caps parameters of the reserve
* @param asset The address of the underlying asset of the reserve
* @return borrowCap The borrow cap of the reserve
* @return supplyCap The supply cap of the reserve
*/
function getReserveCaps(
address asset
) external view returns (uint256 borrowCap, uint256 supplyCap);
/**
* @notice Returns if the pool is paused
* @param asset The address of the underlying asset of the reserve
* @return isPaused True if the pool is paused, false otherwise
*/
function getPaused(address asset) external view returns (bool isPaused);
/**
* @notice Returns the siloed borrowing flag
* @param asset The address of the underlying asset of the reserve
* @return True if the asset is siloed for borrowing
*/
function getSiloedBorrowing(address asset) external view returns (bool);
/**
* @notice Returns the protocol fee on the liquidation bonus
* @param asset The address of the underlying asset of the reserve
* @return The protocol fee on liquidation
*/
function getLiquidationProtocolFee(address asset) external view returns (uint256);
/**
* @notice Returns the unbacked mint cap of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The unbacked mint cap of the reserve
*/
function getUnbackedMintCap(address asset) external view returns (uint256);
/**
* @notice Returns the debt ceiling of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The debt ceiling of the reserve
*/
function getDebtCeiling(address asset) external view returns (uint256);
/**
* @notice Returns the debt ceiling decimals
* @return The debt ceiling decimals
*/
function getDebtCeilingDecimals() external pure returns (uint256);
/**
* @notice Returns the reserve data
* @param asset The address of the underlying asset of the reserve
* @return unbacked The amount of unbacked tokens
* @return accruedToTreasuryScaled The scaled amount of tokens accrued to treasury that is to be minted
* @return totalAToken The total supply of the aToken
* @return totalStableDebt The total stable debt of the reserve
* @return totalVariableDebt The total variable debt of the reserve
* @return liquidityRate The liquidity rate of the reserve
* @return variableBorrowRate The variable borrow rate of the reserve
* @return stableBorrowRate The stable borrow rate of the reserve
* @return averageStableBorrowRate The average stable borrow rate of the reserve
* @return liquidityIndex The liquidity index of the reserve
* @return variableBorrowIndex The variable borrow index of the reserve
* @return lastUpdateTimestamp The timestamp of the last update of the reserve
*/
function getReserveData(
address asset
)
external
view
returns (
uint256 unbacked,
uint256 accruedToTreasuryScaled,
uint256 totalAToken,
uint256 totalStableDebt,
uint256 totalVariableDebt,
uint256 liquidityRate,
uint256 variableBorrowRate,
uint256 stableBorrowRate,
uint256 averageStableBorrowRate,
uint256 liquidityIndex,
uint256 variableBorrowIndex,
uint40 lastUpdateTimestamp
);
/**
* @notice Returns the total supply of aTokens for a given asset
* @param asset The address of the underlying asset of the reserve
* @return The total supply of the aToken
*/
function getATokenTotalSupply(address asset) external view returns (uint256);
/**
* @notice Returns the total debt for a given asset
* @param asset The address of the underlying asset of the reserve
* @return The total debt for asset
*/
function getTotalDebt(address asset) external view returns (uint256);
/**
* @notice Returns the user data in a reserve
* @param asset The address of the underlying asset of the reserve
* @param user The address of the user
* @return currentATokenBalance The current AToken balance of the user
* @return currentStableDebt The current stable debt of the user
* @return currentVariableDebt The current variable debt of the user
* @return principalStableDebt The principal stable debt of the user
* @return scaledVariableDebt The scaled variable debt of the user
* @return stableBorrowRate The stable borrow rate of the user
* @return liquidityRate The liquidity rate of the reserve
* @return stableRateLastUpdated The timestamp of the last update of the user stable rate
* @return usageAsCollateralEnabled True if the user is using the asset as collateral, false
* otherwise
*/
function getUserReserveData(
address asset,
address user
)
external
view
returns (
uint256 currentATokenBalance,
uint256 currentStableDebt,
uint256 currentVariableDebt,
uint256 principalStableDebt,
uint256 scaledVariableDebt,
uint256 stableBorrowRate,
uint256 liquidityRate,
uint40 stableRateLastUpdated,
bool usageAsCollateralEnabled
);
/**
* @notice Returns the token addresses of the reserve
* @param asset The address of the underlying asset of the reserve
* @return aTokenAddress The AToken address of the reserve
* @return stableDebtTokenAddress The StableDebtToken address of the reserve
* @return variableDebtTokenAddress The VariableDebtToken address of the reserve
*/
function getReserveTokensAddresses(
address asset
)
external
view
returns (
address aTokenAddress,
address stableDebtTokenAddress,
address variableDebtTokenAddress
);
/**
* @notice Returns the address of the Interest Rate strategy
* @param asset The address of the underlying asset of the reserve
* @return irStrategyAddress The address of the Interest Rate strategy
*/
function getInterestRateStrategyAddress(
address asset
) external view returns (address irStrategyAddress);
/**
* @notice Returns whether the reserve has FlashLoans enabled or disabled
* @param asset The address of the underlying asset of the reserve
* @return True if FlashLoans are enabled, false otherwise
*/
function getFlashLoanEnabled(address asset) external view returns (bool);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
library DataTypes {
struct ReserveData {
//stores the reserve configuration
ReserveConfigurationMap configuration;
//the liquidity index. Expressed in ray
uint128 liquidityIndex;
//the current supply rate. Expressed in ray
uint128 currentLiquidityRate;
//variable borrow index. Expressed in ray
uint128 variableBorrowIndex;
//the current variable borrow rate. Expressed in ray
uint128 currentVariableBorrowRate;
//the current stable borrow rate. Expressed in ray
uint128 currentStableBorrowRate;
//timestamp of last update
uint40 lastUpdateTimestamp;
//the id of the reserve. Represents the position in the list of the active reserves
uint16 id;
//aToken address
address aTokenAddress;
//stableDebtToken address
address stableDebtTokenAddress;
//variableDebtToken address
address variableDebtTokenAddress;
//address of the interest rate strategy
address interestRateStrategyAddress;
//the current treasury balance, scaled
uint128 accruedToTreasury;
//the outstanding unbacked aTokens minted through the bridging feature
uint128 unbacked;
//the outstanding debt borrowed against this asset in isolation mode
uint128 isolationModeTotalDebt;
}
struct ReserveConfigurationMap {
//bit 0-15: LTV
//bit 16-31: Liq. threshold
//bit 32-47: Liq. bonus
//bit 48-55: Decimals
//bit 56: reserve is active
//bit 57: reserve is frozen
//bit 58: borrowing is enabled
//bit 59: stable rate borrowing enabled
//bit 60: asset is paused
//bit 61: borrowing in isolation mode is enabled
//bit 62: siloed borrowing enabled
//bit 63: flashloaning enabled
//bit 64-79: reserve factor
//bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap
//bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap
//bit 152-167 liquidation protocol fee
//bit 168-175 eMode category
//bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled
//bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals
//bit 252-255 unused
uint256 data;
}
struct UserConfigurationMap {
/**
* @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.
* The first bit indicates if an asset is used as collateral by the user, the second whether an
* asset is borrowed by the user.
*/
uint256 data;
}
struct EModeCategory {
// each eMode category has a custom ltv and liquidation threshold
uint16 ltv;
uint16 liquidationThreshold;
uint16 liquidationBonus;
// each eMode category may or may not have a custom oracle to override the individual assets price oracles
address priceSource;
string label;
}
enum InterestRateMode {NONE, STABLE, VARIABLE}
struct ReserveCache {
uint256 currScaledVariableDebt;
uint256 nextScaledVariableDebt;
uint256 currPrincipalStableDebt;
uint256 currAvgStableBorrowRate;
uint256 currTotalStableDebt;
uint256 nextAvgStableBorrowRate;
uint256 nextTotalStableDebt;
uint256 currLiquidityIndex;
uint256 nextLiquidityIndex;
uint256 currVariableBorrowIndex;
uint256 nextVariableBorrowIndex;
uint256 currLiquidityRate;
uint256 currVariableBorrowRate;
uint256 reserveFactor;
ReserveConfigurationMap reserveConfiguration;
address aTokenAddress;
address stableDebtTokenAddress;
address variableDebtTokenAddress;
uint40 reserveLastUpdateTimestamp;
uint40 stableDebtLastUpdateTimestamp;
}
struct ExecuteLiquidationCallParams {
uint256 reservesCount;
uint256 debtToCover;
address collateralAsset;
address debtAsset;
address user;
bool receiveAToken;
address priceOracle;
uint8 userEModeCategory;
address priceOracleSentinel;
}
struct ExecuteSupplyParams {
address asset;
uint256 amount;
address onBehalfOf;
uint16 referralCode;
}
struct ExecuteBorrowParams {
address asset;
address user;
address onBehalfOf;
uint256 amount;
InterestRateMode interestRateMode;
uint16 referralCode;
bool releaseUnderlying;
uint256 maxStableRateBorrowSizePercent;
uint256 reservesCount;
address oracle;
uint8 userEModeCategory;
address priceOracleSentinel;
}
struct ExecuteRepayParams {
address asset;
uint256 amount;
InterestRateMode interestRateMode;
address onBehalfOf;
bool useATokens;
}
struct ExecuteWithdrawParams {
address asset;
uint256 amount;
address to;
uint256 reservesCount;
address oracle;
uint8 userEModeCategory;
}
struct ExecuteSetUserEModeParams {
uint256 reservesCount;
address oracle;
uint8 categoryId;
}
struct FinalizeTransferParams {
address asset;
address from;
address to;
uint256 amount;
uint256 balanceFromBefore;
uint256 balanceToBefore;
uint256 reservesCount;
address oracle;
uint8 fromEModeCategory;
}
struct FlashloanParams {
address receiverAddress;
address[] assets;
uint256[] amounts;
uint256[] interestRateModes;
address onBehalfOf;
bytes params;
uint16 referralCode;
uint256 flashLoanPremiumToProtocol;
uint256 flashLoanPremiumTotal;
uint256 maxStableRateBorrowSizePercent;
uint256 reservesCount;
address addressesProvider;
uint8 userEModeCategory;
bool isAuthorizedFlashBorrower;
}
struct FlashloanSimpleParams {
address receiverAddress;
address asset;
uint256 amount;
bytes params;
uint16 referralCode;
uint256 flashLoanPremiumToProtocol;
uint256 flashLoanPremiumTotal;
}
struct FlashLoanRepaymentParams {
uint256 amount;
uint256 totalPremium;
uint256 flashLoanPremiumToProtocol;
address asset;
address receiverAddress;
uint16 referralCode;
}
struct CalculateUserAccountDataParams {
UserConfigurationMap userConfig;
uint256 reservesCount;
address user;
address oracle;
uint8 userEModeCategory;
}
struct ValidateBorrowParams {
ReserveCache reserveCache;
UserConfigurationMap userConfig;
address asset;
address userAddress;
uint256 amount;
InterestRateMode interestRateMode;
uint256 maxStableLoanPercent;
uint256 reservesCount;
address oracle;
uint8 userEModeCategory;
address priceOracleSentinel;
bool isolationModeActive;
address isolationModeCollateralAddress;
uint256 isolationModeDebtCeiling;
}
struct ValidateLiquidationCallParams {
ReserveCache debtReserveCache;
uint256 totalDebt;
uint256 healthFactor;
address priceOracleSentinel;
}
struct CalculateInterestRatesParams {
uint256 unbacked;
uint256 liquidityAdded;
uint256 liquidityTaken;
uint256 totalStableDebt;
uint256 totalVariableDebt;
uint256 averageStableBorrowRate;
uint256 reserveFactor;
address reserve;
address aToken;
}
struct InitReserveParams {
address asset;
address aTokenAddress;
address stableDebtAddress;
address variableDebtAddress;
address interestRateStrategyAddress;
uint16 reservesCount;
uint16 maxNumberReserves;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// 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 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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_provider","type":"address"},{"internalType":"address","name":"_uniswapRouter","type":"address"},{"internalType":"address","name":"_sushiSwapRouter","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"profit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"FlashLoanExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"FlashLoanFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"}],"name":"FlashLoanRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPool","type":"address"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"router","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"Swapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"treasury","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TreasuryPaid","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract IPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_DATA_PROVIDER","outputs":[{"internalType":"contract IPoolDataProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"bool","name":"direction","type":"bool"}],"name":"checkTradeProfitability","outputs":[{"internalType":"bool","name":"isProfitable","type":"bool"},{"internalType":"uint256","name":"estimatedProfit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadlineExtension","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"premium","type":"uint256"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minProfitBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"bool","name":"direction","type":"bool"}],"name":"requestFlashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_extension","type":"uint256"}],"name":"setDeadlineExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddr","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minProfitBps","type":"uint256"},{"internalType":"uint256","name":"_treasuryBps","type":"uint256"},{"internalType":"uint256","name":"_slippageBps","type":"uint256"}],"name":"setProfitParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_uni","type":"address"},{"internalType":"address","name":"_sushi","type":"address"}],"name":"setRouters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippageBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sushiSwapRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604090808252346200032e5760808162001f64803803809162000025828562000333565b8339810103126200032e576200003b816200036d565b906020916200004c8383016200036d565b91620000686060620000608784016200036d565b92016200036d565b600080546001600160a01b031980821633908117845589519398919794966001600160a01b039592949386929083167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08c80a360018055601e6008556101f46009556032600a5561012c600b5516918215620002f957508316938415620002b5578316948515620002715783169687156200023a5760028054881683179055885163026b1d5f60e01b8152918383600481845afa9283156200023057908585928495620001e5575b50600494168960035416176003558a519384809263e860accb60e01b82525afa928315620001d957819362000195575b50505016836004541617600455826005541617600555816006541617600655600754161760075551611be19081620003838239f35b9091809350813d8311620001d1575b620001b0818362000333565b81010312620001ce5750620001c5906200036d565b38808062000160565b80fd5b503d620001a4565b508851903d90823e3d90fd5b9280929495508391503d831162000228575b62000203818362000333565b81010312620002245760049291856200021d86936200036d565b9462000130565b8280fd5b503d620001f7565b8a513d84823e3d90fd5b885162461bcd60e51b815260048101849052601060248201526f496e76616c696420747265617375727960801b6044820152606490fd5b885162461bcd60e51b815260048101849052601860248201527f496e76616c69642053757368695377617020726f7574657200000000000000006044820152606490fd5b885162461bcd60e51b815260048101849052601660248201527f496e76616c696420556e697377617020726f75746572000000000000000000006044820152606490fd5b62461bcd60e51b815260048101849052601060248201526f24b73b30b634b210383937bb34b232b960811b6044820152606490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176200035757604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200032e5756fe6040608081526004908136101561001557600080fd5b600091823560e01c90816216256b14610cd55781630542975c14610cac5781631b11d0ff14610c22578163383aeeae14610c035781634437152a14610b5e5781634dc10ea114610b3f5781635431c94e146109ae578163578c71d91461098f5781635ead6fb0146108e557816361d027b3146108bc578163715018a614610862578163735de9f7146108395781637535d246146108105781637b1b9f30146107e25781638ccce95e146103f45781638da5cb5b146103cc578163ae567640146103a4578163b09616f114610385578163f0f4426014610304578163f2fde38b1461023c578163f60d205a1461013f575063fd829a231461011457600080fd5b3461013b578160031936011261013b5760065490516001600160a01b039091168152602090f35b5080fd5b9050346102385760603660031901126102385780356024359160443593610164610dc2565b6103e883116101ff576107d084116101c4576101f4851161018d575050600855600955600a5580f35b906020606492519162461bcd60e51b835282015260116024820152700a6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b6044820152fd5b906020606492519162461bcd60e51b835282015260156024820152740a8e4cac2e6eae4f240c6eae840e8dede40d0d2ced605b1b6044820152fd5b906020606492519162461bcd60e51b8352820152601360248201527209ad2dc40e0e4deccd2e840e8dede40d0d2ced606b1b6044820152fd5b8280fd5b90503461023857602036600319011261023857610257610d3c565b90610260610dc2565b6001600160a01b039182169283156102b2575050600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b9050346102385760203660031901126102385761031f610d3c565b610327610dc2565b6001600160a01b031691821561034f5750506001600160601b0360a01b600754161760075580f35b906020606492519162461bcd60e51b8352820152601060248201526f496e76616c696420747265617375727960801b6044820152fd5b50503461013b578160031936011261013b57602090600b549051908152f35b9050346102385782600319360112610238575490516001600160a01b03909116815260209150f35b50503461013b578160031936011261013b57905490516001600160a01b039091168152602090f35b919050346102385761040536610d81565b93929091610411610dc2565b60026001541461079f5760026001556001600160a01b039182169283151580610794575b156107605782169081841461072b5780156106f7578287541685518091633e15014160e01b8252868a8301528160246101409485935afa9182156106ed578a9261067a575b5050156106375784519581875282857fb752e74552d437a110e9ed85dd27384a4923514d6f68931da0d3dd34c5f2f91f6020809aa38551928588850152868401521515606083015260608252608082019167ffffffffffffffff8311938184108517610624578387526003541691823b15610620579183918a936310ac2ddf60e21b84523060848301528760a483015260c482015260a060e482015280518061012483015289855b82811061060457505060c48282876101448195899701015283610104830152601f801991011681010301925af191826105e0575b50506105d85760649450600080516020611b8c83398151915260608351858152601a868201527f666c6173684c6f616e53696d706c65282920726576657274656400000000000085820152a25162461bcd60e51b8152918201526016602482015275199b185cda131bd85b94da5b5c1b194819985a5b195960521b6044820152fd5b846001805580f35b9691966105f1578352943880610556565b634e487b7160e01b825260418652602482fd5b83810180830151610144909101528d96508795508b9101610522565b8980fd5b634e487b7160e01b8a526041895260248afd5b845162461bcd60e51b8152602081890152601b60248201527f4173736574206e6f7420737570706f72746564206279204161766500000000006044820152606490fd5b90809250813d83116106e6575b6106918183610e1a565b810103126106e2576106da6101206106ab60a08401610e52565b926106b860c08201610e52565b506106c560e08201610e52565b506106d36101008201610e52565b5001610e52565b50388061047a565b8880fd5b503d610687565b87513d8c823e3d90fd5b845162461bcd60e51b8152602081890152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606490fd5b845162461bcd60e51b8152602081890152600f60248201526e29b0b6b2903a37b5b2b7103830b4b960891b6044820152606490fd5b845162461bcd60e51b8152602081890152600e60248201526d496e76616c696420746f6b656e7360901b6044820152606490fd5b508281161515610435565b835162461bcd60e51b8152602081880152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b82843461080d57506107ff6107f636610d81565b929190916119db565b825191151582526020820152f35b80fd5b50503461013b578160031936011261013b5760035490516001600160a01b039091168152602090f35b50503461013b578160031936011261013b5760055490516001600160a01b039091168152602090f35b833461080d578060031936011261080d5761087b610dc2565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461013b578160031936011261013b5760075490516001600160a01b039091168152602090f35b9050346102385781600319360112610238576108ff610d3c565b90610908610d57565b90610911610dc2565b6001600160a01b039283169384151580610984575b1561094f5750506001600160601b0360a01b928360055416176005551690600654161760065580f35b906020606492519162461bcd60e51b8352820152600f60248201526e496e76616c696420726f757465727360881b6044820152fd5b508383161515610926565b50503461013b578160031936011261013b57602090600a549051908152f35b8391503461013b578260031936011261013b576109c9610d3c565b926109d2610d57565b936109db610dc2565b6001600160a01b039085821615610b0f57168151946370a0823160e01b865230848701526020938487602481865afa968715610b05578697610ad2575b508615610aa357835163a9059cbb60e01b81526001600160a01b03909216908201908152602081019690965293948391859182908890829060400103925af1908115610a9a5750610a67578280f35b81813d8311610a93575b610a7b8183610e1a565b8101031261013b57610a8c90610e52565b5081808280f35b503d610a71565b513d85823e3d90fd5b835162461bcd60e51b815290810185905260096024820152684e6f20746f6b656e7360b81b6044820152606490fd5b9096508481813d8311610afe575b610aea8183610e1a565b81010312610afa57519587610a18565b8580fd5b503d610ae0565b84513d88823e3d90fd5b825162461bcd60e51b8152602081860152600a602482015269496e76616c696420746f60b01b6044820152606490fd5b50503461013b578160031936011261013b576020906009549051908152f35b9190503461023857602036600319011261023857610b7a610d3c565b610b82610dc2565b6001600160a01b0316918215610bd25750600380546001600160a01b03191683179055519081527f380cec482764ddef4f75351b5398e3e2bea99ba23e53a00d5521f569fb668e1f90602090a180f35b6020606492519162461bcd60e51b8352820152600c60248201526b125b9d985b1a59081c1bdbdb60a21b6044820152fd5b50503461013b578160031936011261013b576020906008549051908152f35b82843461080d5760a036600319011261080d57610c3d610d3c565b90606435906001600160a01b038216820361080d576084359067ffffffffffffffff9586831161013b573660238401121561013b5782013595861161080d57366024878401011161080d575091602094916024610ca39401916044359060243590610e5f565b90519015158152f35b50503461013b578160031936011261013b5760025490516001600160a01b039091168152602090f35b90503461023857602036600319011261023857803591610cf3610dc2565b610e108311610d04575050600b5580f35b906020606492519162461bcd60e51b83528201526012602482015271457874656e73696f6e20746f6f206c6f6e6760701b6044820152fd5b600435906001600160a01b0382168203610d5257565b600080fd5b602435906001600160a01b0382168203610d5257565b35906001600160a01b0382168203610d5257565b6080906003190112610d52576001600160a01b036004358181168103610d525791602435916044359081168103610d5257906064358015158103610d525790565b6000546001600160a01b03163303610dd657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff821117610e3c57604052565b634e487b7160e01b600052604160045260246000fd5b51908115158203610d5257565b6003546001600160a01b0396939492939290871633036112025786309116036111cd57821561119c578491606092839181010312610d5257610ea085610d6d565b602091610eae838801610d6d565b97604080980135928315158403610d52578116988116918116890361116757821561115c578060055416925b156111525760065416915b87516370a0823160e01b815230600482015284816024818d5afa908115611147578a92918891600091611112575b50106110d557610f2d610f26848461125d565b888361139e565b9081156110715790878484610f4194611460565b91821561102e57610f5c610f55838361125d565b848661139e565b938415610fc95790610f7094939291611460565b948515610f8657505050610f83936115fb565b90565b909250600080516020611b8c83398151915294507314d958dbdb99081cddd85c081c995d995c9d195960621b9193506014815193808552840152820152a2600090565b50505050509150608092506c072207365636f6e64207377617609c1b907f4661696c656420746f20676574206578706563746564206f757470757420666f85602d600080516020611b8c833981519152975195808752860152840152820152a2600090565b505050509150915072119a5c9cdd081cddd85c081c995d995c9d1959606a1b836013600080516020611b8c833981519152955193808552840152820152a2600090565b50505050509150608092506b07220666972737420737761760a41b907f4661696c656420746f20676574206578706563746564206f757470757420666f85602c600080516020611b8c833981519152975195808752860152840152820152a2600090565b50505050915091506c4d697373696e672066756e647360981b83600d600080516020611b8c833981519152955193808552840152820152a2600090565b92935090508582813d8111611140575b61112c8183610e1a565b8101031261080d575090868a925138610f13565b503d611122565b89513d6000823e3d90fd5b6005541691610ee5565b806006541692610eda565b875162461bcd60e51b815260048101859052600e60248201526d0a8ded6cadc40dad2e6dac2e8c6d60931b6044820152606490fd5b60405162461bcd60e51b81526020600482015260096024820152682d32b937903637b0b760b91b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c2130b21034b734ba34b0ba37b960991b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c139bdd0810585d99481c1bdbdb609a1b6044820152606490fd5b8051600110156112475760400190565b634e487b7160e01b600052603260045260246000fd5b9190604051926060840184811067ffffffffffffffff821117610e3c576040526002845260208401604036823784805115611247576001600160a01b039283169091526112a990611237565b91169052565b906020908183820312610d5257825167ffffffffffffffff93848211610d52570181601f82011215610d52578051938411610e3c578360051b90604051946112f985840187610e1a565b85528380860192820101928311610d52578301905b82821061131c575050505090565b8151815290830190830161130e565b90815180825260208080930193019160005b82811061134b575050505090565b83516001600160a01b03168552938101939281019260010161133d565b9190820391821161137557565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561137557565b90916113d19260405192839163d06ca61f60e01b835260048301526040602483015281806000968795604483019061132b565b03916001600160a01b03165afa82918161142f575b506113ef575090565b6113f890611237565b5190600a54916127109283039183831161141b5750906114179161138b565b0490565b634e487b7160e01b81526011600452602490fd5b61144c9192503d8085833e6114448183610e1a565b8101906112af565b90386113e6565b9190820180921161137557565b92919361146d858361125d565b6040805163095ea7b360e01b81526001600160a01b0387811660048301526024820187905260009860209896821696939491939092919089836044818e8c5af180156115f1578b929186916115af575b6115289450169687897f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258d8d8b51908152a36114fb600b5442611453565b875194859384936338ed173960e01b85528d6004860152602485015260a0604485015260a484019061132b565b903060648401526084830152038183895af1899181611593575b5061155257505050505050505090565b7f6782190c91d4a7e8ad2a867deed6ec0a970cab8ff137ae2bd4abd92b3810f4d39495969799985061158390611237565b51809984519889528801521694a4565b6115a89192503d808c833e6114448183610e1a565b9038611542565b925050918981813d83116115ea575b6115c88183610e1a565b810103126115e65791848b926115e061152895610e52565b506114bd565b8a80fd5b503d6115be565b86513d8d823e3d90fd5b9290916116089083611453565b9081811061198e579261161e8261162e95611368565b926127109485916008549061138b565b04831061193c576003546040805163095ea7b360e01b81526001600160a01b0392831660048201526024810185905260009693831695602095929490939186816044818c8c5af18015611932576118fe575b506116e686836003541694858a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925848b51858152a3875163a9059cbb60e01b8082526001600160a01b039097166004820152602481019190915291829081906044820190565b03818c8c5af190816118ca575b5061173a5750505050600080516020611b8c833981519152917410585d99481c995c185e5b595b9d0819985a5b1959605a1b8260156060945193808552840152820152a290565b9796979492939461174d6009548661138b565b04918261178d575b5050507f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9394955082519182524290820152a2600190565b600754865191825282166001600160a01b031660048201526024810183905283816044818c8b5af1988961186e575b5050827f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9697981560001461183c5750505084600080516020611b8c833981519152606085518481526018858201527f5472656173757279207472616e73666572206661696c6564000000000000000087820152a25b8594933880611755565b7fb5668d929317b36d7b61952ab446b7e4dd82c4d9f90788b407c35e90440f56789160075416928651908152a2611832565b8482813d83116118c3575b6118838183610e1a565b8101031261080d57507f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9697986118ba8592610e52565b509897966117bc565b503d611879565b8781813d83116118f7575b6118df8183610e1a565b81010312610620576118f090610e52565b50386116f3565b503d6118d5565b8681813d831161192b575b6119138183610e1a565b810103126106e25761192490610e52565b5038611680565b503d611909565b86513d8b823e3d90fd5b92505050600080516020611b8c83398151915260606040519260208452601660208501527510995b1bddc81c1c9bd99a5d081d1a1c995cda1bdb1960521b604085015260018060a01b031692a2600090565b505050600080516020611b8c833981519152606060405192602084526012602085015271556e70726f66697461626c6520747261646560701b604085015260018060a01b031692a2600090565b939290918115611b79576005546001600160a01b0316915b15611b63576006546001600160a01b031694611a1a905b611a14838261125d565b9261125d565b60009560405196808880611a4a63d06ca61f60e01b978883528a600484015260406024840152604483019061132b565b038160018060a01b038099165afa90978882611b46575b5050611a765750505050509050600090600090565b611a83611aab9597611237565b516000948594604051978895869485938452600484015260406024840152604483019061132b565b0392165afa90918282611b29575b5050611ac85750600091508190565b611ad190611237565b5160098302908382046009148415171561137557611af461271080930485611453565b9081811115611b1c57611b1491611b0a91611368565b936008549061138b565b048210159190565b5050509050600090600090565b611b3e9293503d8091833e6114448183610e1a565b903880611ab9565b611b5b9299503d8091833e6114448183610e1a565b963880611a61565b6005546001600160a01b031694611a1a90611a0a565b6006546001600160a01b0316916119f356fed766091fb367f2d7d457dc54e636901a49b38cf75e67f3be83c665b50fbf8725a264697066735822122050d10e7b5e9eaa6f8bac6d3a60773da58486fa727671a4715a8c732b4ce7817a64736f6c634300081400330000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000140d747dc9087f46a48aa12cde3a6b8f42567309
Deployed Bytecode
0x6040608081526004908136101561001557600080fd5b600091823560e01c90816216256b14610cd55781630542975c14610cac5781631b11d0ff14610c22578163383aeeae14610c035781634437152a14610b5e5781634dc10ea114610b3f5781635431c94e146109ae578163578c71d91461098f5781635ead6fb0146108e557816361d027b3146108bc578163715018a614610862578163735de9f7146108395781637535d246146108105781637b1b9f30146107e25781638ccce95e146103f45781638da5cb5b146103cc578163ae567640146103a4578163b09616f114610385578163f0f4426014610304578163f2fde38b1461023c578163f60d205a1461013f575063fd829a231461011457600080fd5b3461013b578160031936011261013b5760065490516001600160a01b039091168152602090f35b5080fd5b9050346102385760603660031901126102385780356024359160443593610164610dc2565b6103e883116101ff576107d084116101c4576101f4851161018d575050600855600955600a5580f35b906020606492519162461bcd60e51b835282015260116024820152700a6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b6044820152fd5b906020606492519162461bcd60e51b835282015260156024820152740a8e4cac2e6eae4f240c6eae840e8dede40d0d2ced605b1b6044820152fd5b906020606492519162461bcd60e51b8352820152601360248201527209ad2dc40e0e4deccd2e840e8dede40d0d2ced606b1b6044820152fd5b8280fd5b90503461023857602036600319011261023857610257610d3c565b90610260610dc2565b6001600160a01b039182169283156102b2575050600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b9050346102385760203660031901126102385761031f610d3c565b610327610dc2565b6001600160a01b031691821561034f5750506001600160601b0360a01b600754161760075580f35b906020606492519162461bcd60e51b8352820152601060248201526f496e76616c696420747265617375727960801b6044820152fd5b50503461013b578160031936011261013b57602090600b549051908152f35b9050346102385782600319360112610238575490516001600160a01b03909116815260209150f35b50503461013b578160031936011261013b57905490516001600160a01b039091168152602090f35b919050346102385761040536610d81565b93929091610411610dc2565b60026001541461079f5760026001556001600160a01b039182169283151580610794575b156107605782169081841461072b5780156106f7578287541685518091633e15014160e01b8252868a8301528160246101409485935afa9182156106ed578a9261067a575b5050156106375784519581875282857fb752e74552d437a110e9ed85dd27384a4923514d6f68931da0d3dd34c5f2f91f6020809aa38551928588850152868401521515606083015260608252608082019167ffffffffffffffff8311938184108517610624578387526003541691823b15610620579183918a936310ac2ddf60e21b84523060848301528760a483015260c482015260a060e482015280518061012483015289855b82811061060457505060c48282876101448195899701015283610104830152601f801991011681010301925af191826105e0575b50506105d85760649450600080516020611b8c83398151915260608351858152601a868201527f666c6173684c6f616e53696d706c65282920726576657274656400000000000085820152a25162461bcd60e51b8152918201526016602482015275199b185cda131bd85b94da5b5c1b194819985a5b195960521b6044820152fd5b846001805580f35b9691966105f1578352943880610556565b634e487b7160e01b825260418652602482fd5b83810180830151610144909101528d96508795508b9101610522565b8980fd5b634e487b7160e01b8a526041895260248afd5b845162461bcd60e51b8152602081890152601b60248201527f4173736574206e6f7420737570706f72746564206279204161766500000000006044820152606490fd5b90809250813d83116106e6575b6106918183610e1a565b810103126106e2576106da6101206106ab60a08401610e52565b926106b860c08201610e52565b506106c560e08201610e52565b506106d36101008201610e52565b5001610e52565b50388061047a565b8880fd5b503d610687565b87513d8c823e3d90fd5b845162461bcd60e51b8152602081890152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b6044820152606490fd5b845162461bcd60e51b8152602081890152600f60248201526e29b0b6b2903a37b5b2b7103830b4b960891b6044820152606490fd5b845162461bcd60e51b8152602081890152600e60248201526d496e76616c696420746f6b656e7360901b6044820152606490fd5b508281161515610435565b835162461bcd60e51b8152602081880152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b82843461080d57506107ff6107f636610d81565b929190916119db565b825191151582526020820152f35b80fd5b50503461013b578160031936011261013b5760035490516001600160a01b039091168152602090f35b50503461013b578160031936011261013b5760055490516001600160a01b039091168152602090f35b833461080d578060031936011261080d5761087b610dc2565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461013b578160031936011261013b5760075490516001600160a01b039091168152602090f35b9050346102385781600319360112610238576108ff610d3c565b90610908610d57565b90610911610dc2565b6001600160a01b039283169384151580610984575b1561094f5750506001600160601b0360a01b928360055416176005551690600654161760065580f35b906020606492519162461bcd60e51b8352820152600f60248201526e496e76616c696420726f757465727360881b6044820152fd5b508383161515610926565b50503461013b578160031936011261013b57602090600a549051908152f35b8391503461013b578260031936011261013b576109c9610d3c565b926109d2610d57565b936109db610dc2565b6001600160a01b039085821615610b0f57168151946370a0823160e01b865230848701526020938487602481865afa968715610b05578697610ad2575b508615610aa357835163a9059cbb60e01b81526001600160a01b03909216908201908152602081019690965293948391859182908890829060400103925af1908115610a9a5750610a67578280f35b81813d8311610a93575b610a7b8183610e1a565b8101031261013b57610a8c90610e52565b5081808280f35b503d610a71565b513d85823e3d90fd5b835162461bcd60e51b815290810185905260096024820152684e6f20746f6b656e7360b81b6044820152606490fd5b9096508481813d8311610afe575b610aea8183610e1a565b81010312610afa57519587610a18565b8580fd5b503d610ae0565b84513d88823e3d90fd5b825162461bcd60e51b8152602081860152600a602482015269496e76616c696420746f60b01b6044820152606490fd5b50503461013b578160031936011261013b576020906009549051908152f35b9190503461023857602036600319011261023857610b7a610d3c565b610b82610dc2565b6001600160a01b0316918215610bd25750600380546001600160a01b03191683179055519081527f380cec482764ddef4f75351b5398e3e2bea99ba23e53a00d5521f569fb668e1f90602090a180f35b6020606492519162461bcd60e51b8352820152600c60248201526b125b9d985b1a59081c1bdbdb60a21b6044820152fd5b50503461013b578160031936011261013b576020906008549051908152f35b82843461080d5760a036600319011261080d57610c3d610d3c565b90606435906001600160a01b038216820361080d576084359067ffffffffffffffff9586831161013b573660238401121561013b5782013595861161080d57366024878401011161080d575091602094916024610ca39401916044359060243590610e5f565b90519015158152f35b50503461013b578160031936011261013b5760025490516001600160a01b039091168152602090f35b90503461023857602036600319011261023857803591610cf3610dc2565b610e108311610d04575050600b5580f35b906020606492519162461bcd60e51b83528201526012602482015271457874656e73696f6e20746f6f206c6f6e6760701b6044820152fd5b600435906001600160a01b0382168203610d5257565b600080fd5b602435906001600160a01b0382168203610d5257565b35906001600160a01b0382168203610d5257565b6080906003190112610d52576001600160a01b036004358181168103610d525791602435916044359081168103610d5257906064358015158103610d525790565b6000546001600160a01b03163303610dd657565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff821117610e3c57604052565b634e487b7160e01b600052604160045260246000fd5b51908115158203610d5257565b6003546001600160a01b0396939492939290871633036112025786309116036111cd57821561119c578491606092839181010312610d5257610ea085610d6d565b602091610eae838801610d6d565b97604080980135928315158403610d52578116988116918116890361116757821561115c578060055416925b156111525760065416915b87516370a0823160e01b815230600482015284816024818d5afa908115611147578a92918891600091611112575b50106110d557610f2d610f26848461125d565b888361139e565b9081156110715790878484610f4194611460565b91821561102e57610f5c610f55838361125d565b848661139e565b938415610fc95790610f7094939291611460565b948515610f8657505050610f83936115fb565b90565b909250600080516020611b8c83398151915294507314d958dbdb99081cddd85c081c995d995c9d195960621b9193506014815193808552840152820152a2600090565b50505050509150608092506c072207365636f6e64207377617609c1b907f4661696c656420746f20676574206578706563746564206f757470757420666f85602d600080516020611b8c833981519152975195808752860152840152820152a2600090565b505050509150915072119a5c9cdd081cddd85c081c995d995c9d1959606a1b836013600080516020611b8c833981519152955193808552840152820152a2600090565b50505050509150608092506b07220666972737420737761760a41b907f4661696c656420746f20676574206578706563746564206f757470757420666f85602c600080516020611b8c833981519152975195808752860152840152820152a2600090565b50505050915091506c4d697373696e672066756e647360981b83600d600080516020611b8c833981519152955193808552840152820152a2600090565b92935090508582813d8111611140575b61112c8183610e1a565b8101031261080d575090868a925138610f13565b503d611122565b89513d6000823e3d90fd5b6005541691610ee5565b806006541692610eda565b875162461bcd60e51b815260048101859052600e60248201526d0a8ded6cadc40dad2e6dac2e8c6d60931b6044820152606490fd5b60405162461bcd60e51b81526020600482015260096024820152682d32b937903637b0b760b91b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c2130b21034b734ba34b0ba37b960991b6044820152606490fd5b60405162461bcd60e51b815260206004820152600d60248201526c139bdd0810585d99481c1bdbdb609a1b6044820152606490fd5b8051600110156112475760400190565b634e487b7160e01b600052603260045260246000fd5b9190604051926060840184811067ffffffffffffffff821117610e3c576040526002845260208401604036823784805115611247576001600160a01b039283169091526112a990611237565b91169052565b906020908183820312610d5257825167ffffffffffffffff93848211610d52570181601f82011215610d52578051938411610e3c578360051b90604051946112f985840187610e1a565b85528380860192820101928311610d52578301905b82821061131c575050505090565b8151815290830190830161130e565b90815180825260208080930193019160005b82811061134b575050505090565b83516001600160a01b03168552938101939281019260010161133d565b9190820391821161137557565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561137557565b90916113d19260405192839163d06ca61f60e01b835260048301526040602483015281806000968795604483019061132b565b03916001600160a01b03165afa82918161142f575b506113ef575090565b6113f890611237565b5190600a54916127109283039183831161141b5750906114179161138b565b0490565b634e487b7160e01b81526011600452602490fd5b61144c9192503d8085833e6114448183610e1a565b8101906112af565b90386113e6565b9190820180921161137557565b92919361146d858361125d565b6040805163095ea7b360e01b81526001600160a01b0387811660048301526024820187905260009860209896821696939491939092919089836044818e8c5af180156115f1578b929186916115af575b6115289450169687897f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258d8d8b51908152a36114fb600b5442611453565b875194859384936338ed173960e01b85528d6004860152602485015260a0604485015260a484019061132b565b903060648401526084830152038183895af1899181611593575b5061155257505050505050505090565b7f6782190c91d4a7e8ad2a867deed6ec0a970cab8ff137ae2bd4abd92b3810f4d39495969799985061158390611237565b51809984519889528801521694a4565b6115a89192503d808c833e6114448183610e1a565b9038611542565b925050918981813d83116115ea575b6115c88183610e1a565b810103126115e65791848b926115e061152895610e52565b506114bd565b8a80fd5b503d6115be565b86513d8d823e3d90fd5b9290916116089083611453565b9081811061198e579261161e8261162e95611368565b926127109485916008549061138b565b04831061193c576003546040805163095ea7b360e01b81526001600160a01b0392831660048201526024810185905260009693831695602095929490939186816044818c8c5af18015611932576118fe575b506116e686836003541694858a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925848b51858152a3875163a9059cbb60e01b8082526001600160a01b039097166004820152602481019190915291829081906044820190565b03818c8c5af190816118ca575b5061173a5750505050600080516020611b8c833981519152917410585d99481c995c185e5b595b9d0819985a5b1959605a1b8260156060945193808552840152820152a290565b9796979492939461174d6009548661138b565b04918261178d575b5050507f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9394955082519182524290820152a2600190565b600754865191825282166001600160a01b031660048201526024810183905283816044818c8b5af1988961186e575b5050827f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9697981560001461183c5750505084600080516020611b8c833981519152606085518481526018858201527f5472656173757279207472616e73666572206661696c6564000000000000000087820152a25b8594933880611755565b7fb5668d929317b36d7b61952ab446b7e4dd82c4d9f90788b407c35e90440f56789160075416928651908152a2611832565b8482813d83116118c3575b6118838183610e1a565b8101031261080d57507f61268d74931c41c9775dffb6169a5208aab1d09cb2eb6aabe8b97162801e5dfa9697986118ba8592610e52565b509897966117bc565b503d611879565b8781813d83116118f7575b6118df8183610e1a565b81010312610620576118f090610e52565b50386116f3565b503d6118d5565b8681813d831161192b575b6119138183610e1a565b810103126106e25761192490610e52565b5038611680565b503d611909565b86513d8b823e3d90fd5b92505050600080516020611b8c83398151915260606040519260208452601660208501527510995b1bddc81c1c9bd99a5d081d1a1c995cda1bdb1960521b604085015260018060a01b031692a2600090565b505050600080516020611b8c833981519152606060405192602084526012602085015271556e70726f66697461626c6520747261646560701b604085015260018060a01b031692a2600090565b939290918115611b79576005546001600160a01b0316915b15611b63576006546001600160a01b031694611a1a905b611a14838261125d565b9261125d565b60009560405196808880611a4a63d06ca61f60e01b978883528a600484015260406024840152604483019061132b565b038160018060a01b038099165afa90978882611b46575b5050611a765750505050509050600090600090565b611a83611aab9597611237565b516000948594604051978895869485938452600484015260406024840152604483019061132b565b0392165afa90918282611b29575b5050611ac85750600091508190565b611ad190611237565b5160098302908382046009148415171561137557611af461271080930485611453565b9081811115611b1c57611b1491611b0a91611368565b936008549061138b565b048210159190565b5050509050600090600090565b611b3e9293503d8091833e6114448183610e1a565b903880611ab9565b611b5b9299503d8091833e6114448183610e1a565b963880611a61565b6005546001600160a01b031694611a1a90611a0a565b6006546001600160a01b0316916119f356fed766091fb367f2d7d457dc54e636901a49b38cf75e67f3be83c665b50fbf8725a264697066735822122050d10e7b5e9eaa6f8bac6d3a60773da58486fa727671a4715a8c732b4ce7817a64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f000000000000000000000000140d747dc9087f46a48aa12cde3a6b8f42567309
-----Decoded View---------------
Arg [0] : _provider (address): 0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e
Arg [1] : _uniswapRouter (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [2] : _sushiSwapRouter (address): 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F
Arg [3] : _treasury (address): 0x140d747dC9087f46a48aa12CDE3a6B8F42567309
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e
Arg [1] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [2] : 000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f
Arg [3] : 000000000000000000000000140d747dc9087f46a48aa12cde3a6b8f42567309
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.