Contract 0x33b649092ebe7DB1A34550209Cd8e92BE00738a0

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27V Debt Unloop228852412022-09-05 2:08:4622 days 15 hrs ago0x5fdf920301cf76065e3532b5927c8c14ce6d8c35 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00018971
0x50b9bf9d76fb61f05235726d57ff3fbeb747c8314864e6f1cd2f37c52b1f3dc2V Debt Unloop228850112022-09-05 2:05:2922 days 15 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00025095
0x3ea37c8b2e5a4f5f822b0d74e3586e8e2ad4a862b9ddf35668df04358afffb98V Debt Unloop224137552022-09-02 1:11:1725 days 16 hrs ago0x5fdf920301cf76065e3532b5927c8c14ce6d8c35 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.0000997
0xadefa9a431219d5ae8e26af0016dbe3f9ad537bb26d12b9bd569ff191012f647V Debt Unloop222493892022-08-31 23:17:5026 days 18 hrs ago0x5fdf920301cf76065e3532b5927c8c14ce6d8c35 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00017574
0x0019d1390ce326e7b510aee013563a22d5316263ae520664ba8ef5cd6300d54bV Debt Unloop222491342022-08-31 23:15:2826 days 18 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00023697
0xc4554fdf699ef6df2280ff985f65ac75e2f8a0e0139e962ed045ff5870870526V Debt Unloop222489922022-08-31 23:13:5526 days 18 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00024609
0xe8e4c13f37f314e241248cf68d585d63355c5ae9639537bf259c1d43f9ccad33V Debt Unloop222487452022-08-31 23:11:2226 days 18 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.00007732
0x16b7f5a7af868576f3cf51a03c6235fb00a32ebbfb9d1b59c23c1220a5780d06V Debt Unloop218917652022-08-29 19:22:5328 days 22 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.000260155659 ETH
0x336b14e2b346787169d4ad8ca5fba1a5878efd52a9488e602bdda8eee86e8657V Debt Unloop208358302022-08-21 4:02:2137 days 13 hrs ago0x5fdf920301cf76065e3532b5927c8c14ce6d8c35 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.000124751782 ETH
0x73e3a693d35a71a59a1070c199f11163e91f26e930381f6ad03984e0f4d8902fV Debt Unloop208355762022-08-21 3:55:5337 days 13 hrs ago0x15fe8337a6e23629fa09dc6e0f8b041d681ec995 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.000151148388 ETH
0xa7787e9379b4af4e577e304f4db38c99af077d408cc060b18d0860f577d44969V Debt Unloop207571972022-08-20 7:06:5238 days 10 hrs ago0x000000000a38444e0a6e37d3b630d7e855a7cb13 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.000163395373 ETH
0x4a5f842afe66df41f7bacc615395d7b3e2040ac935d524a6a3205d463a6ed454V Debt Unloop204236682022-08-16 16:44:5542 days 1 hr ago0x000000000a38444e0a6e37d3b630d7e855a7cb13 IN  0x33b649092ebe7db1a34550209cd8e92be00738a00 ETH0.000252373796 ETH
0x891ec5ee6d4563f936ace397f94aff62cc932e1f56233711bb2bace29d3808f40x60806040204222222022-08-16 16:22:5242 days 1 hr ago0x000000000a38444e0a6e37d3b630d7e855a7cb13 IN  Create: AAVEDeLeverager0 ETH0.002788562938 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 Radiant: Lending Pool Logic0 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x5293c6ca56b8941040b8d18f557dfa82cf5202160 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0xda10009cbd5d07dd0cecc66161fc93d7c9000da10 ETH
0x111f26d0399461dbe78adc2242f41a197708e4d6f61fa740e2282542c7e1df27228852412022-09-05 2:08:4622 days 15 hrs ago 0x33b649092ebe7db1a34550209cd8e92be00738a0 0x2e9b46867469350e4889c280f74bfa55ca44fcd40 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AAVEDeLeverager

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Multiple files format)

File 1 of 6: AAVEDeLeverager.sol
pragma solidity 0.7.6;
pragma abicoder v2;

// SPDX-License-Identifier: MIT

import "./SafeMath.sol";
import "./IERC20.sol";

import "./ILendingPool.sol";

