ETH Price: $2,375.85 (+0.32%)
Gas: 4.35 Gwei

Contract

0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Withdraw Collate...208848092024-10-03 11:51:5922 hrs ago1727956319IN
Morpho: Morpho Blue
0 ETH0.000682675.92577046
Supply208836512024-10-03 7:59:3526 hrs ago1727942375IN
Morpho: Morpho Blue
0 ETH0.000725835.30290148
Set Authorizatio...208831532024-10-03 6:19:5927 hrs ago1727936399IN
Morpho: Morpho Blue
0 ETH0.000297096.28940032
Supply208816952024-10-03 1:26:5932 hrs ago1727918819IN
Morpho: Morpho Blue
0 ETH0.000787086.29833233
Supply Collatera...208810262024-10-02 23:12:5935 hrs ago1727910779IN
Morpho: Morpho Blue
0 ETH0.00037784.5607909
Borrow208810162024-10-02 23:10:5935 hrs ago1727910659IN
Morpho: Morpho Blue
0 ETH0.000754584.63903632
Supply208809922024-10-02 23:05:5935 hrs ago1727910359IN
Morpho: Morpho Blue
0 ETH0.000621284.7414981
Supply Collatera...208809402024-10-02 22:55:3535 hrs ago1727909735IN
Morpho: Morpho Blue
0 ETH0.000565425.65773654
Create Market208808882024-10-02 22:45:1135 hrs ago1727909111IN
Morpho: Morpho Blue
0 ETH0.001119985.61580703
Supply208802902024-10-02 20:45:2337 hrs ago1727901923IN
Morpho: Morpho Blue
0 ETH0.0020780113.76865142
Withdraw208770992024-10-02 10:04:352 days ago1727863475IN
Morpho: Morpho Blue
0 ETH0.000931729.61372278
Create Market208722212024-10-01 17:45:232 days ago1727804723IN
Morpho: Morpho Blue
0 ETH0.0084031742.13238853
Create Market208713882024-10-01 14:58:112 days ago1727794691IN
Morpho: Morpho Blue
0 ETH0.0029396935.04930683
Withdraw208710952024-10-01 13:58:352 days ago1727791115IN
Morpho: Morpho Blue
0 ETH0.0034706930.44039859
Borrow208692112024-10-01 7:40:113 days ago1727768411IN
Morpho: Morpho Blue
0 ETH0.0024845913.3496956
Supply Collatera...208692102024-10-01 7:39:593 days ago1727768399IN
Morpho: Morpho Blue
0 ETH0.0009390313.67913269
Supply208692082024-10-01 7:39:353 days ago1727768375IN
Morpho: Morpho Blue
0 ETH0.0017087812.78179091
Create Market208692062024-10-01 7:39:113 days ago1727768351IN
Morpho: Morpho Blue
0 ETH0.0027412713.74604968
Set Authorizatio...208677242024-10-01 2:41:473 days ago1727750507IN
Morpho: Morpho Blue
0 ETH0.000321326.80224246
Withdraw208631522024-09-30 11:24:473 days ago1727695487IN
Morpho: Morpho Blue
0 ETH0.000977238.57192644
Withdraw208542302024-09-29 5:32:595 days ago1727587979IN
Morpho: Morpho Blue
0 ETH0.000504814.66017731
Supply208541692024-09-29 5:20:475 days ago1727587247IN
Morpho: Morpho Blue
0 ETH0.000509325
Supply208517192024-09-28 21:08:115 days ago1727557691IN
Morpho: Morpho Blue
0 ETH0.000586745.76002283
Withdraw208516872024-09-28 21:01:475 days ago1727557307IN
Morpho: Morpho Blue
0 ETH0.000504915.97933747
Withdraw208478452024-09-28 8:09:476 days ago1727510987IN
Morpho: Morpho Blue
0 ETH0.000648937.68492256
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
208914812024-10-04 10:12:351 min ago1728036755
0xBBBBBbbB...C37EEFFCb
0 ETH
208914812024-10-04 10:12:351 min ago1728036755
0xBBBBBbbB...C37EEFFCb
0 ETH
208914812024-10-04 10:12:351 min ago1728036755
0xBBBBBbbB...C37EEFFCb
0 ETH
208914812024-10-04 10:12:351 min ago1728036755
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914562024-10-04 10:07:356 mins ago1728036455
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914482024-10-04 10:05:598 mins ago1728036359
0xBBBBBbbB...C37EEFFCb
0 ETH
208914332024-10-04 10:02:5911 mins ago1728036179
0xBBBBBbbB...C37EEFFCb
0 ETH
208914332024-10-04 10:02:5911 mins ago1728036179
0xBBBBBbbB...C37EEFFCb
0 ETH
208914332024-10-04 10:02:5911 mins ago1728036179
0xBBBBBbbB...C37EEFFCb
0 ETH
208914332024-10-04 10:02:5911 mins ago1728036179
0xBBBBBbbB...C37EEFFCb
0 ETH
208914022024-10-04 9:56:3517 mins ago1728035795
0xBBBBBbbB...C37EEFFCb
0 ETH
208914022024-10-04 9:56:3517 mins ago1728035795
0xBBBBBbbB...C37EEFFCb
0 ETH
208914022024-10-04 9:56:3517 mins ago1728035795
0xBBBBBbbB...C37EEFFCb
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Morpho

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 999999 runs

Other Settings:
paris EvmVersion
File 1 of 14 : Morpho.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {
    Id,
    IMorphoStaticTyping,
    IMorphoBase,
    MarketParams,
    Position,
    Market,
    Authorization,
    Signature
} from "./interfaces/IMorpho.sol";
import {
    IMorphoLiquidateCallback,
    IMorphoRepayCallback,
    IMorphoSupplyCallback,
    IMorphoSupplyCollateralCallback,
    IMorphoFlashLoanCallback
} from "./interfaces/IMorphoCallbacks.sol";
import {IIrm} from "./interfaces/IIrm.sol";
import {IERC20} from "./interfaces/IERC20.sol";
import {IOracle} from "./interfaces/IOracle.sol";

import "./libraries/ConstantsLib.sol";
import {UtilsLib} from "./libraries/UtilsLib.sol";
import {EventsLib} from "./libraries/EventsLib.sol";
import {ErrorsLib} from "./libraries/ErrorsLib.sol";
import {MathLib, WAD} from "./libraries/MathLib.sol";
import {SharesMathLib} from "./libraries/SharesMathLib.sol";
import {MarketParamsLib} from "./libraries/MarketParamsLib.sol";
import {SafeTransferLib} from "./libraries/SafeTransferLib.sol";

