Sepolia Testnet

Contract

0xE4D71Cf48BD7aBe48f467C19a56c7505E1094E5a
Transaction Hash
Method
Block
From
To
Cancel Loan46353282023-11-05 13:53:48250 days ago1699192428IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000144261.50000001
Create Loan Lend45711962023-10-27 4:51:12260 days ago1698382272IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0034552510.10119263
Deposit Token45711942023-10-27 4:50:48260 days ago1698382248IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0022198910.21431635
Create Loan Lend45660642023-10-26 10:26:36260 days ago1698315996IN
0xE4D71Cf4...5E1094E5a
0 ETH0.002312287.11359502
Deposit Token45660622023-10-26 10:26:12260 days ago1698315972IN
0xE4D71Cf4...5E1094E5a
0 ETH0.001261585.93631628
Deposit Token42804502023-09-13 12:56:48303 days ago1694609808IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000307741.50095221
Deposit Token42804432023-09-13 12:55:24303 days ago1694609724IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000300511.5008229
Create Loan Lend42345882023-09-06 9:06:24310 days ago1693991184IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0166696348.05812374
Create Loan Lend42341092023-09-06 7:06:12311 days ago1693983972IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000525491.51499622
Create Loan Lend42191062023-09-03 20:10:00313 days ago1693771800IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003121779.00000858
Create Loan Lend42191062023-09-03 20:10:00313 days ago1693771800IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003121779.00000858
Deposit Token42191002023-09-03 20:08:48313 days ago1693771728IN
0xE4D71Cf4...5E1094E5a
0 ETH0.001802089.00000857
Deposit Token41765542023-08-28 7:56:24320 days ago1693209384IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000318811.50000009
Cancel Loan41448172023-08-23 14:20:36324 days ago1692800436IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000211672.67686127
Cancel Loan41428112023-08-23 7:17:36325 days ago1692775056IN
0xE4D71Cf4...5E1094E5a
0 ETH0.000711679.00000006
Create Loan Lend41427912023-08-23 7:13:24325 days ago1692774804IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003121779.00000005
Create Loan Lend41427912023-08-23 7:13:24325 days ago1692774804IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003121779.00000005
Create Loan Lend41427902023-08-23 7:13:00325 days ago1692774780IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003121779.00000005
Take Loan41379282023-08-22 13:08:12325 days ago1692709692IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0010867310
Cancel Loan41369982023-08-22 9:40:12325 days ago1692697212IN
0xE4D71Cf4...5E1094E5a
0 ETH0.003321642.00575284
Cancel Loan41131382023-08-18 13:26:36329 days ago1692365196IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0007907510
Deposit Token41123492023-08-18 10:21:12329 days ago1692354072IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0020503210
Pay Back Loan41123462023-08-18 10:20:12329 days ago1692354012IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0014098210
Take Loan41123462023-08-18 10:20:12329 days ago1692354012IN
0xE4D71Cf4...5E1094E5a
0 ETH0.0010867310
Deposit Token40887542023-08-14 16:52:12333 days ago1692031932IN
0xE4D71Cf4...5E1094E5a
0 ETH0.001793929.17985925
View all transactions

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Coinlend

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : Coinlend.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

/**
 * @title The Conlend DeFi contract
 * @author Jan Pumpe
 * @notice This contract is used for a decentralized lending platform
 */