contract AAVEDeLeverager {
    using SafeMath for uint256;

    uint256 public constant BORROW_RATIO_DECIMALS = 4;

    /// @notice Lending Pool address
    ILendingPool public lendingPool;

    constructor(ILendingPool _lendingPool) {
        lendingPool = _lendingPool;
    }

    /**
     * @dev 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) {
        return lendingPool.getConfiguration(asset);
    }

    /**
     * @dev Returns variable debt token address of asset
     * @param asset The address of the underlying asset of the reserve
     * @return varaiableDebtToken address of the asset
     **/
    function getVDebtToken(address asset) public view returns (address) {
        DataTypes.ReserveData memory reserveData = lendingPool.getReserveData(asset);
        return reserveData.variableDebtTokenAddress;
    }

    /**
     * @dev Returns interest bearing token address of the token supplied
     * @param asset The address of the underlying asset of the reserve
     * @return aTokenAddress address of the asset
     **/
    function getAToken(address asset) public view returns (address) {
        DataTypes.ReserveData memory reserveData = lendingPool.getReserveData(asset);
        return reserveData.aTokenAddress;
    }

    /**
     * @dev Returns loan to value
     * @param asset The address of the underlying asset of the reserve
     * @return ltv of the asset
     **/
    function ltv(address asset) public view returns (uint256) {
        DataTypes.ReserveConfigurationMap memory conf =  lendingPool.getConfiguration(asset);
        return conf.data % (2 ** 16);
    }

    /**
     * @dev Loop the deposit and borrow of an asset
     * @param asset for loop
     * @param amount for the initial deposit
     * @param interestRateMode stable or variable borrow mode
     * @param borrowRatio Ratio of tokens to borrow
     * @param loopCount Repeat count for loop
     **/
    function loop(
        address asset,
        uint256 amount,
        uint256 interestRateMode,
        uint256 borrowRatio,
        uint256 loopCount
    ) external {
        uint16 referralCode = 0;
        IERC20(asset).transferFrom(msg.sender, address(this), amount);
        IERC20(asset).approve(address(lendingPool), type(uint256).max);
        lendingPool.deposit(asset, amount, msg.sender, referralCode);
        for (uint256 i = 0; i < loopCount; i += 1) {
            amount = amount.mul(borrowRatio).div(10 ** BORROW_RATIO_DECIMALS);
            lendingPool.borrow(asset, amount, interestRateMode, referralCode, msg.sender);
            lendingPool.deposit(asset, amount, msg.sender, referralCode);
        }
    }

    /**
     * @dev Select the minimum value between two values
     * @param a for first value
     * @param b for second value
     * @return min of the values
     **/
    function min(uint256 a, uint256 b) public pure returns (uint256)
    {
        return a < b ? a : b;
    }

    /**
     * @dev Unloop the deposit and borrow of an asset
     * @param asset for unloop
     * @param amount for the amount able to withdraw from deposits
     * @param returnRatio Ratio of tokens to return
     * @param loopCount Max repeat count for loop
     **/
    function VDebtUnloop(
        address asset,
        uint256 amount,
        uint256 returnRatio,
        uint256 loopCount
    ) external {
        address aAsset = getAToken(asset);
        address VDebtAsset = getVDebtToken(asset);
        uint256 totalVDebtToken = IERC20(VDebtAsset).balanceOf(msg.sender);
        IERC20(asset).approve(address(lendingPool), type(uint256).max);
        for (uint256 i = 0; i < loopCount; i += 1) {
            if (totalVDebtToken == 0)
            {
                amount = IERC20(aAsset).balanceOf(msg.sender);
                IERC20(aAsset).transferFrom(
                    msg.sender,
                    address(this),
                    amount
                );
                lendingPool.withdraw(asset, amount, address(this));
                break;
            }
            IERC20(aAsset).transferFrom(msg.sender, address(this), amount);
            lendingPool.withdraw(asset, amount, address(this));
            lendingPool.repay(asset, amount, 2, msg.sender);
            totalVDebtToken -= amount;
            amount = min(amount.mul(10 ** BORROW_RATIO_DECIMALS).div(returnRatio), totalVDebtToken);
        }
        IERC20(asset).transfer(msg.sender, IERC20(asset).balanceOf(address(this)));
    }
}

File 2 of 6: DataTypes.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;

library DataTypes {
  // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties.
  struct ReserveData {
    //stores the reserve configuration
    ReserveConfigurationMap configuration;
    //the liquidity index. Expressed in ray
    uint128 liquidityIndex;
    //variable borrow index. Expressed in ray
    uint128 variableBorrowIndex;
    //the current supply rate. Expressed in ray
    uint128 currentLiquidityRate;
    //the current variable borrow rate. Expressed in ray
    uint128 currentVariableBorrowRate;
    //the current stable borrow rate. Expressed in ray
    uint128 currentStableBorrowRate;
    uint40 lastUpdateTimestamp;
    //tokens addresses
    address aTokenAddress;
    address stableDebtTokenAddress;
    address variableDebtTokenAddress;
    //address of the interest rate strategy
    address interestRateStrategyAddress;
    //the id of the reserve. Represents the position in the list of the active reserves
    uint8 id;
  }

  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-63: reserved
    //bit 64-79: reserve factor
    uint256 data;
  }

  struct UserConfigurationMap {
    uint256 data;
  }

  enum InterestRateMode {NONE, STABLE, VARIABLE}
}