/// @title Morpho
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice The Morpho contract.
contract Morpho is IMorphoStaticTyping {
    using MathLib for uint128;
    using MathLib for uint256;
    using UtilsLib for uint256;
    using SharesMathLib for uint256;
    using SafeTransferLib for IERC20;
    using MarketParamsLib for MarketParams;

    /* IMMUTABLES */

    /// @inheritdoc IMorphoBase
    bytes32 public immutable DOMAIN_SEPARATOR;

    /* STORAGE */

    /// @inheritdoc IMorphoBase
    address public owner;
    /// @inheritdoc IMorphoBase
    address public feeRecipient;
    /// @inheritdoc IMorphoStaticTyping
    mapping(Id => mapping(address => Position)) public position;
    /// @inheritdoc IMorphoStaticTyping
    mapping(Id => Market) public market;
    /// @inheritdoc IMorphoBase
    mapping(address => bool) public isIrmEnabled;
    /// @inheritdoc IMorphoBase
    mapping(uint256 => bool) public isLltvEnabled;
    /// @inheritdoc IMorphoBase
    mapping(address => mapping(address => bool)) public isAuthorized;
    /// @inheritdoc IMorphoBase
    mapping(address => uint256) public nonce;
    /// @inheritdoc IMorphoStaticTyping
    mapping(Id => MarketParams) public idToMarketParams;

    /* CONSTRUCTOR */

    /// @param newOwner The new owner of the contract.
    constructor(address newOwner) {
        require(newOwner != address(0), ErrorsLib.ZERO_ADDRESS);

        DOMAIN_SEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, block.chainid, address(this)));
        owner = newOwner;

        emit EventsLib.SetOwner(newOwner);
    }

    /* MODIFIERS */

    /// @dev Reverts if the caller is not the owner.
    modifier onlyOwner() {
        require(msg.sender == owner, ErrorsLib.NOT_OWNER);
        _;
    }

    /* ONLY OWNER FUNCTIONS */

    /// @inheritdoc IMorphoBase
    function setOwner(address newOwner) external onlyOwner {
        require(newOwner != owner, ErrorsLib.ALREADY_SET);

        owner = newOwner;

        emit EventsLib.SetOwner(newOwner);
    }

    /// @inheritdoc IMorphoBase
    function enableIrm(address irm) external onlyOwner {
        require(!isIrmEnabled[irm], ErrorsLib.ALREADY_SET);

        isIrmEnabled[irm] = true;

        emit EventsLib.EnableIrm(irm);
    }

    /// @inheritdoc IMorphoBase
    function enableLltv(uint256 lltv) external onlyOwner {
        require(!isLltvEnabled[lltv], ErrorsLib.ALREADY_SET);
        require(lltv < WAD, ErrorsLib.MAX_LLTV_EXCEEDED);

        isLltvEnabled[lltv] = true;

        emit EventsLib.EnableLltv(lltv);
    }

    /// @inheritdoc IMorphoBase
    function setFee(MarketParams memory marketParams, uint256 newFee) external onlyOwner {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(newFee != market[id].fee, ErrorsLib.ALREADY_SET);
        require(newFee <= MAX_FEE, ErrorsLib.MAX_FEE_EXCEEDED);

        // Accrue interest using the previous fee set before changing it.
        _accrueInterest(marketParams, id);

        // Safe "unchecked" cast.
        market[id].fee = uint128(newFee);

        emit EventsLib.SetFee(id, newFee);
    }

    /// @inheritdoc IMorphoBase
    function setFeeRecipient(address newFeeRecipient) external onlyOwner {
        require(newFeeRecipient != feeRecipient, ErrorsLib.ALREADY_SET);

        feeRecipient = newFeeRecipient;

        emit EventsLib.SetFeeRecipient(newFeeRecipient);
    }

    /* MARKET CREATION */

    /// @inheritdoc IMorphoBase
    function createMarket(MarketParams memory marketParams) external {
        Id id = marketParams.id();
        require(isIrmEnabled[marketParams.irm], ErrorsLib.IRM_NOT_ENABLED);
        require(isLltvEnabled[marketParams.lltv], ErrorsLib.LLTV_NOT_ENABLED);
        require(market[id].lastUpdate == 0, ErrorsLib.MARKET_ALREADY_CREATED);

        // Safe "unchecked" cast.
        market[id].lastUpdate = uint128(block.timestamp);
        idToMarketParams[id] = marketParams;

        emit EventsLib.CreateMarket(id, marketParams);

        // Call to initialize the IRM in case it is stateful.
        if (marketParams.irm != address(0)) IIrm(marketParams.irm).borrowRate(marketParams, market[id]);
    }

    /* SUPPLY MANAGEMENT */

    /// @inheritdoc IMorphoBase
    function supply(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        bytes calldata data
    ) external returns (uint256, uint256) {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(UtilsLib.exactlyOneZero(assets, shares), ErrorsLib.INCONSISTENT_INPUT);
        require(onBehalf != address(0), ErrorsLib.ZERO_ADDRESS);

        _accrueInterest(marketParams, id);

        if (assets > 0) shares = assets.toSharesDown(market[id].totalSupplyAssets, market[id].totalSupplyShares);
        else assets = shares.toAssetsUp(market[id].totalSupplyAssets, market[id].totalSupplyShares);

        position[id][onBehalf].supplyShares += shares;
        market[id].totalSupplyShares += shares.toUint128();
        market[id].totalSupplyAssets += assets.toUint128();

        emit EventsLib.Supply(id, msg.sender, onBehalf, assets, shares);

        if (data.length > 0) IMorphoSupplyCallback(msg.sender).onMorphoSupply(assets, data);

        IERC20(marketParams.loanToken).safeTransferFrom(msg.sender, address(this), assets);

        return (assets, shares);
    }

    /// @inheritdoc IMorphoBase
    function withdraw(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        address receiver
    ) external returns (uint256, uint256) {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(UtilsLib.exactlyOneZero(assets, shares), ErrorsLib.INCONSISTENT_INPUT);
        require(receiver != address(0), ErrorsLib.ZERO_ADDRESS);
        // No need to verify that onBehalf != address(0) thanks to the following authorization check.
        require(_isSenderAuthorized(onBehalf), ErrorsLib.UNAUTHORIZED);

        _accrueInterest(marketParams, id);

        if (assets > 0) shares = assets.toSharesUp(market[id].totalSupplyAssets, market[id].totalSupplyShares);
        else assets = shares.toAssetsDown(market[id].totalSupplyAssets, market[id].totalSupplyShares);

        position[id][onBehalf].supplyShares -= shares;
        market[id].totalSupplyShares -= shares.toUint128();
        market[id].totalSupplyAssets -= assets.toUint128();

        require(market[id].totalBorrowAssets <= market[id].totalSupplyAssets, ErrorsLib.INSUFFICIENT_LIQUIDITY);

        emit EventsLib.Withdraw(id, msg.sender, onBehalf, receiver, assets, shares);

        IERC20(marketParams.loanToken).safeTransfer(receiver, assets);

        return (assets, shares);
    }

    /* BORROW MANAGEMENT */

    /// @inheritdoc IMorphoBase
    function borrow(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        address receiver
    ) external returns (uint256, uint256) {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(UtilsLib.exactlyOneZero(assets, shares), ErrorsLib.INCONSISTENT_INPUT);
        require(receiver != address(0), ErrorsLib.ZERO_ADDRESS);
        // No need to verify that onBehalf != address(0) thanks to the following authorization check.
        require(_isSenderAuthorized(onBehalf), ErrorsLib.UNAUTHORIZED);

        _accrueInterest(marketParams, id);

        if (assets > 0) shares = assets.toSharesUp(market[id].totalBorrowAssets, market[id].totalBorrowShares);
        else assets = shares.toAssetsDown(market[id].totalBorrowAssets, market[id].totalBorrowShares);

        position[id][onBehalf].borrowShares += shares.toUint128();
        market[id].totalBorrowShares += shares.toUint128();
        market[id].totalBorrowAssets += assets.toUint128();

        require(_isHealthy(marketParams, id, onBehalf), ErrorsLib.INSUFFICIENT_COLLATERAL);
        require(market[id].totalBorrowAssets <= market[id].totalSupplyAssets, ErrorsLib.INSUFFICIENT_LIQUIDITY);

        emit EventsLib.Borrow(id, msg.sender, onBehalf, receiver, assets, shares);

        IERC20(marketParams.loanToken).safeTransfer(receiver, assets);

        return (assets, shares);
    }

    /// @inheritdoc IMorphoBase
    function repay(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        bytes calldata data
    ) external returns (uint256, uint256) {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(UtilsLib.exactlyOneZero(assets, shares), ErrorsLib.INCONSISTENT_INPUT);
        require(onBehalf != address(0), ErrorsLib.ZERO_ADDRESS);

        _accrueInterest(marketParams, id);

        if (assets > 0) shares = assets.toSharesDown(market[id].totalBorrowAssets, market[id].totalBorrowShares);
        else assets = shares.toAssetsUp(market[id].totalBorrowAssets, market[id].totalBorrowShares);

        position[id][onBehalf].borrowShares -= shares.toUint128();
        market[id].totalBorrowShares -= shares.toUint128();
        market[id].totalBorrowAssets = UtilsLib.zeroFloorSub(market[id].totalBorrowAssets, assets).toUint128();

        // `assets` may be greater than `totalBorrowAssets` by 1.
        emit EventsLib.Repay(id, msg.sender, onBehalf, assets, shares);

        if (data.length > 0) IMorphoRepayCallback(msg.sender).onMorphoRepay(assets, data);

        IERC20(marketParams.loanToken).safeTransferFrom(msg.sender, address(this), assets);

        return (assets, shares);
    }

    /* COLLATERAL MANAGEMENT */

    /// @inheritdoc IMorphoBase
    function supplyCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, bytes calldata data)
        external
    {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(assets != 0, ErrorsLib.ZERO_ASSETS);
        require(onBehalf != address(0), ErrorsLib.ZERO_ADDRESS);

        // Don't accrue interest because it's not required and it saves gas.

        position[id][onBehalf].collateral += assets.toUint128();

        emit EventsLib.SupplyCollateral(id, msg.sender, onBehalf, assets);

        if (data.length > 0) IMorphoSupplyCollateralCallback(msg.sender).onMorphoSupplyCollateral(assets, data);

        IERC20(marketParams.collateralToken).safeTransferFrom(msg.sender, address(this), assets);
    }

    /// @inheritdoc IMorphoBase
    function withdrawCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, address receiver)
        external
    {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(assets != 0, ErrorsLib.ZERO_ASSETS);
        require(receiver != address(0), ErrorsLib.ZERO_ADDRESS);
        // No need to verify that onBehalf != address(0) thanks to the following authorization check.
        require(_isSenderAuthorized(onBehalf), ErrorsLib.UNAUTHORIZED);

        _accrueInterest(marketParams, id);

        position[id][onBehalf].collateral -= assets.toUint128();

        require(_isHealthy(marketParams, id, onBehalf), ErrorsLib.INSUFFICIENT_COLLATERAL);

        emit EventsLib.WithdrawCollateral(id, msg.sender, onBehalf, receiver, assets);

        IERC20(marketParams.collateralToken).safeTransfer(receiver, assets);
    }

    /* LIQUIDATION */

    /// @inheritdoc IMorphoBase
    function liquidate(
        MarketParams memory marketParams,
        address borrower,
        uint256 seizedAssets,
        uint256 repaidShares,
        bytes calldata data
    ) external returns (uint256, uint256) {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);
        require(UtilsLib.exactlyOneZero(seizedAssets, repaidShares), ErrorsLib.INCONSISTENT_INPUT);

        _accrueInterest(marketParams, id);

        {
            uint256 collateralPrice = IOracle(marketParams.oracle).price();

            require(!_isHealthy(marketParams, id, borrower, collateralPrice), ErrorsLib.HEALTHY_POSITION);

            // The liquidation incentive factor is min(maxLiquidationIncentiveFactor, 1/(1 - cursor*(1 - lltv))).
            uint256 liquidationIncentiveFactor = UtilsLib.min(
                MAX_LIQUIDATION_INCENTIVE_FACTOR,
                WAD.wDivDown(WAD - LIQUIDATION_CURSOR.wMulDown(WAD - marketParams.lltv))
            );

            if (seizedAssets > 0) {
                uint256 seizedAssetsQuoted = seizedAssets.mulDivUp(collateralPrice, ORACLE_PRICE_SCALE);

                repaidShares = seizedAssetsQuoted.wDivUp(liquidationIncentiveFactor).toSharesUp(
                    market[id].totalBorrowAssets, market[id].totalBorrowShares
                );
            } else {
                seizedAssets = repaidShares.toAssetsDown(market[id].totalBorrowAssets, market[id].totalBorrowShares)
                    .wMulDown(liquidationIncentiveFactor).mulDivDown(ORACLE_PRICE_SCALE, collateralPrice);
            }
        }
        uint256 repaidAssets = repaidShares.toAssetsUp(market[id].totalBorrowAssets, market[id].totalBorrowShares);

        position[id][borrower].borrowShares -= repaidShares.toUint128();
        market[id].totalBorrowShares -= repaidShares.toUint128();
        market[id].totalBorrowAssets = UtilsLib.zeroFloorSub(market[id].totalBorrowAssets, repaidAssets).toUint128();

        position[id][borrower].collateral -= seizedAssets.toUint128();

        uint256 badDebtShares;
        uint256 badDebtAssets;
        if (position[id][borrower].collateral == 0) {
            badDebtShares = position[id][borrower].borrowShares;
            badDebtAssets = UtilsLib.min(
                market[id].totalBorrowAssets,
                badDebtShares.toAssetsUp(market[id].totalBorrowAssets, market[id].totalBorrowShares)
            );

            market[id].totalBorrowAssets -= badDebtAssets.toUint128();
            market[id].totalSupplyAssets -= badDebtAssets.toUint128();
            market[id].totalBorrowShares -= badDebtShares.toUint128();
            position[id][borrower].borrowShares = 0;
        }

        // `repaidAssets` may be greater than `totalBorrowAssets` by 1.
        emit EventsLib.Liquidate(
            id, msg.sender, borrower, repaidAssets, repaidShares, seizedAssets, badDebtAssets, badDebtShares
        );

        IERC20(marketParams.collateralToken).safeTransfer(msg.sender, seizedAssets);

        if (data.length > 0) IMorphoLiquidateCallback(msg.sender).onMorphoLiquidate(repaidAssets, data);

        IERC20(marketParams.loanToken).safeTransferFrom(msg.sender, address(this), repaidAssets);

        return (seizedAssets, repaidAssets);
    }

    /* FLASH LOANS */

    /// @inheritdoc IMorphoBase
    function flashLoan(address token, uint256 assets, bytes calldata data) external {
        require(assets != 0, ErrorsLib.ZERO_ASSETS);

        emit EventsLib.FlashLoan(msg.sender, token, assets);

        IERC20(token).safeTransfer(msg.sender, assets);

        IMorphoFlashLoanCallback(msg.sender).onMorphoFlashLoan(assets, data);

        IERC20(token).safeTransferFrom(msg.sender, address(this), assets);
    }

    /* AUTHORIZATION */

    /// @inheritdoc IMorphoBase
    function setAuthorization(address authorized, bool newIsAuthorized) external {
        require(newIsAuthorized != isAuthorized[msg.sender][authorized], ErrorsLib.ALREADY_SET);

        isAuthorized[msg.sender][authorized] = newIsAuthorized;

        emit EventsLib.SetAuthorization(msg.sender, msg.sender, authorized, newIsAuthorized);
    }

    /// @inheritdoc IMorphoBase
    function setAuthorizationWithSig(Authorization memory authorization, Signature calldata signature) external {
        /// Do not check whether authorization is already set because the nonce increment is a desired side effect.
        require(block.timestamp <= authorization.deadline, ErrorsLib.SIGNATURE_EXPIRED);
        require(authorization.nonce == nonce[authorization.authorizer]++, ErrorsLib.INVALID_NONCE);

        bytes32 hashStruct = keccak256(abi.encode(AUTHORIZATION_TYPEHASH, authorization));
        bytes32 digest = keccak256(bytes.concat("\x19\x01", DOMAIN_SEPARATOR, hashStruct));
        address signatory = ecrecover(digest, signature.v, signature.r, signature.s);

        require(signatory != address(0) && authorization.authorizer == signatory, ErrorsLib.INVALID_SIGNATURE);

        emit EventsLib.IncrementNonce(msg.sender, authorization.authorizer, authorization.nonce);

        isAuthorized[authorization.authorizer][authorization.authorized] = authorization.isAuthorized;

        emit EventsLib.SetAuthorization(
            msg.sender, authorization.authorizer, authorization.authorized, authorization.isAuthorized
        );
    }

    /// @dev Returns whether the sender is authorized to manage `onBehalf`'s positions.
    function _isSenderAuthorized(address onBehalf) internal view returns (bool) {
        return msg.sender == onBehalf || isAuthorized[onBehalf][msg.sender];
    }

    /* INTEREST MANAGEMENT */

    /// @inheritdoc IMorphoBase
    function accrueInterest(MarketParams memory marketParams) external {
        Id id = marketParams.id();
        require(market[id].lastUpdate != 0, ErrorsLib.MARKET_NOT_CREATED);

        _accrueInterest(marketParams, id);
    }

    /// @dev Accrues interest for the given market `marketParams`.
    /// @dev Assumes that the inputs `marketParams` and `id` match.
    function _accrueInterest(MarketParams memory marketParams, Id id) internal {
        uint256 elapsed = block.timestamp - market[id].lastUpdate;
        if (elapsed == 0) return;

        if (marketParams.irm != address(0)) {
            uint256 borrowRate = IIrm(marketParams.irm).borrowRate(marketParams, market[id]);
            uint256 interest = market[id].totalBorrowAssets.wMulDown(borrowRate.wTaylorCompounded(elapsed));
            market[id].totalBorrowAssets += interest.toUint128();
            market[id].totalSupplyAssets += interest.toUint128();

            uint256 feeShares;
            if (market[id].fee != 0) {
                uint256 feeAmount = interest.wMulDown(market[id].fee);
                // The fee amount is subtracted from the total supply in this calculation to compensate for the fact
                // that total supply is already increased by the full interest (including the fee amount).
                feeShares =
                    feeAmount.toSharesDown(market[id].totalSupplyAssets - feeAmount, market[id].totalSupplyShares);
                position[id][feeRecipient].supplyShares += feeShares;
                market[id].totalSupplyShares += feeShares.toUint128();
            }

            emit EventsLib.AccrueInterest(id, borrowRate, interest, feeShares);
        }

        // Safe "unchecked" cast.
        market[id].lastUpdate = uint128(block.timestamp);
    }

    /* HEALTH CHECK */

    /// @dev Returns whether the position of `borrower` in the given market `marketParams` is healthy.
    /// @dev Assumes that the inputs `marketParams` and `id` match.
    function _isHealthy(MarketParams memory marketParams, Id id, address borrower) internal view returns (bool) {
        if (position[id][borrower].borrowShares == 0) return true;

        uint256 collateralPrice = IOracle(marketParams.oracle).price();

        return _isHealthy(marketParams, id, borrower, collateralPrice);
    }

    /// @dev Returns whether the position of `borrower` in the given market `marketParams` with the given
    /// `collateralPrice` is healthy.
    /// @dev Assumes that the inputs `marketParams` and `id` match.
    /// @dev Rounds in favor of the protocol, so one might not be able to borrow exactly `maxBorrow` but one unit less.
    function _isHealthy(MarketParams memory marketParams, Id id, address borrower, uint256 collateralPrice)
        internal
        view
        returns (bool)
    {
        uint256 borrowed = uint256(position[id][borrower].borrowShares).toAssetsUp(
            market[id].totalBorrowAssets, market[id].totalBorrowShares
        );
        uint256 maxBorrow = uint256(position[id][borrower].collateral).mulDivDown(collateralPrice, ORACLE_PRICE_SCALE)
            .wMulDown(marketParams.lltv);

        return maxBorrow >= borrowed;
    }

    /* STORAGE VIEW */

    /// @inheritdoc IMorphoBase
    function extSloads(bytes32[] calldata slots) external view returns (bytes32[] memory res) {
        uint256 nSlots = slots.length;

        res = new bytes32[](nSlots);

        for (uint256 i; i < nSlots;) {
            bytes32 slot = slots[i++];

            assembly ("memory-safe") {
                mstore(add(res, mul(i, 32)), sload(slot))
            }
        }
    }
}

File 2 of 14 : IMorpho.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

type Id is bytes32;

struct MarketParams {
    address loanToken;
    address collateralToken;
    address oracle;
    address irm;
    uint256 lltv;
}

/// @dev Warning: For `feeRecipient`, `supplyShares` does not contain the accrued shares since the last interest
/// accrual.
struct Position {
    uint256 supplyShares;
    uint128 borrowShares;
    uint128 collateral;
}

/// @dev Warning: `totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
/// @dev Warning: `totalSupplyShares` does not contain the additional shares accrued by `feeRecipient` since the last
/// interest accrual.
struct Market {
    uint128 totalSupplyAssets;
    uint128 totalSupplyShares;
    uint128 totalBorrowAssets;
    uint128 totalBorrowShares;
    uint128 lastUpdate;
    uint128 fee;
}

struct Authorization {
    address authorizer;
    address authorized;
    bool isAuthorized;
    uint256 nonce;
    uint256 deadline;
}

struct Signature {
    uint8 v;
    bytes32 r;
    bytes32 s;
}

/// @dev This interface is used for factorizing IMorphoStaticTyping and IMorpho.
/// @dev Consider using the IMorpho interface instead of this one.
interface IMorphoBase {
    /// @notice The EIP-712 domain separator.
    /// @dev Warning: Every EIP-712 signed message based on this domain separator can be reused on another chain sharing
    /// the same chain id because the domain separator would be the same.
    function DOMAIN_SEPARATOR() external view returns (bytes32);

    /// @notice The owner of the contract.
    /// @dev It has the power to change the owner.
    /// @dev It has the power to set fees on markets and set the fee recipient.
    /// @dev It has the power to enable but not disable IRMs and LLTVs.
    function owner() external view returns (address);

    /// @notice The fee recipient of all markets.
    /// @dev The recipient receives the fees of a given market through a supply position on that market.
    function feeRecipient() external view returns (address);

    /// @notice Whether the `irm` is enabled.
    function isIrmEnabled(address irm) external view returns (bool);

    /// @notice Whether the `lltv` is enabled.
    function isLltvEnabled(uint256 lltv) external view returns (bool);

    /// @notice Whether `authorized` is authorized to modify `authorizer`'s position on all markets.
    /// @dev Anyone is authorized to modify their own positions, regardless of this variable.
    function isAuthorized(address authorizer, address authorized) external view returns (bool);

    /// @notice The `authorizer`'s current nonce. Used to prevent replay attacks with EIP-712 signatures.
    function nonce(address authorizer) external view returns (uint256);

    /// @notice Sets `newOwner` as `owner` of the contract.
    /// @dev Warning: No two-step transfer ownership.
    /// @dev Warning: The owner can be set to the zero address.
    function setOwner(address newOwner) external;

    /// @notice Enables `irm` as a possible IRM for market creation.
    /// @dev Warning: It is not possible to disable an IRM.
    function enableIrm(address irm) external;

    /// @notice Enables `lltv` as a possible LLTV for market creation.
    /// @dev Warning: It is not possible to disable a LLTV.
    function enableLltv(uint256 lltv) external;

    /// @notice Sets the `newFee` for the given market `marketParams`.
    /// @param newFee The new fee, scaled by WAD.
    /// @dev Warning: The recipient can be the zero address.
    function setFee(MarketParams memory marketParams, uint256 newFee) external;

    /// @notice Sets `newFeeRecipient` as `feeRecipient` of the fee.
    /// @dev Warning: If the fee recipient is set to the zero address, fees will accrue there and will be lost.
    /// @dev Modifying the fee recipient will allow the new recipient to claim any pending fees not yet accrued. To
    /// ensure that the current recipient receives all due fees, accrue interest manually prior to making any changes.
    function setFeeRecipient(address newFeeRecipient) external;