contract Coinlend is ReentrancyGuard, Ownable {
    struct Loan {
        // Attributes of an loan
        uint256 id; // Unique identifier for loan
        address user; // Creator of loan
        address lender; // User who is lending
        address tokenLending; // Address of the token borrower receives
        uint256 tokenLendingAmount; // Amount to lend
        address tokenCollateral; // Address of token used as collateral
        uint256 tokenCollateralAmount; // Amount collateral
        uint256 interestRate; // Interest rate of the loan in basis points -> 5% = 500
        uint256 loanDuration; // The loan duration in days
        uint256 loanState; // The state of the loan (0 = OPEN, 1 = CANCELED, 2 = ACTIVE, 3 = COMPLETE)
        address borrower; // User who is borrowing
        uint256 timestamp; // Time when loan was created or taken
    }

    struct Transfer {
        uint256 id; // Unique identifier for deposit
        address user; // User who is lending
        address token; // Address of the token which is transferred
        uint256 tokenAmount; // Amount transferred
        uint256 transferType; // 0 -> Deposit, 1 -> Withdraw
        uint256 timestamp; // Time transfer was created
    }

    /* State variables */

    /**
     * Mapping of the exchange balances
     */
    mapping(address => mapping(address => uint256)) public tokens;

    /**
     * Mapping of all loans on the platform (id as key)
     */
    mapping(uint256 => Loan) public loans;

    /**
     * Store the fee percent for the loans so fee percent changes don't affect existing loans.
     * Separate mapping needed since loan struct is too big already.
     */
    mapping(uint256 => uint256) public loansFee;

    /**
     * Mapping of all deposits/withdrawals on the platform (id as key)
     */
    mapping(uint256 => Transfer) public transfers;

    /**
     * Mapping of pricefeeds for all supported tokens on the platform
     */
    mapping(address => AggregatorV3Interface) public priceFeeds;

    /**
     * Count of all loans on the platform -> used as ID
     */
    uint256 public loanCount = 1;

    /**
     * Count of all transfers on the platform -> used as ID
     */
    uint256 public transferCount = 1;

    /**
     * The address that receives all fee payments
     */
    address public feeAccount;

    /**
     * The fee charged for the interest generated on the platform in basis points: 5% -> 500
     */
    uint256 public feePercent;

    /**
     * The maximum LTV for new loans
     */
    uint256 public maxLTV;

    /**
     * The  maximum LTV for exiting loans. If LTV exceeds this threshold the lender can force liquidate loan
     */
    uint256 public ltvThreshold;

    /**
     * The time that needs to pass after loan expiration after which the lender can force liquidate the loan if it is not payed back
     */
    uint256 public expirationBuffer = 60 * 60 * 24 * 7; // 7 days

    /**
     * The address of the Coinlend Credits token
     */
    address public coinlendCredits;

    /**
     * Discount in percent for paying with Coinlend Credits
     */
    uint256 public coinlendCreditsDiscount;

    /* Events */

    event LoanListingCreated(
        // Attributes of an loan
        uint256 id, // Unique identifier for loan
        address user, // Creater of the loan
        address lender, // User who is lending
        address tokenLending, // Address of the token they receive
        uint256 tokenLendingAmount, // Amount to lend
        address borrower, // user who is borowwing
        address tokenCollateral, // Address of token for the collateral
        uint256 tokenCollateralAmount, // Amount collateral
        uint256 interestRate,
        uint256 loanDuration,
        uint256 loanState,
        uint256 timestamp // When loan was created
    );

    event LoanListingCancelled(
        // Attributes of an loan
        uint256 id, // Unique identifier for loan
        address user, // user that created event
        address lender, // User who is lending
        address tokenLending, // Address of the token they receive
        uint256 tokenLendingAmount, // Amount to lend
        address borrower,
        address tokenCollateral, // Address of token for the collateral
        uint256 tokenCollateralAmount, // Amount collateral
        uint256 interestRate,
        uint256 loanDuration,
        uint256 loanState,
        uint256 timestamp // When loan was created
    );

    event LoanTaken(
        // Attributes of an loan
        uint256 id, // Unique identifier for loan
        address user,
        address lender, // User who is lending
        address tokenLending, // Address of the token they receive
        uint256 tokenLendingAmount, // Amount to lend
        address borrower,
        address tokenCollateral, // Address of token for the collateral
        uint256 tokenCollateralAmount, // Amount collateral
        uint256 interestRate,
        uint256 loanDuration,
        uint256 loanState,
        uint256 timestamp // When loan was created
    );

    event LoanPayBack(
        // Attributes of an loan
        uint256 id, // Unique identifier for loan
        address user,
        address lender, // User who is lending
        address tokenLending, // Address of the token they receive
        uint256 tokenLendingAmount, // Amount to lend
        address borrower,
        address tokenCollateral, // Address of token for the collateral
        uint256 tokenCollateralAmount, // Amount collateral
        uint256 interestRate,
        uint256 loanDuration,
        uint256 interest,
        uint256 timestamp // When loan was created
    );

    event LoanOfferCancelled(address indexed loanProvider, uint256 loanId);

    event Deposit(uint256 id, address token, address user, uint256 amount, uint256 balance);

    event Withdraw(uint256 id, address token, address user, uint256 amount, uint256 balance);

    /* Functions */
    constructor() ReentrancyGuard() {
        feeAccount = msg.sender; // Deployer will receive fees by default
        feePercent = 500; // 5% default fee
        maxLTV = 80; // Maximum LTV = 80%
        ltvThreshold = 90; // Loans can be liquidated if LTV exceed 90%
    }

    /**
     * Deposit tokens to the platform
     * @param _token Address of the token to deposit
     * @param _amount Amount of token to deposit
     */
    function depositToken(address _token, uint256 _amount) public nonReentrant {
        // Only allow deposit of token with pricefeed (prevent deposit of fake token)
        require(getLatestPrice(_token) > 0);

        // Only allow valid amounts greater 0
        require(_amount > 0);

        uint256 balanceBefore = IERC20(_token).balanceOf(address(this));
        // Transfer tokens to exchange
        SafeERC20.safeTransferFrom(
            IERC20(_token), // Pass the token contract address as the first parameter
            msg.sender, // Sender of the tokens
            address(this), // Recipient of the tokens
            _amount // Amount of tokens to transfer
        );

        // Special handling for deflationary tokens
        uint256 balanceAfter = IERC20(_token).balanceOf(address(this));
        uint256 balanceDiff = balanceAfter - balanceBefore;
        if (balanceDiff < _amount) {
            _amount = balanceDiff;
        }

        // Update user balance
        tokens[_token][msg.sender] = tokens[_token][msg.sender] + _amount;

        transfers[transferCount] = Transfer(
            transferCount,
            msg.sender,
            _token,
            _amount,
            0,
            block.timestamp
        );

        // Emit deposit event
        emit Deposit(transferCount, _token, msg.sender, _amount, tokens[_token][msg.sender]);

        transferCount++;
    }

    /**
     * Withdraw tokens from the platform
     * @param _token Address of the token to withdraw
     * @param _amount Amount of token to withdraw
     */
    function withdrawToken(address _token, uint256 _amount) public nonReentrant {
        // Ensure user has enough tokens to withdraw

        require(tokens[_token][msg.sender] >= _amount);

        // Transfer tokens to user
        SafeERC20.safeTransfer(
            IERC20(_token), // Pass the token contract address as the first parameter
            msg.sender, // Sender of the tokens
            _amount // Amount of tokens to transfer
        );

        // Update user balance
        tokens[_token][msg.sender] = tokens[_token][msg.sender] - _amount;

        transfers[transferCount] = Transfer(
            transferCount,
            msg.sender,
            _token,
            _amount,
            1,
            block.timestamp
        );

        // Emit withdraw event
        emit Withdraw(transferCount, _token, msg.sender, _amount, tokens[_token][msg.sender]);

        transferCount++;
    }

    function balanceOf(address _token, address _user) public view returns (uint256) {
        return tokens[_token][_user];
    }

    function createLoanLend(
        address _tokenLend,
        uint256 _tokenLendAmount,
        address _tokenCollateral,
        uint256 _interestRate, // Interest in basis points: 12% -> 1200
        uint256 _loanDuration,
        uint256 _ltv
    ) public nonReentrant {
        require(_ltv > 0 && _ltv <= maxLTV);
        require(_interestRate >= 1 && _interestRate <= 10000); // Interest in basis points: 0,01% - 100%
        require(_tokenLendAmount > 0);
        require(_loanDuration > 0 && _loanDuration < 3650);

        require(balanceOf(_tokenLend, msg.sender) >= _tokenLendAmount);

        uint256 tokenCollateralAmount = (_tokenLendAmount * 100 * getLatestPrice(_tokenLend)) /
            _ltv /
            getLatestPrice(_tokenCollateral);

        tokens[_tokenLend][msg.sender] -= _tokenLendAmount;

        createLoanInternal(
            msg.sender, // loan creator
            msg.sender,
            _tokenLend,
            _tokenLendAmount,
            address(0),
            _tokenCollateral,
            tokenCollateralAmount,
            _interestRate,
            _loanDuration
        );
    }

    function createLoanBorrow(
        address _tokenLend,
        uint256 _tokenLendAmount,
        address _tokenCollateral,
        uint256 _interestRate,
        uint256 _loanDuration,
        uint256 _ltv
    ) public nonReentrant {
        require(_ltv > 0 && _ltv <= maxLTV);
        require(_interestRate >= 1 && _interestRate <= 10000); // Interest in basis points: 0,01% - 100%
        require(_tokenLendAmount > 0);
        require(_loanDuration > 0 && _loanDuration < 3650);

        uint256 tokenCollateralAmount = (_tokenLendAmount * 100 * getLatestPrice(_tokenLend)) /
            _ltv /
            getLatestPrice(_tokenCollateral);

        require(balanceOf(_tokenCollateral, msg.sender) >= tokenCollateralAmount);

        tokens[_tokenCollateral][msg.sender] -= tokenCollateralAmount;

        createLoanInternal(
            msg.sender, // loan creator
            address(0),
            _tokenLend,
            _tokenLendAmount,
            msg.sender,
            _tokenCollateral,
            tokenCollateralAmount,
            _interestRate,
            _loanDuration
        );
    }

    function createLoanInternal(
        address _user,
        address _lender,
        address _tokenLending,
        uint256 _tokenLendingAmount,
        address _borrower,
        address _tokenCollateral,
        uint256 _tokenCollateralAmount, // Amount collateral
        uint256 _interestRate, // Interest in basis points: 12% -> 1200
        uint256 _loanDuration
    ) internal {
        loans[loanCount] = Loan(
            loanCount,
            _user,
            _lender,
            _tokenLending,
            _tokenLendingAmount,
            _tokenCollateral,
            _tokenCollateralAmount,
            _interestRate,
            _loanDuration,
            0,
            _borrower,
            block.timestamp
        );

        loansFee[loanCount] = feePercent;
        // Emit event
        emit LoanListingCreated(
            loanCount,
            _user, // loan creator
            _lender,
            _tokenLending,
            _tokenLendingAmount,
            _borrower,
            _tokenCollateral,
            _tokenCollateralAmount,
            _interestRate,
            _loanDuration,
            0,
            block.timestamp
        );

        loanCount++;
    }

    function cancelLoan(uint256 _id) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Ensure the caller of the function is the owner of the loan
        require(address(_loan.user) == msg.sender);

        // Ensue the loan is in state open
        require(_loan.loanState == 0);

        // Update loan state
        _loan.loanState = 1;

        if (_loan.borrower == address(0)) {
            tokens[_loan.tokenLending][_loan.lender] += _loan.tokenLendingAmount;
        } else if (_loan.lender == address(0)) {
            tokens[_loan.tokenCollateral][_loan.borrower] += _loan.tokenCollateralAmount;
        }

        // Emit event
        emit LoanListingCancelled(
            _loan.id,
            msg.sender,
            _loan.lender,
            _loan.tokenLending,
            _loan.tokenLendingAmount,
            _loan.borrower,
            _loan.tokenCollateral,
            _loan.tokenCollateralAmount,
            _loan.interestRate,
            _loan.loanDuration,
            1,
            block.timestamp
        );
    }

    function takeLoan(uint256 _id) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Loan must exist
        require(_loan.id == _id);

        // Check loan state: Only open loans can be taken
        require(_loan.loanState == 0);

        // If user takes a lending offer -> check if he has enough collateral
        if (_loan.borrower == address(0)) {
            require(balanceOf(_loan.tokenCollateral, msg.sender) >= _loan.tokenCollateralAmount);
        }

        // If user provides funds for a borrow offer -> check if he has enough funds to lend
        if (_loan.lender == address(0)) {
            require(balanceOf(_loan.tokenLending, msg.sender) >= _loan.tokenLendingAmount);
        }

        _loan.loanState = 2;
        _loan.timestamp = block.timestamp;

        // Transfer tokens
        if (_loan.borrower == address(0)) {
            // Borrower takes a loan: Transfer lending amount to him and transfer collateral to contract

            // Transfer away collateral from borrower
            tokens[_loan.tokenCollateral][msg.sender] -= _loan.tokenCollateralAmount;

            // Transfer borrowed coins to borrower
            tokens[_loan.tokenLending][msg.sender] += _loan.tokenLendingAmount;

            _loan.borrower = msg.sender;
        } else if (_loan.lender == address(0)) {
            // Lender takes borrowing offer
            // Transfer borrowed coins to borrower
            tokens[_loan.tokenLending][_loan.borrower] += _loan.tokenLendingAmount;

            // Subtract borrowed coins from lender
            tokens[_loan.tokenLending][msg.sender] -= _loan.tokenLendingAmount;

            _loan.lender = msg.sender;
        }

        // Emit event
        emit LoanTaken(
            _loan.id,
            msg.sender,
            _loan.lender,
            _loan.tokenLending,
            _loan.tokenLendingAmount,
            _loan.borrower,
            _loan.tokenCollateral,
            _loan.tokenCollateralAmount,
            _loan.interestRate,
            _loan.loanDuration,
            2,
            block.timestamp
        );
    }

    function payBackLoan(uint256 _id) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Ensure the caller of the function is the owner of the loan
        require(address(_loan.borrower) == msg.sender);

        // Only active loans can be paid back
        require(_loan.loanState == 2);

        _loan.loanState = 3;

        // Calculate interest
        uint256 interestAmount = calculateInterest(
            _loan.tokenLendingAmount,
            _loan.interestRate,
            _loan.timestamp,
            block.timestamp
        );

        uint256 fee = calculateFee(interestAmount, loansFee[_id]);

        // Check if borrower has enough funds for payback
        require(hasBorrowerEnoughFundsForPayback(_loan, interestAmount));

        payBackLoanInternal(_loan, interestAmount, fee);
    }

    function payBackLoanInternal(Loan memory _loan, uint256 _interestAmount, uint256 _fee) private {
        uint256 feeValue = (((_fee * getLatestPrice(_loan.tokenLending)) /
            (10 ** (ERC20(_loan.tokenLending).decimals()))) * (100 - coinlendCreditsDiscount)) /
            100;
        // Transfer fee to fee account
        bool senderHasEnoughCredits = senderHasEnoughCoinlendCredits(feeValue);

        if (senderHasEnoughCredits) {
            tokens[coinlendCredits][feeAccount] += feeValue;
        } else {
            tokens[_loan.tokenLending][feeAccount] += _fee;
        }

        uint256 interestAmountMinusFee = _interestAmount - _fee;

        // Payback borrowed token to lender
        tokens[_loan.tokenLending][_loan.lender] +=
            _loan.tokenLendingAmount +
            interestAmountMinusFee;

        if (senderHasEnoughCredits) {
            tokens[coinlendCredits][_loan.borrower] -= feeValue;
            // substract lending amount and interest from borrower balance
            tokens[_loan.tokenLending][_loan.borrower] -= (_loan.tokenLendingAmount +
                interestAmountMinusFee);
        } else {
            // substract lending amount and interest from borrower balance
            tokens[_loan.tokenLending][_loan.borrower] -= (_loan.tokenLendingAmount +
                _interestAmount);
        }

        // Payback collateral
        tokens[_loan.tokenCollateral][_loan.borrower] += _loan.tokenCollateralAmount;

        // Emit event
        emit LoanPayBack(
            _loan.id,
            msg.sender,
            _loan.lender,
            _loan.tokenLending,
            _loan.tokenLendingAmount,
            _loan.borrower,
            _loan.tokenCollateral,
            _loan.tokenCollateralAmount,
            _loan.interestRate,
            _loan.loanDuration,
            interestAmountMinusFee,
            block.timestamp
        );
    }

    function hasBorrowerEnoughFundsForPayback(
        Loan memory _loan,
        uint256 _interestAmount
    ) internal view returns (bool) {
        return
            tokens[_loan.tokenLending][_loan.borrower] >=
            _loan.tokenLendingAmount + _interestAmount;
    }

    function senderHasEnoughCoinlendCredits(uint256 _feeValue) internal view returns (bool) {
        return balanceOf(coinlendCredits, msg.sender) >= _feeValue;
    }

    function calculateInterest(
        uint256 _tokenLendingAmount,
        uint256 _interestRate,
        uint256 _startTime,
        uint256 _endTime
    ) internal pure returns (uint256) {
        // End time needs to be bigger than the start time
        require(_endTime > _startTime);
        uint256 interestAmount = (((_tokenLendingAmount * _interestRate) *
            (_endTime - _startTime)) /
            365 /
            24 /
            60 /
            60 /
            10000);

        return interestAmount;
    }

    function calculateFee(
        uint256 _interestAmount,
        uint256 _feePercent
    ) internal pure returns (uint256) {
        return (_interestAmount * _feePercent) / 10000;
    }

    function forceLiquidateExpiredLoan(uint256 _id) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Ensure the caller of the function is the lender of the loan
        require(address(_loan.lender) == msg.sender);

        // Check loan state
        require(_loan.loanState == 2);

        // check loan is expired + buffer
        // Only loans which are expired the loan duration plus buffer can be liquidated
        require(_loan.timestamp + _loan.loanDuration + expirationBuffer < block.timestamp);

        // If borrower has enough of borrowed currency + fee -> payback lender and return collateral
        uint256 interestAmount = calculateInterest(
            _loan.tokenLendingAmount,
            _loan.interestRate,
            _loan.timestamp,
            block.timestamp
        );

        uint256 fee = calculateFee(interestAmount, loansFee[_id]);

        // Check if borrower has enough funds for payback
        if (hasBorrowerEnoughFundsForPayback(_loan, interestAmount)) {
            payBackLoanInternal(_loan, interestAmount, fee);
        } else {
            // If borrower has not enough of borrowed currency + fee -> move ownership of collateral to lender
            tokens[_loan.tokenCollateral][_loan.lender] += _loan.tokenCollateralAmount;

            // Emit event
            emit LoanPayBack(
                _loan.id,
                msg.sender,
                _loan.lender,
                _loan.tokenLending,
                _loan.tokenLendingAmount,
                _loan.borrower,
                _loan.tokenCollateral,
                _loan.tokenCollateralAmount,
                _loan.interestRate,
                _loan.loanDuration,
                interestAmount - fee,
                block.timestamp
            );
        }

        _loan.loanState = 3;
    }

    function forceLiquidateMarginExceeded(uint256 _id) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Ensure the caller of the function is the lender of the loan
        require(address(_loan.lender) == msg.sender);

        // Check loan state
        require(_loan.loanState == 2);

        uint256 ltv = getLTVOfLoan(_loan);

        // Loan can not be liquiditated since ltv threshold was not exeeded yet
        require(ltv > ltvThreshold);

        // If borrower has enough of borrowed currency + fee -> payback lender and return collateral
        uint256 interestAmount = calculateInterest(
            _loan.tokenLendingAmount,
            _loan.interestRate,
            _loan.timestamp,
            block.timestamp
        );

        uint256 fee = calculateFee(interestAmount, loansFee[_id]);

        // Check if borrower has enough funds for payback
        if (hasBorrowerEnoughFundsForPayback(_loan, interestAmount)) {
            payBackLoanInternal(_loan, interestAmount, fee);
        } else {
            // If borrower has not enough of borrowed currency + fee -> move ownership of collateral to lender
            tokens[_loan.tokenCollateral][_loan.lender] += _loan.tokenCollateralAmount;

            // Emit event
            emit LoanPayBack(
                _loan.id,
                msg.sender,
                _loan.lender,
                _loan.tokenLending,
                _loan.tokenLendingAmount,
                _loan.borrower,
                _loan.tokenCollateral,
                _loan.tokenCollateralAmount,
                _loan.interestRate,
                _loan.loanDuration,
                interestAmount - fee,
                block.timestamp
            );
        }

        _loan.loanState = 3;
    }

    /**
     *  Increase the collateral amount of the loan for the given loan ID
     */
    function increaseCollateral(uint256 _id, uint256 _amount) public nonReentrant {
        // Fetch loan
        Loan storage _loan = loans[_id];

        // Ensure the caller of the function is the borrower of the loan
        require(address(_loan.borrower) == msg.sender);

        // Check loan state
        require(_loan.loanState == 2);

        // check if borrower has enough funds to increase collateral
        require(tokens[_loan.tokenCollateral][msg.sender] >= _amount);

        tokens[_loan.tokenCollateral][_loan.borrower] -= _amount;

        _loan.tokenCollateralAmount += _amount;
    }

    /**
     * Returns the latest price adjusted for the decimals of the token
     */
    function getLatestPrice(address _currencyAddress) public view returns (uint256) {
        (uint80 roundID, int price, , uint256 timeStamp, uint80 answeredInRound) = priceFeeds[
            _currencyAddress
        ].latestRoundData();

        uint256 decimalsFeed = priceFeeds[_currencyAddress].decimals();
        // Validate price feed data
        require(price > 0 && answeredInRound >= roundID && timeStamp != 0);

        return uint256(price) * 10 ** (18 - decimalsFeed); // Price comes with variable decimals but we need 18
    }

    function getLTVOfLoan(uint256 _loanId) internal view returns (uint256) {
        return getLTVOfLoan(loans[_loanId]);
    }

    function getLTVOfLoan(Loan memory _loan) internal view returns (uint256) {
        uint256 tokenLendingTotalValue = (getLatestPrice(_loan.tokenLending) *
            _loan.tokenLendingAmount);

        uint256 tokenCollateralTotalValue = (getLatestPrice(_loan.tokenCollateral) *
            _loan.tokenCollateralAmount);

        return (tokenLendingTotalValue * 100) / tokenCollateralTotalValue;
    }

    function addPriceFeed(address _currencyAddress, address _priceFeedAddress) public onlyOwner {
        priceFeeds[_currencyAddress] = AggregatorV3Interface(_priceFeedAddress);
    }

    function setMaxLTV(uint256 _maxLTV) public onlyOwner {
        require(maxLTV > 0);
        maxLTV = _maxLTV;
    }

    function setFeeAccount(address _feeAccount) public onlyOwner {
        feeAccount = _feeAccount;
    }

    function setExpirationBuffer(uint256 _expirationBuffer) public onlyOwner {
        expirationBuffer = _expirationBuffer;
    }

    function setCoinlendCredits(address _coinlendCredits) public onlyOwner {
        coinlendCredits = _coinlendCredits;
    }

    function setFeePercent(uint256 _feePercent) public onlyOwner {
        require(_feePercent <= 3000); // limit fee to max 30%
        feePercent = _feePercent;
    }

    function setCoinlendCreditsDiscount(uint256 _coinlendCreditsDiscount) public onlyOwner {
        coinlendCreditsDiscount = _coinlendCreditsDiscount;
    }
}