File 3 of 6: IERC20.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
  /**
   * @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 `recipient`.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
    address recipient,
    uint256 amount
  ) external returns (bool);

  /**
   * @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);
}

File 4 of 6: ILendingPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import {ILendingPoolAddressesProvider} from './ILendingPoolAddressesProvider.sol';
import {DataTypes} from './DataTypes.sol';

interface ILendingPool {
  /**
   * @dev Emitted on deposit()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address initiating the deposit
   * @param onBehalfOf The beneficiary of the deposit, receiving the aTokens
   * @param amount The amount deposited
   * @param referral The referral code used
   **/
  event Deposit(
    address indexed reserve,
    address user,
    address indexed onBehalfOf,
    uint256 amount,
    uint16 indexed referral
  );

  /**
   * @dev Emitted on withdraw()
   * @param reserve The address of the underlyng asset being withdrawn
   * @param user The address initiating the withdrawal, owner of aTokens
   * @param to 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 borrowRateMode The rate mode: 1 for Stable, 2 for Variable
   * @param borrowRate The numeric rate at which the user has borrowed
   * @param referral The referral code used
   **/
  event Borrow(
    address indexed reserve,
    address user,
    address indexed onBehalfOf,
    uint256 amount,
    uint256 borrowRateMode,
    uint256 borrowRate,
    uint16 indexed referral
  );

  /**
   * @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
   **/
  event Repay(
    address indexed reserve,
    address indexed user,
    address indexed repayer,
    uint256 amount
  );

  /**
   * @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 rateMode The rate mode that the user wants to swap to
   **/
  event Swap(address indexed reserve, address indexed user, uint256 rateMode);

  /**
   * @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 premium The fee flash borrowed
   * @param referralCode The referral code used
   **/
  event FlashLoan(
    address indexed target,
    address indexed initiator,
    address indexed asset,
    uint256 amount,
    uint256 premium,
    uint16 referralCode
  );

  /**
   * @dev Emitted when the pause is triggered.
   */
  event Paused();

  /**
   * @dev Emitted when the pause is lifted.
   */
  event Unpaused();

  /**
   * @dev Emitted when a borrower is liquidated. This event is emitted by the LendingPool via
   * LendingPoolCollateral manager using a DELEGATECALL
   * This allows to have the events in the generated ABI for LendingPool.
   * @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 liiquidator
   * @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. NOTE: This event is actually declared
   * in the ReserveLogic library and emitted in the updateInterestRates() function. Since the function is internal,
   * the event will actually be fired by the LendingPool contract. The event is therefore replicated here so it
   * gets added to the LendingPool ABI
   * @param reserve The address of the underlying asset of the reserve
   * @param liquidityRate The new liquidity rate
   * @param stableBorrowRate The new stable borrow rate
   * @param variableBorrowRate The new variable borrow rate
   * @param liquidityIndex The new liquidity index
   * @param variableBorrowIndex The new variable borrow index
   **/
  event ReserveDataUpdated(
    address indexed reserve,
    uint256 liquidityRate,
    uint256 stableBorrowRate,
    uint256 variableBorrowRate,
    uint256 liquidityIndex,
    uint256 variableBorrowIndex
  );

  /**
   * @dev Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
   * - E.g. User deposits 100 USDC and gets in return 100 aUSDC
   * @param asset The address of the underlying asset to deposit
   * @param amount The amount to be deposited
   * @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;

  /**
   * @dev 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 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);

  /**
   * @dev Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
   * already deposited 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 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 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 rateMode 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
   * @return The final amount repaid
   **/
  function repay(
    address asset,
    uint256 amount,
    uint256 rateMode,
    address onBehalfOf
  ) external returns (uint256);

  /**
   * @dev Allows a borrower to swap his debt between stable and variable mode, or viceversa
   * @param asset The address of the underlying asset borrowed
   * @param rateMode The rate mode that the user wants to swap to
   **/
  function swapBorrowRateMode(address asset, uint256 rateMode) external;

  /**
   * @dev 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 deposit APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been
   *        borrowed at a stable rate and depositors 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;

  /**
   * @dev Allows depositors to enable/disable a specific deposited asset as collateral
   * @param asset The address of the underlying asset deposited
   * @param useAsCollateral `true` if the user wants to use the deposit as collateral, `false` otherwise
   **/
  function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;

  /**
   * @dev 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;

  /**
   * @dev Allows smartcontracts to access the liquidity of the pool within one transaction,
   * as long as the amount taken plus a fee is returned.
   * IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration.
   * For further details please visit https://developers.aave.com
   * @param receiverAddress The address of the contract receiving the funds, implementing the IFlashLoanReceiver interface
   * @param assets The addresses of the assets being flash-borrowed
   * @param amounts The amounts amounts being flash-borrowed
   * @param modes 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 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 modes,
    address onBehalfOf,
    bytes calldata params,
    uint16 referralCode
  ) external;

  /**
   * @dev Returns the user account data across all the reserves
   * @param user The address of the user
   * @return totalCollateralETH the total collateral in ETH of the user
   * @return totalDebtETH the total debt in ETH of the user
   * @return availableBorrowsETH the borrowing power left of the user
   * @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 totalCollateralETH,
      uint256 totalDebtETH,
      uint256 availableBorrowsETH,
      uint256 currentLiquidationThreshold,
      uint256 ltv,
      uint256 healthFactor
    );

  function initReserve(
    address reserve,
    address aTokenAddress,
    address stableDebtAddress,
    address variableDebtAddress,
    address interestRateStrategyAddress
  ) external;

  function setReserveInterestRateStrategyAddress(address reserve, address rateStrategyAddress)
    external;

  function setConfiguration(address reserve, uint256 configuration) external;

  /**
   * @dev 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);

  /**
   * @dev 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);

  /**
   * @dev Returns the normalized income 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);

  /**
   * @dev Returns the normalized variable debt per unit of asset
   * @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);

  /**
   * @dev Returns the state and configuration of the reserve
   * @param asset The address of the underlying asset of the reserve
   * @return The state of the reserve
   **/
  function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);

  function finalizeTransfer(
    address asset,
    address from,
    address to,
    uint256 amount,
    uint256 balanceFromAfter,
    uint256 balanceToBefore
  ) external;

  function getReservesList() external view returns (address[] memory);

  function getAddressesProvider() external view returns (ILendingPoolAddressesProvider);

  function setPause(bool val) external;

  function paused() external view returns (bool);
}

