Goerli Testnet

Contract

0x28b413F9f09fBA829A4C0B43783541373Ee3F6C3

Overview

ETH Balance

0 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
0x6101206080366942022-11-28 15:33:36459 days ago1669649616IN
 Create: FlashStrategyAAVEv2
0 ETH0.0218583512.81637484

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
96837272023-09-12 20:29:48171 days ago1694550588
0x28b413F9...73Ee3F6C3
0 ETH
96837272023-09-12 20:29:48171 days ago1694550588
0x28b413F9...73Ee3F6C3
0 ETH
96836462023-09-12 20:08:24171 days ago1694549304
0x28b413F9...73Ee3F6C3
0 ETH
96836462023-09-12 20:08:24171 days ago1694549304
0x28b413F9...73Ee3F6C3
0 ETH
96836462023-09-12 20:08:24171 days ago1694549304
0x28b413F9...73Ee3F6C3
0 ETH
96836462023-09-12 20:08:24171 days ago1694549304
0x28b413F9...73Ee3F6C3
0 ETH
96836432023-09-12 20:07:36171 days ago1694549256
0x28b413F9...73Ee3F6C3
0 ETH
96836432023-09-12 20:07:36171 days ago1694549256
0x28b413F9...73Ee3F6C3
0 ETH
96836432023-09-12 20:07:36171 days ago1694549256
0x28b413F9...73Ee3F6C3
0 ETH
96836062023-09-12 19:58:36171 days ago1694548716
0x28b413F9...73Ee3F6C3
0 ETH
96836062023-09-12 19:58:36171 days ago1694548716
0x28b413F9...73Ee3F6C3
0 ETH
96836062023-09-12 19:58:36171 days ago1694548716
0x28b413F9...73Ee3F6C3
0 ETH
96836062023-09-12 19:58:36171 days ago1694548716
0x28b413F9...73Ee3F6C3
0 ETH
96835942023-09-12 19:55:36171 days ago1694548536
0x28b413F9...73Ee3F6C3
0 ETH
96835942023-09-12 19:55:36171 days ago1694548536
0x28b413F9...73Ee3F6C3
0 ETH
96835942023-09-12 19:55:36171 days ago1694548536
0x28b413F9...73Ee3F6C3
0 ETH
96835332023-09-12 19:41:12171 days ago1694547672
0x28b413F9...73Ee3F6C3
0 ETH
96835332023-09-12 19:41:12171 days ago1694547672
0x28b413F9...73Ee3F6C3
0 ETH
96835332023-09-12 19:41:12171 days ago1694547672
0x28b413F9...73Ee3F6C3
0 ETH
96835332023-09-12 19:41:12171 days ago1694547672
0x28b413F9...73Ee3F6C3
0 ETH
91791362023-06-14 20:16:48261 days ago1686773808
0x28b413F9...73Ee3F6C3
0 ETH
91791362023-06-14 20:16:48261 days ago1686773808
0x28b413F9...73Ee3F6C3
0 ETH
91791362023-06-14 20:16:48261 days ago1686773808
0x28b413F9...73Ee3F6C3
0 ETH
91791362023-06-14 20:16:48261 days ago1686773808
0x28b413F9...73Ee3F6C3
0 ETH
91791362023-06-14 20:16:48261 days ago1686773808
0x28b413F9...73Ee3F6C3
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FlashStrategyAAVEv2

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : FlashStrategyAAVEv2.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/AAVE/ILendingPool.sol";
import "../interfaces/AAVE/IAaveIncentivesController.sol";
import "../interfaces/IFlashStrategy.sol";
import "../interfaces/IUserIncentive.sol";
import "../interfaces/IFlashFToken.sol";