    /// @notice Creates the market `marketParams`.
    /// @dev Here is the list of assumptions on the market's dependencies (tokens, IRM and oracle) that guarantees
    /// Morpho behaves as expected:
    /// - The token should be ERC-20 compliant, except that it can omit return values on `transfer` and `transferFrom`.
    /// - The token balance of Morpho should only decrease on `transfer` and `transferFrom`. In particular, tokens with
    /// burn functions are not supported.
    /// - The token should not re-enter Morpho on `transfer` nor `transferFrom`.
    /// - The token balance of the sender (resp. receiver) should decrease (resp. increase) by exactly the given amount
    /// on `transfer` and `transferFrom`. In particular, tokens with fees on transfer are not supported.
    /// - The IRM should not re-enter Morpho.
    /// - The oracle should return a price with the correct scaling.
    /// @dev Here is a list of properties on the market's dependencies that could break Morpho's liveness properties
    /// (funds could get stuck):
    /// - The token can revert on `transfer` and `transferFrom` for a reason other than an approval or balance issue.
    /// - A very high amount of assets (~1e35) supplied or borrowed can make the computation of `toSharesUp` and
    /// `toSharesDown` overflow.
    /// - The IRM can revert on `borrowRate`.
    /// - A very high borrow rate returned by the IRM can make the computation of `interest` in `_accrueInterest`
    /// overflow.
    /// - The oracle can revert on `price`. Note that this can be used to prevent `borrow`, `withdrawCollateral` and
    /// `liquidate` from being used under certain market conditions.
    /// - A very high price returned by the oracle can make the computation of `maxBorrow` in `_isHealthy` overflow, or
    /// the computation of `assetsRepaid` in `liquidate` overflow.
    /// @dev The borrow share price of a market with less than 1e4 assets borrowed can be decreased by manipulations, to
    /// the point where `totalBorrowShares` is very large and borrowing overflows.
    function createMarket(MarketParams memory marketParams) external;

    /// @notice Supplies `assets` or `shares` on behalf of `onBehalf`, optionally calling back the caller's
    /// `onMorphoSupply` function with the given `data`.
    /// @dev Either `assets` or `shares` should be zero. Most use cases should rely on `assets` as an input so the
    /// caller is guaranteed to have `assets` tokens pulled from their balance, but the possibility to mint a specific
    /// amount of shares is given for full compatibility and precision.
    /// @dev Supplying a large amount can revert for overflow.
    /// @dev Supplying an amount of shares may lead to supply more or fewer assets than expected due to slippage.
    /// Consider using the `assets` parameter to avoid this.
    /// @param marketParams The market to supply assets to.
    /// @param assets The amount of assets to supply.
    /// @param shares The amount of shares to mint.
    /// @param onBehalf The address that will own the increased supply position.
    /// @param data Arbitrary data to pass to the `onMorphoSupply` callback. Pass empty data if not needed.
    /// @return assetsSupplied The amount of assets supplied.
    /// @return sharesSupplied The amount of shares minted.
    function supply(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        bytes memory data
    ) external returns (uint256 assetsSupplied, uint256 sharesSupplied);

    /// @notice Withdraws `assets` or `shares` on behalf of `onBehalf` and sends the assets to `receiver`.
    /// @dev Either `assets` or `shares` should be zero. To withdraw max, pass the `shares`'s balance of `onBehalf`.
    /// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
    /// @dev Withdrawing an amount corresponding to more shares than supplied will revert for underflow.
    /// @dev It is advised to use the `shares` input when withdrawing the full position to avoid reverts due to
    /// conversion roundings between shares and assets.
    /// @param marketParams The market to withdraw assets from.
    /// @param assets The amount of assets to withdraw.
    /// @param shares The amount of shares to burn.
    /// @param onBehalf The address of the owner of the supply position.
    /// @param receiver The address that will receive the withdrawn assets.
    /// @return assetsWithdrawn The amount of assets withdrawn.
    /// @return sharesWithdrawn The amount of shares burned.
    function withdraw(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        address receiver
    ) external returns (uint256 assetsWithdrawn, uint256 sharesWithdrawn);

    /// @notice Borrows `assets` or `shares` on behalf of `onBehalf` and sends the assets to `receiver`.
    /// @dev Either `assets` or `shares` should be zero. Most use cases should rely on `assets` as an input so the
    /// caller is guaranteed to borrow `assets` of tokens, but the possibility to mint a specific amount of shares is
    /// given for full compatibility and precision.
    /// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
    /// @dev Borrowing a large amount can revert for overflow.
    /// @dev Borrowing an amount of shares may lead to borrow fewer assets than expected due to slippage.
    /// Consider using the `assets` parameter to avoid this.
    /// @param marketParams The market to borrow assets from.
    /// @param assets The amount of assets to borrow.
    /// @param shares The amount of shares to mint.
    /// @param onBehalf The address that will own the increased borrow position.
    /// @param receiver The address that will receive the borrowed assets.
    /// @return assetsBorrowed The amount of assets borrowed.
    /// @return sharesBorrowed The amount of shares minted.
    function borrow(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        address receiver
    ) external returns (uint256 assetsBorrowed, uint256 sharesBorrowed);

    /// @notice Repays `assets` or `shares` on behalf of `onBehalf`, optionally calling back the caller's
    /// `onMorphoReplay` function with the given `data`.
    /// @dev Either `assets` or `shares` should be zero. To repay max, pass the `shares`'s balance of `onBehalf`.
    /// @dev Repaying an amount corresponding to more shares than borrowed will revert for underflow.
    /// @dev It is advised to use the `shares` input when repaying the full position to avoid reverts due to conversion
    /// roundings between shares and assets.
    /// @dev An attacker can front-run a repay with a small repay making the transaction revert for underflow.
    /// @param marketParams The market to repay assets to.
    /// @param assets The amount of assets to repay.
    /// @param shares The amount of shares to burn.
    /// @param onBehalf The address of the owner of the debt position.
    /// @param data Arbitrary data to pass to the `onMorphoRepay` callback. Pass empty data if not needed.
    /// @return assetsRepaid The amount of assets repaid.
    /// @return sharesRepaid The amount of shares burned.
    function repay(
        MarketParams memory marketParams,
        uint256 assets,
        uint256 shares,
        address onBehalf,
        bytes memory data
    ) external returns (uint256 assetsRepaid, uint256 sharesRepaid);

    /// @notice Supplies `assets` of collateral on behalf of `onBehalf`, optionally calling back the caller's
    /// `onMorphoSupplyCollateral` function with the given `data`.
    /// @dev Interest are not accrued since it's not required and it saves gas.
    /// @dev Supplying a large amount can revert for overflow.
    /// @param marketParams The market to supply collateral to.
    /// @param assets The amount of collateral to supply.
    /// @param onBehalf The address that will own the increased collateral position.
    /// @param data Arbitrary data to pass to the `onMorphoSupplyCollateral` callback. Pass empty data if not needed.
    function supplyCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, bytes memory data)
        external;

    /// @notice Withdraws `assets` of collateral on behalf of `onBehalf` and sends the assets to `receiver`.
    /// @dev `msg.sender` must be authorized to manage `onBehalf`'s positions.
    /// @dev Withdrawing an amount corresponding to more collateral than supplied will revert for underflow.
    /// @param marketParams The market to withdraw collateral from.
    /// @param assets The amount of collateral to withdraw.
    /// @param onBehalf The address of the owner of the collateral position.
    /// @param receiver The address that will receive the collateral assets.
    function withdrawCollateral(MarketParams memory marketParams, uint256 assets, address onBehalf, address receiver)
        external;

    /// @notice Liquidates the given `repaidShares` of debt asset or seize the given `seizedAssets` of collateral on the
    /// given market `marketParams` of the given `borrower`'s position, optionally calling back the caller's
    /// `onMorphoLiquidate` function with the given `data`.
    /// @dev Either `seizedAssets` or `repaidShares` should be zero.
    /// @dev Seizing more than the collateral balance will underflow and revert without any error message.
    /// @dev Repaying more than the borrow balance will underflow and revert without any error message.
    /// @dev An attacker can front-run a liquidation with a small repay making the transaction revert for underflow.
    /// @param marketParams The market of the position.
    /// @param borrower The owner of the position.
    /// @param seizedAssets The amount of collateral to seize.
    /// @param repaidShares The amount of shares to repay.
    /// @param data Arbitrary data to pass to the `onMorphoLiquidate` callback. Pass empty data if not needed.
    /// @return The amount of assets seized.
    /// @return The amount of assets repaid.
    function liquidate(
        MarketParams memory marketParams,
        address borrower,
        uint256 seizedAssets,
        uint256 repaidShares,
        bytes memory data
    ) external returns (uint256, uint256);

    /// @notice Executes a flash loan.
    /// @dev Flash loans have access to the whole balance of the contract (the liquidity and deposited collateral of all
    /// markets combined, plus donations).
    /// @dev Warning: Not ERC-3156 compliant but compatibility is easily reached:
    /// - `flashFee` is zero.
    /// - `maxFlashLoan` is the token's balance of this contract.
    /// - The receiver of `assets` is the caller.
    /// @param token The token to flash loan.
    /// @param assets The amount of assets to flash loan.
    /// @param data Arbitrary data to pass to the `onMorphoFlashLoan` callback.
    function flashLoan(address token, uint256 assets, bytes calldata data) external;

    /// @notice Sets the authorization for `authorized` to manage `msg.sender`'s positions.
    /// @param authorized The authorized address.
    /// @param newIsAuthorized The new authorization status.
    function setAuthorization(address authorized, bool newIsAuthorized) external;

    /// @notice Sets the authorization for `authorization.authorized` to manage `authorization.authorizer`'s positions.
    /// @dev Warning: Reverts if the signature has already been submitted.
    /// @dev The signature is malleable, but it has no impact on the security here.
    /// @dev The nonce is passed as argument to be able to revert with a different error message.
    /// @param authorization The `Authorization` struct.
    /// @param signature The signature.
    function setAuthorizationWithSig(Authorization calldata authorization, Signature calldata signature) external;

    /// @notice Accrues interest for the given market `marketParams`.
    function accrueInterest(MarketParams memory marketParams) external;

    /// @notice Returns the data stored on the different `slots`.
    function extSloads(bytes32[] memory slots) external view returns (bytes32[] memory);
}

/// @dev This interface is inherited by Morpho so that function signatures are checked by the compiler.
/// @dev Consider using the IMorpho interface instead of this one.
interface IMorphoStaticTyping is IMorphoBase {
    /// @notice The state of the position of `user` on the market corresponding to `id`.
    /// @dev Warning: For `feeRecipient`, `supplyShares` does not contain the accrued shares since the last interest
    /// accrual.
    function position(Id id, address user)
        external
        view
        returns (uint256 supplyShares, uint128 borrowShares, uint128 collateral);

    /// @notice The state of the market corresponding to `id`.
    /// @dev Warning: `totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
    /// @dev Warning: `totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
    /// @dev Warning: `totalSupplyShares` does not contain the accrued shares by `feeRecipient` since the last interest
    /// accrual.
    function market(Id id)
        external
        view
        returns (
            uint128 totalSupplyAssets,
            uint128 totalSupplyShares,
            uint128 totalBorrowAssets,
            uint128 totalBorrowShares,
            uint128 lastUpdate,
            uint128 fee
        );

    /// @notice The market params corresponding to `id`.
    /// @dev This mapping is not used in Morpho. It is there to enable reducing the cost associated to calldata on layer
    /// 2s by creating a wrapper contract with functions that take `id` as input instead of `marketParams`.
    function idToMarketParams(Id id)
        external
        view
        returns (address loanToken, address collateralToken, address oracle, address irm, uint256 lltv);
}

/// @title IMorpho
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @dev Use this interface for Morpho to have access to all the functions with the appropriate function signatures.
interface IMorpho is IMorphoBase {
    /// @notice The state of the position of `user` on the market corresponding to `id`.
    /// @dev Warning: For `feeRecipient`, `p.supplyShares` does not contain the accrued shares since the last interest
    /// accrual.
    function position(Id id, address user) external view returns (Position memory p);

    /// @notice The state of the market corresponding to `id`.
    /// @dev Warning: `m.totalSupplyAssets` does not contain the accrued interest since the last interest accrual.
    /// @dev Warning: `m.totalBorrowAssets` does not contain the accrued interest since the last interest accrual.
    /// @dev Warning: `m.totalSupplyShares` does not contain the accrued shares by `feeRecipient` since the last
    /// interest accrual.
    function market(Id id) external view returns (Market memory m);

    /// @notice The market params corresponding to `id`.
    /// @dev This mapping is not used in Morpho. It is there to enable reducing the cost associated to calldata on layer
    /// 2s by creating a wrapper contract with functions that take `id` as input instead of `marketParams`.
    function idToMarketParams(Id id) external view returns (MarketParams memory);
}

File 3 of 14 : IMorphoCallbacks.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title IMorphoLiquidateCallback
/// @notice Interface that liquidators willing to use `liquidate`'s callback must implement.
interface IMorphoLiquidateCallback {
    /// @notice Callback called when a liquidation occurs.
    /// @dev The callback is called only if data is not empty.
    /// @param repaidAssets The amount of repaid assets.
    /// @param data Arbitrary data passed to the `liquidate` function.
    function onMorphoLiquidate(uint256 repaidAssets, bytes calldata data) external;
}

/// @title IMorphoRepayCallback
/// @notice Interface that users willing to use `repay`'s callback must implement.
interface IMorphoRepayCallback {
    /// @notice Callback called when a repayment occurs.
    /// @dev The callback is called only if data is not empty.
    /// @param assets The amount of repaid assets.
    /// @param data Arbitrary data passed to the `repay` function.
    function onMorphoRepay(uint256 assets, bytes calldata data) external;
}

/// @title IMorphoSupplyCallback
/// @notice Interface that users willing to use `supply`'s callback must implement.
interface IMorphoSupplyCallback {
    /// @notice Callback called when a supply occurs.
    /// @dev The callback is called only if data is not empty.
    /// @param assets The amount of supplied assets.
    /// @param data Arbitrary data passed to the `supply` function.
    function onMorphoSupply(uint256 assets, bytes calldata data) external;
}

/// @title IMorphoSupplyCollateralCallback
/// @notice Interface that users willing to use `supplyCollateral`'s callback must implement.
interface IMorphoSupplyCollateralCallback {
    /// @notice Callback called when a supply of collateral occurs.
    /// @dev The callback is called only if data is not empty.
    /// @param assets The amount of supplied collateral.
    /// @param data Arbitrary data passed to the `supplyCollateral` function.
    function onMorphoSupplyCollateral(uint256 assets, bytes calldata data) external;
}

/// @title IMorphoFlashLoanCallback
/// @notice Interface that users willing to use `flashLoan`'s callback must implement.
interface IMorphoFlashLoanCallback {
    /// @notice Callback called when a flash loan occurs.
    /// @dev The callback is called only if data is not empty.
    /// @param assets The amount of assets that was flash loaned.
    /// @param data Arbitrary data passed to the `flashLoan` function.
    function onMorphoFlashLoan(uint256 assets, bytes calldata data) external;
}

File 4 of 14 : IIrm.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {MarketParams, Market} from "./IMorpho.sol";

/// @title IIrm
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Interface that Interest Rate Models (IRMs) used by Morpho must implement.
interface IIrm {
    /// @notice Returns the borrow rate per second (scaled by WAD) of the market `marketParams`.
    /// @dev Assumes that `market` corresponds to `marketParams`.
    function borrowRate(MarketParams memory marketParams, Market memory market) external returns (uint256);

    /// @notice Returns the borrow rate per second (scaled by WAD) of the market `marketParams` without modifying any
    /// storage.
    /// @dev Assumes that `market` corresponds to `marketParams`.
    function borrowRateView(MarketParams memory marketParams, Market memory market) external view returns (uint256);
}

File 5 of 14 : IERC20.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title IERC20
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @dev Empty because we only call library functions. It prevents calling transfer (transferFrom) instead of
/// safeTransfer (safeTransferFrom).
interface IERC20 {}

File 6 of 14 : IOracle.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title IOracle
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Interface that oracles used by Morpho must implement.
/// @dev It is the user's responsibility to select markets with safe oracles.
interface IOracle {
    /// @notice Returns the price of 1 asset of collateral token quoted in 1 asset of loan token, scaled by 1e36.
    /// @dev It corresponds to the price of 10**(collateral token decimals) assets of collateral token quoted in
    /// 10**(loan token decimals) assets of loan token with `36 + loan token decimals - collateral token decimals`
    /// decimals of precision.
    function price() external view returns (uint256);
}