File 5 of 6: ILendingPoolAddressesProvider.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;

/**
 * @title LendingPoolAddressesProvider contract
 * @dev Main registry of addresses part of or connected to the protocol, including permissioned roles
 * - Acting also as factory of proxies and admin of those, so with right to change its implementations
 * - Owned by the Aave Governance
 * @author Aave
 **/
interface ILendingPoolAddressesProvider {
  event MarketIdSet(string newMarketId);
  event LendingPoolUpdated(address indexed newAddress);
  event ConfigurationAdminUpdated(address indexed newAddress);
  event EmergencyAdminUpdated(address indexed newAddress);
  event LendingPoolConfiguratorUpdated(address indexed newAddress);
  event LendingPoolCollateralManagerUpdated(address indexed newAddress);
  event PriceOracleUpdated(address indexed newAddress);
  event LendingRateOracleUpdated(address indexed newAddress);
  event ProxyCreated(bytes32 id, address indexed newAddress);
  event AddressSet(bytes32 id, address indexed newAddress, bool hasProxy);

  function getMarketId() external view returns (string memory);

  function setMarketId(string calldata marketId) external;

  function setAddress(bytes32 id, address newAddress) external;

  function setAddressAsProxy(bytes32 id, address impl) external;

  function getAddress(bytes32 id) external view returns (address);

  function getLendingPool() external view returns (address);

  function setLendingPoolImpl(address pool) external;

  function getLendingPoolConfigurator() external view returns (address);

  function setLendingPoolConfiguratorImpl(address configurator) external;

  function getLendingPoolCollateralManager() external view returns (address);

  function setLendingPoolCollateralManager(address manager) external;

  function getPoolAdmin() external view returns (address);

  function setPoolAdmin(address admin) external;

  function getEmergencyAdmin() external view returns (address);

  function setEmergencyAdmin(address admin) external;

  function getPriceOracle() external view returns (address);

  function setPriceOracle(address priceOracle) external;

  function getLendingRateOracle() external view returns (address);

  function setLendingRateOracle(address lendingRateOracle) external;

  function getLiquidationFeeTo() external view returns (address);

  function setLiquidationFeeTo(address liquidationFeeTo) external;
}