contract FlashStrategyAAVEv2 is IFlashStrategy, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    address immutable flashProtocolAddress;
    address immutable lendingPoolAddress; // The AAVE V2 lending pool address
    address immutable principalTokenAddress; // The Principal token address (eg DAI)
    address immutable interestBearingTokenAddress; // The AAVE V2 interest bearing token address
    uint8 immutable principalDecimals;

    address fTokenAddress; // The Flash fERC20 token address
    uint16 referralCode = 0; // The AAVE V2 referral code
    uint256 principalBalance; // The amount of principal in this strategy
    address constant aaveIncentivesAddress = 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5;

    address public userIncentiveAddress;
    bool public userIncentiveAddressLocked;

    uint256 maxStakeDuration = 63072000; // Maximum stake duration for this strategy
    bool public maxStakeDurationLocked = false; // Determines if the above variable is locked (stop future updates)

    constructor(
        address _lendingPoolAddress,
        address _principalTokenAddress,
        address _interestBearingTokenAddress,
        address _flashProtocolAddress
    ) public {
        lendingPoolAddress = _lendingPoolAddress;
        principalTokenAddress = _principalTokenAddress;
        interestBearingTokenAddress = _interestBearingTokenAddress;
        flashProtocolAddress = _flashProtocolAddress;

        // Read the number of decimals from the principal token
        principalDecimals = IFlashFToken(principalTokenAddress).decimals();

        increaseAllowance();
    }

    // Implemented as a separate function just in case the strategy ever runs out of allowance
    function increaseAllowance() public {
        IERC20(principalTokenAddress).safeApprove(lendingPoolAddress, 0);
        IERC20(principalTokenAddress).safeApprove(lendingPoolAddress, type(uint256).max);
    }

    function depositPrincipal(uint256 _tokenAmount) external override onlyAuthorised returns (uint256) {
        // Register how much we are depositing
        principalBalance = principalBalance + _tokenAmount;

        // Deposit into AAVE
        ILendingPool(lendingPoolAddress).deposit(principalTokenAddress, _tokenAmount, address(this), referralCode);

        return _tokenAmount;
    }

    function withdrawYield(uint256 _tokenAmount) private {
        // Withdraw from AAVE
        uint256 returnedTokens = ILendingPool(lendingPoolAddress).withdraw(
            principalTokenAddress,
            _tokenAmount,
            address(this)
        );
        require(returnedTokens >= _tokenAmount);

        uint256 aTokenBalance = IERC20(interestBearingTokenAddress).balanceOf(address(this));
        require(aTokenBalance >= getPrincipalBalance(), "PRINCIPAL BALANCE INVALID");
    }

    function withdrawPrincipal(uint256 _tokenAmount) external override onlyAuthorised {
        // Withdraw from AAVE
        uint256 returnedTokens = ILendingPool(lendingPoolAddress).withdraw(
            principalTokenAddress,
            _tokenAmount,
            address(this)
        );
        require(returnedTokens >= _tokenAmount);

        IERC20(principalTokenAddress).safeTransfer(msg.sender, _tokenAmount);

        principalBalance = principalBalance - _tokenAmount;
    }

    function withdrawERC20(address[] calldata _tokenAddresses, uint256[] calldata _tokenAmounts) external onlyOwner {
        require(_tokenAddresses.length == _tokenAmounts.length, "ARRAY SIZE MISMATCH");

        for (uint256 i = 0; i < _tokenAddresses.length; i++) {
            // Ensure the token being withdrawn is not the interest bearing token
            require(_tokenAddresses[i] != interestBearingTokenAddress, "TOKEN ADDRESS PROHIBITED");

            // Transfer the token to the caller
            IERC20(_tokenAddresses[i]).safeTransfer(msg.sender, _tokenAmounts[i]);
        }
    }

    function getPrincipalBalance() public view override returns (uint256) {
        return principalBalance;
    }

    function getYieldBalance() public view override returns (uint256) {
        uint256 interestBearingTokenBalance = IERC20(interestBearingTokenAddress).balanceOf(address(this));

        return (interestBearingTokenBalance - getPrincipalBalance());
    }

    function getPrincipalAddress() external view override returns (address) {
        return principalTokenAddress;
    }

    function getFTokenAddress() external view returns (address) {
        return fTokenAddress;
    }

    function setFTokenAddress(address _fTokenAddress) external override onlyAuthorised {
        require(fTokenAddress == address(0), "FTOKEN ADDRESS ALREADY SET");
        fTokenAddress = _fTokenAddress;
    }

    function quoteMintFToken(uint256 _tokenAmount, uint256 _duration) external view override returns (uint256) {
        // Enforce minimum _duration
        require(_duration >= 60, "DURATION TOO LOW");

        // 1 ERC20 for 365 DAYS = 1 fERC20
        // 1 second = 0.000000031709792000
        // eg (100000000000000000 * (1 second * 31709792000)) / 10**18
        // eg (1000000 * (1 second * 31709792000)) / 10**6
        uint256 amountToMint = (_tokenAmount * (_duration * 31709792000)) / (10**principalDecimals);

        require(amountToMint > 0, "INSUFFICIENT OUTPUT");

        return amountToMint;
    }

    function quoteBurnFToken(uint256 _tokenAmount) public view override returns (uint256) {
        uint256 totalSupply = IERC20(fTokenAddress).totalSupply();
        require(totalSupply > 0, "INSUFFICIENT fERC20 TOKEN SUPPLY");

        if (_tokenAmount > totalSupply) {
            _tokenAmount = totalSupply;
        }

        // Calculate the percentage of _tokenAmount vs totalSupply provided
        // and multiply by total yield
        return (getYieldBalance() * _tokenAmount) / totalSupply;
    }

    function burnFToken(
        uint256 _tokenAmount,
        uint256 _minimumReturned,
        address _yieldTo
    ) external override nonReentrant returns (uint256) {
        // Calculate how much yield to give back
        uint256 tokensOwed = quoteBurnFToken(_tokenAmount);
        require(tokensOwed >= _minimumReturned && tokensOwed > 0, "INSUFFICIENT OUTPUT");

        // Transfer fERC20 (from caller) tokens to contract so we can burn them
        IFlashFToken(fTokenAddress).burnFrom(msg.sender, _tokenAmount);

        withdrawYield(tokensOwed);
        IERC20(principalTokenAddress).safeTransfer(_yieldTo, tokensOwed);

        // Distribute rewards if there is a reward balance within contract
        if (userIncentiveAddress != address(0)) {
            IUserIncentive(userIncentiveAddress).claimReward(_tokenAmount, _yieldTo);
        }

        emit BurnedFToken(msg.sender, _tokenAmount, tokensOwed);

        return tokensOwed;
    }

    modifier onlyAuthorised() {
        require(msg.sender == flashProtocolAddress || msg.sender == address(this), "NOT FLASH PROTOCOL");
        _;
    }

    function getMaxStakeDuration() public view override returns (uint256) {
        return maxStakeDuration;
    }

    function claimAAVEv2Rewards(address[] calldata _assets, uint256 _amount) external onlyOwner {
        IAaveIncentivesController(aaveIncentivesAddress).claimRewards(_assets, _amount, address(this));
    }

    // @notice sets the new maximum stake duration
    // @dev this can only be called by the strategy owner
    function setMaxStakeDuration(uint256 _newMaxStakeDuration) external onlyOwner {
        require(maxStakeDurationLocked == false);
        maxStakeDuration = _newMaxStakeDuration;
    }

    // @notice permanently locks the max stake duration
    // @dev this can only be called by the strategy owner
    function lockMaxStakeDuration() external onlyOwner {
        maxStakeDurationLocked = true;
    }

    // @notice set the new user incentive address
    // @dev this can only be called by the strategy owner
    function setUserIncentiveAddress(address _userIncentiveAddress) external onlyOwner {
        require(userIncentiveAddressLocked == false);
        userIncentiveAddress = _userIncentiveAddress;
    }

    // @notice permanently locks the user incentive address
    // @dev this can only be called by the strategy owner
    function lockSetUserIncentiveAddress() external onlyOwner {
        userIncentiveAddressLocked = true;
    }
}