File 7 of 14 : ConstantsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @dev The maximum fee a market can have (25%).
uint256 constant MAX_FEE = 0.25e18;

/// @dev Oracle price scale.
uint256 constant ORACLE_PRICE_SCALE = 1e36;

/// @dev Liquidation cursor.
uint256 constant LIQUIDATION_CURSOR = 0.3e18;

/// @dev Max liquidation incentive factor.
uint256 constant MAX_LIQUIDATION_INCENTIVE_FACTOR = 1.15e18;

/// @dev The EIP-712 typeHash for EIP712Domain.
bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(uint256 chainId,address verifyingContract)");

/// @dev The EIP-712 typeHash for Authorization.
bytes32 constant AUTHORIZATION_TYPEHASH =
    keccak256("Authorization(address authorizer,address authorized,bool isAuthorized,uint256 nonce,uint256 deadline)");

File 8 of 14 : UtilsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {ErrorsLib} from "../libraries/ErrorsLib.sol";

/// @title UtilsLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library exposing helpers.
/// @dev Inspired by https://github.com/morpho-org/morpho-utils.
library UtilsLib {
    /// @dev Returns true if there is exactly one zero among `x` and `y`.
    function exactlyOneZero(uint256 x, uint256 y) internal pure returns (bool z) {
        assembly {
            z := xor(iszero(x), iszero(y))
        }
    }

    /// @dev Returns the min of `x` and `y`.
    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assembly {
            z := xor(x, mul(xor(x, y), lt(y, x)))
        }
    }

    /// @dev Returns `x` safely cast to uint128.
    function toUint128(uint256 x) internal pure returns (uint128) {
        require(x <= type(uint128).max, ErrorsLib.MAX_UINT128_EXCEEDED);
        return uint128(x);
    }

    /// @dev Returns max(0, x - y).
    function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assembly {
            z := mul(gt(x, y), sub(x, y))
        }
    }
}

File 9 of 14 : EventsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {Id, MarketParams} from "../interfaces/IMorpho.sol";

/// @title EventsLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library exposing events.
library EventsLib {
    /// @notice Emitted when setting a new owner.
    /// @param newOwner The new owner of the contract.
    event SetOwner(address indexed newOwner);

    /// @notice Emitted when setting a new fee.
    /// @param id The market id.
    /// @param newFee The new fee.
    event SetFee(Id indexed id, uint256 newFee);

    /// @notice Emitted when setting a new fee recipient.
    /// @param newFeeRecipient The new fee recipient.
    event SetFeeRecipient(address indexed newFeeRecipient);

    /// @notice Emitted when enabling an IRM.
    /// @param irm The IRM that was enabled.
    event EnableIrm(address indexed irm);

    /// @notice Emitted when enabling an LLTV.
    /// @param lltv The LLTV that was enabled.
    event EnableLltv(uint256 lltv);

    /// @notice Emitted when creating a market.
    /// @param id The market id.
    /// @param marketParams The market that was created.
    event CreateMarket(Id indexed id, MarketParams marketParams);

    /// @notice Emitted on supply of assets.
    /// @dev Warning: `feeRecipient` receives some shares during interest accrual without any supply event emitted.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param assets The amount of assets supplied.
    /// @param shares The amount of shares minted.
    event Supply(Id indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares);

    /// @notice Emitted on withdrawal of assets.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param receiver The address that received the withdrawn assets.
    /// @param assets The amount of assets withdrawn.
    /// @param shares The amount of shares burned.
    event Withdraw(
        Id indexed id,
        address caller,
        address indexed onBehalf,
        address indexed receiver,
        uint256 assets,
        uint256 shares
    );

    /// @notice Emitted on borrow of assets.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param receiver The address that received the borrowed assets.
    /// @param assets The amount of assets borrowed.
    /// @param shares The amount of shares minted.
    event Borrow(
        Id indexed id,
        address caller,
        address indexed onBehalf,
        address indexed receiver,
        uint256 assets,
        uint256 shares
    );

    /// @notice Emitted on repayment of assets.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param assets The amount of assets repaid. May be 1 over the corresponding market's `totalBorrowAssets`.
    /// @param shares The amount of shares burned.
    event Repay(Id indexed id, address indexed caller, address indexed onBehalf, uint256 assets, uint256 shares);

    /// @notice Emitted on supply of collateral.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param assets The amount of collateral supplied.
    event SupplyCollateral(Id indexed id, address indexed caller, address indexed onBehalf, uint256 assets);

    /// @notice Emitted on withdrawal of collateral.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param onBehalf The owner of the modified position.
    /// @param receiver The address that received the withdrawn collateral.
    /// @param assets The amount of collateral withdrawn.
    event WithdrawCollateral(
        Id indexed id, address caller, address indexed onBehalf, address indexed receiver, uint256 assets
    );

    /// @notice Emitted on liquidation of a position.
    /// @param id The market id.
    /// @param caller The caller.
    /// @param borrower The borrower of the position.
    /// @param repaidAssets The amount of assets repaid. May be 1 over the corresponding market's `totalBorrowAssets`.
    /// @param repaidShares The amount of shares burned.
    /// @param seizedAssets The amount of collateral seized.
    /// @param badDebtAssets The amount of assets of bad debt realized.
    /// @param badDebtShares The amount of borrow shares of bad debt realized.
    event Liquidate(
        Id indexed id,
        address indexed caller,
        address indexed borrower,
        uint256 repaidAssets,
        uint256 repaidShares,
        uint256 seizedAssets,
        uint256 badDebtAssets,
        uint256 badDebtShares
    );

    /// @notice Emitted on flash loan.
    /// @param caller The caller.
    /// @param token The token that was flash loaned.
    /// @param assets The amount that was flash loaned.
    event FlashLoan(address indexed caller, address indexed token, uint256 assets);

    /// @notice Emitted when setting an authorization.
    /// @param caller The caller.
    /// @param authorizer The authorizer address.
    /// @param authorized The authorized address.
    /// @param newIsAuthorized The new authorization status.
    event SetAuthorization(
        address indexed caller, address indexed authorizer, address indexed authorized, bool newIsAuthorized
    );

    /// @notice Emitted when setting an authorization with a signature.
    /// @param caller The caller.
    /// @param authorizer The authorizer address.
    /// @param usedNonce The nonce that was used.
    event IncrementNonce(address indexed caller, address indexed authorizer, uint256 usedNonce);

    /// @notice Emitted when accruing interest.
    /// @param id The market id.
    /// @param prevBorrowRate The previous borrow rate.
    /// @param interest The amount of interest accrued.
    /// @param feeShares The amount of shares minted as fee.
    event AccrueInterest(Id indexed id, uint256 prevBorrowRate, uint256 interest, uint256 feeShares);
}

File 10 of 14 : ErrorsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @title ErrorsLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library exposing error messages.
library ErrorsLib {
    /// @notice Thrown when the caller is not the owner.
    string internal constant NOT_OWNER = "not owner";

    /// @notice Thrown when the LLTV to enable exceeds the maximum LLTV.
    string internal constant MAX_LLTV_EXCEEDED = "max LLTV exceeded";

    /// @notice Thrown when the fee to set exceeds the maximum fee.
    string internal constant MAX_FEE_EXCEEDED = "max fee exceeded";

    /// @notice Thrown when the value is already set.
    string internal constant ALREADY_SET = "already set";

    /// @notice Thrown when the IRM is not enabled at market creation.
    string internal constant IRM_NOT_ENABLED = "IRM not enabled";

    /// @notice Thrown when the LLTV is not enabled at market creation.
    string internal constant LLTV_NOT_ENABLED = "LLTV not enabled";

    /// @notice Thrown when the market is already created.
    string internal constant MARKET_ALREADY_CREATED = "market already created";

    /// @notice Thrown when a token to transfer doesn't have code.
    string internal constant NO_CODE = "no code";

    /// @notice Thrown when the market is not created.
    string internal constant MARKET_NOT_CREATED = "market not created";

    /// @notice Thrown when not exactly one of the input amount is zero.
    string internal constant INCONSISTENT_INPUT = "inconsistent input";

    /// @notice Thrown when zero assets is passed as input.
    string internal constant ZERO_ASSETS = "zero assets";

    /// @notice Thrown when a zero address is passed as input.
    string internal constant ZERO_ADDRESS = "zero address";

    /// @notice Thrown when the caller is not authorized to conduct an action.
    string internal constant UNAUTHORIZED = "unauthorized";

    /// @notice Thrown when the collateral is insufficient to `borrow` or `withdrawCollateral`.
    string internal constant INSUFFICIENT_COLLATERAL = "insufficient collateral";

    /// @notice Thrown when the liquidity is insufficient to `withdraw` or `borrow`.
    string internal constant INSUFFICIENT_LIQUIDITY = "insufficient liquidity";

    /// @notice Thrown when the position to liquidate is healthy.
    string internal constant HEALTHY_POSITION = "position is healthy";

    /// @notice Thrown when the authorization signature is invalid.
    string internal constant INVALID_SIGNATURE = "invalid signature";

    /// @notice Thrown when the authorization signature is expired.
    string internal constant SIGNATURE_EXPIRED = "signature expired";

    /// @notice Thrown when the nonce is invalid.
    string internal constant INVALID_NONCE = "invalid nonce";

    /// @notice Thrown when a token transfer reverted.
    string internal constant TRANSFER_REVERTED = "transfer reverted";

    /// @notice Thrown when a token transfer returned false.
    string internal constant TRANSFER_RETURNED_FALSE = "transfer returned false";

    /// @notice Thrown when a token transferFrom reverted.
    string internal constant TRANSFER_FROM_REVERTED = "transferFrom reverted";

    /// @notice Thrown when a token transferFrom returned false
    string internal constant TRANSFER_FROM_RETURNED_FALSE = "transferFrom returned false";

    /// @notice Thrown when the maximum uint128 is exceeded.
    string internal constant MAX_UINT128_EXCEEDED = "max uint128 exceeded";
}

File 11 of 14 : MathLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

uint256 constant WAD = 1e18;

/// @title MathLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library to manage fixed-point arithmetic.
library MathLib {
    /// @dev Returns (`x` * `y`) / `WAD` rounded down.
    function wMulDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD);
    }

    /// @dev Returns (`x` * `WAD`) / `y` rounded down.
    function wDivDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y);
    }

    /// @dev Returns (`x` * `WAD`) / `y` rounded up.
    function wDivUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y);
    }

    /// @dev Returns (`x` * `y`) / `d` rounded down.
    function mulDivDown(uint256 x, uint256 y, uint256 d) internal pure returns (uint256) {
        return (x * y) / d;
    }

    /// @dev Returns (`x` * `y`) / `d` rounded up.
    function mulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256) {
        return (x * y + (d - 1)) / d;
    }

    /// @dev Returns the sum of the first three non-zero terms of a Taylor expansion of e^(nx) - 1, to approximate a
    /// continuous compound interest rate.
    function wTaylorCompounded(uint256 x, uint256 n) internal pure returns (uint256) {
        uint256 firstTerm = x * n;
        uint256 secondTerm = mulDivDown(firstTerm, firstTerm, 2 * WAD);
        uint256 thirdTerm = mulDivDown(secondTerm, firstTerm, 3 * WAD);

        return firstTerm + secondTerm + thirdTerm;
    }
}

File 12 of 14 : SharesMathLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {MathLib} from "./MathLib.sol";

/// @title SharesMathLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Shares management library.
/// @dev This implementation mitigates share price manipulations, using OpenZeppelin's method of virtual shares:
/// https://docs.openzeppelin.com/contracts/4.x/erc4626#inflation-attack.
library SharesMathLib {
    using MathLib for uint256;

    /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure
    /// high precision computations.
    /// @dev Virtual shares can never be redeemed for the assets they are entitled to, but it is assumed the share price
    /// stays low enough not to inflate these assets to a significant value.
    /// @dev Warning: The assets to which virtual borrow shares are entitled behave like unrealizable bad debt.
    uint256 internal constant VIRTUAL_SHARES = 1e6;

    /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is
    /// empty.
    uint256 internal constant VIRTUAL_ASSETS = 1;

    /// @dev Calculates the value of `assets` quoted in shares, rounding down.
    function toSharesDown(uint256 assets, uint256 totalAssets, uint256 totalShares) internal pure returns (uint256) {
        return assets.mulDivDown(totalShares + VIRTUAL_SHARES, totalAssets + VIRTUAL_ASSETS);
    }

    /// @dev Calculates the value of `shares` quoted in assets, rounding down.
    function toAssetsDown(uint256 shares, uint256 totalAssets, uint256 totalShares) internal pure returns (uint256) {
        return shares.mulDivDown(totalAssets + VIRTUAL_ASSETS, totalShares + VIRTUAL_SHARES);
    }

    /// @dev Calculates the value of `assets` quoted in shares, rounding up.
    function toSharesUp(uint256 assets, uint256 totalAssets, uint256 totalShares) internal pure returns (uint256) {
        return assets.mulDivUp(totalShares + VIRTUAL_SHARES, totalAssets + VIRTUAL_ASSETS);
    }

    /// @dev Calculates the value of `shares` quoted in assets, rounding up.
    function toAssetsUp(uint256 shares, uint256 totalAssets, uint256 totalShares) internal pure returns (uint256) {
        return shares.mulDivUp(totalAssets + VIRTUAL_ASSETS, totalShares + VIRTUAL_SHARES);
    }
}

File 13 of 14 : MarketParamsLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {Id, MarketParams} from "../interfaces/IMorpho.sol";

/// @title MarketParamsLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library to convert a market to its id.
library MarketParamsLib {
    /// @notice The length of the data used to compute the id of a market.
    /// @dev The length is 5 * 32 because `MarketParams` has 5 variables of 32 bytes each.
    uint256 internal constant MARKET_PARAMS_BYTES_LENGTH = 5 * 32;

    /// @notice Returns the id of the market `marketParams`.
    function id(MarketParams memory marketParams) internal pure returns (Id marketParamsId) {
        assembly ("memory-safe") {
            marketParamsId := keccak256(marketParams, MARKET_PARAMS_BYTES_LENGTH)
        }
    }
}

File 14 of 14 : SafeTransferLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {IERC20} from "../interfaces/IERC20.sol";

import {ErrorsLib} from "../libraries/ErrorsLib.sol";