File 6 of 6: SafeMath.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
  /**
   * @dev Returns the addition of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `+` operator.
   *
   * Requirements:
   * - Addition cannot overflow.
   */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, 'SafeMath: addition overflow');

    return c;
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting on
   * overflow (when the result is negative).
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   * - Subtraction cannot overflow.
   */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return sub(a, b, 'SafeMath: subtraction overflow');
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
   * overflow (when the result is negative).
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   * - Subtraction cannot overflow.
   */
  function sub(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    require(b <= a, errorMessage);
    uint256 c = a - b;

    return c;
  }

  /**
   * @dev Returns the multiplication of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `*` operator.
   *
   * Requirements:
   * - Multiplication cannot overflow.
   */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
    if (a == 0) {
      return 0;
    }

    uint256 c = a * b;
    require(c / a == b, 'SafeMath: multiplication overflow');

    return c;
  }

  /**
   * @dev Returns the integer division of two unsigned integers. Reverts on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator. Note: this function uses a
   * `revert` opcode (which leaves remaining gas untouched) while Solidity
   * uses an invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return div(a, b, 'SafeMath: division by zero');
  }

  /**
   * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator. Note: this function uses a
   * `revert` opcode (which leaves remaining gas untouched) while Solidity
   * uses an invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function div(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, errorMessage);
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * Reverts when dividing by zero.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    return mod(a, b, 'SafeMath: modulo by zero');
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * Reverts with custom message when dividing by zero.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function mod(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    require(b != 0, errorMessage);
    return a % b;
  }
}

Contract ABI

[{"inputs":[{"internalType":"contract ILendingPool","name":"_lendingPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BORROW_RATIO_DECIMALS","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":"returnRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"VDebtUnloop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getAToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getConfiguration","outputs":[{"components":[{"internalType":"uint256","name":"data","type":"uint256"}],"internalType":"struct DataTypes.ReserveConfigurationMap","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getVDebtToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lendingPool","outputs":[{"internalType":"contract ILendingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint256","name":"borrowRatio","type":"uint256"},{"internalType":"uint256","name":"loopCount","type":"uint256"}],"name":"loop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ltv","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"min","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b506040516111c53803806111c583398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b611134806100916000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80637ae2b5c7116100665780637ae2b5c7146101095780639c978eec1461011c578063a59a997314610124578063b5f293601461012c578063c44b11f71461013f57610093565b80632f23bfd814610098578063667f3745146100ad578063732a52ee146100d65780637473eea6146100e9575b600080fd5b6100ab6100a6366004610dad565b61015f565b005b6100c06100bb366004610d91565b6106e1565b6040516100cd9190610f8e565b60405180910390f35b6100c06100e4366004610d91565b610771565b6100fc6100f7366004610d91565b6107fe565b6040516100cd9190611098565b6100fc610117366004610f6d565b61088b565b6100fc6108a5565b6100c06108aa565b6100ab61013a366004610de7565b6108b9565b61015261014d366004610d91565b610b32565b6040516100cd919061108e565b600061016a85610771565b90506000610177866106e1565b90506000816001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016101a79190610f8e565b60206040518083038186803b1580156101bf57600080fd5b505afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610f55565b60005460405163095ea7b360e01b81529192506001600160a01b03808a169263095ea7b39261022e92169060001990600401610fc6565b602060405180830381600087803b15801561024857600080fd5b505af115801561025c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102809190610e2a565b5060005b848110156105e1578161041f576040516370a0823160e01b81526001600160a01b038516906370a08231906102bd903390600401610f8e565b60206040518083038186803b1580156102d557600080fd5b505afa1580156102e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030d9190610f55565b6040516323b872dd60e01b81529097506001600160a01b038516906323b872dd9061034090339030908c90600401610fa2565b602060405180830381600087803b15801561035a57600080fd5b505af115801561036e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103929190610e2a565b50600054604051631a4ca37b60e21b81526001600160a01b03909116906369328dec906103c7908b908b903090600401610fdf565b602060405180830381600087803b1580156103e157600080fd5b505af11580156103f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104199190610f55565b506105e1565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061044f90339030908c90600401610fa2565b602060405180830381600087803b15801561046957600080fd5b505af115801561047d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a19190610e2a565b50600054604051631a4ca37b60e21b81526001600160a01b03909116906369328dec906104d6908b908b903090600401610fdf565b602060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105289190610f55565b5060005460405163573ade8160e01b81526001600160a01b039091169063573ade8190610560908b908b90600290339060040161102f565b602060405180830381600087803b15801561057a57600080fd5b505af115801561058e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b29190610f55565b5090869003906105d76105d1876105cb8a612710610bba565b90610c13565b8361088b565b9650600101610284565b506040516370a0823160e01b81526001600160a01b0388169063a9059cbb90339083906370a0823190610618903090600401610f8e565b60206040518083038186803b15801561063057600080fd5b505afa158015610644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106689190610f55565b6040518363ffffffff1660e01b8152600401610685929190610fc6565b602060405180830381600087803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d79190610e2a565b5050505050505050565b600080546040516335ea6a7560e01b815282916001600160a01b0316906335ea6a7590610712908690600401610f8e565b6101806040518083038186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190610e65565b61012001519150505b919050565b600080546040516335ea6a7560e01b815282916001600160a01b0316906335ea6a75906107a2908690600401610f8e565b6101806040518083038186803b1580156107bb57600080fd5b505afa1580156107cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f39190610e65565b60e001519392505050565b6000805460405163c44b11f760e01b815282916001600160a01b03169063c44b11f79061082f908690600401610f8e565b60206040518083038186803b15801561084757600080fd5b505afa15801561085b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087f9190610e4a565b5161ffff169392505050565b600081831061089a578161089c565b825b90505b92915050565b600481565b6000546001600160a01b031681565b6040516323b872dd60e01b81526000906001600160a01b038716906323b872dd906108ec90339030908a90600401610fa2565b602060405180830381600087803b15801561090657600080fd5b505af115801561091a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093e9190610e2a565b5060005460405163095ea7b360e01b81526001600160a01b038881169263095ea7b392610975929091169060001990600401610fc6565b602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190610e2a565b5060005460405163e8eda9df60e01b81526001600160a01b039091169063e8eda9df906109fe908990899033908790600401611002565b600060405180830381600087803b158015610a1857600080fd5b505af1158015610a2c573d6000803e3d6000fd5b5050505060005b82811015610b2957610a4b6127106105cb8887610bba565b60005460405163a415bcad60e01b81529197506001600160a01b03169063a415bcad90610a84908a908a908a908890339060040161105a565b600060405180830381600087803b158015610a9e57600080fd5b505af1158015610ab2573d6000803e3d6000fd5b505060005460405163e8eda9df60e01b81526001600160a01b03909116925063e8eda9df9150610aec908a908a9033908890600401611002565b600060405180830381600087803b158015610b0657600080fd5b505af1158015610b1a573d6000803e3d6000fd5b50505050600181019050610a33565b50505050505050565b610b3a610cf2565b60005460405163c44b11f760e01b81526001600160a01b039091169063c44b11f790610b6a908590600401610f8e565b60206040518083038186803b158015610b8257600080fd5b505afa158015610b96573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089f9190610e4a565b600082610bc95750600061089f565b82820282848281610bd657fe5b041461089c5760405162461bcd60e51b81526004018080602001828103825260218152602001806110de6021913960400191505060405180910390fd5b600061089c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183610cdc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ca1578181015183820152602001610c89565b50505050905090810190601f168015610cce5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ce857fe5b0495945050505050565b6040518060200160405280600081525090565b805161076c816110c5565b600060208284031215610d21578081fd5b6040516020810181811067ffffffffffffffff82111715610d3e57fe5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff8116811461076c57600080fd5b805164ffffffffff8116811461076c57600080fd5b805160ff8116811461076c57600080fd5b600060208284031215610da2578081fd5b813561089c816110c5565b60008060008060808587031215610dc2578283fd5b8435610dcd816110c5565b966020860135965060408601359560600135945092505050565b600080600080600060a08688031215610dfe578081fd5b8535610e09816110c5565b97602087013597506040870135966060810135965060800135945092505050565b600060208284031215610e3b578081fd5b8151801515811461089c578182fd5b600060208284031215610e5b578081fd5b61089c8383610d10565b6000610180808385031215610e78578182fd5b610e81816110a1565b9050610e8d8484610d10565b8152610e9b60208401610d4b565b6020820152610eac60408401610d4b565b6040820152610ebd60608401610d4b565b6060820152610ece60808401610d4b565b6080820152610edf60a08401610d4b565b60a0820152610ef060c08401610d6b565b60c0820152610f0160e08401610d05565b60e0820152610100610f14818501610d05565b90820152610120610f26848201610d05565b90820152610140610f38848201610d05565b90820152610160610f4a848201610d80565b908201529392505050565b600060208284031215610f66578081fd5b5051919050565b60008060408385031215610f7f578182fd5b50508035926020909101359150565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6001600160a01b03948516815260208101939093529216604082015261ffff909116606082015260800190565b6001600160a01b03948516815260208101939093526040830191909152909116606082015260800190565b6001600160a01b0395861681526020810194909452604084019290925261ffff166060830152909116608082015260a00190565b9051815260200190565b90815260200190565b60405181810167ffffffffffffffff811182821017156110bd57fe5b604052919050565b6001600160a01b03811681146110da57600080fd5b5056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122018ec18d56433848d03a89cc00c6f490549dc636d476c701b71f983aa6008e3c364736f6c634300070600330000000000000000000000002032b9a8e9f7e76768ca9271003d3e43e1616b1f

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000002032b9a8e9f7e76768ca9271003d3e43e1616b1f

-----Decoded View---------------
Arg [0] : _lendingPool (address): 0x2032b9a8e9f7e76768ca9271003d3e43e1616b1f

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002032b9a8e9f7e76768ca9271003d3e43e1616b1f


Deployed ByteCode Sourcemap

166:4806:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3686:1283;;;;;;:::i;:::-;;:::i;:::-;;1035:217;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1476:202;;;;;;:::i;:::-;;:::i;1845:200::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;3291:109::-;;;;;;:::i;:::-;;:::i;233:49::-;;;:::i;329:31::-;;;:::i;2364:742::-;;;;;;:::i;:::-;;:::i;655:167::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;3686:1283::-;3841:14;3858:16;3868:5;3858:9;:16::i;:::-;3841:33;;3885:18;3906:20;3920:5;3906:13;:20::i;:::-;3885:41;;3937:23;3970:10;-1:-1:-1;;;;;3963:28:0;;3992:10;3963:40;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4044:11;;4014:62;;-1:-1:-1;;;4014:62:0;;3937:66;;-1:-1:-1;;;;;;4014:21:0;;;;;;:62;;4044:11;;-1:-1:-1;;4058:17:0;4014:62;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;4092:9;4087:790;4111:9;4107:1;:13;4087:790;;;4149:20;4145:375;;4212:36;;-1:-1:-1;;;4212:36:0;;-1:-1:-1;;;;;4212:24:0;;;;;:36;;4237:10;;4212:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4267:144;;-1:-1:-1;;;4267:144:0;;4203:45;;-1:-1:-1;;;;;;4267:27:0;;;;;:144;;4317:10;;4358:4;;4203:45;;4267:144;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;4430:11:0;;:50;;-1:-1:-1;;;4430:50:0;;-1:-1:-1;;;;;4430:11:0;;;;:20;;:50;;4451:5;;4458:6;;4474:4;;4430:50;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;4499:5;;4145:375;4534:62;;-1:-1:-1;;;4534:62:0;;-1:-1:-1;;;;;4534:27:0;;;;;:62;;4562:10;;4582:4;;4589:6;;4534:62;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;4611:11:0;;:50;;-1:-1:-1;;;4611:50:0;;-1:-1:-1;;;;;4611:11:0;;;;:20;;:50;;4632:5;;4639:6;;4655:4;;4611:50;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;4676:11:0;;:47;;-1:-1:-1;;;4676:47:0;;-1:-1:-1;;;;;4676:11:0;;;;:17;;:47;;4694:5;;4701:6;;4709:1;;4712:10;;4676:47;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;4738:25:0;;;;;4787:78;4791:56;4835:11;4791:39;4757:6;4802:27;4791:10;:39::i;:::-;:43;;:56::i;:::-;4849:15;4787:3;:78::i;:::-;4778:87;-1:-1:-1;4127:1:0;4122:6;4087:790;;;-1:-1:-1;4922:38:0;;-1:-1:-1;;;4922:38:0;;-1:-1:-1;;;;;4887:22:0;;;;;4910:10;;4887:22;;4922:23;;:38;;4954:4;;4922:38;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4887:74;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;3686:1283;;;;;;;:::o;1035:217::-;1094:7;1157:11;;:33;;-1:-1:-1;;;1157:33:0;;1094:7;;-1:-1:-1;;;;;1157:11:0;;:26;;:33;;1184:5;;1157:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1208:36;;;;-1:-1:-1;;1035:217:0;;;;:::o;1476:202::-;1531:7;1594:11;;:33;;-1:-1:-1;;;1594:33:0;;1531:7;;-1:-1:-1;;;;;1594:11:0;;:26;;:33;;1621:5;;1594:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1645:25;;;;1476:202;-1:-1:-1;;;1476:202:0:o;1845:200::-;1894:7;1963:11;;:35;;-1:-1:-1;;;1963:35:0;;1894:7;;-1:-1:-1;;;;;1963:11:0;;:28;;:35;;1992:5;;1963:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2016:9;:21;;;;-1:-1:-1;;;1845:200:0:o;3291:109::-;3347:7;3383:1;3379;:5;:13;;3391:1;3379:13;;;3387:1;3379:13;3372:20;;3291:109;;;;;:::o;233:49::-;281:1;233:49;:::o;329:31::-;;;-1:-1:-1;;;;;329:31:0;;:::o;2364:742::-;2581:61;;-1:-1:-1;;;2581:61:0;;2547:19;;-1:-1:-1;;;;;2581:26:0;;;;;:61;;2608:10;;2628:4;;2635:6;;2581:61;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2683:11:0;;2653:62;;-1:-1:-1;;;2653:62:0;;-1:-1:-1;;;;;2653:21:0;;;;;;:62;;2683:11;;;;-1:-1:-1;;2697:17:0;2653:62;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2726:11:0;;:60;;-1:-1:-1;;;2726:60:0;;-1:-1:-1;;;;;2726:11:0;;;;:19;;:60;;2746:5;;2753:6;;2761:10;;2773:12;;2726:60;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2802:9;2797:302;2821:9;2817:1;:13;2797:302;;;2864:56;2892:27;2864:23;:6;2875:11;2864:10;:23::i;:56::-;2935:11;;:77;;-1:-1:-1;;;2935:77:0;;2855:65;;-1:-1:-1;;;;;;2935:11:0;;:18;;:77;;2954:5;;2855:65;;2969:16;;2987:12;;3001:10;;2935:77;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3027:11:0;;:60;;-1:-1:-1;;;3027:60:0;;-1:-1:-1;;;;;3027:11:0;;;;-1:-1:-1;3027:19:0;;-1:-1:-1;3027:60:0;;3047:5;;3054:6;;3062:10;;3074:12;;3027:60;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2837:1;2832:6;;;;2797:302;;;;2364:742;;;;;;:::o;655:167::-;719:40;;:::i;:::-;779:11;;:35;;-1:-1:-1;;;779:35:0;;-1:-1:-1;;;;;779:11:0;;;;:28;;:35;;808:5;;779:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;2132:431:5:-;2190:7;2419:6;2415:37;;-1:-1:-1;2443:1:5;2436:8;;2415:37;2472:5;;;2476:1;2472;:5;:1;2492:5;;;;;:10;2484:56;;;;-1:-1:-1;;;2484:56:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3007:126;3065:7;3088:39;3092:1;3095;3088:39;;;;;;;;;;;;;;;;;3703:7;3797:12;3790:5;3782:28;;;;-1:-1:-1;;;3782:28:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3817:9;3833:1;3829;:5;;;;;;;3597:343;-1:-1:-1;;;;;3597:343:5:o;-1:-1:-1:-;;;;;;;;;;;;;;:::o;14:142:6:-;95:13;;117:33;95:13;117:33;:::i;161:428::-;;293:4;281:9;276:3;272:19;268:30;265:2;;;315:5;308;301:20;265:2;352;346:9;394:4;386:6;382:17;465:6;453:10;450:22;429:18;417:10;414:34;411:62;408:2;;;476:9;408:2;503;496:22;566:16;;551:32;;-1:-1:-1;536:6:6;255:334;-1:-1:-1;255:334:6:o;594:194::-;675:13;;728:34;717:46;;707:57;;697:2;;778:1;775;768:12;793:171;873:13;;926:12;915:24;;905:35;;895:2;;954:1;951;944:12;969:162;1048:13;;1101:4;1090:16;;1080:27;;1070:2;;1121:1;1118;1111:12;1136:259;;1248:2;1236:9;1227:7;1223:23;1219:32;1216:2;;;1269:6;1261;1254:22;1216:2;1313:9;1300:23;1332:33;1359:5;1332:33;:::i;1400:464::-;;;;;1563:3;1551:9;1542:7;1538:23;1534:33;1531:2;;;1585:6;1577;1570:22;1531:2;1629:9;1616:23;1648:33;1675:5;1648:33;:::i;:::-;1700:5;1752:2;1737:18;;1724:32;;-1:-1:-1;1803:2:6;1788:18;;1775:32;;1854:2;1839:18;1826:32;;-1:-1:-1;1521:343:6;-1:-1:-1;;;1521:343:6:o;1869:533::-;;;;;;2049:3;2037:9;2028:7;2024:23;2020:33;2017:2;;;2071:6;2063;2056:22;2017:2;2115:9;2102:23;2134:33;2161:5;2134:33;:::i;:::-;2186:5;2238:2;2223:18;;2210:32;;-1:-1:-1;2289:2:6;2274:18;;2261:32;;2340:2;2325:18;;2312:32;;-1:-1:-1;2391:3:6;2376:19;2363:33;;-1:-1:-1;2007:395:6;-1:-1:-1;;;2007:395:6:o;2407:297::-;;2527:2;2515:9;2506:7;2502:23;2498:32;2495:2;;;2548:6;2540;2533:22;2495:2;2585:9;2579:16;2638:5;2631:13;2624:21;2617:5;2614:32;2604:2;;2665:6;2657;2650:22;2709:293;;2872:2;2860:9;2851:7;2847:23;2843:32;2840:2;;;2893:6;2885;2878:22;2840:2;2921:75;2988:7;2977:9;2921:75;:::i;3007:1389::-;;3136:3;3180:2;3168:9;3159:7;3155:23;3151:32;3148:2;;;3201:6;3193;3186:22;3148:2;3232:18;3247:2;3232:18;:::i;:::-;3219:31;;3273:75;3340:7;3329:9;3273:75;:::i;:::-;3266:5;3259:90;3381:51;3428:2;3417:9;3413:18;3381:51;:::i;:::-;3376:2;3369:5;3365:14;3358:75;3465:51;3512:2;3501:9;3497:18;3465:51;:::i;:::-;3460:2;3453:5;3449:14;3442:75;3549:51;3596:2;3585:9;3581:18;3549:51;:::i;:::-;3544:2;3537:5;3533:14;3526:75;3634:52;3681:3;3670:9;3666:19;3634:52;:::i;:::-;3628:3;3621:5;3617:15;3610:77;3720:52;3767:3;3756:9;3752:19;3720:52;:::i;:::-;3714:3;3707:5;3703:15;3696:77;3806:51;3852:3;3841:9;3837:19;3806:51;:::i;:::-;3800:3;3793:5;3789:15;3782:76;3891:52;3938:3;3927:9;3923:19;3891:52;:::i;:::-;3885:3;3878:5;3874:15;3867:77;3963:3;3998:51;4045:2;4034:9;4030:18;3998:51;:::i;:::-;3982:14;;;3975:75;4069:3;4104:51;4136:18;;;4104:51;:::i;:::-;4088:14;;;4081:75;4175:3;4210:51;4242:18;;;4210:51;:::i;:::-;4194:14;;;4187:75;4281:3;4316:49;4346:18;;;4316:49;:::i;:::-;4300:14;;;4293:73;4304:5;3116:1280;-1:-1:-1;;;3116:1280:6:o;4401:194::-;;4524:2;4512:9;4503:7;4499:23;4495:32;4492:2;;;4545:6;4537;4530:22;4492:2;-1:-1:-1;4573:16:6;;4482:113;-1:-1:-1;4482:113:6:o;4600:258::-;;;4729:2;4717:9;4708:7;4704:23;4700:32;4697:2;;;4750:6;4742;4735:22;4697:2;-1:-1:-1;;4778:23:6;;;4848:2;4833:18;;;4820:32;;-1:-1:-1;4687:171:6:o;4863:203::-;-1:-1:-1;;;;;5027:32:6;;;;5009:51;;4997:2;4982:18;;4964:102::o;5287:383::-;-1:-1:-1;;;;;5553:15:6;;;5535:34;;5605:15;;;;5600:2;5585:18;;5578:43;5652:2;5637:18;;5630:34;;;;5485:2;5470:18;;5452:218::o;5675:282::-;-1:-1:-1;;;;;5875:32:6;;;;5857:51;;5939:2;5924:18;;5917:34;5845:2;5830:18;;5812:145::o;6241:375::-;-1:-1:-1;;;;;6499:15:6;;;6481:34;;6546:2;6531:18;;6524:34;;;;6594:15;;;6589:2;6574:18;;6567:43;6431:2;6416:18;;6398:218::o;6621:466::-;-1:-1:-1;;;;;6914:15:6;;;6896:34;;6961:2;6946:18;;6939:34;;;;7009:15;;7004:2;6989:18;;6982:43;7073:6;7061:19;;;7056:2;7041:18;;7034:47;6845:3;6830:19;;6812:275::o;7092:463::-;-1:-1:-1;;;;;7395:15:6;;;7377:34;;7442:2;7427:18;;7420:34;;;;7485:2;7470:18;;7463:34;;;;7533:15;;;7528:2;7513:18;;7506:43;7326:3;7311:19;;7293:262::o;7560:538::-;-1:-1:-1;;;;;7881:15:6;;;7863:34;;7928:2;7913:18;;7906:34;;;;7971:2;7956:18;;7949:34;;;;8031:6;8019:19;8014:2;7999:18;;7992:47;8076:15;;;8070:3;8055:19;;8048:44;7812:3;7797:19;;7779:319::o;8331:264::-;8575:13;;8557:32;;8545:2;8530:18;;8512:83::o;8600:177::-;8746:25;;;8734:2;8719:18;;8701:76::o;8782:242::-;8852:2;8846:9;8882:17;;;8929:18;8914:34;;8950:22;;;8911:62;8908:2;;;8976:9;8908:2;9003;8996:22;8826:198;;-1:-1:-1;8826:198:6:o;9029:133::-;-1:-1:-1;;;;;9106:31:6;;9096:42;;9086:2;;9152:1;9149;9142:12;9086:2;9076:86;:::o

Metadata Hash

18ec18d56433848d03a89cc00c6f490549dc636d476c701b71f983aa6008e3c3
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.