File 2 of 15 : IUserIncentive.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IUserIncentive {
    event RewardClaimed(address _rewardToken, address indexed _address);

    // This will be called by the Strategy to claim rewards for the user
    // This should be permissioned such that only the Strategy address can call
    function claimReward(uint256 _fERC20Burned, address _yieldTo) external;

    // This is a view function to determine how many reward tokens will be paid out
    // providing ??? fERC20 tokens are burned
    function quoteReward(uint256 _fERC20Burned) external view returns (uint256);

    // Administrator: setting the reward ratio
    function setRewardRatio(uint256 _ratio) external;

    // Administrator: adding the reward tokens
    function addRewardTokens(uint256 _tokenAmount) external;

    // Administrator: depositing the reward tokens
    function depositReward(
        address _rewardTokenAddress,
        uint256 _tokenAmount,
        uint256 _ratio
    ) external;
}

File 3 of 15 : IFlashStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IFlashStrategy {
    event BurnedFToken(address indexed _address, uint256 _tokenAmount, uint256 _yieldReturned);

    // This is how principal will be deposited into the contract
    // The Flash protocol allows the strategy to specify how much
    // should be registered. This allows the strategy to manipulate (eg take fee)
    // on the principal if the strategy requires
    function depositPrincipal(uint256 _tokenAmount) external returns (uint256);

    // This is how principal will be returned from the contract
    function withdrawPrincipal(uint256 _tokenAmount) external;

    // Responsible for instant upfront yield. Takes fERC20 tokens specific to this
    // strategy. The strategy is responsible for returning some amount of principal tokens
    function burnFToken(
        uint256 _tokenAmount,
        uint256 _minimumReturned,
        address _yieldTo
    ) external returns (uint256);

    // This should return the current total of all principal within the contract
    function getPrincipalBalance() external view returns (uint256);

    // This should return the current total of all yield generated to date (including bootstrapped tokens)
    function getYieldBalance() external view returns (uint256);

    // This should return the principal token address (eg DAI)
    function getPrincipalAddress() external view returns (address);

    // View function which quotes how many principal tokens would be returned if x
    // fERC20 tokens are burned
    function quoteMintFToken(uint256 _tokenAmount, uint256 duration) external view returns (uint256);

    // View function which quotes how many principal tokens would be returned if x
    // fERC20 tokens are burned
    // IMPORTANT NOTE: This should utilise bootstrap tokens if they exist
    // bootstrapped tokens are any principal tokens that exist within the smart contract
    function quoteBurnFToken(uint256 _tokenAmount) external view returns (uint256);

    // The function to set the fERC20 address within the strategy
    function setFTokenAddress(address _fTokenAddress) external;

    // This should return what the maximum stake duration is
    function getMaxStakeDuration() external view returns (uint256);
}