File 2 of 11 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

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

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 3 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

File 6 of 11 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 7 of 11 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 8 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 9 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 10 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 11 of 11 : 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenLending","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenLendingAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"tokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCollateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanState","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LoanListingCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenLending","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenLendingAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"tokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCollateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanState","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LoanListingCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"loanProvider","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanId","type":"uint256"}],"name":"LoanOfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenLending","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenLendingAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"tokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCollateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LoanPayBack","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"tokenLending","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenLendingAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"address","name":"tokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenCollateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanDuration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"loanState","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LoanTaken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_currencyAddress","type":"address"},{"internalType":"address","name":"_priceFeedAddress","type":"address"}],"name":"addPriceFeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"cancelLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"coinlendCredits","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coinlendCreditsDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenLend","type":"address"},{"internalType":"uint256","name":"_tokenLendAmount","type":"uint256"},{"internalType":"address","name":"_tokenCollateral","type":"address"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_loanDuration","type":"uint256"},{"internalType":"uint256","name":"_ltv","type":"uint256"}],"name":"createLoanBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenLend","type":"address"},{"internalType":"uint256","name":"_tokenLendAmount","type":"uint256"},{"internalType":"address","name":"_tokenCollateral","type":"address"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_loanDuration","type":"uint256"},{"internalType":"uint256","name":"_ltv","type":"uint256"}],"name":"createLoanLend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expirationBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"forceLiquidateExpiredLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"forceLiquidateMarginExceeded","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_currencyAddress","type":"address"}],"name":"getLatestPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"loanCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loans","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"lender","type":"address"},{"internalType":"address","name":"tokenLending","type":"address"},{"internalType":"uint256","name":"tokenLendingAmount","type":"uint256"},{"internalType":"address","name":"tokenCollateral","type":"address"},{"internalType":"uint256","name":"tokenCollateralAmount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"},{"internalType":"uint256","name":"loanDuration","type":"uint256"},{"internalType":"uint256","name":"loanState","type":"uint256"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"loansFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ltvThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLTV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"payBackLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"priceFeeds","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_coinlendCredits","type":"address"}],"name":"setCoinlendCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_coinlendCreditsDiscount","type":"uint256"}],"name":"setCoinlendCreditsDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expirationBuffer","type":"uint256"}],"name":"setExpirationBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAccount","type":"address"}],"name":"setFeeAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"setFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxLTV","type":"uint256"}],"name":"setMaxLTV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"takeLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"tokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfers","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"uint256","name":"transferType","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526001600755600160085562093a80600d553480156200002257600080fd5b5060016000819055506200004b6200003f620000ab60201b60201c565b620000b360201b60201c565b33600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101f4600a819055506050600b81905550605a600c8190555062000179565b600033905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b615dad80620001896000396000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c80639377d71111610125578063e0384691116100ad578063f0af5b711161007c578063f0af5b711461060d578063f2fde38b14610629578063f384bd0514610645578063f7888aec14610663578063fb9ee6c7146106935761021c565b8063e03846911461057c578063e1ec3c6814610598578063e3d33fc9146105d3578063e8a97a3e146105f15761021c565b8063b2b3ff4b116100f4578063b2b3ff4b146104d8578063bdbfa3de146104f6578063ce63094d14610512578063d7b4c4e114610530578063df6d088d1461054c5761021c565b80639377d711146104395780639dcb511a1461046e5780639e281a981461049e578063aedd2dfc146104ba5761021c565b80636faa8b3f116101a8578063803e265d11610177578063803e265d146103a75780638c803fc2146103c55780638da5cb5b146103e1578063929d106f146103ff5780639340817a1461041d5761021c565b80636faa8b3f14610347578063715018a6146103635780637ce3489b1461036d5780637fd6f15c146103895761021c565b8063338b5dea116101ef578063338b5dea146102a55780634b023cf8146102c1578063508493bc146102dd57806354f0cb0d1461030d57806365e17c9d146103295761021c565b806308a0c3751461022157806316345f181461023d5780631cdd78301461026d57806325b6905914610289575b600080fd5b61023b60048036038101906102369190614be9565b6106af565b005b61025760048036038101906102529190614c74565b6106d0565b6040516102649190614cb0565b60405180910390f35b61028760048036038101906102829190614be9565b6108f2565b005b6102a3600480360381019061029e9190614be9565b6111ea565b005b6102bf60048036038101906102ba9190614ccb565b6118f2565b005b6102db60048036038101906102d69190614c74565b611d56565b005b6102f760048036038101906102f29190614d0b565b611da2565b6040516103049190614cb0565b60405180910390f35b61032760048036038101906103229190614d4b565b611dc7565b005b610331612003565b60405161033e9190614d9a565b60405180910390f35b610361600480360381019061035c9190614be9565b612029565b005b61036b612528565b005b61038760048036038101906103829190614be9565b61253c565b005b61039161255d565b60405161039e9190614cb0565b60405180910390f35b6103af612563565b6040516103bc9190614cb0565b60405180910390f35b6103df60048036038101906103da9190614be9565b612569565b005b6103e9612c35565b6040516103f69190614d9a565b60405180910390f35b610407612c5f565b6040516104149190614d9a565b60405180910390f35b61043760048036038101906104329190614be9565b612c85565b005b610453600480360381019061044e9190614be9565b612c97565b60405161046596959493929190614db5565b60405180910390f35b61048860048036038101906104839190614c74565b612d13565b6040516104959190614e75565b60405180910390f35b6104b860048036038101906104b39190614ccb565b612d46565b005b6104c26130f5565b6040516104cf9190614cb0565b60405180910390f35b6104e06130fb565b6040516104ed9190614cb0565b60405180910390f35b610510600480360381019061050b9190614be9565b613101565b005b61051a61350a565b6040516105279190614cb0565b60405180910390f35b61054a60048036038101906105459190614c74565b613510565b005b61056660048036038101906105619190614be9565b61355c565b6040516105739190614cb0565b60405180910390f35b61059660048036038101906105919190614e90565b613574565b005b6105b260048036038101906105ad9190614be9565b6136e8565b6040516105ca9c9b9a99989796959493929190614f1d565b60405180910390f35b6105db6137e8565b6040516105e89190614cb0565b60405180910390f35b61060b60048036038101906106069190614d0b565b6137ee565b005b61062760048036038101906106229190614be9565b613878565b005b610643600480360381019061063e9190614c74565b61388a565b005b61064d61390d565b60405161065a9190614cb0565b60405180910390f35b61067d60048036038101906106789190614d0b565b613913565b60405161068a9190614cb0565b60405180910390f35b6106ad60048036038101906106a89190614e90565b61399a565b005b6106b7613b0e565b6000600b54116106c657600080fd5b80600b8190555050565b6000806000806000600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a69190615064565b9450945050935093506000600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087f9190615118565b60ff1690506000841380156108ac57508469ffffffffffffffffffff168269ffffffffffffffffffff1610155b80156108b9575060008314155b6108c257600080fd5b8060126108cf9190615174565b600a6108db91906152db565b846108e69190615326565b95505050505050919050565b6108fa613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096d57600080fd5b600281600901541461097e57600080fd5b6000610b898260405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b82015481525050613bdb565b9050600c548111610b9957600080fd5b6000610bb38360040154846007015485600b015442613c3d565b90506000610bd4826004600088815260200190815260200160002054613cba565b9050610de08460405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b15610ff557610ff08460405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b6111d1565b8360060154600260008660050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110cd9190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb8460000154338660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886004015489600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a60050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b600601548c600701548d600801548b8d6111af9190615174565b426040516111c89c9b9a9998979695949392919061539c565b60405180910390a15b60038460090181905550505050506111e76143e3565b50565b6111f2613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126557600080fd5b600281600901541461127657600080fd5b42600d54826008015483600b015461128e9190615368565b6112989190615368565b106112a257600080fd5b60006112bc8260040154836007015484600b015442613c3d565b905060006112dd826004600087815260200190815260200160002054613cba565b90506114e98360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b156116fe576116f98360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b6118da565b8260060154600260008560050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117d69190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb8360000154338560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876004015488600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168960050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a600601548b600701548c600801548b8d6118b89190615174565b426040516118d19c9b9a9998979695949392919061539c565b60405180910390a15b600383600901819055505050506118ef6143e3565b50565b6118fa613b8c565b6000611905836106d0565b1161190f57600080fd5b6000811161191c57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119579190614d9a565b602060405180830381865afa158015611974573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119989190615456565b90506119a6833330856143ed565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119e19190614d9a565b602060405180830381865afa1580156119fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a229190615456565b905060008282611a329190615174565b905083811015611a40578093505b83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac89190615368565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506040518060c0016040528060085481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160008152602001428152506005600060085481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501559050507feb65d0f36862bbd8763c5e2c983c9d753267d223eee35a224d8d0a9d7ef433a2600854863387600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051611d27959493929190615483565b60405180910390a160086000815480929190611d42906154d6565b9190505550505050611d526143e3565b5050565b611d5e613b0e565b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002602052816000526040600020602052806000526040600020600091509150505481565b611dcf613b8c565b60006003600084815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e4257600080fd5b6002816009015414611e5357600080fd5b81600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611f0057600080fd5b81600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fd49190615174565b9250508190555081816006016000828254611fef9190615368565b9250508190555050611fff6143e3565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612031613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120a457600080fd5b60028160090154146120b557600080fd5b6003816009018190555060006120d98260040154836007015484600b015442613c3d565b905060006120fa826004600087815260200190815260200160002054613cba565b90506123068360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b61230f57600080fd5b61251a8360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b5050506125256143e3565b50565b612530613b0e565b61253a6000614476565b565b612544613b0e565b610bb881111561255357600080fd5b80600a8190555050565b600a5481565b600f5481565b612571613b8c565b60006003600083815260200190815260200160002090508181600001541461259857600080fd5b60008160090154146125a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036126405780600601546126348260050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b101561263f57600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036126d75780600401546126cb8260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b10156126d657600080fd5b5b600281600901819055504281600b0181905550600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612900578060060154600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127f69190615174565b925050819055508060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128b19190615368565b925050819055503381600a0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612b37565b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612b36578060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612a309190615368565b925050819055508060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612aeb9190615174565b92505081905550338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b7fdcafc6dbac5448cffb7b7888d7c84dc838744a5d806e90325d40920386eacd2f8160000154338360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004015486600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886006015489600701548a60080154600242604051612c219c9b9a99989796959493929190615559565b60405180910390a150612c326143e3565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612c8d613b0e565b80600f8190555050565b60056020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154905086565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612d4e613b8c565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612dd757600080fd5b612de282338361453c565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e6a9190615174565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506040518060c0016040528060085481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200160018152602001428152506005600060085481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501559050507ffe7813e2866053d5c3938554e517b554fce6666a6561bed9eaa7419b29fa9b68600854833384600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040516130c9959493929190615483565b60405180910390a1600860008154809291906130e4906154d6565b91905055506130f16143e3565b5050565b600c5481565b600d5481565b613109613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461317c57600080fd5b600081600901541461318d57600080fd5b60018160090181905550600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036132d3578060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546132c79190615368565b9250508190555061340c565b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361340b578060060154600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134039190615368565b925050819055505b5b7ff12c65f01e4cbc4711a3be05281e821ea706e98cac3d7fc25aa512be38d069d78160000154338360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004015486600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886006015489600701548a600801546001426040516134f69c9b9a9998979695949392919061564e565b60405180910390a1506135076143e3565b50565b60075481565b613518613b0e565b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b61357c613b8c565b60008111801561358e5750600b548111155b61359757600080fd5b600183101580156135aa57506127108311155b6135b357600080fd5b600085116135c057600080fd5b6000821180156135d15750610e4282105b6135da57600080fd5b846135e58733613913565b10156135f057600080fd5b60006135fb856106d0565b82613605896106d0565b6064896136129190615326565b61361c9190615326565b6136269190615737565b6136309190615737565b905085600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546136be9190615174565b925050819055506136d73333898960008a878b8b6145c2565b506136e06143e3565b505050505050565b60036020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600601549080600701549080600801549080600901549080600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600b015490508c565b60085481565b6137f6613b0e565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b613880613b0e565b80600d8190555050565b613892613b0e565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138f8906157eb565b60405180910390fd5b61390a81614476565b50565b600b5481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6139a2613b8c565b6000811180156139b45750600b548111155b6139bd57600080fd5b600183101580156139d057506127108311155b6139d957600080fd5b600085116139e657600080fd5b6000821180156139f75750610e4282105b613a0057600080fd5b6000613a0b856106d0565b82613a15896106d0565b606489613a229190615326565b613a2c9190615326565b613a369190615737565b613a409190615737565b905080613a4d8633613913565b1015613a5857600080fd5b80600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613ae49190615174565b92505081905550613afd3360008989338a878b8b6145c2565b50613b066143e3565b505050505050565b613b166148d9565b73ffffffffffffffffffffffffffffffffffffffff16613b34612c35565b73ffffffffffffffffffffffffffffffffffffffff1614613b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b8190615857565b60405180910390fd5b565b600260005403613bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613bc8906158c3565b60405180910390fd5b6002600081905550565b6000808260800151613bf084606001516106d0565b613bfa9190615326565b905060008360c00151613c108560a001516106d0565b613c1a9190615326565b905080606483613c2a9190615326565b613c349190615737565b92505050919050565b6000828211613c4b57600080fd5b6000612710603c80601861016d8888613c649190615174565b8a8c613c709190615326565b613c7a9190615326565b613c849190615737565b613c8e9190615737565b613c989190615737565b613ca29190615737565b613cac9190615737565b905080915050949350505050565b60006127108284613ccb9190615326565b613cd59190615737565b905092915050565b6000818360800151613cef9190615368565b60026000856060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015905092915050565b60006064600f546064613d929190615174565b856060015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015613de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e059190615118565b600a613e1191906158e3565b613e1e87606001516106d0565b85613e299190615326565b613e339190615737565b613e3d9190615326565b613e479190615737565b90506000613e54826148e1565b90508015613f38578160026000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613f2c9190615368565b92505081905550613ff2565b8260026000876060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613fea9190615368565b925050819055505b600083856140009190615174565b90508086608001516140129190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000886040015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546140a59190615368565b92505081905550811561421c578260026000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546141659190615174565b9250508190555080866080015161417c9190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546142109190615174565b925050819055506142c8565b84866080015161422c9190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546142c09190615174565b925050819055505b8560c00151600260008860a0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546143619190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb866000015133886040015189606001518a608001518b61014001518c60a001518d60c001518e60e001518f61010001518b426040516143d39c9b9a9998979695949392919061539c565b60405180910390a1505050505050565b6001600081905550565b614470846323b872dd60e01b85858560405160240161440e9392919061592e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614919565b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6145bd8363a9059cbb60e01b848460405160240161455b929190615965565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614919565b505050565b60405180610180016040528060075481526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001600081526020018673ffffffffffffffffffffffffffffffffffffffff168152602001428152506003600060075481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a08201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061016082015181600b0155905050600a54600460006007548152602001908152602001600020819055507f2fbbf22c6ebe94502147a9c148009f41c67fe0f03501a407e2e4f72d8236133d6007548a8a8a8a8a8a8a8a8a6000426040516148ae9c9b9a999897969594939291906159c9565b60405180910390a1600760008154809291906148c9906154d6565b9190505550505050505050505050565b600033905090565b600081614910600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b10159050919050565b600061497b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166149e19092919063ffffffff16565b905060008151148061499d57508080602001905181019061499c9190615abb565b5b6149dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016149d390615b5a565b60405180910390fd5b505050565b60606149f084846000856149f9565b90509392505050565b606082471015614a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614a3590615bec565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614a679190615c7d565b60006040518083038185875af1925050503d8060008114614aa4576040519150601f19603f3d011682016040523d82523d6000602084013e614aa9565b606091505b5091509150614aba87838387614ac6565b92505050949350505050565b60608315614b28576000835103614b2057614ae085614b3b565b614b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614b1690615ce0565b60405180910390fd5b5b829050614b33565b614b328383614b5e565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115614b715781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614ba59190615d55565b60405180910390fd5b600080fd5b6000819050919050565b614bc681614bb3565b8114614bd157600080fd5b50565b600081359050614be381614bbd565b92915050565b600060208284031215614bff57614bfe614bae565b5b6000614c0d84828501614bd4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614c4182614c16565b9050919050565b614c5181614c36565b8114614c5c57600080fd5b50565b600081359050614c6e81614c48565b92915050565b600060208284031215614c8a57614c89614bae565b5b6000614c9884828501614c5f565b91505092915050565b614caa81614bb3565b82525050565b6000602082019050614cc56000830184614ca1565b92915050565b60008060408385031215614ce257614ce1614bae565b5b6000614cf085828601614c5f565b9250506020614d0185828601614bd4565b9150509250929050565b60008060408385031215614d2257614d21614bae565b5b6000614d3085828601614c5f565b9250506020614d4185828601614c5f565b9150509250929050565b60008060408385031215614d6257614d61614bae565b5b6000614d7085828601614bd4565b9250506020614d8185828601614bd4565b9150509250929050565b614d9481614c36565b82525050565b6000602082019050614daf6000830184614d8b565b92915050565b600060c082019050614dca6000830189614ca1565b614dd76020830188614d8b565b614de46040830187614d8b565b614df16060830186614ca1565b614dfe6080830185614ca1565b614e0b60a0830184614ca1565b979650505050505050565b6000819050919050565b6000614e3b614e36614e3184614c16565b614e16565b614c16565b9050919050565b6000614e4d82614e20565b9050919050565b6000614e5f82614e42565b9050919050565b614e6f81614e54565b82525050565b6000602082019050614e8a6000830184614e66565b92915050565b60008060008060008060c08789031215614ead57614eac614bae565b5b6000614ebb89828a01614c5f565b9650506020614ecc89828a01614bd4565b9550506040614edd89828a01614c5f565b9450506060614eee89828a01614bd4565b9350506080614eff89828a01614bd4565b92505060a0614f1089828a01614bd4565b9150509295509295509295565b600061018082019050614f33600083018f614ca1565b614f40602083018e614d8b565b614f4d604083018d614d8b565b614f5a606083018c614d8b565b614f67608083018b614ca1565b614f7460a083018a614d8b565b614f8160c0830189614ca1565b614f8e60e0830188614ca1565b614f9c610100830187614ca1565b614faa610120830186614ca1565b614fb8610140830185614d8b565b614fc6610160830184614ca1565b9d9c50505050505050505050505050565b600069ffffffffffffffffffff82169050919050565b614ff681614fd7565b811461500157600080fd5b50565b60008151905061501381614fed565b92915050565b6000819050919050565b61502c81615019565b811461503757600080fd5b50565b60008151905061504981615023565b92915050565b60008151905061505e81614bbd565b92915050565b600080600080600060a086880312156150805761507f614bae565b5b600061508e88828901615004565b955050602061509f8882890161503a565b94505060406150b08882890161504f565b93505060606150c18882890161504f565b92505060806150d288828901615004565b9150509295509295909350565b600060ff82169050919050565b6150f5816150df565b811461510057600080fd5b50565b600081519050615112816150ec565b92915050565b60006020828403121561512e5761512d614bae565b5b600061513c84828501615103565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061517f82614bb3565b915061518a83614bb3565b92508282039050818111156151a2576151a1615145565b5b92915050565b60008160011c9050919050565b6000808291508390505b60018511156151ff578086048111156151db576151da615145565b5b60018516156151ea5780820291505b80810290506151f8856151a8565b94506151bf565b94509492505050565b60008261521857600190506152d4565b8161522657600090506152d4565b816001811461523c576002811461524657615275565b60019150506152d4565b60ff84111561525857615257615145565b5b8360020a91508482111561526f5761526e615145565b5b506152d4565b5060208310610133831016604e8410600b84101617156152aa5782820a9050838111156152a5576152a4615145565b5b6152d4565b6152b784848460016151b5565b925090508184048111156152ce576152cd615145565b5b81810290505b9392505050565b60006152e682614bb3565b91506152f183614bb3565b925061531e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484615208565b905092915050565b600061533182614bb3565b915061533c83614bb3565b925082820261534a81614bb3565b9150828204841483151761536157615360615145565b5b5092915050565b600061537382614bb3565b915061537e83614bb3565b925082820190508082111561539657615395615145565b5b92915050565b6000610180820190506153b2600083018f614ca1565b6153bf602083018e614d8b565b6153cc604083018d614d8b565b6153d9606083018c614d8b565b6153e6608083018b614ca1565b6153f360a083018a614d8b565b61540060c0830189614d8b565b61540d60e0830188614ca1565b61541b610100830187614ca1565b615429610120830186614ca1565b615437610140830185614ca1565b615445610160830184614ca1565b9d9c50505050505050505050505050565b60006020828403121561546c5761546b614bae565b5b600061547a8482850161504f565b91505092915050565b600060a0820190506154986000830188614ca1565b6154a56020830187614d8b565b6154b26040830186614d8b565b6154bf6060830185614ca1565b6154cc6080830184614ca1565b9695505050505050565b60006154e182614bb3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361551357615512615145565b5b600182019050919050565b6000819050919050565b600061554361553e6155398461551e565b614e16565b614bb3565b9050919050565b61555381615528565b82525050565b60006101808201905061556f600083018f614ca1565b61557c602083018e614d8b565b615589604083018d614d8b565b615596606083018c614d8b565b6155a3608083018b614ca1565b6155b060a083018a614d8b565b6155bd60c0830189614d8b565b6155ca60e0830188614ca1565b6155d8610100830187614ca1565b6155e6610120830186614ca1565b6155f461014083018561554a565b615602610160830184614ca1565b9d9c50505050505050505050505050565b6000819050919050565b600061563861563361562e84615613565b614e16565b614bb3565b9050919050565b6156488161561d565b82525050565b600061018082019050615664600083018f614ca1565b615671602083018e614d8b565b61567e604083018d614d8b565b61568b606083018c614d8b565b615698608083018b614ca1565b6156a560a083018a614d8b565b6156b260c0830189614d8b565b6156bf60e0830188614ca1565b6156cd610100830187614ca1565b6156db610120830186614ca1565b6156e961014083018561563f565b6156f7610160830184614ca1565b9d9c50505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061574282614bb3565b915061574d83614bb3565b92508261575d5761575c615708565b5b828204905092915050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006157d5602683615768565b91506157e082615779565b604082019050919050565b60006020820190508181036000830152615804816157c8565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000615841602083615768565b915061584c8261580b565b602082019050919050565b6000602082019050818103600083015261587081615834565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006158ad601f83615768565b91506158b882615877565b602082019050919050565b600060208201905081810360008301526158dc816158a0565b9050919050565b60006158ee82614bb3565b91506158f9836150df565b92506159267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484615208565b905092915050565b60006060820190506159436000830186614d8b565b6159506020830185614d8b565b61595d6040830184614ca1565b949350505050565b600060408201905061597a6000830185614d8b565b6159876020830184614ca1565b9392505050565b6000819050919050565b60006159b36159ae6159a98461598e565b614e16565b614bb3565b9050919050565b6159c381615998565b82525050565b6000610180820190506159df600083018f614ca1565b6159ec602083018e614d8b565b6159f9604083018d614d8b565b615a06606083018c614d8b565b615a13608083018b614ca1565b615a2060a083018a614d8b565b615a2d60c0830189614d8b565b615a3a60e0830188614ca1565b615a48610100830187614ca1565b615a56610120830186614ca1565b615a646101408301856159ba565b615a72610160830184614ca1565b9d9c50505050505050505050505050565b60008115159050919050565b615a9881615a83565b8114615aa357600080fd5b50565b600081519050615ab581615a8f565b92915050565b600060208284031215615ad157615ad0614bae565b5b6000615adf84828501615aa6565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000615b44602a83615768565b9150615b4f82615ae8565b604082019050919050565b60006020820190508181036000830152615b7381615b37565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615bd6602683615768565b9150615be182615b7a565b604082019050919050565b60006020820190508181036000830152615c0581615bc9565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015615c40578082015181840152602081019050615c25565b60008484015250505050565b6000615c5782615c0c565b615c618185615c17565b9350615c71818560208601615c22565b80840191505092915050565b6000615c898284615c4c565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615cca601d83615768565b9150615cd582615c94565b602082019050919050565b60006020820190508181036000830152615cf981615cbd565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b6000615d2782615d00565b615d318185615768565b9350615d41818560208601615c22565b615d4a81615d0b565b840191505092915050565b60006020820190508181036000830152615d6f8184615d1c565b90509291505056fea2646970667358221220dd5a993f247db6a610bb8b937eecc1eeea6b97b85c1be53d8d8f6a0a22415f4c64736f6c63430008130033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061021c5760003560e01c80639377d71111610125578063e0384691116100ad578063f0af5b711161007c578063f0af5b711461060d578063f2fde38b14610629578063f384bd0514610645578063f7888aec14610663578063fb9ee6c7146106935761021c565b8063e03846911461057c578063e1ec3c6814610598578063e3d33fc9146105d3578063e8a97a3e146105f15761021c565b8063b2b3ff4b116100f4578063b2b3ff4b146104d8578063bdbfa3de146104f6578063ce63094d14610512578063d7b4c4e114610530578063df6d088d1461054c5761021c565b80639377d711146104395780639dcb511a1461046e5780639e281a981461049e578063aedd2dfc146104ba5761021c565b80636faa8b3f116101a8578063803e265d11610177578063803e265d146103a75780638c803fc2146103c55780638da5cb5b146103e1578063929d106f146103ff5780639340817a1461041d5761021c565b80636faa8b3f14610347578063715018a6146103635780637ce3489b1461036d5780637fd6f15c146103895761021c565b8063338b5dea116101ef578063338b5dea146102a55780634b023cf8146102c1578063508493bc146102dd57806354f0cb0d1461030d57806365e17c9d146103295761021c565b806308a0c3751461022157806316345f181461023d5780631cdd78301461026d57806325b6905914610289575b600080fd5b61023b60048036038101906102369190614be9565b6106af565b005b61025760048036038101906102529190614c74565b6106d0565b6040516102649190614cb0565b60405180910390f35b61028760048036038101906102829190614be9565b6108f2565b005b6102a3600480360381019061029e9190614be9565b6111ea565b005b6102bf60048036038101906102ba9190614ccb565b6118f2565b005b6102db60048036038101906102d69190614c74565b611d56565b005b6102f760048036038101906102f29190614d0b565b611da2565b6040516103049190614cb0565b60405180910390f35b61032760048036038101906103229190614d4b565b611dc7565b005b610331612003565b60405161033e9190614d9a565b60405180910390f35b610361600480360381019061035c9190614be9565b612029565b005b61036b612528565b005b61038760048036038101906103829190614be9565b61253c565b005b61039161255d565b60405161039e9190614cb0565b60405180910390f35b6103af612563565b6040516103bc9190614cb0565b60405180910390f35b6103df60048036038101906103da9190614be9565b612569565b005b6103e9612c35565b6040516103f69190614d9a565b60405180910390f35b610407612c5f565b6040516104149190614d9a565b60405180910390f35b61043760048036038101906104329190614be9565b612c85565b005b610453600480360381019061044e9190614be9565b612c97565b60405161046596959493929190614db5565b60405180910390f35b61048860048036038101906104839190614c74565b612d13565b6040516104959190614e75565b60405180910390f35b6104b860048036038101906104b39190614ccb565b612d46565b005b6104c26130f5565b6040516104cf9190614cb0565b60405180910390f35b6104e06130fb565b6040516104ed9190614cb0565b60405180910390f35b610510600480360381019061050b9190614be9565b613101565b005b61051a61350a565b6040516105279190614cb0565b60405180910390f35b61054a60048036038101906105459190614c74565b613510565b005b61056660048036038101906105619190614be9565b61355c565b6040516105739190614cb0565b60405180910390f35b61059660048036038101906105919190614e90565b613574565b005b6105b260048036038101906105ad9190614be9565b6136e8565b6040516105ca9c9b9a99989796959493929190614f1d565b60405180910390f35b6105db6137e8565b6040516105e89190614cb0565b60405180910390f35b61060b60048036038101906106069190614d0b565b6137ee565b005b61062760048036038101906106229190614be9565b613878565b005b610643600480360381019061063e9190614c74565b61388a565b005b61064d61390d565b60405161065a9190614cb0565b60405180910390f35b61067d60048036038101906106789190614d0b565b613913565b60405161068a9190614cb0565b60405180910390f35b6106ad60048036038101906106a89190614e90565b61399a565b005b6106b7613b0e565b6000600b54116106c657600080fd5b80600b8190555050565b6000806000806000600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a69190615064565b9450945050935093506000600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087f9190615118565b60ff1690506000841380156108ac57508469ffffffffffffffffffff168269ffffffffffffffffffff1610155b80156108b9575060008314155b6108c257600080fd5b8060126108cf9190615174565b600a6108db91906152db565b846108e69190615326565b95505050505050919050565b6108fa613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096d57600080fd5b600281600901541461097e57600080fd5b6000610b898260405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b82015481525050613bdb565b9050600c548111610b9957600080fd5b6000610bb38360040154846007015485600b015442613c3d565b90506000610bd4826004600088815260200190815260200160002054613cba565b9050610de08460405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b15610ff557610ff08460405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b6111d1565b8360060154600260008660050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110cd9190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb8460000154338660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886004015489600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a60050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b600601548c600701548d600801548b8d6111af9190615174565b426040516111c89c9b9a9998979695949392919061539c565b60405180910390a15b60038460090181905550505050506111e76143e3565b50565b6111f2613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126557600080fd5b600281600901541461127657600080fd5b42600d54826008015483600b015461128e9190615368565b6112989190615368565b106112a257600080fd5b60006112bc8260040154836007015484600b015442613c3d565b905060006112dd826004600087815260200190815260200160002054613cba565b90506114e98360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b156116fe576116f98360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b6118da565b8260060154600260008560050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117d69190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb8360000154338560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876004015488600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168960050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a600601548b600701548c600801548b8d6118b89190615174565b426040516118d19c9b9a9998979695949392919061539c565b60405180910390a15b600383600901819055505050506118ef6143e3565b50565b6118fa613b8c565b6000611905836106d0565b1161190f57600080fd5b6000811161191c57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119579190614d9a565b602060405180830381865afa158015611974573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119989190615456565b90506119a6833330856143ed565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119e19190614d9a565b602060405180830381865afa1580156119fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a229190615456565b905060008282611a329190615174565b905083811015611a40578093505b83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac89190615368565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506040518060c0016040528060085481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160008152602001428152506005600060085481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501559050507feb65d0f36862bbd8763c5e2c983c9d753267d223eee35a224d8d0a9d7ef433a2600854863387600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051611d27959493929190615483565b60405180910390a160086000815480929190611d42906154d6565b9190505550505050611d526143e3565b5050565b611d5e613b0e565b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002602052816000526040600020602052806000526040600020600091509150505481565b611dcf613b8c565b60006003600084815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e4257600080fd5b6002816009015414611e5357600080fd5b81600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611f0057600080fd5b81600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fd49190615174565b9250508190555081816006016000828254611fef9190615368565b9250508190555050611fff6143e3565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612031613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120a457600080fd5b60028160090154146120b557600080fd5b6003816009018190555060006120d98260040154836007015484600b015442613c3d565b905060006120fa826004600087815260200190815260200160002054613cba565b90506123068360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b8201548152505083613cdd565b61230f57600080fd5b61251a8360405180610180016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600b820154815250508383613d7f565b5050506125256143e3565b50565b612530613b0e565b61253a6000614476565b565b612544613b0e565b610bb881111561255357600080fd5b80600a8190555050565b600a5481565b600f5481565b612571613b8c565b60006003600083815260200190815260200160002090508181600001541461259857600080fd5b60008160090154146125a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036126405780600601546126348260050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b101561263f57600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036126d75780600401546126cb8260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b10156126d657600080fd5b5b600281600901819055504281600b0181905550600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612900578060060154600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127f69190615174565b925050819055508060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128b19190615368565b925050819055503381600a0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612b37565b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612b36578060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612a309190615368565b925050819055508060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612aeb9190615174565b92505081905550338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b7fdcafc6dbac5448cffb7b7888d7c84dc838744a5d806e90325d40920386eacd2f8160000154338360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004015486600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886006015489600701548a60080154600242604051612c219c9b9a99989796959493929190615559565b60405180910390a150612c326143e3565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612c8d613b0e565b80600f8190555050565b60056020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154905086565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612d4e613b8c565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612dd757600080fd5b612de282338361453c565b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e6a9190615174565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506040518060c0016040528060085481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200160018152602001428152506005600060085481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501559050507ffe7813e2866053d5c3938554e517b554fce6666a6561bed9eaa7419b29fa9b68600854833384600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040516130c9959493929190615483565b60405180910390a1600860008154809291906130e4906154d6565b91905055506130f16143e3565b5050565b600c5481565b600d5481565b613109613b8c565b60006003600083815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461317c57600080fd5b600081600901541461318d57600080fd5b60018160090181905550600073ffffffffffffffffffffffffffffffffffffffff1681600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036132d3578060040154600260008360030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546132c79190615368565b9250508190555061340c565b600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361340b578060060154600260008360050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134039190615368565b925050819055505b5b7ff12c65f01e4cbc4711a3be05281e821ea706e98cac3d7fc25aa512be38d069d78160000154338360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004015486600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886006015489600701548a600801546001426040516134f69c9b9a9998979695949392919061564e565b60405180910390a1506135076143e3565b50565b60075481565b613518613b0e565b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b61357c613b8c565b60008111801561358e5750600b548111155b61359757600080fd5b600183101580156135aa57506127108311155b6135b357600080fd5b600085116135c057600080fd5b6000821180156135d15750610e4282105b6135da57600080fd5b846135e58733613913565b10156135f057600080fd5b60006135fb856106d0565b82613605896106d0565b6064896136129190615326565b61361c9190615326565b6136269190615737565b6136309190615737565b905085600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546136be9190615174565b925050819055506136d73333898960008a878b8b6145c2565b506136e06143e3565b505050505050565b60036020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600601549080600701549080600801549080600901549080600a0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600b015490508c565b60085481565b6137f6613b0e565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b613880613b0e565b80600d8190555050565b613892613b0e565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138f8906157eb565b60405180910390fd5b61390a81614476565b50565b600b5481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6139a2613b8c565b6000811180156139b45750600b548111155b6139bd57600080fd5b600183101580156139d057506127108311155b6139d957600080fd5b600085116139e657600080fd5b6000821180156139f75750610e4282105b613a0057600080fd5b6000613a0b856106d0565b82613a15896106d0565b606489613a229190615326565b613a2c9190615326565b613a369190615737565b613a409190615737565b905080613a4d8633613913565b1015613a5857600080fd5b80600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613ae49190615174565b92505081905550613afd3360008989338a878b8b6145c2565b50613b066143e3565b505050505050565b613b166148d9565b73ffffffffffffffffffffffffffffffffffffffff16613b34612c35565b73ffffffffffffffffffffffffffffffffffffffff1614613b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b8190615857565b60405180910390fd5b565b600260005403613bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613bc8906158c3565b60405180910390fd5b6002600081905550565b6000808260800151613bf084606001516106d0565b613bfa9190615326565b905060008360c00151613c108560a001516106d0565b613c1a9190615326565b905080606483613c2a9190615326565b613c349190615737565b92505050919050565b6000828211613c4b57600080fd5b6000612710603c80601861016d8888613c649190615174565b8a8c613c709190615326565b613c7a9190615326565b613c849190615737565b613c8e9190615737565b613c989190615737565b613ca29190615737565b613cac9190615737565b905080915050949350505050565b60006127108284613ccb9190615326565b613cd59190615737565b905092915050565b6000818360800151613cef9190615368565b60026000856060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015905092915050565b60006064600f546064613d929190615174565b856060015173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015613de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e059190615118565b600a613e1191906158e3565b613e1e87606001516106d0565b85613e299190615326565b613e339190615737565b613e3d9190615326565b613e479190615737565b90506000613e54826148e1565b90508015613f38578160026000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613f2c9190615368565b92505081905550613ff2565b8260026000876060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613fea9190615368565b925050819055505b600083856140009190615174565b90508086608001516140129190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000886040015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546140a59190615368565b92505081905550811561421c578260026000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546141659190615174565b9250508190555080866080015161417c9190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546142109190615174565b925050819055506142c8565b84866080015161422c9190615368565b60026000886060015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546142c09190615174565b925050819055505b8560c00151600260008860a0015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088610140015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546143619190615368565b925050819055507f9cdc815dd4fb4c3e808deb72539377b7ee6e0cd3f227c5b48db4ad03f0eb64bb866000015133886040015189606001518a608001518b61014001518c60a001518d60c001518e60e001518f61010001518b426040516143d39c9b9a9998979695949392919061539c565b60405180910390a1505050505050565b6001600081905550565b614470846323b872dd60e01b85858560405160240161440e9392919061592e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614919565b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6145bd8363a9059cbb60e01b848460405160240161455b929190615965565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614919565b505050565b60405180610180016040528060075481526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001600081526020018673ffffffffffffffffffffffffffffffffffffffff168152602001428152506003600060075481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a08201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061016082015181600b0155905050600a54600460006007548152602001908152602001600020819055507f2fbbf22c6ebe94502147a9c148009f41c67fe0f03501a407e2e4f72d8236133d6007548a8a8a8a8a8a8a8a8a6000426040516148ae9c9b9a999897969594939291906159c9565b60405180910390a1600760008154809291906148c9906154d6565b9190505550505050505050505050565b600033905090565b600081614910600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633613913565b10159050919050565b600061497b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166149e19092919063ffffffff16565b905060008151148061499d57508080602001905181019061499c9190615abb565b5b6149dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016149d390615b5a565b60405180910390fd5b505050565b60606149f084846000856149f9565b90509392505050565b606082471015614a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614a3590615bec565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051614a679190615c7d565b60006040518083038185875af1925050503d8060008114614aa4576040519150601f19603f3d011682016040523d82523d6000602084013e614aa9565b606091505b5091509150614aba87838387614ac6565b92505050949350505050565b60608315614b28576000835103614b2057614ae085614b3b565b614b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614b1690615ce0565b60405180910390fd5b5b829050614b33565b614b328383614b5e565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115614b715781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614ba59190615d55565b60405180910390fd5b600080fd5b6000819050919050565b614bc681614bb3565b8114614bd157600080fd5b50565b600081359050614be381614bbd565b92915050565b600060208284031215614bff57614bfe614bae565b5b6000614c0d84828501614bd4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614c4182614c16565b9050919050565b614c5181614c36565b8114614c5c57600080fd5b50565b600081359050614c6e81614c48565b92915050565b600060208284031215614c8a57614c89614bae565b5b6000614c9884828501614c5f565b91505092915050565b614caa81614bb3565b82525050565b6000602082019050614cc56000830184614ca1565b92915050565b60008060408385031215614ce257614ce1614bae565b5b6000614cf085828601614c5f565b9250506020614d0185828601614bd4565b9150509250929050565b60008060408385031215614d2257614d21614bae565b5b6000614d3085828601614c5f565b9250506020614d4185828601614c5f565b9150509250929050565b60008060408385031215614d6257614d61614bae565b5b6000614d7085828601614bd4565b9250506020614d8185828601614bd4565b9150509250929050565b614d9481614c36565b82525050565b6000602082019050614daf6000830184614d8b565b92915050565b600060c082019050614dca6000830189614ca1565b614dd76020830188614d8b565b614de46040830187614d8b565b614df16060830186614ca1565b614dfe6080830185614ca1565b614e0b60a0830184614ca1565b979650505050505050565b6000819050919050565b6000614e3b614e36614e3184614c16565b614e16565b614c16565b9050919050565b6000614e4d82614e20565b9050919050565b6000614e5f82614e42565b9050919050565b614e6f81614e54565b82525050565b6000602082019050614e8a6000830184614e66565b92915050565b60008060008060008060c08789031215614ead57614eac614bae565b5b6000614ebb89828a01614c5f565b9650506020614ecc89828a01614bd4565b9550506040614edd89828a01614c5f565b9450506060614eee89828a01614bd4565b9350506080614eff89828a01614bd4565b92505060a0614f1089828a01614bd4565b9150509295509295509295565b600061018082019050614f33600083018f614ca1565b614f40602083018e614d8b565b614f4d604083018d614d8b565b614f5a606083018c614d8b565b614f67608083018b614ca1565b614f7460a083018a614d8b565b614f8160c0830189614ca1565b614f8e60e0830188614ca1565b614f9c610100830187614ca1565b614faa610120830186614ca1565b614fb8610140830185614d8b565b614fc6610160830184614ca1565b9d9c50505050505050505050505050565b600069ffffffffffffffffffff82169050919050565b614ff681614fd7565b811461500157600080fd5b50565b60008151905061501381614fed565b92915050565b6000819050919050565b61502c81615019565b811461503757600080fd5b50565b60008151905061504981615023565b92915050565b60008151905061505e81614bbd565b92915050565b600080600080600060a086880312156150805761507f614bae565b5b600061508e88828901615004565b955050602061509f8882890161503a565b94505060406150b08882890161504f565b93505060606150c18882890161504f565b92505060806150d288828901615004565b9150509295509295909350565b600060ff82169050919050565b6150f5816150df565b811461510057600080fd5b50565b600081519050615112816150ec565b92915050565b60006020828403121561512e5761512d614bae565b5b600061513c84828501615103565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061517f82614bb3565b915061518a83614bb3565b92508282039050818111156151a2576151a1615145565b5b92915050565b60008160011c9050919050565b6000808291508390505b60018511156151ff578086048111156151db576151da615145565b5b60018516156151ea5780820291505b80810290506151f8856151a8565b94506151bf565b94509492505050565b60008261521857600190506152d4565b8161522657600090506152d4565b816001811461523c576002811461524657615275565b60019150506152d4565b60ff84111561525857615257615145565b5b8360020a91508482111561526f5761526e615145565b5b506152d4565b5060208310610133831016604e8410600b84101617156152aa5782820a9050838111156152a5576152a4615145565b5b6152d4565b6152b784848460016151b5565b925090508184048111156152ce576152cd615145565b5b81810290505b9392505050565b60006152e682614bb3565b91506152f183614bb3565b925061531e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484615208565b905092915050565b600061533182614bb3565b915061533c83614bb3565b925082820261534a81614bb3565b9150828204841483151761536157615360615145565b5b5092915050565b600061537382614bb3565b915061537e83614bb3565b925082820190508082111561539657615395615145565b5b92915050565b6000610180820190506153b2600083018f614ca1565b6153bf602083018e614d8b565b6153cc604083018d614d8b565b6153d9606083018c614d8b565b6153e6608083018b614ca1565b6153f360a083018a614d8b565b61540060c0830189614d8b565b61540d60e0830188614ca1565b61541b610100830187614ca1565b615429610120830186614ca1565b615437610140830185614ca1565b615445610160830184614ca1565b9d9c50505050505050505050505050565b60006020828403121561546c5761546b614bae565b5b600061547a8482850161504f565b91505092915050565b600060a0820190506154986000830188614ca1565b6154a56020830187614d8b565b6154b26040830186614d8b565b6154bf6060830185614ca1565b6154cc6080830184614ca1565b9695505050505050565b60006154e182614bb3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361551357615512615145565b5b600182019050919050565b6000819050919050565b600061554361553e6155398461551e565b614e16565b614bb3565b9050919050565b61555381615528565b82525050565b60006101808201905061556f600083018f614ca1565b61557c602083018e614d8b565b615589604083018d614d8b565b615596606083018c614d8b565b6155a3608083018b614ca1565b6155b060a083018a614d8b565b6155bd60c0830189614d8b565b6155ca60e0830188614ca1565b6155d8610100830187614ca1565b6155e6610120830186614ca1565b6155f461014083018561554a565b615602610160830184614ca1565b9d9c50505050505050505050505050565b6000819050919050565b600061563861563361562e84615613565b614e16565b614bb3565b9050919050565b6156488161561d565b82525050565b600061018082019050615664600083018f614ca1565b615671602083018e614d8b565b61567e604083018d614d8b565b61568b606083018c614d8b565b615698608083018b614ca1565b6156a560a083018a614d8b565b6156b260c0830189614d8b565b6156bf60e0830188614ca1565b6156cd610100830187614ca1565b6156db610120830186614ca1565b6156e961014083018561563f565b6156f7610160830184614ca1565b9d9c50505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061574282614bb3565b915061574d83614bb3565b92508261575d5761575c615708565b5b828204905092915050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006157d5602683615768565b91506157e082615779565b604082019050919050565b60006020820190508181036000830152615804816157c8565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000615841602083615768565b915061584c8261580b565b602082019050919050565b6000602082019050818103600083015261587081615834565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006158ad601f83615768565b91506158b882615877565b602082019050919050565b600060208201905081810360008301526158dc816158a0565b9050919050565b60006158ee82614bb3565b91506158f9836150df565b92506159267fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484615208565b905092915050565b60006060820190506159436000830186614d8b565b6159506020830185614d8b565b61595d6040830184614ca1565b949350505050565b600060408201905061597a6000830185614d8b565b6159876020830184614ca1565b9392505050565b6000819050919050565b60006159b36159ae6159a98461598e565b614e16565b614bb3565b9050919050565b6159c381615998565b82525050565b6000610180820190506159df600083018f614ca1565b6159ec602083018e614d8b565b6159f9604083018d614d8b565b615a06606083018c614d8b565b615a13608083018b614ca1565b615a2060a083018a614d8b565b615a2d60c0830189614d8b565b615a3a60e0830188614ca1565b615a48610100830187614ca1565b615a56610120830186614ca1565b615a646101408301856159ba565b615a72610160830184614ca1565b9d9c50505050505050505050505050565b60008115159050919050565b615a9881615a83565b8114615aa357600080fd5b50565b600081519050615ab581615a8f565b92915050565b600060208284031215615ad157615ad0614bae565b5b6000615adf84828501615aa6565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000615b44602a83615768565b9150615b4f82615ae8565b604082019050919050565b60006020820190508181036000830152615b7381615b37565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615bd6602683615768565b9150615be182615b7a565b604082019050919050565b60006020820190508181036000830152615c0581615bc9565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015615c40578082015181840152602081019050615c25565b60008484015250505050565b6000615c5782615c0c565b615c618185615c17565b9350615c71818560208601615c22565b80840191505092915050565b6000615c898284615c4c565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615cca601d83615768565b9150615cd582615c94565b602082019050919050565b60006020820190508181036000830152615cf981615cbd565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b6000615d2782615d00565b615d318185615768565b9350615d41818560208601615c22565b615d4a81615d0b565b840191505092915050565b60006020820190508181036000830152615d6f8184615d1c565b90509291505056fea2646970667358221220dd5a993f247db6a610bb8b937eecc1eeea6b97b85c1be53d8d8f6a0a22415f4c64736f6c63430008130033

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

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.