interface IERC20Internal {
    function transfer(address to, uint256 value) external returns (bool);
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

/// @title SafeTransferLib
/// @author Morpho Labs
/// @custom:contact [email protected]
/// @notice Library to manage transfers of tokens, even if calls to the transfer or transferFrom functions are not
/// returning a boolean.
library SafeTransferLib {
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        require(address(token).code.length > 0, ErrorsLib.NO_CODE);

        (bool success, bytes memory returndata) =
            address(token).call(abi.encodeCall(IERC20Internal.transfer, (to, value)));
        require(success, ErrorsLib.TRANSFER_REVERTED);
        require(returndata.length == 0 || abi.decode(returndata, (bool)), ErrorsLib.TRANSFER_RETURNED_FALSE);
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        require(address(token).code.length > 0, ErrorsLib.NO_CODE);

        (bool success, bytes memory returndata) =
            address(token).call(abi.encodeCall(IERC20Internal.transferFrom, (from, to, value)));
        require(success, ErrorsLib.TRANSFER_FROM_REVERTED);
        require(returndata.length == 0 || abi.decode(returndata, (bool)), ErrorsLib.TRANSFER_FROM_RETURNED_FALSE);
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"prevBorrowRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeShares","type":"uint256"}],"name":"AccrueInterest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Borrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"indexed":false,"internalType":"struct MarketParams","name":"marketParams","type":"tuple"}],"name":"CreateMarket","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"irm","type":"address"}],"name":"EnableIrm","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lltv","type":"uint256"}],"name":"EnableLltv","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"FlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":false,"internalType":"uint256","name":"usedNonce","type":"uint256"}],"name":"IncrementNonce","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"repaidAssets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"repaidShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seizedAssets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"badDebtAssets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"badDebtShares","type":"uint256"}],"name":"Liquidate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Repay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":true,"internalType":"address","name":"authorized","type":"address"},{"indexed":false,"internalType":"bool","name":"newIsAuthorized","type":"bool"}],"name":"SetAuthorization","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"SetFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newFeeRecipient","type":"address"}],"name":"SetFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"SetOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Supply","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"SupplyCollateral","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalf","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"WithdrawCollateral","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"}],"name":"accrueInterest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"address","name":"receiver","type":"address"}],"name":"borrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"}],"name":"createMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"irm","type":"address"}],"name":"enableIrm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lltv","type":"uint256"}],"name":"enableLltv","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"slots","type":"bytes32[]"}],"name":"extSloads","outputs":[{"internalType":"bytes32[]","name":"res","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"Id","name":"","type":"bytes32"}],"name":"idToMarketParams","outputs":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isAuthorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isIrmEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isLltvEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"seizedAssets","type":"uint256"},{"internalType":"uint256","name":"repaidShares","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"liquidate","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"Id","name":"","type":"bytes32"}],"name":"market","outputs":[{"internalType":"uint128","name":"totalSupplyAssets","type":"uint128"},{"internalType":"uint128","name":"totalSupplyShares","type":"uint128"},{"internalType":"uint128","name":"totalBorrowAssets","type":"uint128"},{"internalType":"uint128","name":"totalBorrowShares","type":"uint128"},{"internalType":"uint128","name":"lastUpdate","type":"uint128"},{"internalType":"uint128","name":"fee","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonce","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":"Id","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"position","outputs":[{"internalType":"uint256","name":"supplyShares","type":"uint256"},{"internalType":"uint128","name":"borrowShares","type":"uint128"},{"internalType":"uint128","name":"collateral","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"repay","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authorized","type":"address"},{"internalType":"bool","name":"newIsAuthorized","type":"bool"}],"name":"setAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"authorizer","type":"address"},{"internalType":"address","name":"authorized","type":"address"},{"internalType":"bool","name":"isAuthorized","type":"bool"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct Authorization","name":"authorization","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"name":"setAuthorizationWithSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeRecipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"supplyCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"address","name":"receiver","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"onBehalf","type":"address"},{"internalType":"address","name":"receiver","type":"address"}],"name":"withdrawCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a034620001aa576001600160401b0390601f1990601f62003eb73881900391820184168301929185841183851017620001395780839260409586528339602092839181010312620001aa57516001600160a01b0381169390849003620001aa5782518381018181108782111762000139578452600c81526b7a65726f206164647265737360a01b8382015284156200014f5750508151908101917f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921883524681830152306060830152606082526080820194828610908611176200013957849052519020608052600080546001600160a01b031916821781557f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb59080a2613d079081620001b0823960805181818161188a01526124b90152f35b634e487b7160e01b600052604160045260246000fd5b82845192839162461bcd60e51b835280600484015283519081602485015260005b828110620001925750506044935080600085601f938601015201168101030190fd5b80860182015187820160440152869450810162000170565b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c806313af403514612b90578063151c1ade14612b2057806320b76e81146128c1578063238d6579146126f75780632b4f013c1461256e5780632c3c9157146124dc5780633644e5151461248357806346904840146124315780634d98a93b1461231557806350d8cd4b146120815780635a64f51e14611fa95780635c2bea4914611d485780635c60e39a14611cb757806365e4ad9e14611c3757806370ae92d214611bd45780637784c68514611a685780638069218f1461167f5780638720316d1461150f5780638c1358a2146111f85780638da5cb5b146111a757806393c520621461110e578063a99aad8914610eda578063b485f3b814610e8d578063d8eabcb8146104e5578063e0232b4214610398578063e74b981b146102cd578063eecea000146101bb5763f2b863ce1461015157600080fd5b346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760ff604060209273ffffffffffffffffffffffffffffffffffffffff6101a4612c5a565b168152600484522054166040519015158152f35b80fd5b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576101f3612c5a565b602435801515908181036102c85761029790338552600660205273ffffffffffffffffffffffffffffffffffffffff604086209416938460005260205261024f60ff604060002054161515841415610249612fdd565b90612f41565b3385526006602052604085208460005260205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b60405190815233907fd5e969f01efe921d3f766bdebad25f0a05e3f237311f56482bf132d0326309c060203392a480f35b600080fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761036c610308612c5a565b7fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff91610350838654163314610249612f08565b826001549116938493610361612fdd565b908316851415612f41565b16176001557f2e979f80fe4d43055c584cf4a8467c55875ea36728fc37176c05acd784eb7a738280a280f35b50346101b85760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576103d0612c5a565b6024358260443567ffffffffffffffff81116104e15761040973ffffffffffffffffffffffffffffffffffffffff913690600401612de8565b91909461041f6104176132c2565b861515612f41565b1693846040518581527fc76f1b4fe4396ac07a9fa55a415d4ca430e72651d37d3401f3bed7cb13fc4f1260203392a361045984338761394a565b333b156104d25761049b91839160405193849283927f31f57072000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156104d6576104be575b50506104bb9130903390613ab9565b80f35b6104c790612cc3565b6104d25782386104ac565b8280fd5b6040513d84823e3d90fd5b5080fd5b50346101b8576101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761051f36612d50565b9073ffffffffffffffffffffffffffffffffffffffff60a4351660a435036102c8576101043567ffffffffffffffff81116104e157610562903690600401612de8565b9160c4359260e4359260a0862093848452600360205261059f6fffffffffffffffffffffffffffffffff6002604087200154161515610249613016565b6105b46105aa6130f9565b8215881518612f41565b6105be858861336e565b6004602073ffffffffffffffffffffffffffffffffffffffff60408a015116604051928380927fa035b1fe0000000000000000000000000000000000000000000000000000000082525afa908115610e82578591610e50575b506106666106298260a435898c61376d565b156040519061063782612cf3565b601382527f706f736974696f6e206973206865616c746879000000000000000000000000006020830152612f41565b6080880151670de0b6b3a764000003670de0b6b3a76400008111610ca057670429d069189e00009080820291820403610ccd57670de0b6b3a764000090049182670de0b6b3a76400000392670de0b6b3a76400008411610e2357670de0b6b3a764000014610df4578715610cfc57506106df908761383b565b6ec097ce7bc90715b34b9f0fffffffff8101809111610ccd576ec097ce7bc90715b34b9f1000000000900480670de0b6b3a7640000810204670de0b6b3a76400001481151715610ccd57670ff59ee833b300006ec097ce7bc90715b34b9f10000000008390048082189082110281187fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810111610ca057610807926107d9926ec097ce7bc90715b34b9f10000000009190910480831890831102909118906107d4907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830190670de0b6b3a76400000261316b565b61384e565b85855260036020526001604086200154906fffffffffffffffffffffffffffffffff8260801c921690613c33565b935b808452600360205261083960016040862001546fffffffffffffffffffffffffffffffff8160801c911687613c55565b9461084381613c78565b82865260026020526040862073ffffffffffffffffffffffffffffffffffffffff60a4351660005260205260016040600020016fffffffffffffffffffffffffffffffff61089582549382851661322e565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008093161790556109266108c983613c78565b84885260036020526108e6600160408a200191825460801c61322e565b6fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b82865260036020526109576fffffffffffffffffffffffffffffffff60016040892001541688808203911102613c78565b83875260036020526fffffffffffffffffffffffffffffffff600160408920019116828254161790556109cd61098c89613c78565b84885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a435166000526020526108e6600160406000200191825460801c61322e565b8590869084885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a4351660005260205260016040600020015460801c15610b39575b506040519288845260208401528860408401526060830152608082015273ffffffffffffffffffffffffffffffffffffffff60a43516917fa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e4160a03393a4610a90853373ffffffffffffffffffffffffffffffffffffffff60208a01511661394a565b81610acc575b505050610ac08173ffffffffffffffffffffffffffffffffffffffff604095511630903390613ab9565b82519182526020820152f35b333b156104d257610b0e91839160405193849283927fcf7ea196000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156104d657610b25575b80610a96565b610b2f8291612cc3565b6101b85780610b1f565b91505082865260026020526040862073ffffffffffffffffffffffffffffffffffffffff60a435166000526020526fffffffffffffffffffffffffffffffff600160406000200154169083875260036020526001604088200154610bb46fffffffffffffffffffffffffffffffff82169160801c8285613c55565b818110908218021890610bc682613c78565b8589526003602052600160408a200190826fffffffffffffffffffffffffffffffff610bf684549382851661322e565b169116179055610c0582613c78565b85895260036020526040892090826fffffffffffffffffffffffffffffffff610c3284549382851661322e565b169116179055610c61610c4484613c78565b868a5260036020526108e6600160408c200191825460801c61322e565b84885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a43516600052602052600160406000200190815416905538610a0e565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b95965090610d78670de0b6b3a7640000918887526003602052610d73600160408920015491670ff59ee833b300009081816ec097ce7bc90715b34b9f10000000000410906ec097ce7bc90715b34b9f10000000000482180218916fffffffffffffffffffffffffffffffff8160801c91168a613c0d565b61383b565b04806ec097ce7bc90715b34b9f10000000008102046ec097ce7bc90715b34b9f10000000001481151715610dc757906ec097ce7bc90715b34b9f1000000000610dc1920261384e565b94610809565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d602011610e7a575b81610e6b60209383612d0f565b810103126102c8575138610617565b3d9150610e5e565b6040513d87823e3d90fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760ff60406020926004358152600584522054166040519015158152f35b50346101b857610ee936612e16565b849691959296958460a08520808552602096600388526fffffffffffffffffffffffffffffffff98610f288a600260408a200154161515610249613016565b1592610f3e610f356130f9565b82158618612f41565b73ffffffffffffffffffffffffffffffffffffffff809c1693610f62610417613132565b610f6c848a61336e565b6110e757505080855260038752610f8e6040862054898160801c91168b613be8565b975b81865260028852604086208360005288526040600020610fb18a825461316b565b9055610fd8610fbf8a613c78565b83885260038a526108e66040892091825460801c613178565b610fe18a613c78565b828752600389527fffffffffffffffffffffffffffffffff00000000000000000000000000000000604088209261101c845493828516613178565b1691161790556040519089825288888301527fedf8870433c83823eb071d3df1caa8d008f12f6440918c20d75a3602cda30fe060403393a48161107a575b5050508360409561107092511630903390613ab9565b8351928352820152f35b333b156104d2576110bc91839160405193849283927f2075be030000000000000000000000000000000000000000000000000000000084528b6004850161319c565b038183335af180156104d6576110d3575b8061105a565b6110dd8291612cc3565b6101b857806110cd565b61110891999a50828752600389526040872054908b8260801c921690613c55565b98610f90565b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85773ffffffffffffffffffffffffffffffffffffffff604061115d612ca0565b926004358152600260205220911660005260205260606040600020600181549101546040519182526fffffffffffffffffffffffffffffffff8116602083015260801c6040820152f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346101b85760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761123136612d50565b60a0812090606081019173ffffffffffffffffffffffffffffffffffffffff808451168552602093600485526112a360ff6040882054166040519061127582612cf3565b600f82527f49524d206e6f7420656e61626c6564000000000000000000000000000000000088830152612f41565b6080840180518752600586526112f560ff604089205416604051906112c782612cf3565b601082527f4c4c5456206e6f7420656e61626c65640000000000000000000000000000000089830152612f41565b838752600386526fffffffffffffffffffffffffffffffff61135681600260408b20015416156040519061132882612cf3565b601682527f6d61726b657420616c72656164792063726561746564000000000000000000008a830152612f41565b84885260038752600260408920019042167fffffffffffffffffffffffffffffffff000000000000000000000000000000008254161790556008865260046040882091848751167fffffffffffffffffffffffff0000000000000000000000000000000000000000908185541617845560018401868a8a01511682825416179055600284018660408a015116828254161790556003840190868651169082541617905551910155827fac4b2400f169220b0c0afdde7a0b32e775ba727ea1cb30b35f935cdaab8683ac60a060405161147281896080809173ffffffffffffffffffffffffffffffffffffffff80825116855280602083015116602086015280604083015116604086015260608201511660608501520151910152565ba25116918261147f578480f35b6114c69284928652600383526040862091866040518096819582947f9451fed40000000000000000000000000000000000000000000000000000000084526004840161304f565b03925af18015611504576114db575b80808480f35b813d83116114fd575b6114ee8183612d0f565b810103126102c85738806114d5565b503d6114e4565b6040513d85823e3d90fd5b50346101b8576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761154936612d50565b60a435611554612c7d565b60e4359073ffffffffffffffffffffffffffffffffffffffff90818316948584036102c8576104bb958760209361164561163d60a0862092838552600388526115ba6fffffffffffffffffffffffffffffffff6002604088200154161515610249613016565b6115cd6115c56132c2565b8c1515612f41565b6115e06115d8613132565b871515612f41565b6115f46115ec82613328565b6102496131e8565b6115fe848861336e565b611636604061160c8d613c78565b9686815260028b5220958a831696876000528a526108e6600160406000200191825460801c61322e565b838761367c565b610249613289565b60408051338152602081018a90527fe80ebd7cc9223d7382aab2e0d1d6155c65651f83d53c8b9b06901d167e3211429190a401511661394a565b50346101b857610100367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc018181126104d25760a0136104e1576040516116c581612cd7565b6116cd612c5a565b81526116d7612ca0565b906020908181019283526044359384151585036102c85760408201948552606082016064358152608435608084019080825260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5c360112611a64576040516117749161174382612cf3565b601182527f7369676e6174757265206578706972656400000000000000000000000000000088830152421115612f41565b8151926117e873ffffffffffffffffffffffffffffffffffffffff94858751168b526007885260408b208054906117aa826132fb565b9055604051916117b983612cf3565b600d83527f696e76616c6964206e6f6e6365000000000000000000000000000000000000008a84015214612f41565b60405191868301907f81d0284fb0e2cde18d0553b06189d6f7613c96a01bb5b5e7828eade6a0dcac918252858751166040850152858951166060850152895115156080850152845160a08501525160c084015260c0835260e083019167ffffffffffffffff9184841083851117611a35578360405284519020908401907f190100000000000000000000000000000000000000000000000000000000000082527f00000000000000000000000000000000000000000000000000000000000000006101028601526101228501526042835261016084019183831090831117611a35578a92826040525190209060a4359360ff8516809503611a31578894608093835261018082015260c4356101a08201526101c060e43591015282805260015afa15611a26577fd5e969f01efe921d3f766bdebad25f0a05e3f237311f56482bf132d0326309c092829161197f838a51168015159081611a19575b506040519061195182612cf3565b601182527f696e76616c6964207369676e617475726500000000000000000000000000000089830152612f41565b8282511690516040519081527fa58af1a0c70dba0c7aa60d1a1a147ebd61000d1690a968828ac718bca927f2c7873392a3611a0387511515838351168a526006875260408a2084895116600052875260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b511693511693511515916040519283523392a480f35b9050848451161438611943565b6040513d88823e3d90fd5b8380fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8880fd5b50346101b8576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104e1576004359067ffffffffffffffff90818311611a315736602384011215611a31578260040135918211611a3157602491600590368482841b87010111611bd057849181611ae58893613823565b95611af36040519788612d0f565b818752611aff82613823565b947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08789019601368737845b838110611b7557505050505060405193838594850191818652518092526040850193925b828110611b5e57505050500390f35b835185528695509381019392810192600101611b4f565b9497959694611b83816132fb565b9084811015611ba457851b82018301355481861b8801529597949695611b2b565b838a7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8580fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060209173ffffffffffffffffffffffffffffffffffffffff611c26612c5a565b168152600783522054604051908152f35b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857611c6f612c5a565b6040611c79612ca0565b9273ffffffffffffffffffffffffffffffffffffffff80931681526006602052209116600052602052602060ff604060002054166040519015158152f35b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060c091600435815260036020522080546002600183015492015490604051926fffffffffffffffffffffffffffffffff91828116855260801c6020850152818116604085015260801c60608401528116608083015260801c60a0820152f35b50346101b857604090611d5a36612e98565b9294939190858260a08520918288526003602052611d946fffffffffffffffffffffffffffffffff60028c8b200154161515610249613016565b1593611daa611da16130f9565b82158718612f41565b73ffffffffffffffffffffffffffffffffffffffff871694611dcd6115d8613132565b611dd96115ec86613328565b611de3848861336e565b611f4e57505092610ac0949273ffffffffffffffffffffffffffffffffffffffff9285899689526003602052611f0e8b611e37818c20546fffffffffffffffffffffffffffffffff8160801c91168b613c33565b9a5b8381526002602052878282209516948560005260205281600020611e5e8d8254613221565b9055611e85611e6c8d613c78565b85835260036020526108e684842091825460801c61322e565b611e8e8a613c78565b8482526003602052828220907fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff611eda84549382851661322e565b1691161790558381526003602052206fffffffffffffffffffffffffffffffff806001830154169154161015610249613250565b8a5133815260208101889052604081018a90527fa56fc0ad5702ec05ce63666221f796fb62437c32db1aa1aa075fc6484cf58fbf90606090a4511661394a565b8998509282611f0e611fa173ffffffffffffffffffffffffffffffffffffffff968b9996610ac09b99969c5260036020528c8a2054906fffffffffffffffffffffffffffffffff8260801c921690613c0d565b9a8b98611e39565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857611fe1612c5a565b73ffffffffffffffffffffffffffffffffffffffff90612008828454163314610249612f08565b16808252600460205261202560ff60408420541615610249612fdd565b80825260046020526040822060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f590e04cdebeccba40f566186b9746ad295a4cd358ea4fefaaea6ce79630d96c08280a280f35b50346101b85761209036612e98565b909291948294869160a08220958682526003966020968888526fffffffffffffffffffffffffffffffff906120d2826002604088200154161515610249613016565b15936120e86120df6130f9565b8d158718612f41565b73ffffffffffffffffffffffffffffffffffffffff968789169561211561210d613132565b881515612f41565b6121216115ec87613328565b61212b858961336e565b6122e657508a9b5082819b98999a9b528a8a526121566001604083200154838160801c91168a613c33565b9a8b945b61216386613c78565b85845260028d528c8360408620988c8516998a60005283526040600020600101888154958187169061219491613178565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008096161790556121c590613c78565b91888752526040852060010190815460801c906121e191613178565b81546fffffffffffffffffffffffffffffffff1660809190911b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000161790558c8361222b8d613c78565b91888752526040852060010191868354928184169061224991613178565b16911617905561225a90858961367c565b612262613289565b61226b91612f41565b8382528a526040902090806001830154169154161015612289613250565b61229291612f41565b60408051338152602081018890529081018a90527f570954540bed6b1304a87dfe815a5eda4a648f7097a16240dcd85c9b5fd42a4390606090a45116916122d89261394a565b604051928352820152604090f35b9a5061230d8b9498999a9c8483528d8c52600160408420015490848260801c921690613c0d565b9b8c9861215a565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8577f297b80e7a896fad470c630f6575072d609bde997260ff3db851939405ec29139602060043561239073ffffffffffffffffffffffffffffffffffffffff8554163314610249612f08565b808452600582526123ab60ff60408620541615610249612fdd565b6123f36040516123ba81612cf3565b601181527f6d6178204c4c545620657863656564656400000000000000000000000000000084820152670de0b6b3a76400008310612f41565b808452600582526040842060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055604051908152a180f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060a091600435815260086020522073ffffffffffffffffffffffffffffffffffffffff8082541691816001820154169160048160028401541691600384015416920154926040519485526020850152604084015260608301526080820152f35b50346101b85760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576125a736612d50565b7f139d6f58e9a127229667c8e3b36e88890a66cfc8ab1024ddc513e189e125b75b602060a4356125f273ffffffffffffffffffffffffffffffffffffffff8654163314610249612f08565b6126ed60a08520948587526003845261269c866fffffffffffffffffffffffffffffffff9261262e84600260408d200154161515610249613016565b818a526003875261264e600260408c20015460801c871415610249612fdd565b61269760405161265d81612cf3565b601081527f6d61782066656520657863656564656400000000000000000000000000000000898201526703782dace9d90000881115612f41565b61336e565b85875260038452821660026040882001906fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b604051908152a280f35b50346101b8576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761273136612d50565b9060a43561273d612c7d565b60e43567ffffffffffffffff8111611a315761275d903690600401612de8565b9060a0862080865260036020526127916fffffffffffffffffffffffffffffffff6002604089200154161515610249613016565b61279c6104176132c2565b73ffffffffffffffffffffffffffffffffffffffff809416906127c86127c0613132565b831515612f41565b6127fb6127d487613c78565b828952600260205260408920848a526020526108e6600160408b200191825460801c613178565b604051908682527fa3b9472a1399e17e123f3c2e6586c23e504184d504de59cdaa2b375e880c618460203393a481612843575b505060206104bb939401511630903390613ab9565b333b156128bd5761288591859160405193849283927fb1022fdf000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156128b25761289c575b8061282e565b6104bb936128ab602092612cc3565b9350612896565b6040513d86823e3d90fd5b8480fd5b50346101b8576128d036612e16565b849691959296958460a0852080855260036020978189526fffffffffffffffffffffffffffffffff996129108b600260408b200154161515610249613016565b159361291d611da16130f9565b73ffffffffffffffffffffffffffffffffffffffff809d16946129416115d8613132565b61294b858b61336e565b612af757505081865280885261296f60016040882001548a8160801c91168c613be8565b985b61297a8a613c78565b9083885260028a52604088208589528a5260016040892001816129a182549482861661322e565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008094161790556129f06129d58c613c78565b858a52848c526108e6600160408c200191825460801c61322e565b838852828a52612a0f81600160408b200154168d808203911102613c78565b928489528a52600160408920019216908254161790556040519089825288888301527f52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa0960403393a481612a72575050508360409561107092511630903390613ab9565b333b156104d257918091612ab59360405194859283927f05b4591c0000000000000000000000000000000000000000000000000000000084528b6004850161319c565b038183335af1908115612aeb575095611070928692604098612adc575b509281975061105a565b612ae590612cc3565b38612ad2565b604051903d90823e3d90fd5b612b1a919a9b50838852828a526001604089200154908c8260801c921690613c55565b99612971565b50346101b85760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576104bb612b5c36612d50565b60a081209081845260036020526126976fffffffffffffffffffffffffffffffff6002604087200154161515610249613016565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857612c2f612bcb612c5a565b7fffffffffffffffffffffffff0000000000000000000000000000000000000000835473ffffffffffffffffffffffffffffffffffffffff80821693612c1a612c12612f08565b863314612f41565b16938493612c26612fdd565b90851415612f41565b161782557f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb58280a280f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b60c4359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b67ffffffffffffffff8111611a3557604052565b60a0810190811067ffffffffffffffff821117611a3557604052565b6040810190811067ffffffffffffffff821117611a3557604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117611a3557604052565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60a09101126102c85760405190612d8782612cd7565b8173ffffffffffffffffffffffffffffffffffffffff60043581811681036102c857825260243581811681036102c857602083015260443581811681036102c857604083015260643590811681036102c85760608201526080608435910152565b9181601f840112156102c85782359167ffffffffffffffff83116102c857602083818601950101116102c857565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102c857612e4a81612d50565b9160a4359160c4359160e43573ffffffffffffffffffffffffffffffffffffffff811681036102c85791610104359067ffffffffffffffff82116102c857612e9491600401612de8565b9091565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102c857612ecc90612d50565b9060a4359060c4359073ffffffffffffffffffffffffffffffffffffffff9060e43582811681036102c857916101043590811681036102c85790565b60405190612f1582612cf3565b600982527f6e6f74206f776e657200000000000000000000000000000000000000000000006020830152565b15612f495750565b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110612fc6575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201612f85565b60405190612fea82612cf3565b600b82527f616c7265616479207365740000000000000000000000000000000000000000006020830152565b6040519061302382612cf3565b601282527f6d61726b6574206e6f74206372656174656400000000000000000000000000006020830152565b909291610140906130a9836101608101966080809173ffffffffffffffffffffffffffffffffffffffff80825116855280602083015116602086015280604083015116604086015260608201511660608501520151910152565b60028154916fffffffffffffffffffffffffffffffff9283811660a087015260801c60c0860152600181015483811660e087015260801c610100860152015490811661012084015260801c910152565b6040519061310682612cf3565b601282527f696e636f6e73697374656e7420696e70757400000000000000000000000000006020830152565b6040519061313f82612cf3565b600c82527f7a65726f206164647265737300000000000000000000000000000000000000006020830152565b91908201809211610ccd57565b9190916fffffffffffffffffffffffffffffffff80809416911601918211610ccd57565b9183606094601f927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0948652604060208701528160408701528686013760008582860101520116010190565b604051906131f582612cf3565b600c82527f756e617574686f72697a656400000000000000000000000000000000000000006020830152565b91908203918211610ccd57565b6fffffffffffffffffffffffffffffffff9182169082160391908211610ccd57565b6040519061325d82612cf3565b601682527f696e73756666696369656e74206c6971756964697479000000000000000000006020830152565b6040519061329682612cf3565b601782527f696e73756666696369656e7420636f6c6c61746572616c0000000000000000006020830152565b604051906132cf82612cf3565b600b82527f7a65726f206173736574730000000000000000000000000000000000000000006020830152565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ccd5760010190565b73ffffffffffffffffffffffffffffffffffffffff1680331490811561334c575090565b9050600052600660205260406000203360005260205260ff6040600020541690565b91906000908082526003916020928084526fffffffffffffffffffffffffffffffff936040936133a686600287872001541642613221565b80156136715773ffffffffffffffffffffffffffffffffffffffff908160608b01511680613409575b50505060029596975083525220019042167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055565b61344d8591858952878352898920898b519e8f94859384927f9451fed40000000000000000000000000000000000000000000000000000000084526004840161304f565b03925af1998a1561366757869a613637575b50606088999a6134f087898796898860029f8f7f9d9bd501d0657d7dfe415f779a620a62b78bc508ddc0891fbbd8b7ac0f8fce879a8387528785526134fb6134b0846001858b20015416928c61383b565b916134f5671bc16d674ec800006134c7858061383b565b0493670de0b6b3a76400009c856729a2241af62c00008f97846134e99161383b565b049261316b565b61316b565b9061383b565b049561350687613c78565b84825288865260018383200184613521825493828516613178565b167fffffffffffffffffffffffffffffffff0000000000000000000000000000000080931617905561355288613c78565b858352898752838320918561356b845493828516613178565b16911617905580978482528086526002838320015460801c998a6135aa575b505090519889525050505050888401528a83015250a287969538806133cf565b8899506135bf6135ce97989b6135e19a61383b565b04968795835252205416613221565b888d528b8b528d8d205460801c91613be8565b91868b528c89528b8b2090600154168b5288528a8a2061360283825461316b565b905561362761361083613c78565b878c528a8a526108e68d8d2091825460801c613178565b819038898f89908f8f8f8661358a565b9099508381813d8311613660575b61364f8183612d0f565b81010312611bd0575198606061345f565b503d613645565b87513d88823e3d90fd5b505050505050509050565b909291600093808552602092600284526040862073ffffffffffffffffffffffffffffffffffffffff90818516885285526fffffffffffffffffffffffffffffffff600160408920015416156137625784600491604084015116604051928380927fa035b1fe0000000000000000000000000000000000000000000000000000000082525afa948515613757578795613720575b505061371d94955061376d565b90565b9080929550813d8311613750575b6137388183612d0f565b81010312611bd05761371d9495505192859438613710565b503d61372e565b6040513d89823e3d90fd5b506001955050505050565b60806ec097ce7bc90715b34b9f100000000061381361381d949660016040670de0b6b3a7640000986000908b8252600260205273ffffffffffffffffffffffffffffffffffffffff8383209116908183526020526137f86fffffffffffffffffffffffffffffffff8d8187878720015416908552600360205286868620015491828c1c921690613c55565b9b82526002602052828220908252602052200154841c61383b565b049101519061383b565b04101590565b67ffffffffffffffff8111611a355760051b60200190565b81810292918115918404141715610ccd57565b8115610df4570490565b906138629161383b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810191818311610ccd5761371d926107d49161316b565b604051906138a882612cf3565b600782527f6e6f20636f6465000000000000000000000000000000000000000000000000006020830152565b3d1561392d573d9067ffffffffffffffff8211611a35576040519161392160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184612d0f565b82523d6000602084013e565b606090565b908160209103126102c8575180151581036102c85790565b613a9d92600092836139da613a0673ffffffffffffffffffffffffffffffffffffffff83961694613980863b151561024961389b565b60405192839160208301967fa9059cbb000000000000000000000000000000000000000000000000000000008852602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282612d0f565b51925af1613a52613a156138d4565b9160405190613a2382612cf3565b601182527f7472616e736665722072657665727465640000000000000000000000000000006020830152612f41565b8051908115918215613a9f575b505060405190613a6e82612cf3565b601782527f7472616e736665722072657475726e65642066616c73650000000000000000006020830152612f41565b565b613ab29250602080918301019101613932565b3880613a5f565b60009291838093613a9d9673ffffffffffffffffffffffffffffffffffffffff80951694613aec863b151561024961389b565b604051928160208501967f23b872dd000000000000000000000000000000000000000000000000000000008852166024850152166044830152606482015260648152613b3781612cd7565b51925af1613b83613b466138d4565b9160405190613b5482612cf3565b601582527f7472616e7366657246726f6d20726576657274656400000000000000000000006020830152612f41565b8051908115918215613bce575b505060405190613b9f82612cf3565b601b82527f7472616e7366657246726f6d2072657475726e65642066616c736500000000006020830152612f41565b613be19250602080918301019101613932565b3880613b90565b620f42408301809311610ccd5760018201809211610ccd5761371d926107d49161383b565b6001820192918310610ccd57620f42408201809211610ccd5761371d926107d49161383b565b91620f42408101809111610ccd5760018201809211610ccd5761371d92613858565b919060018101809111610ccd57620f42408201809211610ccd5761371d92613858565b60405190613c8582612cf3565b601482527f6d61782075696e743132382065786365656465640000000000000000000000006020830152613ccd6fffffffffffffffffffffffffffffffff9283831115612f41565b169056fea264697066735822122079158eb535c7c15b41fefd9a35ecfba352cc57513680ee925005a5e78d70326264736f6c63430008130033000000000000000000000000937ce2d6c488b361825d2db5e8a70e26d48afed5

Deployed Bytecode

0x6080604052600436101561001257600080fd5b6000803560e01c806313af403514612b90578063151c1ade14612b2057806320b76e81146128c1578063238d6579146126f75780632b4f013c1461256e5780632c3c9157146124dc5780633644e5151461248357806346904840146124315780634d98a93b1461231557806350d8cd4b146120815780635a64f51e14611fa95780635c2bea4914611d485780635c60e39a14611cb757806365e4ad9e14611c3757806370ae92d214611bd45780637784c68514611a685780638069218f1461167f5780638720316d1461150f5780638c1358a2146111f85780638da5cb5b146111a757806393c520621461110e578063a99aad8914610eda578063b485f3b814610e8d578063d8eabcb8146104e5578063e0232b4214610398578063e74b981b146102cd578063eecea000146101bb5763f2b863ce1461015157600080fd5b346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760ff604060209273ffffffffffffffffffffffffffffffffffffffff6101a4612c5a565b168152600484522054166040519015158152f35b80fd5b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576101f3612c5a565b602435801515908181036102c85761029790338552600660205273ffffffffffffffffffffffffffffffffffffffff604086209416938460005260205261024f60ff604060002054161515841415610249612fdd565b90612f41565b3385526006602052604085208460005260205260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b60405190815233907fd5e969f01efe921d3f766bdebad25f0a05e3f237311f56482bf132d0326309c060203392a480f35b600080fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761036c610308612c5a565b7fffffffffffffffffffffffff000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff91610350838654163314610249612f08565b826001549116938493610361612fdd565b908316851415612f41565b16176001557f2e979f80fe4d43055c584cf4a8467c55875ea36728fc37176c05acd784eb7a738280a280f35b50346101b85760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576103d0612c5a565b6024358260443567ffffffffffffffff81116104e15761040973ffffffffffffffffffffffffffffffffffffffff913690600401612de8565b91909461041f6104176132c2565b861515612f41565b1693846040518581527fc76f1b4fe4396ac07a9fa55a415d4ca430e72651d37d3401f3bed7cb13fc4f1260203392a361045984338761394a565b333b156104d25761049b91839160405193849283927f31f57072000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156104d6576104be575b50506104bb9130903390613ab9565b80f35b6104c790612cc3565b6104d25782386104ac565b8280fd5b6040513d84823e3d90fd5b5080fd5b50346101b8576101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761051f36612d50565b9073ffffffffffffffffffffffffffffffffffffffff60a4351660a435036102c8576101043567ffffffffffffffff81116104e157610562903690600401612de8565b9160c4359260e4359260a0862093848452600360205261059f6fffffffffffffffffffffffffffffffff6002604087200154161515610249613016565b6105b46105aa6130f9565b8215881518612f41565b6105be858861336e565b6004602073ffffffffffffffffffffffffffffffffffffffff60408a015116604051928380927fa035b1fe0000000000000000000000000000000000000000000000000000000082525afa908115610e82578591610e50575b506106666106298260a435898c61376d565b156040519061063782612cf3565b601382527f706f736974696f6e206973206865616c746879000000000000000000000000006020830152612f41565b6080880151670de0b6b3a764000003670de0b6b3a76400008111610ca057670429d069189e00009080820291820403610ccd57670de0b6b3a764000090049182670de0b6b3a76400000392670de0b6b3a76400008411610e2357670de0b6b3a764000014610df4578715610cfc57506106df908761383b565b6ec097ce7bc90715b34b9f0fffffffff8101809111610ccd576ec097ce7bc90715b34b9f1000000000900480670de0b6b3a7640000810204670de0b6b3a76400001481151715610ccd57670ff59ee833b300006ec097ce7bc90715b34b9f10000000008390048082189082110281187fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810111610ca057610807926107d9926ec097ce7bc90715b34b9f10000000009190910480831890831102909118906107d4907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830190670de0b6b3a76400000261316b565b61384e565b85855260036020526001604086200154906fffffffffffffffffffffffffffffffff8260801c921690613c33565b935b808452600360205261083960016040862001546fffffffffffffffffffffffffffffffff8160801c911687613c55565b9461084381613c78565b82865260026020526040862073ffffffffffffffffffffffffffffffffffffffff60a4351660005260205260016040600020016fffffffffffffffffffffffffffffffff61089582549382851661322e565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008093161790556109266108c983613c78565b84885260036020526108e6600160408a200191825460801c61322e565b6fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b82865260036020526109576fffffffffffffffffffffffffffffffff60016040892001541688808203911102613c78565b83875260036020526fffffffffffffffffffffffffffffffff600160408920019116828254161790556109cd61098c89613c78565b84885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a435166000526020526108e6600160406000200191825460801c61322e565b8590869084885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a4351660005260205260016040600020015460801c15610b39575b506040519288845260208401528860408401526060830152608082015273ffffffffffffffffffffffffffffffffffffffff60a43516917fa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e4160a03393a4610a90853373ffffffffffffffffffffffffffffffffffffffff60208a01511661394a565b81610acc575b505050610ac08173ffffffffffffffffffffffffffffffffffffffff604095511630903390613ab9565b82519182526020820152f35b333b156104d257610b0e91839160405193849283927fcf7ea196000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156104d657610b25575b80610a96565b610b2f8291612cc3565b6101b85780610b1f565b91505082865260026020526040862073ffffffffffffffffffffffffffffffffffffffff60a435166000526020526fffffffffffffffffffffffffffffffff600160406000200154169083875260036020526001604088200154610bb46fffffffffffffffffffffffffffffffff82169160801c8285613c55565b818110908218021890610bc682613c78565b8589526003602052600160408a200190826fffffffffffffffffffffffffffffffff610bf684549382851661322e565b169116179055610c0582613c78565b85895260036020526040892090826fffffffffffffffffffffffffffffffff610c3284549382851661322e565b169116179055610c61610c4484613c78565b868a5260036020526108e6600160408c200191825460801c61322e565b84885260026020526040882073ffffffffffffffffffffffffffffffffffffffff60a43516600052602052600160406000200190815416905538610a0e565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b95965090610d78670de0b6b3a7640000918887526003602052610d73600160408920015491670ff59ee833b300009081816ec097ce7bc90715b34b9f10000000000410906ec097ce7bc90715b34b9f10000000000482180218916fffffffffffffffffffffffffffffffff8160801c91168a613c0d565b61383b565b04806ec097ce7bc90715b34b9f10000000008102046ec097ce7bc90715b34b9f10000000001481151715610dc757906ec097ce7bc90715b34b9f1000000000610dc1920261384e565b94610809565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b90506020813d602011610e7a575b81610e6b60209383612d0f565b810103126102c8575138610617565b3d9150610e5e565b6040513d87823e3d90fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760ff60406020926004358152600584522054166040519015158152f35b50346101b857610ee936612e16565b849691959296958460a08520808552602096600388526fffffffffffffffffffffffffffffffff98610f288a600260408a200154161515610249613016565b1592610f3e610f356130f9565b82158618612f41565b73ffffffffffffffffffffffffffffffffffffffff809c1693610f62610417613132565b610f6c848a61336e565b6110e757505080855260038752610f8e6040862054898160801c91168b613be8565b975b81865260028852604086208360005288526040600020610fb18a825461316b565b9055610fd8610fbf8a613c78565b83885260038a526108e66040892091825460801c613178565b610fe18a613c78565b828752600389527fffffffffffffffffffffffffffffffff00000000000000000000000000000000604088209261101c845493828516613178565b1691161790556040519089825288888301527fedf8870433c83823eb071d3df1caa8d008f12f6440918c20d75a3602cda30fe060403393a48161107a575b5050508360409561107092511630903390613ab9565b8351928352820152f35b333b156104d2576110bc91839160405193849283927f2075be030000000000000000000000000000000000000000000000000000000084528b6004850161319c565b038183335af180156104d6576110d3575b8061105a565b6110dd8291612cc3565b6101b857806110cd565b61110891999a50828752600389526040872054908b8260801c921690613c55565b98610f90565b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85773ffffffffffffffffffffffffffffffffffffffff604061115d612ca0565b926004358152600260205220911660005260205260606040600020600181549101546040519182526fffffffffffffffffffffffffffffffff8116602083015260801c6040820152f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346101b85760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761123136612d50565b60a0812090606081019173ffffffffffffffffffffffffffffffffffffffff808451168552602093600485526112a360ff6040882054166040519061127582612cf3565b600f82527f49524d206e6f7420656e61626c6564000000000000000000000000000000000088830152612f41565b6080840180518752600586526112f560ff604089205416604051906112c782612cf3565b601082527f4c4c5456206e6f7420656e61626c65640000000000000000000000000000000089830152612f41565b838752600386526fffffffffffffffffffffffffffffffff61135681600260408b20015416156040519061132882612cf3565b601682527f6d61726b657420616c72656164792063726561746564000000000000000000008a830152612f41565b84885260038752600260408920019042167fffffffffffffffffffffffffffffffff000000000000000000000000000000008254161790556008865260046040882091848751167fffffffffffffffffffffffff0000000000000000000000000000000000000000908185541617845560018401868a8a01511682825416179055600284018660408a015116828254161790556003840190868651169082541617905551910155827fac4b2400f169220b0c0afdde7a0b32e775ba727ea1cb30b35f935cdaab8683ac60a060405161147281896080809173ffffffffffffffffffffffffffffffffffffffff80825116855280602083015116602086015280604083015116604086015260608201511660608501520151910152565ba25116918261147f578480f35b6114c69284928652600383526040862091866040518096819582947f9451fed40000000000000000000000000000000000000000000000000000000084526004840161304f565b03925af18015611504576114db575b80808480f35b813d83116114fd575b6114ee8183612d0f565b810103126102c85738806114d5565b503d6114e4565b6040513d85823e3d90fd5b50346101b8576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761154936612d50565b60a435611554612c7d565b60e4359073ffffffffffffffffffffffffffffffffffffffff90818316948584036102c8576104bb958760209361164561163d60a0862092838552600388526115ba6fffffffffffffffffffffffffffffffff6002604088200154161515610249613016565b6115cd6115c56132c2565b8c1515612f41565b6115e06115d8613132565b871515612f41565b6115f46115ec82613328565b6102496131e8565b6115fe848861336e565b611636604061160c8d613c78565b9686815260028b5220958a831696876000528a526108e6600160406000200191825460801c61322e565b838761367c565b610249613289565b60408051338152602081018a90527fe80ebd7cc9223d7382aab2e0d1d6155c65651f83d53c8b9b06901d167e3211429190a401511661394a565b50346101b857610100367ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc018181126104d25760a0136104e1576040516116c581612cd7565b6116cd612c5a565b81526116d7612ca0565b906020908181019283526044359384151585036102c85760408201948552606082016064358152608435608084019080825260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5c360112611a64576040516117749161174382612cf3565b601182527f7369676e6174757265206578706972656400000000000000000000000000000088830152421115612f41565b8151926117e873ffffffffffffffffffffffffffffffffffffffff94858751168b526007885260408b208054906117aa826132fb565b9055604051916117b983612cf3565b600d83527f696e76616c6964206e6f6e6365000000000000000000000000000000000000008a84015214612f41565b60405191868301907f81d0284fb0e2cde18d0553b06189d6f7613c96a01bb5b5e7828eade6a0dcac918252858751166040850152858951166060850152895115156080850152845160a08501525160c084015260c0835260e083019167ffffffffffffffff9184841083851117611a35578360405284519020908401907f190100000000000000000000000000000000000000000000000000000000000082527fec6ac4ec6469375712b671d38548b711c7a4a17b4db99be41e0eb9f28cafdd2d6101028601526101228501526042835261016084019183831090831117611a35578a92826040525190209060a4359360ff8516809503611a31578894608093835261018082015260c4356101a08201526101c060e43591015282805260015afa15611a26577fd5e969f01efe921d3f766bdebad25f0a05e3f237311f56482bf132d0326309c092829161197f838a51168015159081611a19575b506040519061195182612cf3565b601182527f696e76616c6964207369676e617475726500000000000000000000000000000089830152612f41565b8282511690516040519081527fa58af1a0c70dba0c7aa60d1a1a147ebd61000d1690a968828ac718bca927f2c7873392a3611a0387511515838351168a526006875260408a2084895116600052875260406000209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691151516179055565b511693511693511515916040519283523392a480f35b9050848451161438611943565b6040513d88823e3d90fd5b8380fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8880fd5b50346101b8576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104e1576004359067ffffffffffffffff90818311611a315736602384011215611a31578260040135918211611a3157602491600590368482841b87010111611bd057849181611ae58893613823565b95611af36040519788612d0f565b818752611aff82613823565b947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08789019601368737845b838110611b7557505050505060405193838594850191818652518092526040850193925b828110611b5e57505050500390f35b835185528695509381019392810192600101611b4f565b9497959694611b83816132fb565b9084811015611ba457851b82018301355481861b8801529597949695611b2b565b838a7f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8580fd5b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060209173ffffffffffffffffffffffffffffffffffffffff611c26612c5a565b168152600783522054604051908152f35b50346101b85760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857611c6f612c5a565b6040611c79612ca0565b9273ffffffffffffffffffffffffffffffffffffffff80931681526006602052209116600052602052602060ff604060002054166040519015158152f35b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060c091600435815260036020522080546002600183015492015490604051926fffffffffffffffffffffffffffffffff91828116855260801c6020850152818116604085015260801c60608401528116608083015260801c60a0820152f35b50346101b857604090611d5a36612e98565b9294939190858260a08520918288526003602052611d946fffffffffffffffffffffffffffffffff60028c8b200154161515610249613016565b1593611daa611da16130f9565b82158718612f41565b73ffffffffffffffffffffffffffffffffffffffff871694611dcd6115d8613132565b611dd96115ec86613328565b611de3848861336e565b611f4e57505092610ac0949273ffffffffffffffffffffffffffffffffffffffff9285899689526003602052611f0e8b611e37818c20546fffffffffffffffffffffffffffffffff8160801c91168b613c33565b9a5b8381526002602052878282209516948560005260205281600020611e5e8d8254613221565b9055611e85611e6c8d613c78565b85835260036020526108e684842091825460801c61322e565b611e8e8a613c78565b8482526003602052828220907fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff611eda84549382851661322e565b1691161790558381526003602052206fffffffffffffffffffffffffffffffff806001830154169154161015610249613250565b8a5133815260208101889052604081018a90527fa56fc0ad5702ec05ce63666221f796fb62437c32db1aa1aa075fc6484cf58fbf90606090a4511661394a565b8998509282611f0e611fa173ffffffffffffffffffffffffffffffffffffffff968b9996610ac09b99969c5260036020528c8a2054906fffffffffffffffffffffffffffffffff8260801c921690613c0d565b9a8b98611e39565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857611fe1612c5a565b73ffffffffffffffffffffffffffffffffffffffff90612008828454163314610249612f08565b16808252600460205261202560ff60408420541615610249612fdd565b80825260046020526040822060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f590e04cdebeccba40f566186b9746ad295a4cd358ea4fefaaea6ce79630d96c08280a280f35b50346101b85761209036612e98565b909291948294869160a08220958682526003966020968888526fffffffffffffffffffffffffffffffff906120d2826002604088200154161515610249613016565b15936120e86120df6130f9565b8d158718612f41565b73ffffffffffffffffffffffffffffffffffffffff968789169561211561210d613132565b881515612f41565b6121216115ec87613328565b61212b858961336e565b6122e657508a9b5082819b98999a9b528a8a526121566001604083200154838160801c91168a613c33565b9a8b945b61216386613c78565b85845260028d528c8360408620988c8516998a60005283526040600020600101888154958187169061219491613178565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008096161790556121c590613c78565b91888752526040852060010190815460801c906121e191613178565b81546fffffffffffffffffffffffffffffffff1660809190911b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000161790558c8361222b8d613c78565b91888752526040852060010191868354928184169061224991613178565b16911617905561225a90858961367c565b612262613289565b61226b91612f41565b8382528a526040902090806001830154169154161015612289613250565b61229291612f41565b60408051338152602081018890529081018a90527f570954540bed6b1304a87dfe815a5eda4a648f7097a16240dcd85c9b5fd42a4390606090a45116916122d89261394a565b604051928352820152604090f35b9a5061230d8b9498999a9c8483528d8c52600160408420015490848260801c921690613c0d565b9b8c9861215a565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8577f297b80e7a896fad470c630f6575072d609bde997260ff3db851939405ec29139602060043561239073ffffffffffffffffffffffffffffffffffffffff8554163314610249612f08565b808452600582526123ab60ff60408620541615610249612fdd565b6123f36040516123ba81612cf3565b601181527f6d6178204c4c545620657863656564656400000000000000000000000000000084820152670de0b6b3a76400008310612f41565b808452600582526040842060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055604051908152a180f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101b857807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85760206040517fec6ac4ec6469375712b671d38548b711c7a4a17b4db99be41e0eb9f28cafdd2d8152f35b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857604060a091600435815260086020522073ffffffffffffffffffffffffffffffffffffffff8082541691816001820154169160048160028401541691600384015416920154926040519485526020850152604084015260608301526080820152f35b50346101b85760c07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576125a736612d50565b7f139d6f58e9a127229667c8e3b36e88890a66cfc8ab1024ddc513e189e125b75b602060a4356125f273ffffffffffffffffffffffffffffffffffffffff8654163314610249612f08565b6126ed60a08520948587526003845261269c866fffffffffffffffffffffffffffffffff9261262e84600260408d200154161515610249613016565b818a526003875261264e600260408c20015460801c871415610249612fdd565b61269760405161265d81612cf3565b601081527f6d61782066656520657863656564656400000000000000000000000000000000898201526703782dace9d90000881115612f41565b61336e565b85875260038452821660026040882001906fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083549260801b169116179055565b604051908152a280f35b50346101b8576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b85761273136612d50565b9060a43561273d612c7d565b60e43567ffffffffffffffff8111611a315761275d903690600401612de8565b9060a0862080865260036020526127916fffffffffffffffffffffffffffffffff6002604089200154161515610249613016565b61279c6104176132c2565b73ffffffffffffffffffffffffffffffffffffffff809416906127c86127c0613132565b831515612f41565b6127fb6127d487613c78565b828952600260205260408920848a526020526108e6600160408b200191825460801c613178565b604051908682527fa3b9472a1399e17e123f3c2e6586c23e504184d504de59cdaa2b375e880c618460203393a481612843575b505060206104bb939401511630903390613ab9565b333b156128bd5761288591859160405193849283927fb1022fdf000000000000000000000000000000000000000000000000000000008452886004850161319c565b038183335af180156128b25761289c575b8061282e565b6104bb936128ab602092612cc3565b9350612896565b6040513d86823e3d90fd5b8480fd5b50346101b8576128d036612e16565b849691959296958460a0852080855260036020978189526fffffffffffffffffffffffffffffffff996129108b600260408b200154161515610249613016565b159361291d611da16130f9565b73ffffffffffffffffffffffffffffffffffffffff809d16946129416115d8613132565b61294b858b61336e565b612af757505081865280885261296f60016040882001548a8160801c91168c613be8565b985b61297a8a613c78565b9083885260028a52604088208589528a5260016040892001816129a182549482861661322e565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008094161790556129f06129d58c613c78565b858a52848c526108e6600160408c200191825460801c61322e565b838852828a52612a0f81600160408b200154168d808203911102613c78565b928489528a52600160408920019216908254161790556040519089825288888301527f52acb05cebbd3cd39715469f22afbf5a17496295ef3bc9bb5944056c63ccaa0960403393a481612a72575050508360409561107092511630903390613ab9565b333b156104d257918091612ab59360405194859283927f05b4591c0000000000000000000000000000000000000000000000000000000084528b6004850161319c565b038183335af1908115612aeb575095611070928692604098612adc575b509281975061105a565b612ae590612cc3565b38612ad2565b604051903d90823e3d90fd5b612b1a919a9b50838852828a526001604089200154908c8260801c921690613c55565b99612971565b50346101b85760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b8576104bb612b5c36612d50565b60a081209081845260036020526126976fffffffffffffffffffffffffffffffff6002604087200154161515610249613016565b50346101b85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101b857612c2f612bcb612c5a565b7fffffffffffffffffffffffff0000000000000000000000000000000000000000835473ffffffffffffffffffffffffffffffffffffffff80821693612c1a612c12612f08565b863314612f41565b16938493612c26612fdd565b90851415612f41565b161782557f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb58280a280f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b60c4359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036102c857565b67ffffffffffffffff8111611a3557604052565b60a0810190811067ffffffffffffffff821117611a3557604052565b6040810190811067ffffffffffffffff821117611a3557604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117611a3557604052565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc60a09101126102c85760405190612d8782612cd7565b8173ffffffffffffffffffffffffffffffffffffffff60043581811681036102c857825260243581811681036102c857602083015260443581811681036102c857604083015260643590811681036102c85760608201526080608435910152565b9181601f840112156102c85782359167ffffffffffffffff83116102c857602083818601950101116102c857565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102c857612e4a81612d50565b9160a4359160c4359160e43573ffffffffffffffffffffffffffffffffffffffff811681036102c85791610104359067ffffffffffffffff82116102c857612e9491600401612de8565b9091565b6101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126102c857612ecc90612d50565b9060a4359060c4359073ffffffffffffffffffffffffffffffffffffffff9060e43582811681036102c857916101043590811681036102c85790565b60405190612f1582612cf3565b600982527f6e6f74206f776e657200000000000000000000000000000000000000000000006020830152565b15612f495750565b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110612fc6575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201612f85565b60405190612fea82612cf3565b600b82527f616c7265616479207365740000000000000000000000000000000000000000006020830152565b6040519061302382612cf3565b601282527f6d61726b6574206e6f74206372656174656400000000000000000000000000006020830152565b909291610140906130a9836101608101966080809173ffffffffffffffffffffffffffffffffffffffff80825116855280602083015116602086015280604083015116604086015260608201511660608501520151910152565b60028154916fffffffffffffffffffffffffffffffff9283811660a087015260801c60c0860152600181015483811660e087015260801c610100860152015490811661012084015260801c910152565b6040519061310682612cf3565b601282527f696e636f6e73697374656e7420696e70757400000000000000000000000000006020830152565b6040519061313f82612cf3565b600c82527f7a65726f206164647265737300000000000000000000000000000000000000006020830152565b91908201809211610ccd57565b9190916fffffffffffffffffffffffffffffffff80809416911601918211610ccd57565b9183606094601f927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0948652604060208701528160408701528686013760008582860101520116010190565b604051906131f582612cf3565b600c82527f756e617574686f72697a656400000000000000000000000000000000000000006020830152565b91908203918211610ccd57565b6fffffffffffffffffffffffffffffffff9182169082160391908211610ccd57565b6040519061325d82612cf3565b601682527f696e73756666696369656e74206c6971756964697479000000000000000000006020830152565b6040519061329682612cf3565b601782527f696e73756666696369656e7420636f6c6c61746572616c0000000000000000006020830152565b604051906132cf82612cf3565b600b82527f7a65726f206173736574730000000000000000000000000000000000000000006020830152565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610ccd5760010190565b73ffffffffffffffffffffffffffffffffffffffff1680331490811561334c575090565b9050600052600660205260406000203360005260205260ff6040600020541690565b91906000908082526003916020928084526fffffffffffffffffffffffffffffffff936040936133a686600287872001541642613221565b80156136715773ffffffffffffffffffffffffffffffffffffffff908160608b01511680613409575b50505060029596975083525220019042167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055565b61344d8591858952878352898920898b519e8f94859384927f9451fed40000000000000000000000000000000000000000000000000000000084526004840161304f565b03925af1998a1561366757869a613637575b50606088999a6134f087898796898860029f8f7f9d9bd501d0657d7dfe415f779a620a62b78bc508ddc0891fbbd8b7ac0f8fce879a8387528785526134fb6134b0846001858b20015416928c61383b565b916134f5671bc16d674ec800006134c7858061383b565b0493670de0b6b3a76400009c856729a2241af62c00008f97846134e99161383b565b049261316b565b61316b565b9061383b565b049561350687613c78565b84825288865260018383200184613521825493828516613178565b167fffffffffffffffffffffffffffffffff0000000000000000000000000000000080931617905561355288613c78565b858352898752838320918561356b845493828516613178565b16911617905580978482528086526002838320015460801c998a6135aa575b505090519889525050505050888401528a83015250a287969538806133cf565b8899506135bf6135ce97989b6135e19a61383b565b04968795835252205416613221565b888d528b8b528d8d205460801c91613be8565b91868b528c89528b8b2090600154168b5288528a8a2061360283825461316b565b905561362761361083613c78565b878c528a8a526108e68d8d2091825460801c613178565b819038898f89908f8f8f8661358a565b9099508381813d8311613660575b61364f8183612d0f565b81010312611bd0575198606061345f565b503d613645565b87513d88823e3d90fd5b505050505050509050565b909291600093808552602092600284526040862073ffffffffffffffffffffffffffffffffffffffff90818516885285526fffffffffffffffffffffffffffffffff600160408920015416156137625784600491604084015116604051928380927fa035b1fe0000000000000000000000000000000000000000000000000000000082525afa948515613757578795613720575b505061371d94955061376d565b90565b9080929550813d8311613750575b6137388183612d0f565b81010312611bd05761371d9495505192859438613710565b503d61372e565b6040513d89823e3d90fd5b506001955050505050565b60806ec097ce7bc90715b34b9f100000000061381361381d949660016040670de0b6b3a7640000986000908b8252600260205273ffffffffffffffffffffffffffffffffffffffff8383209116908183526020526137f86fffffffffffffffffffffffffffffffff8d8187878720015416908552600360205286868620015491828c1c921690613c55565b9b82526002602052828220908252602052200154841c61383b565b049101519061383b565b04101590565b67ffffffffffffffff8111611a355760051b60200190565b81810292918115918404141715610ccd57565b8115610df4570490565b906138629161383b565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810191818311610ccd5761371d926107d49161316b565b604051906138a882612cf3565b600782527f6e6f20636f6465000000000000000000000000000000000000000000000000006020830152565b3d1561392d573d9067ffffffffffffffff8211611a35576040519161392160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184612d0f565b82523d6000602084013e565b606090565b908160209103126102c8575180151581036102c85790565b613a9d92600092836139da613a0673ffffffffffffffffffffffffffffffffffffffff83961694613980863b151561024961389b565b60405192839160208301967fa9059cbb000000000000000000000000000000000000000000000000000000008852602484016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282612d0f565b51925af1613a52613a156138d4565b9160405190613a2382612cf3565b601182527f7472616e736665722072657665727465640000000000000000000000000000006020830152612f41565b8051908115918215613a9f575b505060405190613a6e82612cf3565b601782527f7472616e736665722072657475726e65642066616c73650000000000000000006020830152612f41565b565b613ab29250602080918301019101613932565b3880613a5f565b60009291838093613a9d9673ffffffffffffffffffffffffffffffffffffffff80951694613aec863b151561024961389b565b604051928160208501967f23b872dd000000000000000000000000000000000000000000000000000000008852166024850152166044830152606482015260648152613b3781612cd7565b51925af1613b83613b466138d4565b9160405190613b5482612cf3565b601582527f7472616e7366657246726f6d20726576657274656400000000000000000000006020830152612f41565b8051908115918215613bce575b505060405190613b9f82612cf3565b601b82527f7472616e7366657246726f6d2072657475726e65642066616c736500000000006020830152612f41565b613be19250602080918301019101613932565b3880613b90565b620f42408301809311610ccd5760018201809211610ccd5761371d926107d49161383b565b6001820192918310610ccd57620f42408201809211610ccd5761371d926107d49161383b565b91620f42408101809111610ccd5760018201809211610ccd5761371d92613858565b919060018101809111610ccd57620f42408201809211610ccd5761371d92613858565b60405190613c8582612cf3565b601482527f6d61782075696e743132382065786365656465640000000000000000000000006020830152613ccd6fffffffffffffffffffffffffffffffff9283831115612f41565b169056fea264697066735822122079158eb535c7c15b41fefd9a35ecfba352cc57513680ee925005a5e78d70326264736f6c63430008130033

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

000000000000000000000000937ce2d6c488b361825d2db5e8a70e26d48afed5

-----Decoded View---------------
Arg [0] : newOwner (address): 0x937Ce2d6c488b361825D2DB5e8A70e26d48afEd5

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000937ce2d6c488b361825d2db5e8a70e26d48afed5


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

Morpho Blue is a noncustodial lending protocol implemented for the Ethereum Virtual Machine

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Chain Token Portfolio % Price Amount Value
ETH15.53%$61,2021,978.2551$121,073,167.33
ETH14.06%$0.999328109,649,775.8857$109,576,091.24
ETH13.61%$2,809.7837,770.813$106,127,674.82
ETH13.61%$0.999328106,170,783.2679$106,099,436.5
ETH8.44%$165,830,522.4755$65,830,522.48
ETH6.32%$149,195,343.979$49,293,734.67
ETH3.42%$0.99976426,628,402.4123$26,622,118.11
ETH2.99%$1,447.6716,122.041$23,339,395.04
ETH2.90%$2,401.649,427.841$22,642,280.05
ETH1.37%$2,376.154,508.592$10,713,088.92
ETH1.00%$61,405126.5946$7,773,543.5
ETH0.91%$2,496.722,847.2261$7,108,726.43
ETH0.77%$61,26198.4494$6,031,109.99
ETH0.46%$1.113,252,397.7295$3,610,161.48
ETH0.36%$0.9997032,811,287.0342$2,810,452.08
ETH0.31%$12,426,371.9536$2,427,097.31
ETH0.30%$2,433.94968.3791$2,356,973.94
ETH0.29%$61,25637.0579$2,270,017.74
ETH0.22%$2,443.34696.9763$1,702,949.99
ETH0.21%$0.9991461,620,266.0282$1,618,882.32
ETH0.19%$2,451.76601.9683$1,475,881.76
ETH0.19%$11,445,197.4247$1,446,642.62
ETH0.17%$0.9997231,293,922.5029$1,293,564.09
ETH0.14%$2,413.11447.1204$1,078,948.89
ETH0.09%$2,423.56275.2713$667,136.45
ETH0.07%$2,664.95215.6883$574,798.64
ETH0.07%$1.02552,529.2817$561,369.75
ETH0.05%$2,423.4161.6726$391,797.49
ETH0.04%$0.999177334,262.7789$333,987.68
ETH0.04%$1.03266,348.6163$274,871.77
ETH0.03%$0.997351229,342.3931$228,734.87
ETH0.03%$2,628.7378.8812$207,357.39
ETH0.01%$0.99999999,935$99,934.9
ETH0.01%$1.1578,337.1183$90,087.69
ETH0.01%$10.997,883.0741$86,634.98
ETH<0.01%$6.75,301.5867$35,520.63
ETH<0.01%$1.18,881.277$9,807.99
ETH<0.01%$2,665.731.0065$2,683.06
ETH<0.01%$60,3210.0021$126.67
ETH<0.01%$1.11.22$1.34
ETH<0.01%$1.11$1.1
ETH<0.01%$1.10.1$0.11
BASE3.21%$2,809.588,901.1292$25,008,434.59
BASE2.91%$0.99991122,719,313.9702$22,717,291.95
BASE2.18%$2,376.197,140.1667$16,966,392.8
BASE1.80%$2,568.935,457.3432$14,019,525.19
BASE0.76%$1.15,377,697.8181$5,915,467.6
BASE0.29%$61,26436.6483$2,245,222.75
BASE0.28%$2,413.52898.3779$2,168,253.03
BASE0.19%$2,420.92598.4131$1,448,710.24
BASE0.07%$1544,613.9448$544,613.94
BASE0.03%$1.15230,576.9341$265,163.47
BASE0.01%$1.1101,274.9424$111,402.44
BASE0.01%$0.999999100,001.1$100,001
BASE0.01%$0.00835610,874,929.8916$90,874.61
BASE<0.01%$2,658.9424.9731$66,401.87
BASE<0.01%$0.999041162.841$162.68
BASE<0.01%$4.021.8$7.24
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.