File 4 of 15 : IFlashFToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IFlashFToken {
    function mint(address account, uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;

    function decimals() external returns (uint8);
}

File 5 of 15 : IAaveIncentivesController.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;
pragma experimental ABIEncoderV2;

interface IAaveIncentivesController {
    event RewardsAccrued(address indexed user, uint256 amount);

    event RewardsClaimed(address indexed user, address indexed to, uint256 amount);

    event RewardsClaimed(address indexed user, address indexed to, address indexed claimer, uint256 amount);

    event ClaimerSet(address indexed user, address indexed claimer);

    /*
     * @dev Returns the configuration of the distribution for a certain asset
     * @param asset The address of the reference asset of the distribution
     * @return The asset index, the emission per second and the last updated timestamp
     **/
    function getAssetData(address asset)
        external
        view
        returns (
            uint256,
            uint256,
            uint256
        );

    /*
     * LEGACY **************************
     * @dev Returns the configuration of the distribution for a certain asset
     * @param asset The address of the reference asset of the distribution
     * @return The asset index, the emission per second and the last updated timestamp
     **/
    function assets(address asset)
        external
        view
        returns (
            uint128,
            uint128,
            uint256
        );

    /**
     * @dev Whitelists an address to claim the rewards on behalf of another address
     * @param user The address of the user
     * @param claimer The address of the claimer
     */
    function setClaimer(address user, address claimer) external;

    /**
     * @dev Returns the whitelisted claimer for a certain address (0x0 if not set)
     * @param user The address of the user
     * @return The claimer address
     */
    function getClaimer(address user) external view returns (address);

    /**
     * @dev Configure assets for a certain rewards emission
     * @param assets The assets to incentivize
     * @param emissionsPerSecond The emission for each asset
     */
    function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond) external;

    /**
     * @dev Called by the corresponding asset on any update that affects the rewards distribution
     * @param asset The address of the user
     * @param userBalance The balance of the user of the asset in the lending pool
     * @param totalSupply The total supply of the asset in the lending pool
     **/
    function handleAction(
        address asset,
        uint256 userBalance,
        uint256 totalSupply
    ) external;

    /**
     * @dev Returns the total of rewards of an user, already accrued + not yet accrued
     * @param user The address of the user
     * @return The rewards
     **/
    function getRewardsBalance(address[] calldata assets, address user) external view returns (uint256);

    /**
     * @dev Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards
     * @param amount Amount of rewards to claim
     * @param to Address that will be receiving the rewards
     * @return Rewards claimed
     **/
    function claimRewards(
        address[] calldata assets,
        uint256 amount,
        address to
    ) external returns (uint256);

    /**
     * @dev Claims reward for an user on behalf, on all the assets of the lending pool, accumulating the pending rewards. The caller must
     * be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager
     * @param amount Amount of rewards to claim
     * @param user Address to check and claim rewards
     * @param to Address that will be receiving the rewards
     * @return Rewards claimed
     **/
    function claimRewardsOnBehalf(
        address[] calldata assets,
        uint256 amount,
        address user,
        address to
    ) external returns (uint256);

    /**
     * @dev returns the unclaimed rewards of the user
     * @param user the address of the user
     * @return the unclaimed user rewards
     */
    function getUserUnclaimedRewards(address user) external view returns (uint256);

    /**
     * @dev returns the unclaimed rewards of the user
     * @param user the address of the user
     * @param asset The asset to incentivize
     * @return the user index for the asset
     */
    function getUserAssetData(address user, address asset) external view returns (uint256);

    /**
     * @dev for backward compatibility with previous implementation of the Incentives controller
     */
    function REWARD_TOKEN() external view returns (address);

    /**
     * @dev for backward compatibility with previous implementation of the Incentives controller
     */
    function PRECISION() external view returns (uint8);

    /**
     * @dev Gets the distribution end timestamp of the emissions
     */
    function DISTRIBUTION_END() external view returns (uint256);
}

File 6 of 15 : ILendingPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;
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 7 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }
}

File 8 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 9 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
}

File 10 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 11 of 15 : ILendingPoolAddressesProvider.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

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

File 12 of 15 : DataTypes.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

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 13 of 15 : Context.sol
// 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;
    }
}

File 14 of 15 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 15 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lendingPoolAddress","type":"address"},{"internalType":"address","name":"_principalTokenAddress","type":"address"},{"internalType":"address","name":"_interestBearingTokenAddress","type":"address"},{"internalType":"address","name":"_flashProtocolAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_yieldReturned","type":"uint256"}],"name":"BurnedFToken","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"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint256","name":"_minimumReturned","type":"uint256"},{"internalType":"address","name":"_yieldTo","type":"address"}],"name":"burnFToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_assets","type":"address[]"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"claimAAVEv2Rewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"depositPrincipal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxStakeDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrincipalAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrincipalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getYieldBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"increaseAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockMaxStakeDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockSetUserIncentiveAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxStakeDurationLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"quoteBurnFToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"quoteMintFToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fTokenAddress","type":"address"}],"name":"setFTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxStakeDuration","type":"uint256"}],"name":"setMaxStakeDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_userIncentiveAddress","type":"address"}],"name":"setUserIncentiveAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userIncentiveAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"userIncentiveAddressLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokenAddresses","type":"address[]"},{"internalType":"uint256[]","name":"_tokenAmounts","type":"uint256[]"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"withdrawPrincipal","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101206040526002805461ffff60a01b191690556303c267006005556006805460ff191690553480156200003257600080fd5b5060405162002326380380620023268339810160408190526200005591620005af565b620000603362000115565b600180556001600160a01b0380851660a05283811660c081905283821660e0529082166080526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181600087803b158015620000bf57600080fd5b505af1158015620000d4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000fa91906200060c565b60ff16610100526200010b62000165565b50505050620006f5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6200018f60a051600060c0516001600160a01b0316620001bc60201b62001048179092919060201c565b620001ba60a05160001960c0516001600160a01b0316620001bc60201b62001048179092919060201c565b565b8015806200024a5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156200020d57600080fd5b505afa15801562000222573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000248919062000631565b155b620002c25760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200031a9185916200031f16565b505050565b60006200037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620003fd60201b620011d8179092919060201c565b8051909150156200031a57808060200190518101906200039c91906200064b565b6200031a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620002b9565b60606200040e848460008562000418565b90505b9392505050565b6060824710156200047b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620002b9565b6001600160a01b0385163b620004d45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620002b9565b600080866001600160a01b03168587604051620004f29190620006a2565b60006040518083038185875af1925050503d806000811462000531576040519150601f19603f3d011682016040523d82523d6000602084013e62000536565b606091505b5090925090506200054982828662000554565b979650505050505050565b606083156200056557508162000411565b825115620005765782518084602001fd5b8160405162461bcd60e51b8152600401620002b99190620006c0565b80516001600160a01b0381168114620005aa57600080fd5b919050565b60008060008060808587031215620005c657600080fd5b620005d18562000592565b9350620005e16020860162000592565b9250620005f16040860162000592565b9150620006016060860162000592565b905092959194509250565b6000602082840312156200061f57600080fd5b815160ff811681146200041157600080fd5b6000602082840312156200064457600080fd5b5051919050565b6000602082840312156200065e57600080fd5b815180151581146200041157600080fd5b60005b838110156200068c57818101518382015260200162000672565b838111156200069c576000848401525b50505050565b60008251620006b68184602087016200066f565b9190910192915050565b6020815260008251806020840152620006e18160408501602087016200066f565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051611b83620007a36000396000610aa70152600081816103dd0152818161054a015261136d015260008181610233015281816107b90152818161092b015281816109fd01528181610dc801528181610e1d01528181610f02015261129001526000818161096301528181610dea01528181610e3f01528181610f5101526112c80152600081816108a801528181610cc70152610e730152611b836000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c8063658e28a4116100e35780638da5cb5b1161008c578063ed91f1d011610066578063ed91f1d014610329578063ef8d496414610331578063f2fde38b1461034457600080fd5b80638da5cb5b146102f2578063cec833a914610303578063e68c84cb1461031657600080fd5b80637b027af0116100bd5780637b027af0146102c45780638997c1f4146102d75780638b4fd515146102ea57600080fd5b8063658e28a4146102a1578063715018a6146102b457806376972999146102bc57600080fd5b806345ed7f33116101455780634cae6edc1161011f5780634cae6edc14610267578063580d2b5d1461027b578063594cc6861461028e57600080fd5b806345ed7f33146102315780634756ce0d14610257578063489cc20c1461025f57600080fd5b8063272d28ca11610176578063272d28ca146101dc5780633b28e4181461020157806344f049111461021457600080fd5b806308aae3301461019d57806318819022146101b2578063202f2a27146101c5575b600080fd5b6101b06101ab36600461170c565b610357565b005b6101b06101c0366004611771565b610374565b6003545b6040519081526020015b60405180910390f35b6002546001600160a01b03165b6040516001600160a01b0390911681526020016101d3565b6004546101e9906001600160a01b031681565b6006546102219060ff1681565b60405190151581526020016101d3565b7f00000000000000000000000000000000000000000000000000000000000000006101e9565b6101b06104f0565b6101c9610528565b60045461022190600160a01b900460ff1681565b6101b06102893660046117dd565b6105df565b6101c961029c366004611840565b61067c565b6101b06102af36600461170c565b61089d565b6101b0610a39565b6005546101c9565b6101c96102d2366004611875565b610a4d565b6101b06102e5366004611897565b610b4b565b6101b0610b99565b6000546001600160a01b03166101e9565b6101c961031136600461170c565b610bb0565b6101b0610324366004611897565b610cbc565b6101b0610dbb565b6101c961033f36600461170c565b610e66565b6101b0610352366004611897565b610fb8565b61035f6111ef565b60065460ff161561036f57600080fd5b600555565b61037c6111ef565b8281146103d05760405162461bcd60e51b815260206004820152601360248201527f41525241592053495a45204d49534d415443480000000000000000000000000060448201526064015b60405180910390fd5b60005b838110156104e9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316858583818110610417576104176118b2565b905060200201602081019061042c9190611897565b6001600160a01b031614156104835760405162461bcd60e51b815260206004820152601860248201527f544f4b454e20414444524553532050524f48494249544544000000000000000060448201526064016103c7565b6104d733848484818110610499576104996118b2565b905060200201358787858181106104b2576104b26118b2565b90506020020160208101906104c79190611897565b6001600160a01b03169190611249565b806104e1816118de565b9150506103d3565b5050505050565b6104f86111ef565b600480547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b15801561058c57600080fd5b505afa1580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c491906118f9565b90506105cf60035490565b6105d99082611912565b91505090565b6105e76111ef565b604051633111e7b360e01b815273d784927ff2f95ba542bfc824c8a8a98f3495f6b590633111e7b390610624908690869086903090600401611929565b602060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067691906118f9565b50505050565b6000600260015414156106d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103c7565b600260015560006106e185610bb0565b90508381101580156106f35750600081115b61073f5760405162461bcd60e51b815260206004820152601360248201527f494e53554646494349454e54204f55545055540000000000000000000000000060448201526064016103c7565b60025460405163079cc67960e41b8152336004820152602481018790526001600160a01b03909116906379cc679090604401600060405180830381600087803b15801561078b57600080fd5b505af115801561079f573d6000803e3d6000fd5b505050506107ac81611279565b6107e06001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611249565b6004546001600160a01b031615610856576004805460405163738759c960e11b81529182018790526001600160a01b038581166024840152169063e70eb39290604401600060405180830381600087803b15801561083d57600080fd5b505af1158015610851573d6000803e3d6000fd5b505050505b604080518681526020810183905233917f931033e43a2977753dbe3de2347d53265c3a695c82b3fa009dd57e06d6a20503910160405180910390a260018055949350505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806108d357503330145b6109145760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b604051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390523060448301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec90606401602060405180830381600087803b1580156109a957600080fd5b505af11580156109bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e191906118f9565b9050818110156109f057600080fd5b610a246001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384611249565b81600354610a329190611912565b6003555050565b610a416111ef565b610a4b6000611449565b565b6000603c821015610aa05760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e20544f4f204c4f570000000000000000000000000000000060448201526064016103c7565b6000610acd7f0000000000000000000000000000000000000000000000000000000000000000600a611a71565b610adc846407620d0700611a80565b610ae69086611a80565b610af09190611a9f565b905060008111610b425760405162461bcd60e51b815260206004820152601360248201527f494e53554646494349454e54204f55545055540000000000000000000000000060448201526064016103c7565b90505b92915050565b610b536111ef565b600454600160a01b900460ff1615610b6a57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610ba16111ef565b6006805460ff19166001179055565b600080600260009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0157600080fd5b505afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3991906118f9565b905060008111610c8b5760405162461bcd60e51b815260206004820181905260248201527f494e53554646494349454e542066455243323020544f4b454e20535550504c5960448201526064016103c7565b80831115610c97578092505b8083610ca1610528565b610cab9190611a80565b610cb59190611a9f565b9392505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610cf257503330145b610d335760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b6002546001600160a01b031615610d8c5760405162461bcd60e51b815260206004820152601a60248201527f46544f4b454e204144445245535320414c52454144592053455400000000000060448201526064016103c7565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610e106001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000006000611048565b610a4b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000600019611048565b6000336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e9e57503330145b610edf5760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b81600354610eed9190611ac1565b60035560025460405163e8eda9df60e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116600483015260248201859052306044830152600160a01b90920461ffff1660648201527f00000000000000000000000000000000000000000000000000000000000000009091169063e8eda9df90608401600060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050508190505b919050565b610fc06111ef565b6001600160a01b03811661103c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103c7565b61104581611449565b50565b8015806110d15750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf91906118f9565b155b6111435760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103c7565b6040516001600160a01b0383166024820152604481018290526111d390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526114a6565b505050565b60606111e7848460008561158b565b949350505050565b6000546001600160a01b03163314610a4b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c7565b6040516001600160a01b0383166024820152604481018290526111d390849063a9059cbb60e01b9060640161116f565b604051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390523060448301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906369328dec90606401602060405180830381600087803b15801561130e57600080fd5b505af1158015611322573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134691906118f9565b90508181101561135557600080fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b1580156113b757600080fd5b505afa1580156113cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ef91906118f9565b90506113fa60035490565b8110156111d35760405162461bcd60e51b815260206004820152601960248201527f5052494e434950414c2042414c414e434520494e56414c49440000000000000060448201526064016103c7565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006114fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111d89092919063ffffffff16565b8051909150156111d357808060200190518101906115199190611ad9565b6111d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103c7565b6060824710156116035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103c7565b6001600160a01b0385163b61165a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c7565b600080866001600160a01b031685876040516116769190611b27565b60006040518083038185875af1925050503d80600081146116b3576040519150601f19603f3d011682016040523d82523d6000602084013e6116b8565b606091505b50915091506116c88282866116d3565b979650505050505050565b606083156116e2575081610cb5565b8251156116f25782518084602001fd5b8160405162461bcd60e51b81526004016103c79190611b43565b60006020828403121561171e57600080fd5b5035919050565b60008083601f84011261173757600080fd5b50813567ffffffffffffffff81111561174f57600080fd5b6020830191508360208260051b850101111561176a57600080fd5b9250929050565b6000806000806040858703121561178757600080fd5b843567ffffffffffffffff8082111561179f57600080fd5b6117ab88838901611725565b909650945060208701359150808211156117c457600080fd5b506117d187828801611725565b95989497509550505050565b6000806000604084860312156117f257600080fd5b833567ffffffffffffffff81111561180957600080fd5b61181586828701611725565b909790965060209590950135949350505050565b80356001600160a01b0381168114610fb357600080fd5b60008060006060848603121561185557600080fd5b833592506020840135915061186c60408501611829565b90509250925092565b6000806040838503121561188857600080fd5b50508035926020909101359150565b6000602082840312156118a957600080fd5b610cb582611829565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156118f2576118f26118c8565b5060010190565b60006020828403121561190b57600080fd5b5051919050565b600082821015611924576119246118c8565b500390565b6060808252810184905260008560808301825b8781101561196a576001600160a01b0361195584611829565b1682526020928301929091019060010161193c565b50602084019590955250506001600160a01b039190911660409091015292915050565b600181815b808511156119c85781600019048211156119ae576119ae6118c8565b808516156119bb57918102915b93841c9390800290611992565b509250929050565b6000826119df57506001610b45565b816119ec57506000610b45565b8160018114611a025760028114611a0c57611a28565b6001915050610b45565b60ff841115611a1d57611a1d6118c8565b50506001821b610b45565b5060208310610133831016604e8410600b8410161715611a4b575081810a610b45565b611a55838361198d565b8060001904821115611a6957611a696118c8565b029392505050565b6000610cb560ff8416836119d0565b6000816000190483118215151615611a9a57611a9a6118c8565b500290565b600082611abc57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611ad457611ad46118c8565b500190565b600060208284031215611aeb57600080fd5b81518015158114610b4257600080fd5b60005b83811015611b16578181015183820152602001611afe565b838111156106765750506000910152565b60008251611b39818460208701611afb565b9190910192915050565b6020815260008251806020840152611b62816040850160208701611afb565b601f01601f1916919091016040019291505056fea164736f6c6343000809000a0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210000000000000000000000000f4423f4152966ebb106261740da907662a3569c50000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b9

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101985760003560e01c8063658e28a4116100e35780638da5cb5b1161008c578063ed91f1d011610066578063ed91f1d014610329578063ef8d496414610331578063f2fde38b1461034457600080fd5b80638da5cb5b146102f2578063cec833a914610303578063e68c84cb1461031657600080fd5b80637b027af0116100bd5780637b027af0146102c45780638997c1f4146102d75780638b4fd515146102ea57600080fd5b8063658e28a4146102a1578063715018a6146102b457806376972999146102bc57600080fd5b806345ed7f33116101455780634cae6edc1161011f5780634cae6edc14610267578063580d2b5d1461027b578063594cc6861461028e57600080fd5b806345ed7f33146102315780634756ce0d14610257578063489cc20c1461025f57600080fd5b8063272d28ca11610176578063272d28ca146101dc5780633b28e4181461020157806344f049111461021457600080fd5b806308aae3301461019d57806318819022146101b2578063202f2a27146101c5575b600080fd5b6101b06101ab36600461170c565b610357565b005b6101b06101c0366004611771565b610374565b6003545b6040519081526020015b60405180910390f35b6002546001600160a01b03165b6040516001600160a01b0390911681526020016101d3565b6004546101e9906001600160a01b031681565b6006546102219060ff1681565b60405190151581526020016101d3565b7f000000000000000000000000f4423f4152966ebb106261740da907662a3569c56101e9565b6101b06104f0565b6101c9610528565b60045461022190600160a01b900460ff1681565b6101b06102893660046117dd565b6105df565b6101c961029c366004611840565b61067c565b6101b06102af36600461170c565b61089d565b6101b0610a39565b6005546101c9565b6101c96102d2366004611875565b610a4d565b6101b06102e5366004611897565b610b4b565b6101b0610b99565b6000546001600160a01b03166101e9565b6101c961031136600461170c565b610bb0565b6101b0610324366004611897565b610cbc565b6101b0610dbb565b6101c961033f36600461170c565b610e66565b6101b0610352366004611897565b610fb8565b61035f6111ef565b60065460ff161561036f57600080fd5b600555565b61037c6111ef565b8281146103d05760405162461bcd60e51b815260206004820152601360248201527f41525241592053495a45204d49534d415443480000000000000000000000000060448201526064015b60405180910390fd5b60005b838110156104e9577f0000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b6001600160a01b0316858583818110610417576104176118b2565b905060200201602081019061042c9190611897565b6001600160a01b031614156104835760405162461bcd60e51b815260206004820152601860248201527f544f4b454e20414444524553532050524f48494249544544000000000000000060448201526064016103c7565b6104d733848484818110610499576104996118b2565b905060200201358787858181106104b2576104b26118b2565b90506020020160208101906104c79190611897565b6001600160a01b03169190611249565b806104e1816118de565b9150506103d3565b5050505050565b6104f86111ef565b600480547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b179055565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f0000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b16906370a082319060240160206040518083038186803b15801561058c57600080fd5b505afa1580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c491906118f9565b90506105cf60035490565b6105d99082611912565b91505090565b6105e76111ef565b604051633111e7b360e01b815273d784927ff2f95ba542bfc824c8a8a98f3495f6b590633111e7b390610624908690869086903090600401611929565b602060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067691906118f9565b50505050565b6000600260015414156106d15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103c7565b600260015560006106e185610bb0565b90508381101580156106f35750600081115b61073f5760405162461bcd60e51b815260206004820152601360248201527f494e53554646494349454e54204f55545055540000000000000000000000000060448201526064016103c7565b60025460405163079cc67960e41b8152336004820152602481018790526001600160a01b03909116906379cc679090604401600060405180830381600087803b15801561078b57600080fd5b505af115801561079f573d6000803e3d6000fd5b505050506107ac81611279565b6107e06001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c5168483611249565b6004546001600160a01b031615610856576004805460405163738759c960e11b81529182018790526001600160a01b038581166024840152169063e70eb39290604401600060405180830381600087803b15801561083d57600080fd5b505af1158015610851573d6000803e3d6000fd5b505050505b604080518681526020810183905233917f931033e43a2977753dbe3de2347d53265c3a695c82b3fa009dd57e06d6a20503910160405180910390a260018055949350505050565b336001600160a01b037f00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b91614806108d357503330145b6109145760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b604051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c581166004830152602482018390523060448301526000917f0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210909116906369328dec90606401602060405180830381600087803b1580156109a957600080fd5b505af11580156109bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e191906118f9565b9050818110156109f057600080fd5b610a246001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c5163384611249565b81600354610a329190611912565b6003555050565b610a416111ef565b610a4b6000611449565b565b6000603c821015610aa05760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e20544f4f204c4f570000000000000000000000000000000060448201526064016103c7565b6000610acd7f0000000000000000000000000000000000000000000000000000000000000008600a611a71565b610adc846407620d0700611a80565b610ae69086611a80565b610af09190611a9f565b905060008111610b425760405162461bcd60e51b815260206004820152601360248201527f494e53554646494349454e54204f55545055540000000000000000000000000060448201526064016103c7565b90505b92915050565b610b536111ef565b600454600160a01b900460ff1615610b6a57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610ba16111ef565b6006805460ff19166001179055565b600080600260009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0157600080fd5b505afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3991906118f9565b905060008111610c8b5760405162461bcd60e51b815260206004820181905260248201527f494e53554646494349454e542066455243323020544f4b454e20535550504c5960448201526064016103c7565b80831115610c97578092505b8083610ca1610528565b610cab9190611a80565b610cb59190611a9f565b9392505050565b336001600160a01b037f00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b9161480610cf257503330145b610d335760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b6002546001600160a01b031615610d8c5760405162461bcd60e51b815260206004820152601a60248201527f46544f4b454e204144445245535320414c52454144592053455400000000000060448201526064016103c7565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610e106001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c5167f0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f2106000611048565b610a4b6001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c5167f0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210600019611048565b6000336001600160a01b037f00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b9161480610e9e57503330145b610edf5760405162461bcd60e51b81526020600482015260126024820152711393d50811931054d208141493d513d0d3d360721b60448201526064016103c7565b81600354610eed9190611ac1565b60035560025460405163e8eda9df60e01b81527f000000000000000000000000f4423f4152966ebb106261740da907662a3569c56001600160a01b03908116600483015260248201859052306044830152600160a01b90920461ffff1660648201527f0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f2109091169063e8eda9df90608401600060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050508190505b919050565b610fc06111ef565b6001600160a01b03811661103c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103c7565b61104581611449565b50565b8015806110d15750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf91906118f9565b155b6111435760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103c7565b6040516001600160a01b0383166024820152604481018290526111d390849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526114a6565b505050565b60606111e7848460008561158b565b949350505050565b6000546001600160a01b03163314610a4b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c7565b6040516001600160a01b0383166024820152604481018290526111d390849063a9059cbb60e01b9060640161116f565b604051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000f4423f4152966ebb106261740da907662a3569c581166004830152602482018390523060448301526000917f0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210909116906369328dec90606401602060405180830381600087803b15801561130e57600080fd5b505af1158015611322573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134691906118f9565b90508181101561135557600080fd5b6040516370a0823160e01b81523060048201526000907f0000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b6001600160a01b0316906370a082319060240160206040518083038186803b1580156113b757600080fd5b505afa1580156113cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ef91906118f9565b90506113fa60035490565b8110156111d35760405162461bcd60e51b815260206004820152601960248201527f5052494e434950414c2042414c414e434520494e56414c49440000000000000060448201526064016103c7565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006114fb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111d89092919063ffffffff16565b8051909150156111d357808060200190518101906115199190611ad9565b6111d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103c7565b6060824710156116035760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103c7565b6001600160a01b0385163b61165a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c7565b600080866001600160a01b031685876040516116769190611b27565b60006040518083038185875af1925050503d80600081146116b3576040519150601f19603f3d011682016040523d82523d6000602084013e6116b8565b606091505b50915091506116c88282866116d3565b979650505050505050565b606083156116e2575081610cb5565b8251156116f25782518084602001fd5b8160405162461bcd60e51b81526004016103c79190611b43565b60006020828403121561171e57600080fd5b5035919050565b60008083601f84011261173757600080fd5b50813567ffffffffffffffff81111561174f57600080fd5b6020830191508360208260051b850101111561176a57600080fd5b9250929050565b6000806000806040858703121561178757600080fd5b843567ffffffffffffffff8082111561179f57600080fd5b6117ab88838901611725565b909650945060208701359150808211156117c457600080fd5b506117d187828801611725565b95989497509550505050565b6000806000604084860312156117f257600080fd5b833567ffffffffffffffff81111561180957600080fd5b61181586828701611725565b909790965060209590950135949350505050565b80356001600160a01b0381168114610fb357600080fd5b60008060006060848603121561185557600080fd5b833592506020840135915061186c60408501611829565b90509250925092565b6000806040838503121561188857600080fd5b50508035926020909101359150565b6000602082840312156118a957600080fd5b610cb582611829565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156118f2576118f26118c8565b5060010190565b60006020828403121561190b57600080fd5b5051919050565b600082821015611924576119246118c8565b500390565b6060808252810184905260008560808301825b8781101561196a576001600160a01b0361195584611829565b1682526020928301929091019060010161193c565b50602084019590955250506001600160a01b039190911660409091015292915050565b600181815b808511156119c85781600019048211156119ae576119ae6118c8565b808516156119bb57918102915b93841c9390800290611992565b509250929050565b6000826119df57506001610b45565b816119ec57506000610b45565b8160018114611a025760028114611a0c57611a28565b6001915050610b45565b60ff841115611a1d57611a1d6118c8565b50506001821b610b45565b5060208310610133831016604e8410600b8410161715611a4b575081810a610b45565b611a55838361198d565b8060001904821115611a6957611a696118c8565b029392505050565b6000610cb560ff8416836119d0565b6000816000190483118215151615611a9a57611a9a6118c8565b500290565b600082611abc57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611ad457611ad46118c8565b500190565b600060208284031215611aeb57600080fd5b81518015158114610b4257600080fd5b60005b83811015611b16578181015183820152602001611afe565b838111156106765750506000910152565b60008251611b39818460208701611afb565b9190910192915050565b6020815260008251806020840152611b62816040850160208701611afb565b601f01601f1916919091016040019291505056fea164736f6c6343000809000a

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

0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210000000000000000000000000f4423f4152966ebb106261740da907662a3569c50000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b9

-----Decoded View---------------
Arg [0] : _lendingPoolAddress (address): 0x4bd5643ac6f66a5237E18bfA7d47cF22f1c9F210
Arg [1] : _principalTokenAddress (address): 0xf4423F4152966eBb106261740da907662A3569C5
Arg [2] : _interestBearingTokenAddress (address): 0x2f8274ce7fB939014e657e480e9ed3e1131f242B
Arg [3] : _flashProtocolAddress (address): 0x78b2d65dd1d3d9Fb2972d7Ef467261Ca101EC2B9

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000004bd5643ac6f66a5237e18bfa7d47cf22f1c9f210
Arg [1] : 000000000000000000000000f4423f4152966ebb106261740da907662a3569c5
Arg [2] : 0000000000000000000000002f8274ce7fb939014e657e480e9ed3e1131f242b
Arg [3] : 00000000000000000000000078b2d65dd1d3d9fb2972d7ef467261ca101ec2b9


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.