{"file_path":"Comptroller.sol","creation_status":"success","source_code":"pragma solidity ^0.5.16;\n\ncontract ComptrollerInterface {\n    /// @notice Indicator that this is a Comptroller contract (for inspection)\n    bool public constant isComptroller = true;\n\n    /*** Assets You Are In ***/\n\n    function enterMarkets(address[] calldata cTokens) external returns (uint[] memory);\n    function exitMarket(address cToken) external returns (uint);\n\n    /*** Policy Hooks ***/\n\n    function mintAllowed(address cToken, address minter, uint mintAmount) external returns (uint);\n    function mintVerify(address cToken, address minter, uint mintAmount, uint mintTokens) external;\n\n    function redeemAllowed(address cToken, address redeemer, uint redeemTokens) external returns (uint);\n    function redeemVerify(address cToken, address redeemer, uint redeemAmount, uint redeemTokens) external;\n\n    function borrowAllowed(address cToken, address borrower, uint borrowAmount) external returns (uint);\n    function borrowVerify(address cToken, address borrower, uint borrowAmount) external;\n\n    function repayBorrowAllowed(\n        address cToken,\n        address payer,\n        address borrower,\n        uint repayAmount) external returns (uint);\n    function repayBorrowVerify(\n        address cToken,\n        address payer,\n        address borrower,\n        uint repayAmount,\n        uint borrowerIndex) external;\n\n    function liquidateBorrowAllowed(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        address liquidator,\n        address borrower,\n        uint repayAmount) external returns (uint);\n    function liquidateBorrowVerify(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        address liquidator,\n        address borrower,\n        uint repayAmount,\n        uint seizeTokens) external;\n\n    function seizeAllowed(\n        address cTokenCollateral,\n        address cTokenBorrowed,\n        address liquidator,\n        address borrower,\n        uint seizeTokens) external returns (uint);\n    function seizeVerify(\n        address cTokenCollateral,\n        address cTokenBorrowed,\n        address liquidator,\n        address borrower,\n        uint seizeTokens) external;\n\n    function transferAllowed(address cToken, address src, address dst, uint transferTokens) external returns (uint);\n    function transferVerify(address cToken, address src, address dst, uint transferTokens) external;\n\n    /*** Liquidity/Liquidation Calculations ***/\n\n    function liquidateCalculateSeizeTokens(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        uint repayAmount) external view returns (uint, uint);\n}/**\n  * @title Compound's InterestRateModel Interface\n  * @author Compound\n  */\ncontract InterestRateModel {\n    /// @notice Indicator that this is an InterestRateModel contract (for inspection)\n    bool public constant isInterestRateModel = true;\n\n    /**\n      * @notice Calculates the current borrow interest rate per block\n      * @param cash The total amount of cash the market has\n      * @param borrows The total amount of borrows the market has outstanding\n      * @param reserves The total amount of reserves the market has\n      * @return The borrow rate per block (as a percentage, and scaled by 1e18)\n      */\n    function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);\n\n    /**\n      * @notice Calculates the current supply interest rate per block\n      * @param cash The total amount of cash the market has\n      * @param borrows The total amount of borrows the market has outstanding\n      * @param reserves The total amount of reserves the market has\n      * @param reserveFactorMantissa The current reserve factor the market has\n      * @return The supply rate per block (as a percentage, and scaled by 1e18)\n      */\n    function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint);\n\n}\ncontract CTokenStorage {\n    /**\n     * @dev Guard variable for re-entrancy checks\n     */\n    bool internal _notEntered;\n\n    /**\n     * @notice EIP-20 token name for this token\n     */\n    string public name;\n\n    /**\n     * @notice EIP-20 token symbol for this token\n     */\n    string public symbol;\n\n    /**\n     * @notice EIP-20 token decimals for this token\n     */\n    uint8 public decimals;\n\n    /**\n     * @notice Maximum borrow rate that can ever be applied (.0005% / block)\n     */\n\n    uint internal constant borrowRateMaxMantissa = 0.0005e16;\n\n    /**\n     * @notice Maximum fraction of interest that can be set aside for reserves\n     */\n    uint internal constant reserveFactorMaxMantissa = 1e18;\n\n    /**\n     * @notice Administrator for this contract\n     */\n    address payable public admin;\n\n    /**\n     * @notice Pending administrator for this contract\n     */\n    address payable public pendingAdmin;\n\n    /**\n     * @notice Contract which oversees inter-cToken operations\n     */\n    ComptrollerInterface public comptroller;\n\n    /**\n     * @notice Model which tells what the current interest rate should be\n     */\n    InterestRateModel public interestRateModel;\n\n    /**\n     * @notice Initial exchange rate used when minting the first CTokens (used when totalSupply = 0)\n     */\n    uint internal initialExchangeRateMantissa;\n\n    /**\n     * @notice Fraction of interest currently set aside for reserves\n     */\n    uint public reserveFactorMantissa;\n\n    /**\n     * @notice Block number that interest was last accrued at\n     */\n    uint public accrualBlockNumber;\n\n    /**\n     * @notice Accumulator of the total earned interest rate since the opening of the market\n     */\n    uint public borrowIndex;\n\n    /**\n     * @notice Total amount of outstanding borrows of the underlying in this market\n     */\n    uint public totalBorrows;\n\n    /**\n     * @notice Total amount of reserves of the underlying held in this market\n     */\n    uint public totalReserves;\n\n    /**\n     * @notice Total number of tokens in circulation\n     */\n    uint public totalSupply;\n\n    /**\n     * @notice Official record of token balances for each account\n     */\n    mapping (address => uint) internal accountTokens;\n\n    /**\n     * @notice Approved token transfer amounts on behalf of others\n     */\n    mapping (address => mapping (address => uint)) internal transferAllowances;\n\n    /**\n     * @notice Container for borrow balance information\n     * @member principal Total balance (with accrued interest), after applying the most recent balance-changing action\n     * @member interestIndex Global borrowIndex as of the most recent balance-changing action\n     */\n    struct BorrowSnapshot {\n        uint principal;\n        uint interestIndex;\n    }\n\n    /**\n     * @notice Mapping of account addresses to outstanding borrow balances\n     */\n    mapping(address => BorrowSnapshot) internal accountBorrows;\n}\n\ncontract CTokenInterface is CTokenStorage {\n    /**\n     * @notice Indicator that this is a CToken contract (for inspection)\n     */\n    bool public constant isCToken = true;\n\n\n    /*** Market Events ***/\n\n    /**\n     * @notice Event emitted when interest is accrued\n     */\n    event AccrueInterest(uint cashPrior, uint interestAccumulated, uint borrowIndex, uint totalBorrows);\n\n    /**\n     * @notice Event emitted when tokens are minted\n     */\n    event Mint(address minter, uint mintAmount, uint mintTokens);\n\n    /**\n     * @notice Event emitted when tokens are redeemed\n     */\n    event Redeem(address redeemer, uint redeemAmount, uint redeemTokens);\n\n    /**\n     * @notice Event emitted when underlying is borrowed\n     */\n    event Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows);\n\n    /**\n     * @notice Event emitted when a borrow is repaid\n     */\n    event RepayBorrow(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows);\n\n    /**\n     * @notice Event emitted when a borrow is liquidated\n     */\n    event LiquidateBorrow(address liquidator, address borrower, uint repayAmount, address cTokenCollateral, uint seizeTokens);\n\n\n    /*** Admin Events ***/\n\n    /**\n     * @notice Event emitted when pendingAdmin is changed\n     */\n    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\n\n    /**\n     * @notice Event emitted when pendingAdmin is accepted, which means admin is updated\n     */\n    event NewAdmin(address oldAdmin, address newAdmin);\n\n    /**\n     * @notice Event emitted when comptroller is changed\n     */\n    event NewComptroller(ComptrollerInterface oldComptroller, ComptrollerInterface newComptroller);\n\n    /**\n     * @notice Event emitted when interestRateModel is changed\n     */\n    event NewMarketInterestRateModel(InterestRateModel oldInterestRateModel, InterestRateModel newInterestRateModel);\n\n    /**\n     * @notice Event emitted when the reserve factor is changed\n     */\n    event NewReserveFactor(uint oldReserveFactorMantissa, uint newReserveFactorMantissa);\n\n    /**\n     * @notice Event emitted when the reserves are added\n     */\n    event ReservesAdded(address benefactor, uint addAmount, uint newTotalReserves);\n\n    /**\n     * @notice Event emitted when the reserves are reduced\n     */\n    event ReservesReduced(address admin, uint reduceAmount, uint newTotalReserves);\n\n    /**\n     * @notice EIP20 Transfer event\n     */\n    event Transfer(address indexed from, address indexed to, uint amount);\n\n    /**\n     * @notice EIP20 Approval event\n     */\n    event Approval(address indexed owner, address indexed spender, uint amount);\n\n    /**\n     * @notice Failure event\n     */\n    event Failure(uint error, uint info, uint detail);\n\n\n    /*** User Interface ***/\n\n    function transfer(address dst, uint amount) external returns (bool);\n    function transferFrom(address src, address dst, uint amount) external returns (bool);\n    function approve(address spender, uint amount) external returns (bool);\n    function allowance(address owner, address spender) external view returns (uint);\n    function balanceOf(address owner) external view returns (uint);\n    function balanceOfUnderlying(address owner) external returns (uint);\n    function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint);\n    function borrowRatePerBlock() external view returns (uint);\n    function supplyRatePerBlock() external view returns (uint);\n    function totalBorrowsCurrent() external returns (uint);\n    function borrowBalanceCurrent(address account) external returns (uint);\n    function borrowBalanceStored(address account) public view returns (uint);\n    function exchangeRateCurrent() public returns (uint);\n    function exchangeRateStored() public view returns (uint);\n    function getCash() external view returns (uint);\n    function accrueInterest() public returns (uint);\n    function seize(address liquidator, address borrower, uint seizeTokens) external returns (uint);\n\n\n    /*** Admin Functions ***/\n\n    function _setPendingAdmin(address payable newPendingAdmin) external returns (uint);\n    function _acceptAdmin() external returns (uint);\n    function _setComptroller(ComptrollerInterface newComptroller) public returns (uint);\n    function _setReserveFactor(uint newReserveFactorMantissa) external returns (uint);\n    function _reduceReserves(uint reduceAmount) external returns (uint);\n    function _setInterestRateModel(InterestRateModel newInterestRateModel) public returns (uint);\n}\n\ncontract CErc20Storage {\n    /**\n     * @notice Underlying asset for this CToken\n     */\n    address public underlying;\n}\n\ncontract CErc20Interface is CErc20Storage {\n\n    /*** User Interface ***/\n\n    function mint(uint mintAmount) external returns (uint);\n    function redeem(uint redeemTokens) external returns (uint);\n    function redeemUnderlying(uint redeemAmount) external returns (uint);\n    function borrow(uint borrowAmount) external returns (uint);\n    function repayBorrow(uint repayAmount) external returns (uint);\n    function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint);\n    function liquidateBorrow(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) external returns (uint);\n\n\n    /*** Admin Functions ***/\n\n    function _addReserves(uint addAmount) external returns (uint);\n}\n\ncontract CDelegationStorage {\n    /**\n     * @notice Implementation address for this contract\n     */\n    address public implementation;\n}\n\ncontract CDelegatorInterface is CDelegationStorage {\n    /**\n     * @notice Emitted when implementation is changed\n     */\n    event NewImplementation(address oldImplementation, address newImplementation);\n\n    /**\n     * @notice Called by the admin to update the implementation of the delegator\n     * @param implementation_ The address of the new implementation for delegation\n     * @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation\n     * @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation\n     */\n    function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public;\n}\n\ncontract CDelegateInterface is CDelegationStorage {\n    /**\n     * @notice Called by the delegator on a delegate to initialize it for duty\n     * @dev Should revert if any issues arise which make it unfit for delegation\n     * @param data The encoded bytes data for any initialization\n     */\n    function _becomeImplementation(bytes memory data) public;\n\n    /**\n     * @notice Called by the delegator on a delegate to forfeit its responsibility\n     */\n    function _resignImplementation() public;\n}contract ComptrollerErrorReporter {\n    enum Error {\n        NO_ERROR,\n        UNAUTHORIZED,\n        COMPTROLLER_MISMATCH,\n        INSUFFICIENT_SHORTFALL,\n        INSUFFICIENT_LIQUIDITY,\n        INVALID_CLOSE_FACTOR,\n        INVALID_COLLATERAL_FACTOR,\n        INVALID_LIQUIDATION_INCENTIVE,\n        MARKET_NOT_ENTERED, // no longer possible\n        MARKET_NOT_LISTED,\n        MARKET_ALREADY_LISTED,\n        MATH_ERROR,\n        NONZERO_BORROW_BALANCE,\n        PRICE_ERROR,\n        REJECTION,\n        SNAPSHOT_ERROR,\n        TOO_MANY_ASSETS,\n        TOO_MUCH_REPAY,\n        COLLATERAL_PAUSED\n    }\n\n    enum FailureInfo {\n        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,\n        ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,\n        EXIT_MARKET_BALANCE_OWED,\n        EXIT_MARKET_REJECTION,\n        SET_CLOSE_FACTOR_OWNER_CHECK,\n        SET_CLOSE_FACTOR_VALIDATION,\n        SET_COLLATERAL_FACTOR_OWNER_CHECK,\n        SET_COLLATERAL_FACTOR_NO_EXISTS,\n        SET_COLLATERAL_FACTOR_VALIDATION,\n        SET_COLLATERAL_FACTOR_WITHOUT_PRICE,\n        SET_IMPLEMENTATION_OWNER_CHECK,\n        SET_LIQUIDATION_INCENTIVE_OWNER_CHECK,\n        SET_LIQUIDATION_INCENTIVE_VALIDATION,\n        SET_MAX_ASSETS_OWNER_CHECK,\n        SET_PENDING_ADMIN_OWNER_CHECK,\n        SET_PENDING_IMPLEMENTATION_OWNER_CHECK,\n        SET_PRICE_ORACLE_OWNER_CHECK,\n        SUPPORT_MARKET_EXISTS,\n        SUPPORT_MARKET_OWNER_CHECK,\n        SET_PAUSE_GUARDIAN_OWNER_CHECK\n    }\n\n    /**\n     * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary\n     * contract-specific code that enables us to report opaque error codes from upgradeable contracts.\n     **/\n    event Failure(uint256 error, uint256 info, uint256 detail);\n\n    /**\n     * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator\n     */\n    function fail(Error err, FailureInfo info) internal returns (uint256) {\n        emit Failure(uint256(err), uint256(info), 0);\n\n        return uint256(err);\n    }\n\n    /**\n     * @dev use this when reporting an opaque error from an upgradeable collaborator contract\n     */\n    function failOpaque(\n        Error err,\n        FailureInfo info,\n        uint256 opaqueError\n    ) internal returns (uint256) {\n        emit Failure(uint256(err), uint256(info), opaqueError);\n\n        return uint256(err);\n    }\n}\n\ncontract TokenErrorReporter {\n    enum Error {\n        NO_ERROR,\n        UNAUTHORIZED,\n        BAD_INPUT,\n        COMPTROLLER_REJECTION,\n        COMPTROLLER_CALCULATION_ERROR,\n        INTEREST_RATE_MODEL_ERROR,\n        INVALID_ACCOUNT_PAIR,\n        INVALID_CLOSE_AMOUNT_REQUESTED,\n        INVALID_COLLATERAL_FACTOR,\n        MATH_ERROR,\n        MARKET_NOT_FRESH,\n        MARKET_NOT_LISTED,\n        TOKEN_INSUFFICIENT_ALLOWANCE,\n        TOKEN_INSUFFICIENT_BALANCE,\n        TOKEN_INSUFFICIENT_CASH,\n        TOKEN_TRANSFER_IN_FAILED,\n        TOKEN_TRANSFER_OUT_FAILED\n    }\n\n    /*\n     * Note: FailureInfo (but not Error) is kept in alphabetical order\n     *       This is because FailureInfo grows significantly faster, and\n     *       the order of Error has some meaning, while the order of FailureInfo\n     *       is entirely arbitrary.\n     */\n    enum FailureInfo {\n        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,\n        ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED,\n        ACCRUE_INTEREST_BORROW_RATE_CALCULATION_FAILED,\n        ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED,\n        ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED,\n        ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED,\n        ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED,\n        BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,\n        BORROW_ACCRUE_INTEREST_FAILED,\n        BORROW_CASH_NOT_AVAILABLE,\n        BORROW_FRESHNESS_CHECK,\n        BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,\n        BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,\n        BORROW_MARKET_NOT_LISTED,\n        BORROW_COMPTROLLER_REJECTION,\n        LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED,\n        LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED,\n        LIQUIDATE_COLLATERAL_FRESHNESS_CHECK,\n        LIQUIDATE_COMPTROLLER_REJECTION,\n        LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED,\n        LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX,\n        LIQUIDATE_CLOSE_AMOUNT_IS_ZERO,\n        LIQUIDATE_FRESHNESS_CHECK,\n        LIQUIDATE_LIQUIDATOR_IS_BORROWER,\n        LIQUIDATE_REPAY_BORROW_FRESH_FAILED,\n        LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED,\n        LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED,\n        LIQUIDATE_SEIZE_COMPTROLLER_REJECTION,\n        LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER,\n        LIQUIDATE_SEIZE_TOO_MUCH,\n        MINT_ACCRUE_INTEREST_FAILED,\n        MINT_COMPTROLLER_REJECTION,\n        MINT_EXCHANGE_CALCULATION_FAILED,\n        MINT_EXCHANGE_RATE_READ_FAILED,\n        MINT_FRESHNESS_CHECK,\n        MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,\n        MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,\n        MINT_TRANSFER_IN_FAILED,\n        MINT_TRANSFER_IN_NOT_POSSIBLE,\n        REDEEM_ACCRUE_INTEREST_FAILED,\n        REDEEM_COMPTROLLER_REJECTION,\n        REDEEM_EXCHANGE_TOKENS_CALCULATION_FAILED,\n        REDEEM_EXCHANGE_AMOUNT_CALCULATION_FAILED,\n        REDEEM_EXCHANGE_RATE_READ_FAILED,\n        REDEEM_FRESHNESS_CHECK,\n        REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,\n        REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,\n        REDEEM_TRANSFER_OUT_NOT_POSSIBLE,\n        REDUCE_RESERVES_ACCRUE_INTEREST_FAILED,\n        REDUCE_RESERVES_ADMIN_CHECK,\n        REDUCE_RESERVES_CASH_NOT_AVAILABLE,\n        REDUCE_RESERVES_FRESH_CHECK,\n        REDUCE_RESERVES_VALIDATION,\n        REPAY_BEHALF_ACCRUE_INTEREST_FAILED,\n        REPAY_BORROW_ACCRUE_INTEREST_FAILED,\n        REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,\n        REPAY_BORROW_COMPTROLLER_REJECTION,\n        REPAY_BORROW_FRESHNESS_CHECK,\n        REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,\n        REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,\n        REPAY_BORROW_TRANSFER_IN_NOT_POSSIBLE,\n        SET_COLLATERAL_FACTOR_OWNER_CHECK,\n        SET_COLLATERAL_FACTOR_VALIDATION,\n        SET_COMPTROLLER_OWNER_CHECK,\n        SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED,\n        SET_INTEREST_RATE_MODEL_FRESH_CHECK,\n        SET_INTEREST_RATE_MODEL_OWNER_CHECK,\n        SET_MAX_ASSETS_OWNER_CHECK,\n        SET_ORACLE_MARKET_NOT_LISTED,\n        SET_PENDING_ADMIN_OWNER_CHECK,\n        SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED,\n        SET_RESERVE_FACTOR_ADMIN_CHECK,\n        SET_RESERVE_FACTOR_FRESH_CHECK,\n        SET_RESERVE_FACTOR_BOUNDS_CHECK,\n        TRANSFER_COMPTROLLER_REJECTION,\n        TRANSFER_NOT_ALLOWED,\n        TRANSFER_NOT_ENOUGH,\n        TRANSFER_TOO_MUCH,\n        ADD_RESERVES_ACCRUE_INTEREST_FAILED,\n        ADD_RESERVES_FRESH_CHECK,\n        ADD_RESERVES_TRANSFER_IN_NOT_POSSIBLE\n    }\n\n    /**\n     * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary\n     * contract-specific code that enables us to report opaque error codes from upgradeable contracts.\n     **/\n    event Failure(uint256 error, uint256 info, uint256 detail);\n\n    /**\n     * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator\n     */\n    function fail(Error err, FailureInfo info) internal returns (uint256) {\n        emit Failure(uint256(err), uint256(info), 0);\n\n        return uint256(err);\n    }\n\n    /**\n     * @dev use this when reporting an opaque error from an upgradeable collaborator contract\n     */\n    function failOpaque(\n        Error err,\n        FailureInfo info,\n        uint256 opaqueError\n    ) internal returns (uint256) {\n        emit Failure(uint256(err), uint256(info), opaqueError);\n\n        return uint256(err);\n    }\n}/**\n  * @title Careful Math\n  * @author Compound\n  * @notice Derived from OpenZeppelin's SafeMath library\n  *         https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol\n  */\ncontract CarefulMath {\n\n    /**\n     * @dev Possible error codes that we can return\n     */\n    enum MathError {\n        NO_ERROR,\n        DIVISION_BY_ZERO,\n        INTEGER_OVERFLOW,\n        INTEGER_UNDERFLOW\n    }\n\n    /**\n    * @dev Multiplies two numbers, returns an error on overflow.\n    */\n    function mulUInt(uint a, uint b) internal pure returns (MathError, uint) {\n        if (a == 0) {\n            return (MathError.NO_ERROR, 0);\n        }\n\n        uint c = a * b;\n\n        if (c / a != b) {\n            return (MathError.INTEGER_OVERFLOW, 0);\n        } else {\n            return (MathError.NO_ERROR, c);\n        }\n    }\n\n    /**\n    * @dev Integer division of two numbers, truncating the quotient.\n    */\n    function divUInt(uint a, uint b) internal pure returns (MathError, uint) {\n        if (b == 0) {\n            return (MathError.DIVISION_BY_ZERO, 0);\n        }\n\n        return (MathError.NO_ERROR, a / b);\n    }\n\n    /**\n    * @dev Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).\n    */\n    function subUInt(uint a, uint b) internal pure returns (MathError, uint) {\n        if (b <= a) {\n            return (MathError.NO_ERROR, a - b);\n        } else {\n            return (MathError.INTEGER_UNDERFLOW, 0);\n        }\n    }\n\n    /**\n    * @dev Adds two numbers, returns an error on overflow.\n    */\n    function addUInt(uint a, uint b) internal pure returns (MathError, uint) {\n        uint c = a + b;\n\n        if (c >= a) {\n            return (MathError.NO_ERROR, c);\n        } else {\n            return (MathError.INTEGER_OVERFLOW, 0);\n        }\n    }\n\n    /**\n    * @dev add a and b and then subtract c\n    */\n    function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {\n        (MathError err0, uint sum) = addUInt(a, b);\n\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, 0);\n        }\n\n        return subUInt(sum, c);\n    }\n}/**\n * @title Exponential module for storing fixed-precision decimals\n * @author Compound\n * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.\n *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:\n *         `Exp({mantissa: 5100000000000000000})`.\n */\ncontract ExponentialNoError {\n    uint constant expScale = 1e18;\n    uint constant doubleScale = 1e36;\n    uint constant halfExpScale = expScale/2;\n    uint constant mantissaOne = expScale;\n\n    struct Exp {\n        uint mantissa;\n    }\n\n    struct Double {\n        uint mantissa;\n    }\n\n    /**\n     * @dev Truncates the given exp to a whole number value.\n     *      For example, truncate(Exp{mantissa: 15 * expScale}) = 15\n     */\n    function truncate(Exp memory exp) pure internal returns (uint) {\n        // Note: We are not using careful math here as we're performing a division that cannot fail\n        return exp.mantissa / expScale;\n    }\n\n    /**\n     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.\n     */\n    function mul_ScalarTruncate(Exp memory a, uint scalar) pure internal returns (uint) {\n        Exp memory product = mul_(a, scalar);\n        return truncate(product);\n    }\n\n    /**\n     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.\n     */\n    function mul_ScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (uint) {\n        Exp memory product = mul_(a, scalar);\n        return add_(truncate(product), addend);\n    }\n\n    /**\n     * @dev Checks if first Exp is less than second Exp.\n     */\n    function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {\n        return left.mantissa < right.mantissa;\n    }\n\n    /**\n     * @dev Checks if left Exp <= right Exp.\n     */\n    function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {\n        return left.mantissa <= right.mantissa;\n    }\n\n    /**\n     * @dev Checks if left Exp > right Exp.\n     */\n    function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {\n        return left.mantissa > right.mantissa;\n    }\n\n    /**\n     * @dev returns true if Exp is exactly zero\n     */\n    function isZeroExp(Exp memory value) pure internal returns (bool) {\n        return value.mantissa == 0;\n    }\n\n    function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {\n        require(n < 2**224, errorMessage);\n        return uint224(n);\n    }\n\n    function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {\n        require(n < 2**32, errorMessage);\n        return uint32(n);\n    }\n\n    function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\n        return Exp({mantissa: add_(a.mantissa, b.mantissa)});\n    }\n\n    function add_(Double memory a, Double memory b) pure internal returns (Double memory) {\n        return Double({mantissa: add_(a.mantissa, b.mantissa)});\n    }\n\n    function add_(uint a, uint b) pure internal returns (uint) {\n        return add_(a, b, \"addition overflow\");\n    }\n\n    function add_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {\n        uint c = a + b;\n        require(c >= a, errorMessage);\n        return c;\n    }\n\n    function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\n        return Exp({mantissa: sub_(a.mantissa, b.mantissa)});\n    }\n\n    function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {\n        return Double({mantissa: sub_(a.mantissa, b.mantissa)});\n    }\n\n    function sub_(uint a, uint b) pure internal returns (uint) {\n        return sub_(a, b, \"subtraction underflow\");\n    }\n\n    function sub_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {\n        require(b <= a, errorMessage);\n        return a - b;\n    }\n\n    function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\n        return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});\n    }\n\n    function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {\n        return Exp({mantissa: mul_(a.mantissa, b)});\n    }\n\n    function mul_(uint a, Exp memory b) pure internal returns (uint) {\n        return mul_(a, b.mantissa) / expScale;\n    }\n\n    function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {\n        return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});\n    }\n\n    function mul_(Double memory a, uint b) pure internal returns (Double memory) {\n        return Double({mantissa: mul_(a.mantissa, b)});\n    }\n\n    function mul_(uint a, Double memory b) pure internal returns (uint) {\n        return mul_(a, b.mantissa) / doubleScale;\n    }\n\n    function mul_(uint a, uint b) pure internal returns (uint) {\n        return mul_(a, b, \"multiplication overflow\");\n    }\n\n    function mul_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {\n        if (a == 0 || b == 0) {\n            return 0;\n        }\n        uint c = a * b;\n        require(c / a == b, errorMessage);\n        return c;\n    }\n\n    function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\n        return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});\n    }\n\n    function div_(Exp memory a, uint b) pure internal returns (Exp memory) {\n        return Exp({mantissa: div_(a.mantissa, b)});\n    }\n\n    function div_(uint a, Exp memory b) pure internal returns (uint) {\n        return div_(mul_(a, expScale), b.mantissa);\n    }\n\n    function div_(Double memory a, Double memory b) pure internal returns (Double memory) {\n        return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});\n    }\n\n    function div_(Double memory a, uint b) pure internal returns (Double memory) {\n        return Double({mantissa: div_(a.mantissa, b)});\n    }\n\n    function div_(uint a, Double memory b) pure internal returns (uint) {\n        return div_(mul_(a, doubleScale), b.mantissa);\n    }\n\n    function div_(uint a, uint b) pure internal returns (uint) {\n        return div_(a, b, \"divide by zero\");\n    }\n\n    function div_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {\n        require(b > 0, errorMessage);\n        return a / b;\n    }\n\n    function fraction(uint a, uint b) pure internal returns (Double memory) {\n        return Double({mantissa: div_(mul_(a, doubleScale), b)});\n    }\n}\n/**\n * @title Exponential module for storing fixed-precision decimals\n * @author Compound\n * @dev Legacy contract for compatibility reasons with existing contracts that still use MathError\n * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.\n *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:\n *         `Exp({mantissa: 5100000000000000000})`.\n */\ncontract Exponential is CarefulMath, ExponentialNoError {\n    /**\n     * @dev Creates an exponential from numerator and denominator values.\n     *      Note: Returns an error if (`num` * 10e18) > MAX_INT,\n     *            or if `denom` is zero.\n     */\n    function getExp(uint num, uint denom) pure internal returns (MathError, Exp memory) {\n        (MathError err0, uint scaledNumerator) = mulUInt(num, expScale);\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, Exp({mantissa: 0}));\n        }\n\n        (MathError err1, uint rational) = divUInt(scaledNumerator, denom);\n        if (err1 != MathError.NO_ERROR) {\n            return (err1, Exp({mantissa: 0}));\n        }\n\n        return (MathError.NO_ERROR, Exp({mantissa: rational}));\n    }\n\n    /**\n     * @dev Adds two exponentials, returning a new exponential.\n     */\n    function addExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {\n        (MathError error, uint result) = addUInt(a.mantissa, b.mantissa);\n\n        return (error, Exp({mantissa: result}));\n    }\n\n    /**\n     * @dev Subtracts two exponentials, returning a new exponential.\n     */\n    function subExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {\n        (MathError error, uint result) = subUInt(a.mantissa, b.mantissa);\n\n        return (error, Exp({mantissa: result}));\n    }\n\n    /**\n     * @dev Multiply an Exp by a scalar, returning a new Exp.\n     */\n    function mulScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {\n        (MathError err0, uint scaledMantissa) = mulUInt(a.mantissa, scalar);\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, Exp({mantissa: 0}));\n        }\n\n        return (MathError.NO_ERROR, Exp({mantissa: scaledMantissa}));\n    }\n\n    /**\n     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.\n     */\n    function mulScalarTruncate(Exp memory a, uint scalar) pure internal returns (MathError, uint) {\n        (MathError err, Exp memory product) = mulScalar(a, scalar);\n        if (err != MathError.NO_ERROR) {\n            return (err, 0);\n        }\n\n        return (MathError.NO_ERROR, truncate(product));\n    }\n\n    /**\n     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.\n     */\n    function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (MathError, uint) {\n        (MathError err, Exp memory product) = mulScalar(a, scalar);\n        if (err != MathError.NO_ERROR) {\n            return (err, 0);\n        }\n\n        return addUInt(truncate(product), addend);\n    }\n\n    /**\n     * @dev Divide an Exp by a scalar, returning a new Exp.\n     */\n    function divScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {\n        (MathError err0, uint descaledMantissa) = divUInt(a.mantissa, scalar);\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, Exp({mantissa: 0}));\n        }\n\n        return (MathError.NO_ERROR, Exp({mantissa: descaledMantissa}));\n    }\n\n    /**\n     * @dev Divide a scalar by an Exp, returning a new Exp.\n     */\n    function divScalarByExp(uint scalar, Exp memory divisor) pure internal returns (MathError, Exp memory) {\n        /*\n          We are doing this as:\n          getExp(mulUInt(expScale, scalar), divisor.mantissa)\n\n          How it works:\n          Exp = a / b;\n          Scalar = s;\n          `s / (a / b)` = `b * s / a` and since for an Exp `a = mantissa, b = expScale`\n        */\n        (MathError err0, uint numerator) = mulUInt(expScale, scalar);\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, Exp({mantissa: 0}));\n        }\n        return getExp(numerator, divisor.mantissa);\n    }\n\n    /**\n     * @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.\n     */\n    function divScalarByExpTruncate(uint scalar, Exp memory divisor) pure internal returns (MathError, uint) {\n        (MathError err, Exp memory fraction) = divScalarByExp(scalar, divisor);\n        if (err != MathError.NO_ERROR) {\n            return (err, 0);\n        }\n\n        return (MathError.NO_ERROR, truncate(fraction));\n    }\n\n    /**\n     * @dev Multiplies two exponentials, returning a new exponential.\n     */\n    function mulExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {\n\n        (MathError err0, uint doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa);\n        if (err0 != MathError.NO_ERROR) {\n            return (err0, Exp({mantissa: 0}));\n        }\n\n        // We add half the scale before dividing so that we get rounding instead of truncation.\n        //  See \"Listing 6\" and text above it at https://accu.org/index.php/journals/1717\n        // Without this change, a result like 6.6...e-19 will be truncated to 0 instead of being rounded to 1e-18.\n        (MathError err1, uint doubleScaledProductWithHalfScale) = addUInt(halfExpScale, doubleScaledProduct);\n        if (err1 != MathError.NO_ERROR) {\n            return (err1, Exp({mantissa: 0}));\n        }\n\n        (MathError err2, uint product) = divUInt(doubleScaledProductWithHalfScale, expScale);\n        // The only error `div` can return is MathError.DIVISION_BY_ZERO but we control `expScale` and it is not zero.\n        assert(err2 == MathError.NO_ERROR);\n\n        return (MathError.NO_ERROR, Exp({mantissa: product}));\n    }\n\n    /**\n     * @dev Multiplies two exponentials given their mantissas, returning a new exponential.\n     */\n    function mulExp(uint a, uint b) pure internal returns (MathError, Exp memory) {\n        return mulExp(Exp({mantissa: a}), Exp({mantissa: b}));\n    }\n\n    /**\n     * @dev Multiplies three exponentials, returning a new exponential.\n     */\n    function mulExp3(Exp memory a, Exp memory b, Exp memory c) pure internal returns (MathError, Exp memory) {\n        (MathError err, Exp memory ab) = mulExp(a, b);\n        if (err != MathError.NO_ERROR) {\n            return (err, ab);\n        }\n        return mulExp(ab, c);\n    }\n\n    /**\n     * @dev Divides two exponentials, returning a new exponential.\n     *     (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,\n     *  which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)\n     */\n    function divExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {\n        return getExp(a.mantissa, b.mantissa);\n    }\n}/**\n * @title ERC 20 Token Standard Interface\n *  https://eips.ethereum.org/EIPS/eip-20\n */\ninterface EIP20Interface {\n    function name() external view returns (string memory);\n    function symbol() external view returns (string memory);\n    function decimals() external view returns (uint8);\n\n    /**\n      * @notice Get the total number of tokens in circulation\n      * @return The supply of tokens\n      */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @notice Gets the balance of the specified address\n     * @param owner The address from which the balance will be retrieved\n     * @return The balance\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n      * @notice Transfer `amount` tokens from `msg.sender` to `dst`\n      * @param dst The address of the destination account\n      * @param amount The number of tokens to transfer\n      * @return Whether or not the transfer succeeded\n      */\n    function transfer(address dst, uint256 amount) external returns (bool success);\n\n    /**\n      * @notice Transfer `amount` tokens from `src` to `dst`\n      * @param src The address of the source account\n      * @param dst The address of the destination account\n      * @param amount The number of tokens to transfer\n      * @return Whether or not the transfer succeeded\n      */\n    function transferFrom(address src, address dst, uint256 amount) external returns (bool success);\n\n    /**\n      * @notice Approve `spender` to transfer up to `amount` from `src`\n      * @dev This will overwrite the approval amount for `spender`\n      *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\n      * @param spender The address of the account which may transfer tokens\n      * @param amount The number of tokens that are approved (-1 means infinite)\n      * @return Whether or not the approval succeeded\n      */\n    function approve(address spender, uint256 amount) external returns (bool success);\n\n    /**\n      * @notice Get the current allowance from `owner` for `spender`\n      * @param owner The address of the account which owns the tokens to be spent\n      * @param spender The address of the account which may transfer tokens\n      * @return The number of tokens allowed to be spent (-1 means infinite)\n      */\n    function allowance(address owner, address spender) external view returns (uint256 remaining);\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Approval(address indexed owner, address indexed spender, uint256 amount);\n}/**\n * @title EIP20NonStandardInterface\n * @dev Version of ERC20 with no return values for `transfer` and `transferFrom`\n *  See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\n */\ninterface EIP20NonStandardInterface {\n\n    /**\n     * @notice Get the total number of tokens in circulation\n     * @return The supply of tokens\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @notice Gets the balance of the specified address\n     * @param owner The address from which the balance will be retrieved\n     * @return The balance\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    ///\n    /// !!!!!!!!!!!!!!\n    /// !!! NOTICE !!! `transfer` does not return a value, in violation of the ERC-20 specification\n    /// !!!!!!!!!!!!!!\n    ///\n\n    /**\n      * @notice Transfer `amount` tokens from `msg.sender` to `dst`\n      * @param dst The address of the destination account\n      * @param amount The number of tokens to transfer\n      */\n    function transfer(address dst, uint256 amount) external;\n\n    ///\n    /// !!!!!!!!!!!!!!\n    /// !!! NOTICE !!! `transferFrom` does not return a value, in violation of the ERC-20 specification\n    /// !!!!!!!!!!!!!!\n    ///\n\n    /**\n      * @notice Transfer `amount` tokens from `src` to `dst`\n      * @param src The address of the source account\n      * @param dst The address of the destination account\n      * @param amount The number of tokens to transfer\n      */\n    function transferFrom(address src, address dst, uint256 amount) external;\n\n    /**\n      * @notice Approve `spender` to transfer up to `amount` from `src`\n      * @dev This will overwrite the approval amount for `spender`\n      *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\n      * @param spender The address of the account which may transfer tokens\n      * @param amount The number of tokens that are approved\n      * @return Whether or not the approval succeeded\n      */\n    function approve(address spender, uint256 amount) external returns (bool success);\n\n    /**\n      * @notice Get the current allowance from `owner` for `spender`\n      * @param owner The address of the account which owns the tokens to be spent\n      * @param spender The address of the account which may transfer tokens\n      * @return The number of tokens allowed to be spent\n      */\n    function allowance(address owner, address spender) external view returns (uint256 remaining);\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Approval(address indexed owner, address indexed spender, uint256 amount);\n}\n/**\n * @title Compound's CToken Contract\n * @notice Abstract base for CTokens\n * @author Compound\n */\ncontract CToken is CTokenInterface, Exponential, TokenErrorReporter {\n    /**\n     * @notice Initialize the money market\n     * @param comptroller_ The address of the Comptroller\n     * @param interestRateModel_ The address of the interest rate model\n     * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18\n     * @param name_ EIP-20 name of this token\n     * @param symbol_ EIP-20 symbol of this token\n     * @param decimals_ EIP-20 decimal precision of this token\n     */\n    function initialize(\n        ComptrollerInterface comptroller_,\n        InterestRateModel interestRateModel_,\n        uint256 initialExchangeRateMantissa_,\n        string memory name_,\n        string memory symbol_,\n        uint8 decimals_\n    ) public {\n        require(msg.sender == admin, \"only admin may initialize the market\");\n        require(\n            accrualBlockNumber == 0 && borrowIndex == 0,\n            \"market may only be initialized once\"\n        );\n\n        // Set initial exchange rate\n        initialExchangeRateMantissa = initialExchangeRateMantissa_;\n        require(\n            initialExchangeRateMantissa > 0,\n            \"initial exchange rate must be greater than zero.\"\n        );\n\n        // Set the comptroller\n        uint256 err = _setComptroller(comptroller_);\n        require(err == uint256(Error.NO_ERROR), \"setting comptroller failed\");\n\n        // Initialize block number and borrow index (block number mocks depend on comptroller being set)\n        accrualBlockNumber = getBlockNumber();\n        borrowIndex = mantissaOne;\n\n        // Set the interest rate model (depends on block number / borrow index)\n        err = _setInterestRateModelFresh(interestRateModel_);\n        require(\n            err == uint256(Error.NO_ERROR),\n            \"setting interest rate model failed\"\n        );\n\n        name = name_;\n        symbol = symbol_;\n        decimals = decimals_;\n\n        // The counter starts true to prevent changing it from zero to non-zero (i.e. smaller cost/refund)\n        _notEntered = true;\n    }\n\n    /**\n     * @notice Transfer `tokens` tokens from `src` to `dst` by `spender`\n     * @dev Called by both `transfer` and `transferFrom` internally\n     * @param spender The address of the account performing the transfer\n     * @param src The address of the source account\n     * @param dst The address of the destination account\n     * @param tokens The number of tokens to transfer\n     * @return Whether or not the transfer succeeded\n     */\n    function transferTokens(\n        address spender,\n        address src,\n        address dst,\n        uint256 tokens\n    ) internal returns (uint256) {\n        /* Fail if transfer not allowed */\n        uint256 allowed = comptroller.transferAllowed(\n            address(this),\n            src,\n            dst,\n            tokens\n        );\n        if (allowed != 0) {\n            return\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.TRANSFER_COMPTROLLER_REJECTION,\n                    allowed\n                );\n        }\n\n        /* Do not allow self-transfers */\n        if (src == dst) {\n            return fail(Error.BAD_INPUT, FailureInfo.TRANSFER_NOT_ALLOWED);\n        }\n\n        /* Get the allowance, infinite for the account owner */\n        uint256 startingAllowance = 0;\n        if (spender == src) {\n            startingAllowance = uint256(-1);\n        } else {\n            startingAllowance = transferAllowances[src][spender];\n        }\n\n        /* Do the calculations, checking for {under,over}flow */\n        MathError mathErr;\n        uint256 allowanceNew;\n        uint256 srcTokensNew;\n        uint256 dstTokensNew;\n\n        (mathErr, allowanceNew) = subUInt(startingAllowance, tokens);\n        if (mathErr != MathError.NO_ERROR) {\n            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ALLOWED);\n        }\n\n        (mathErr, srcTokensNew) = subUInt(accountTokens[src], tokens);\n        if (mathErr != MathError.NO_ERROR) {\n            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ENOUGH);\n        }\n\n        (mathErr, dstTokensNew) = addUInt(accountTokens[dst], tokens);\n        if (mathErr != MathError.NO_ERROR) {\n            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_TOO_MUCH);\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        accountTokens[src] = srcTokensNew;\n        accountTokens[dst] = dstTokensNew;\n\n        /* Eat some of the allowance (if necessary) */\n        if (startingAllowance != uint256(-1)) {\n            transferAllowances[src][spender] = allowanceNew;\n        }\n\n        /* We emit a Transfer event */\n        emit Transfer(src, dst, tokens);\n\n        comptroller.transferVerify(address(this), src, dst, tokens);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Transfer `amount` tokens from `msg.sender` to `dst`\n     * @param dst The address of the destination account\n     * @param amount The number of tokens to transfer\n     * @return Whether or not the transfer succeeded\n     */\n    function transfer(address dst, uint256 amount)\n        external\n        nonReentrant\n        returns (bool)\n    {\n        return\n            transferTokens(msg.sender, msg.sender, dst, amount) ==\n            uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Transfer `amount` tokens from `src` to `dst`\n     * @param src The address of the source account\n     * @param dst The address of the destination account\n     * @param amount The number of tokens to transfer\n     * @return Whether or not the transfer succeeded\n     */\n    function transferFrom(\n        address src,\n        address dst,\n        uint256 amount\n    ) external nonReentrant returns (bool) {\n        return\n            transferTokens(msg.sender, src, dst, amount) ==\n            uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Approve `spender` to transfer up to `amount` from `src`\n     * @dev This will overwrite the approval amount for `spender`\n     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\n     * @param spender The address of the account which may transfer tokens\n     * @param amount The number of tokens that are approved (-1 means infinite)\n     * @return Whether or not the approval succeeded\n     */\n    function approve(address spender, uint256 amount) external returns (bool) {\n        address src = msg.sender;\n        transferAllowances[src][spender] = amount;\n        emit Approval(src, spender, amount);\n        return true;\n    }\n\n    /**\n     * @notice Get the current allowance from `owner` for `spender`\n     * @param owner The address of the account which owns the tokens to be spent\n     * @param spender The address of the account which may transfer tokens\n     * @return The number of tokens allowed to be spent (-1 means infinite)\n     */\n    function allowance(address owner, address spender)\n        external\n        view\n        returns (uint256)\n    {\n        return transferAllowances[owner][spender];\n    }\n\n    /**\n     * @notice Get the token balance of the `owner`\n     * @param owner The address of the account to query\n     * @return The number of tokens owned by `owner`\n     */\n    function balanceOf(address owner) external view returns (uint256) {\n        return accountTokens[owner];\n    }\n\n    /**\n     * @notice Get the underlying balance of the `owner`\n     * @dev This also accrues interest in a transaction\n     * @param owner The address of the account to query\n     * @return The amount of underlying owned by `owner`\n     */\n    function balanceOfUnderlying(address owner) external returns (uint256) {\n        Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});\n        (MathError mErr, uint256 balance) = mulScalarTruncate(\n            exchangeRate,\n            accountTokens[owner]\n        );\n        require(mErr == MathError.NO_ERROR, \"balance could not be calculated\");\n        return balance;\n    }\n\n    /**\n     * @notice Get a snapshot of the account's balances, and the cached exchange rate\n     * @dev This is used by comptroller to more efficiently perform liquidity checks.\n     * @param account Address of the account to snapshot\n     * @return (possible error, token balance, borrow balance, exchange rate mantissa)\n     */\n    function getAccountSnapshot(address account)\n        external\n        view\n        returns (\n            uint256,\n            uint256,\n            uint256,\n            uint256\n        )\n    {\n        uint256 cTokenBalance = accountTokens[account];\n        uint256 borrowBalance;\n        uint256 exchangeRateMantissa;\n\n        MathError mErr;\n\n        (mErr, borrowBalance) = borrowBalanceStoredInternal(account);\n        if (mErr != MathError.NO_ERROR) {\n            return (uint256(Error.MATH_ERROR), 0, 0, 0);\n        }\n\n        (mErr, exchangeRateMantissa) = exchangeRateStoredInternal();\n        if (mErr != MathError.NO_ERROR) {\n            return (uint256(Error.MATH_ERROR), 0, 0, 0);\n        }\n\n        return (\n            uint256(Error.NO_ERROR),\n            cTokenBalance,\n            borrowBalance,\n            exchangeRateMantissa\n        );\n    }\n\n    /**\n     * @dev Function to simply retrieve block number\n     *  This exists mainly for inheriting test contracts to stub this result.\n     */\n    function getBlockNumber() internal view returns (uint256) {\n        return block.number;\n    }\n\n    /**\n     * @notice Returns the current per-block borrow interest rate for this cToken\n     * @return The borrow interest rate per block, scaled by 1e18\n     */\n    function borrowRatePerBlock() external view returns (uint256) {\n        return\n            interestRateModel.getBorrowRate(\n                getCashPrior(),\n                totalBorrows,\n                totalReserves\n            );\n    }\n\n    /**\n     * @notice Returns the current per-block supply interest rate for this cToken\n     * @return The supply interest rate per block, scaled by 1e18\n     */\n    function supplyRatePerBlock() external view returns (uint256) {\n        return\n            interestRateModel.getSupplyRate(\n                getCashPrior(),\n                totalBorrows,\n                totalReserves,\n                reserveFactorMantissa\n            );\n    }\n\n    /**\n     * @notice Returns the current total borrows plus accrued interest\n     * @return The total borrows with interest\n     */\n    function totalBorrowsCurrent() external nonReentrant returns (uint256) {\n        require(\n            accrueInterest() == uint256(Error.NO_ERROR),\n            \"accrue interest failed\"\n        );\n        return totalBorrows;\n    }\n\n    /**\n     * @notice Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex\n     * @param account The address whose balance should be calculated after updating borrowIndex\n     * @return The calculated balance\n     */\n    function borrowBalanceCurrent(address account)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        require(\n            accrueInterest() == uint256(Error.NO_ERROR),\n            \"accrue interest failed\"\n        );\n        return borrowBalanceStored(account);\n    }\n\n    /**\n     * @notice Return the borrow balance of account based on stored data\n     * @param account The address whose balance should be calculated\n     * @return The calculated balance\n     */\n    function borrowBalanceStored(address account)\n        public\n        view\n        returns (uint256)\n    {\n        (MathError err, uint256 result) = borrowBalanceStoredInternal(account);\n        require(\n            err == MathError.NO_ERROR,\n            \"borrowBalanceStored: borrowBalanceStoredInternal failed\"\n        );\n        return result;\n    }\n\n    /**\n     * @notice Return the borrow balance of account based on stored data\n     * @param account The address whose balance should be calculated\n     * @return (error code, the calculated balance or 0 if error code is non-zero)\n     */\n    function borrowBalanceStoredInternal(address account)\n        internal\n        view\n        returns (MathError, uint256)\n    {\n        /* Note: we do not assert that the market is up to date */\n        MathError mathErr;\n        uint256 principalTimesIndex;\n        uint256 result;\n\n        /* Get borrowBalance and borrowIndex */\n        BorrowSnapshot storage borrowSnapshot = accountBorrows[account];\n\n        /* If borrowBalance = 0 then borrowIndex is likely also 0.\n         * Rather than failing the calculation with a division by 0, we immediately return 0 in this case.\n         */\n        if (borrowSnapshot.principal == 0) {\n            return (MathError.NO_ERROR, 0);\n        }\n\n        /* Calculate new borrow balance using the interest index:\n         *  recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex\n         */\n        (mathErr, principalTimesIndex) = mulUInt(\n            borrowSnapshot.principal,\n            borrowIndex\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return (mathErr, 0);\n        }\n\n        (mathErr, result) = divUInt(\n            principalTimesIndex,\n            borrowSnapshot.interestIndex\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return (mathErr, 0);\n        }\n\n        return (MathError.NO_ERROR, result);\n    }\n\n    /**\n     * @notice Accrue interest then return the up-to-date exchange rate\n     * @return Calculated exchange rate scaled by 1e18\n     */\n    function exchangeRateCurrent() public nonReentrant returns (uint256) {\n        require(\n            accrueInterest() == uint256(Error.NO_ERROR),\n            \"accrue interest failed\"\n        );\n        return exchangeRateStored();\n    }\n\n    /**\n     * @notice Calculates the exchange rate from the underlying to the CToken\n     * @dev This function does not accrue interest before calculating the exchange rate\n     * @return Calculated exchange rate scaled by 1e18\n     */\n    function exchangeRateStored() public view returns (uint256) {\n        (MathError err, uint256 result) = exchangeRateStoredInternal();\n        require(\n            err == MathError.NO_ERROR,\n            \"exchangeRateStored: exchangeRateStoredInternal failed\"\n        );\n        return result;\n    }\n\n    /**\n     * @notice Calculates the exchange rate from the underlying to the CToken\n     * @dev This function does not accrue interest before calculating the exchange rate\n     * @return (error code, calculated exchange rate scaled by 1e18)\n     */\n    function exchangeRateStoredInternal()\n        internal\n        view\n        returns (MathError, uint256)\n    {\n        uint256 _totalSupply = totalSupply;\n        if (_totalSupply == 0) {\n            /*\n             * If there are no tokens minted:\n             *  exchangeRate = initialExchangeRate\n             */\n            return (MathError.NO_ERROR, initialExchangeRateMantissa);\n        } else {\n            /*\n             * Otherwise:\n             *  exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply\n             */\n            uint256 totalCash = getCashPrior();\n            uint256 cashPlusBorrowsMinusReserves;\n            Exp memory exchangeRate;\n            MathError mathErr;\n\n            (mathErr, cashPlusBorrowsMinusReserves) = addThenSubUInt(\n                totalCash,\n                totalBorrows,\n                totalReserves\n            );\n            if (mathErr != MathError.NO_ERROR) {\n                return (mathErr, 0);\n            }\n\n            (mathErr, exchangeRate) = getExp(\n                cashPlusBorrowsMinusReserves,\n                _totalSupply\n            );\n            if (mathErr != MathError.NO_ERROR) {\n                return (mathErr, 0);\n            }\n\n            return (MathError.NO_ERROR, exchangeRate.mantissa);\n        }\n    }\n\n    /**\n     * @notice Get cash balance of this cToken in the underlying asset\n     * @return The quantity of underlying asset owned by this contract\n     */\n    function getCash() external view returns (uint256) {\n        return getCashPrior();\n    }\n\n    /**\n     * @notice Applies accrued interest to total borrows and reserves\n     * @dev This calculates interest accrued from the last checkpointed block\n     *   up to the current block and writes new checkpoint to storage.\n     */\n    function accrueInterest() public returns (uint256) {\n        /* Remember the initial block number */\n        uint256 currentBlockNumber = getBlockNumber();\n        uint256 accrualBlockNumberPrior = accrualBlockNumber;\n\n        /* Short-circuit accumulating 0 interest */\n        if (accrualBlockNumberPrior == currentBlockNumber) {\n            return uint256(Error.NO_ERROR);\n        }\n\n        /* Read the previous values out of storage */\n        uint256 cashPrior = getCashPrior();\n        uint256 borrowsPrior = totalBorrows;\n        uint256 reservesPrior = totalReserves;\n        uint256 borrowIndexPrior = borrowIndex;\n\n        /* Calculate the current borrow interest rate */\n        uint256 borrowRateMantissa = interestRateModel.getBorrowRate(\n            cashPrior,\n            borrowsPrior,\n            reservesPrior\n        );\n        require(\n            borrowRateMantissa <= borrowRateMaxMantissa,\n            \"borrow rate is absurdly high\"\n        );\n\n        /* Calculate the number of blocks elapsed since the last accrual */\n        (MathError mathErr, uint256 blockDelta) = subUInt(\n            currentBlockNumber,\n            accrualBlockNumberPrior\n        );\n        require(\n            mathErr == MathError.NO_ERROR,\n            \"could not calculate block delta\"\n        );\n\n        /*\n         * Calculate the interest accumulated into borrows and reserves and the new index:\n         *  simpleInterestFactor = borrowRate * blockDelta\n         *  interestAccumulated = simpleInterestFactor * totalBorrows\n         *  totalBorrowsNew = interestAccumulated + totalBorrows\n         *  totalReservesNew = interestAccumulated * reserveFactor + totalReserves\n         *  borrowIndexNew = simpleInterestFactor * borrowIndex + borrowIndex\n         */\n\n        Exp memory simpleInterestFactor;\n        uint256 interestAccumulated;\n        uint256 totalBorrowsNew;\n        uint256 totalReservesNew;\n        uint256 borrowIndexNew;\n\n        (mathErr, simpleInterestFactor) = mulScalar(\n            Exp({mantissa: borrowRateMantissa}),\n            blockDelta\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        (mathErr, interestAccumulated) = mulScalarTruncate(\n            simpleInterestFactor,\n            borrowsPrior\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        (mathErr, totalBorrowsNew) = addUInt(interestAccumulated, borrowsPrior);\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        (mathErr, totalReservesNew) = mulScalarTruncateAddUInt(\n            Exp({mantissa: reserveFactorMantissa}),\n            interestAccumulated,\n            reservesPrior\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        (mathErr, borrowIndexNew) = mulScalarTruncateAddUInt(\n            simpleInterestFactor,\n            borrowIndexPrior,\n            borrowIndexPrior\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /* We write the previously calculated values into storage */\n        accrualBlockNumber = currentBlockNumber;\n        borrowIndex = borrowIndexNew;\n        totalBorrows = totalBorrowsNew;\n        totalReserves = totalReservesNew;\n\n        /* We emit an AccrueInterest event */\n        emit AccrueInterest(\n            cashPrior,\n            interestAccumulated,\n            borrowIndexNew,\n            totalBorrowsNew\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sender supplies assets into the market and receives cTokens in exchange\n     * @dev Accrues interest whether or not the operation succeeds, unless reverted\n     * @param mintAmount The amount of the underlying asset to supply\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.\n     */\n    function mintInternal(uint256 mintAmount)\n        internal\n        nonReentrant\n        returns (uint256, uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed\n            return (\n                fail(Error(error), FailureInfo.MINT_ACCRUE_INTEREST_FAILED),\n                0\n            );\n        }\n        // mintFresh emits the actual Mint event if successful and logs on errors, so we don't need to\n        return mintFresh(msg.sender, mintAmount);\n    }\n\n    struct MintLocalVars {\n        Error err;\n        MathError mathErr;\n        uint256 exchangeRateMantissa;\n        uint256 mintTokens;\n        uint256 totalSupplyNew;\n        uint256 accountTokensNew;\n        uint256 actualMintAmount;\n    }\n\n    /**\n     * @notice User supplies assets into the market and receives cTokens in exchange\n     * @dev Assumes interest has already been accrued up to the current block\n     * @param minter The address of the account which is supplying the assets\n     * @param mintAmount The amount of the underlying asset to supply\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.\n     */\n    function mintFresh(address minter, uint256 mintAmount)\n        internal\n        returns (uint256, uint256)\n    {\n        /* Fail if mint not allowed */\n        uint256 allowed = comptroller.mintAllowed(\n            address(this),\n            minter,\n            mintAmount\n        );\n        if (allowed != 0) {\n            return (\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.MINT_COMPTROLLER_REJECTION,\n                    allowed\n                ),\n                0\n            );\n        }\n\n        /* Verify market's block number equals current block number */\n        if (accrualBlockNumber != getBlockNumber()) {\n            return (\n                fail(Error.MARKET_NOT_FRESH, FailureInfo.MINT_FRESHNESS_CHECK),\n                0\n            );\n        }\n\n        MintLocalVars memory vars;\n\n        (\n            vars.mathErr,\n            vars.exchangeRateMantissa\n        ) = exchangeRateStoredInternal();\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return (\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.MINT_EXCHANGE_RATE_READ_FAILED,\n                    uint256(vars.mathErr)\n                ),\n                0\n            );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /*\n         *  We call `doTransferIn` for the minter and the mintAmount.\n         *  Note: The cToken must handle variations between ERC-20 and ETH underlying.\n         *  `doTransferIn` reverts if anything goes wrong, since we can't be sure if\n         *  side-effects occurred. The function returns the amount actually transferred,\n         *  in case of a fee. On success, the cToken holds an additional `actualMintAmount`\n         *  of cash.\n         */\n        vars.actualMintAmount = doTransferIn(minter, mintAmount);\n\n        /*\n         * We get the current exchange rate and calculate the number of cTokens to be minted:\n         *  mintTokens = actualMintAmount / exchangeRate\n         */\n\n        (vars.mathErr, vars.mintTokens) = divScalarByExpTruncate(\n            vars.actualMintAmount,\n            Exp({mantissa: vars.exchangeRateMantissa})\n        );\n        require(\n            vars.mathErr == MathError.NO_ERROR,\n            \"MINT_EXCHANGE_CALCULATION_FAILED\"\n        );\n\n        /*\n         * We calculate the new total supply of cTokens and minter token balance, checking for overflow:\n         *  totalSupplyNew = totalSupply + mintTokens\n         *  accountTokensNew = accountTokens[minter] + mintTokens\n         */\n        (vars.mathErr, vars.totalSupplyNew) = addUInt(\n            totalSupply,\n            vars.mintTokens\n        );\n        require(\n            vars.mathErr == MathError.NO_ERROR,\n            \"MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED\"\n        );\n\n        (vars.mathErr, vars.accountTokensNew) = addUInt(\n            accountTokens[minter],\n            vars.mintTokens\n        );\n        require(\n            vars.mathErr == MathError.NO_ERROR,\n            \"MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED\"\n        );\n\n        /* We write previously calculated values into storage */\n        totalSupply = vars.totalSupplyNew;\n        accountTokens[minter] = vars.accountTokensNew;\n\n        /* We emit a Mint event, and a Transfer event */\n        emit Mint(minter, vars.actualMintAmount, vars.mintTokens);\n        emit Transfer(address(this), minter, vars.mintTokens);\n\n        /* We call the defense hook */\n        comptroller.mintVerify(\n            address(this),\n            minter,\n            vars.actualMintAmount,\n            vars.mintTokens\n        );\n\n        return (uint256(Error.NO_ERROR), vars.actualMintAmount);\n    }\n\n    /**\n     * @notice Sender redeems cTokens in exchange for the underlying asset\n     * @dev Accrues interest whether or not the operation succeeds, unless reverted\n     * @param redeemTokens The number of cTokens to redeem into underlying\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function redeemInternal(uint256 redeemTokens)\n        internal\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed\n            return\n                fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);\n        }\n        // redeemFresh emits redeem-specific logs on errors, so we don't need to\n        return redeemFresh(msg.sender, redeemTokens, 0);\n    }\n\n    /**\n     * @notice Sender redeems cTokens in exchange for a specified amount of underlying asset\n     * @dev Accrues interest whether or not the operation succeeds, unless reverted\n     * @param redeemAmount The amount of underlying to receive from redeeming cTokens\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function redeemUnderlyingInternal(uint256 redeemAmount)\n        internal\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed\n            return\n                fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);\n        }\n        // redeemFresh emits redeem-specific logs on errors, so we don't need to\n        return redeemFresh(msg.sender, 0, redeemAmount);\n    }\n\n    struct RedeemLocalVars {\n        Error err;\n        MathError mathErr;\n        uint256 exchangeRateMantissa;\n        uint256 redeemTokens;\n        uint256 redeemAmount;\n        uint256 totalSupplyNew;\n        uint256 accountTokensNew;\n    }\n\n    /**\n     * @notice User redeems cTokens in exchange for the underlying asset\n     * @dev Assumes interest has already been accrued up to the current block\n     * @param redeemer The address of the account which is redeeming the tokens\n     * @param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n     * @param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function redeemFresh(\n        address payable redeemer,\n        uint256 redeemTokensIn,\n        uint256 redeemAmountIn\n    ) internal returns (uint256) {\n        require(\n            redeemTokensIn == 0 || redeemAmountIn == 0,\n            \"one of redeemTokensIn or redeemAmountIn must be zero\"\n        );\n\n        RedeemLocalVars memory vars;\n\n        /* exchangeRate = invoke Exchange Rate Stored() */\n        (\n            vars.mathErr,\n            vars.exchangeRateMantissa\n        ) = exchangeRateStoredInternal();\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.REDEEM_EXCHANGE_RATE_READ_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        /* If redeemTokensIn > 0: */\n        if (redeemTokensIn > 0) {\n            /*\n             * We calculate the exchange rate and the amount of underlying to be redeemed:\n             *  redeemTokens = redeemTokensIn\n             *  redeemAmount = redeemTokensIn x exchangeRateCurrent\n             */\n            vars.redeemTokens = redeemTokensIn;\n\n            (vars.mathErr, vars.redeemAmount) = mulScalarTruncate(\n                Exp({mantissa: vars.exchangeRateMantissa}),\n                redeemTokensIn\n            );\n            if (vars.mathErr != MathError.NO_ERROR) {\n                return\n                    failOpaque(\n                        Error.MATH_ERROR,\n                        FailureInfo.REDEEM_EXCHANGE_TOKENS_CALCULATION_FAILED,\n                        uint256(vars.mathErr)\n                    );\n            }\n        } else {\n            /*\n             * We get the current exchange rate and calculate the amount to be redeemed:\n             *  redeemTokens = redeemAmountIn / exchangeRate\n             *  redeemAmount = redeemAmountIn\n             */\n\n            (vars.mathErr, vars.redeemTokens) = divScalarByExpTruncate(\n                redeemAmountIn,\n                Exp({mantissa: vars.exchangeRateMantissa})\n            );\n            if (vars.mathErr != MathError.NO_ERROR) {\n                return\n                    failOpaque(\n                        Error.MATH_ERROR,\n                        FailureInfo.REDEEM_EXCHANGE_AMOUNT_CALCULATION_FAILED,\n                        uint256(vars.mathErr)\n                    );\n            }\n\n            vars.redeemAmount = redeemAmountIn;\n        }\n\n        /* Fail if redeem not allowed */\n        uint256 allowed = comptroller.redeemAllowed(\n            address(this),\n            redeemer,\n            vars.redeemTokens\n        );\n        if (allowed != 0) {\n            return\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.REDEEM_COMPTROLLER_REJECTION,\n                    allowed\n                );\n        }\n\n        /* Verify market's block number equals current block number */\n        if (accrualBlockNumber != getBlockNumber()) {\n            return\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.REDEEM_FRESHNESS_CHECK\n                );\n        }\n\n        /*\n         * We calculate the new total supply and redeemer balance, checking for underflow:\n         *  totalSupplyNew = totalSupply - redeemTokens\n         *  accountTokensNew = accountTokens[redeemer] - redeemTokens\n         */\n        (vars.mathErr, vars.totalSupplyNew) = subUInt(\n            totalSupply,\n            vars.redeemTokens\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        (vars.mathErr, vars.accountTokensNew) = subUInt(\n            accountTokens[redeemer],\n            vars.redeemTokens\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        /* Fail gracefully if protocol has insufficient cash */\n        if (getCashPrior() < vars.redeemAmount) {\n            return\n                fail(\n                    Error.TOKEN_INSUFFICIENT_CASH,\n                    FailureInfo.REDEEM_TRANSFER_OUT_NOT_POSSIBLE\n                );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /*\n         * We invoke doTransferOut for the redeemer and the redeemAmount.\n         *  Note: The cToken must handle variations between ERC-20 and ETH underlying.\n         *  On success, the cToken has redeemAmount less of cash.\n         *  doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\n         */\n        doTransferOut(redeemer, vars.redeemAmount);\n\n        /* We write previously calculated values into storage */\n        totalSupply = vars.totalSupplyNew;\n        accountTokens[redeemer] = vars.accountTokensNew;\n\n        /* We emit a Transfer event, and a Redeem event */\n        emit Transfer(redeemer, address(this), vars.redeemTokens);\n        emit Redeem(redeemer, vars.redeemAmount, vars.redeemTokens);\n\n        /* We call the defense hook */\n        comptroller.redeemVerify(\n            address(this),\n            redeemer,\n            vars.redeemAmount,\n            vars.redeemTokens\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sender borrows assets from the protocol to their own address\n     * @param borrowAmount The amount of the underlying asset to borrow\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function borrowInternal(uint256 borrowAmount)\n        internal\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed\n            return\n                fail(Error(error), FailureInfo.BORROW_ACCRUE_INTEREST_FAILED);\n        }\n        // borrowFresh emits borrow-specific logs on errors, so we don't need to\n        return borrowFresh(msg.sender, borrowAmount);\n    }\n\n    struct BorrowLocalVars {\n        MathError mathErr;\n        uint256 accountBorrows;\n        uint256 accountBorrowsNew;\n        uint256 totalBorrowsNew;\n    }\n\n    /**\n     * @notice Users borrow assets from the protocol to their own address\n     * @param borrowAmount The amount of the underlying asset to borrow\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function borrowFresh(address payable borrower, uint256 borrowAmount)\n        internal\n        returns (uint256)\n    {\n        /* Fail if borrow not allowed */\n        uint256 allowed = comptroller.borrowAllowed(\n            address(this),\n            borrower,\n            borrowAmount\n        );\n        if (allowed != 0) {\n            return\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.BORROW_COMPTROLLER_REJECTION,\n                    allowed\n                );\n        }\n\n        /* Verify market's block number equals current block number */\n        if (accrualBlockNumber != getBlockNumber()) {\n            return\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.BORROW_FRESHNESS_CHECK\n                );\n        }\n\n        /* Fail gracefully if protocol has insufficient underlying cash */\n        if (getCashPrior() < borrowAmount) {\n            return\n                fail(\n                    Error.TOKEN_INSUFFICIENT_CASH,\n                    FailureInfo.BORROW_CASH_NOT_AVAILABLE\n                );\n        }\n\n        BorrowLocalVars memory vars;\n\n        /*\n         * We calculate the new borrower and total borrow balances, failing on overflow:\n         *  accountBorrowsNew = accountBorrows + borrowAmount\n         *  totalBorrowsNew = totalBorrows + borrowAmount\n         */\n        (vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(\n            borrower\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        (vars.mathErr, vars.accountBorrowsNew) = addUInt(\n            vars.accountBorrows,\n            borrowAmount\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        (vars.mathErr, vars.totalBorrowsNew) = addUInt(\n            totalBorrows,\n            borrowAmount\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /*\n         * We invoke doTransferOut for the borrower and the borrowAmount.\n         *  Note: The cToken must handle variations between ERC-20 and ETH underlying.\n         *  On success, the cToken borrowAmount less of cash.\n         *  doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\n         */\n        doTransferOut(borrower, borrowAmount);\n\n        /* We write the previously calculated values into storage */\n        accountBorrows[borrower].principal = vars.accountBorrowsNew;\n        accountBorrows[borrower].interestIndex = borrowIndex;\n        totalBorrows = vars.totalBorrowsNew;\n\n        /* We emit a Borrow event */\n        emit Borrow(\n            borrower,\n            borrowAmount,\n            vars.accountBorrowsNew,\n            vars.totalBorrowsNew\n        );\n\n        /* We call the defense hook */\n        comptroller.borrowVerify(address(this), borrower, borrowAmount);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sender repays their own borrow\n     * @param repayAmount The amount to repay\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.\n     */\n    function repayBorrowInternal(uint256 repayAmount)\n        internal\n        nonReentrant\n        returns (uint256, uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed\n            return (\n                fail(\n                    Error(error),\n                    FailureInfo.REPAY_BORROW_ACCRUE_INTEREST_FAILED\n                ),\n                0\n            );\n        }\n        // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to\n        return repayBorrowFresh(msg.sender, msg.sender, repayAmount);\n    }\n\n    /**\n     * @notice Sender repays a borrow belonging to borrower\n     * @param borrower the account with the debt being payed off\n     * @param repayAmount The amount to repay\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.\n     */\n    function repayBorrowBehalfInternal(address borrower, uint256 repayAmount)\n        internal\n        nonReentrant\n        returns (uint256, uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed\n            return (\n                fail(\n                    Error(error),\n                    FailureInfo.REPAY_BEHALF_ACCRUE_INTEREST_FAILED\n                ),\n                0\n            );\n        }\n        // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to\n        return repayBorrowFresh(msg.sender, borrower, repayAmount);\n    }\n\n    struct RepayBorrowLocalVars {\n        Error err;\n        MathError mathErr;\n        uint256 repayAmount;\n        uint256 borrowerIndex;\n        uint256 accountBorrows;\n        uint256 accountBorrowsNew;\n        uint256 totalBorrowsNew;\n        uint256 actualRepayAmount;\n    }\n\n    /**\n     * @notice Borrows are repaid by another user (possibly the borrower).\n     * @param payer the account paying off the borrow\n     * @param borrower the account with the debt being payed off\n     * @param repayAmount the amount of undelrying tokens being returned\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.\n     */\n    function repayBorrowFresh(\n        address payer,\n        address borrower,\n        uint256 repayAmount\n    ) internal returns (uint256, uint256) {\n        /* Fail if repayBorrow not allowed */\n        uint256 allowed = comptroller.repayBorrowAllowed(\n            address(this),\n            payer,\n            borrower,\n            repayAmount\n        );\n        if (allowed != 0) {\n            return (\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.REPAY_BORROW_COMPTROLLER_REJECTION,\n                    allowed\n                ),\n                0\n            );\n        }\n\n        /* Verify market's block number equals current block number */\n        if (accrualBlockNumber != getBlockNumber()) {\n            return (\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.REPAY_BORROW_FRESHNESS_CHECK\n                ),\n                0\n            );\n        }\n\n        RepayBorrowLocalVars memory vars;\n\n        /* We remember the original borrowerIndex for verification purposes */\n        vars.borrowerIndex = accountBorrows[borrower].interestIndex;\n\n        /* We fetch the amount the borrower owes, with accumulated interest */\n        (vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(\n            borrower\n        );\n        if (vars.mathErr != MathError.NO_ERROR) {\n            return (\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo\n                        .REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,\n                    uint256(vars.mathErr)\n                ),\n                0\n            );\n        }\n\n        /* If repayAmount == -1, repayAmount = accountBorrows */\n        if (repayAmount == uint256(-1)) {\n            vars.repayAmount = vars.accountBorrows;\n        } else {\n            vars.repayAmount = repayAmount;\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /*\n         * We call doTransferIn for the payer and the repayAmount\n         *  Note: The cToken must handle variations between ERC-20 and ETH underlying.\n         *  On success, the cToken holds an additional repayAmount of cash.\n         *  doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.\n         *   it returns the amount actually transferred, in case of a fee.\n         */\n        vars.actualRepayAmount = doTransferIn(payer, vars.repayAmount);\n\n        /*\n         * We calculate the new borrower and total borrow balances, failing on underflow:\n         *  accountBorrowsNew = accountBorrows - actualRepayAmount\n         *  totalBorrowsNew = totalBorrows - actualRepayAmount\n         */\n        (vars.mathErr, vars.accountBorrowsNew) = subUInt(\n            vars.accountBorrows,\n            vars.actualRepayAmount\n        );\n        require(\n            vars.mathErr == MathError.NO_ERROR,\n            \"REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED\"\n        );\n\n        (vars.mathErr, vars.totalBorrowsNew) = subUInt(\n            totalBorrows,\n            vars.actualRepayAmount\n        );\n        require(\n            vars.mathErr == MathError.NO_ERROR,\n            \"REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED\"\n        );\n\n        /* We write the previously calculated values into storage */\n        accountBorrows[borrower].principal = vars.accountBorrowsNew;\n        accountBorrows[borrower].interestIndex = borrowIndex;\n        totalBorrows = vars.totalBorrowsNew;\n\n        /* We emit a RepayBorrow event */\n        emit RepayBorrow(\n            payer,\n            borrower,\n            vars.actualRepayAmount,\n            vars.accountBorrowsNew,\n            vars.totalBorrowsNew\n        );\n\n        /* We call the defense hook */\n        comptroller.repayBorrowVerify(\n            address(this),\n            payer,\n            borrower,\n            vars.actualRepayAmount,\n            vars.borrowerIndex\n        );\n\n        return (uint256(Error.NO_ERROR), vars.actualRepayAmount);\n    }\n\n    /**\n     * @notice The sender liquidates the borrowers collateral.\n     *  The collateral seized is transferred to the liquidator.\n     * @param borrower The borrower of this cToken to be liquidated\n     * @param cTokenCollateral The market in which to seize collateral from the borrower\n     * @param repayAmount The amount of the underlying borrowed asset to repay\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.\n     */\n    function liquidateBorrowInternal(\n        address borrower,\n        uint256 repayAmount,\n        CTokenInterface cTokenCollateral\n    ) internal nonReentrant returns (uint256, uint256) {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed\n            return (\n                fail(\n                    Error(error),\n                    FailureInfo.LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED\n                ),\n                0\n            );\n        }\n\n        error = cTokenCollateral.accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed\n            return (\n                fail(\n                    Error(error),\n                    FailureInfo.LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED\n                ),\n                0\n            );\n        }\n\n        // liquidateBorrowFresh emits borrow-specific logs on errors, so we don't need to\n        return\n            liquidateBorrowFresh(\n                msg.sender,\n                borrower,\n                repayAmount,\n                cTokenCollateral\n            );\n    }\n\n    /**\n     * @notice The liquidator liquidates the borrowers collateral.\n     *  The collateral seized is transferred to the liquidator.\n     * @param borrower The borrower of this cToken to be liquidated\n     * @param liquidator The address repaying the borrow and seizing collateral\n     * @param cTokenCollateral The market in which to seize collateral from the borrower\n     * @param repayAmount The amount of the underlying borrowed asset to repay\n     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.\n     */\n    function liquidateBorrowFresh(\n        address liquidator,\n        address borrower,\n        uint256 repayAmount,\n        CTokenInterface cTokenCollateral\n    ) internal returns (uint256, uint256) {\n        /* Fail if liquidate not allowed */\n        uint256 allowed = comptroller.liquidateBorrowAllowed(\n            address(this),\n            address(cTokenCollateral),\n            liquidator,\n            borrower,\n            repayAmount\n        );\n        if (allowed != 0) {\n            return (\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.LIQUIDATE_COMPTROLLER_REJECTION,\n                    allowed\n                ),\n                0\n            );\n        }\n\n        /* Verify market's block number equals current block number */\n        if (accrualBlockNumber != getBlockNumber()) {\n            return (\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.LIQUIDATE_FRESHNESS_CHECK\n                ),\n                0\n            );\n        }\n\n        /* Verify cTokenCollateral market's block number equals current block number */\n        if (cTokenCollateral.accrualBlockNumber() != getBlockNumber()) {\n            return (\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.LIQUIDATE_COLLATERAL_FRESHNESS_CHECK\n                ),\n                0\n            );\n        }\n\n        /* Fail if borrower = liquidator */\n        if (borrower == liquidator) {\n            return (\n                fail(\n                    Error.INVALID_ACCOUNT_PAIR,\n                    FailureInfo.LIQUIDATE_LIQUIDATOR_IS_BORROWER\n                ),\n                0\n            );\n        }\n\n        /* Fail if repayAmount = 0 */\n        if (repayAmount == 0) {\n            return (\n                fail(\n                    Error.INVALID_CLOSE_AMOUNT_REQUESTED,\n                    FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_ZERO\n                ),\n                0\n            );\n        }\n\n        /* Fail if repayAmount = -1 */\n        if (repayAmount == uint256(-1)) {\n            return (\n                fail(\n                    Error.INVALID_CLOSE_AMOUNT_REQUESTED,\n                    FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX\n                ),\n                0\n            );\n        }\n\n        /* Fail if repayBorrow fails */\n        (\n            uint256 repayBorrowError,\n            uint256 actualRepayAmount\n        ) = repayBorrowFresh(liquidator, borrower, repayAmount);\n        if (repayBorrowError != uint256(Error.NO_ERROR)) {\n            return (\n                fail(\n                    Error(repayBorrowError),\n                    FailureInfo.LIQUIDATE_REPAY_BORROW_FRESH_FAILED\n                ),\n                0\n            );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /* We calculate the number of collateral tokens that will be seized */\n        (uint256 amountSeizeError, uint256 seizeTokens) = comptroller\n            .liquidateCalculateSeizeTokens(\n                address(this),\n                address(cTokenCollateral),\n                actualRepayAmount\n            );\n        require(\n            amountSeizeError == uint256(Error.NO_ERROR),\n            \"LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED\"\n        );\n\n        /* Revert if borrower collateral token balance < seizeTokens */\n        require(\n            cTokenCollateral.balanceOf(borrower) >= seizeTokens,\n            \"LIQUIDATE_SEIZE_TOO_MUCH\"\n        );\n\n        // If this is also the collateral, run seizeInternal to avoid re-entrancy, otherwise make an external call\n        uint256 seizeError;\n        if (address(cTokenCollateral) == address(this)) {\n            seizeError = seizeInternal(\n                address(this),\n                liquidator,\n                borrower,\n                seizeTokens\n            );\n        } else {\n            seizeError = cTokenCollateral.seize(\n                liquidator,\n                borrower,\n                seizeTokens\n            );\n        }\n\n        /* Revert if seize tokens fails (since we cannot be sure of side effects) */\n        require(seizeError == uint256(Error.NO_ERROR), \"token seizure failed\");\n\n        /* We emit a LiquidateBorrow event */\n        emit LiquidateBorrow(\n            liquidator,\n            borrower,\n            actualRepayAmount,\n            address(cTokenCollateral),\n            seizeTokens\n        );\n\n        /* We call the defense hook */\n        comptroller.liquidateBorrowVerify(\n            address(this),\n            address(cTokenCollateral),\n            liquidator,\n            borrower,\n            actualRepayAmount,\n            seizeTokens\n        );\n\n        return (uint256(Error.NO_ERROR), actualRepayAmount);\n    }\n\n    /**\n     * @notice Transfers collateral tokens (this market) to the liquidator.\n     * @dev Will fail unless called by another cToken during the process of liquidation.\n     *  Its absolutely critical to use msg.sender as the borrowed cToken and not a parameter.\n     * @param liquidator The account receiving seized collateral\n     * @param borrower The account having collateral seized\n     * @param seizeTokens The number of cTokens to seize\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function seize(\n        address liquidator,\n        address borrower,\n        uint256 seizeTokens\n    ) external nonReentrant returns (uint256) {\n        return seizeInternal(msg.sender, liquidator, borrower, seizeTokens);\n    }\n\n    /**\n     * @notice Transfers collateral tokens (this market) to the liquidator.\n     * @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another CToken.\n     *  Its absolutely critical to use msg.sender as the seizer cToken and not a parameter.\n     * @param seizerToken The contract seizing the collateral (i.e. borrowed cToken)\n     * @param liquidator The account receiving seized collateral\n     * @param borrower The account having collateral seized\n     * @param seizeTokens The number of cTokens to seize\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function seizeInternal(\n        address seizerToken,\n        address liquidator,\n        address borrower,\n        uint256 seizeTokens\n    ) internal returns (uint256) {\n        /* Fail if seize not allowed */\n        uint256 allowed = comptroller.seizeAllowed(\n            address(this),\n            seizerToken,\n            liquidator,\n            borrower,\n            seizeTokens\n        );\n        if (allowed != 0) {\n            return\n                failOpaque(\n                    Error.COMPTROLLER_REJECTION,\n                    FailureInfo.LIQUIDATE_SEIZE_COMPTROLLER_REJECTION,\n                    allowed\n                );\n        }\n\n        /* Fail if borrower = liquidator */\n        if (borrower == liquidator) {\n            return\n                fail(\n                    Error.INVALID_ACCOUNT_PAIR,\n                    FailureInfo.LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER\n                );\n        }\n\n        MathError mathErr;\n        uint256 borrowerTokensNew;\n        uint256 liquidatorTokensNew;\n\n        /*\n         * We calculate the new borrower and liquidator token balances, failing on underflow/overflow:\n         *  borrowerTokensNew = accountTokens[borrower] - seizeTokens\n         *  liquidatorTokensNew = accountTokens[liquidator] + seizeTokens\n         */\n        (mathErr, borrowerTokensNew) = subUInt(\n            accountTokens[borrower],\n            seizeTokens\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        (mathErr, liquidatorTokensNew) = addUInt(\n            accountTokens[liquidator],\n            seizeTokens\n        );\n        if (mathErr != MathError.NO_ERROR) {\n            return\n                failOpaque(\n                    Error.MATH_ERROR,\n                    FailureInfo.LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED,\n                    uint256(mathErr)\n                );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /* We write the previously calculated values into storage */\n        accountTokens[borrower] = borrowerTokensNew;\n        accountTokens[liquidator] = liquidatorTokensNew;\n\n        /* Emit a Transfer event */\n        emit Transfer(borrower, liquidator, seizeTokens);\n\n        /* We call the defense hook */\n        comptroller.seizeVerify(\n            address(this),\n            seizerToken,\n            liquidator,\n            borrower,\n            seizeTokens\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /*** Admin Functions ***/\n\n    /**\n     * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n     * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n     * @param newPendingAdmin New pending admin.\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setPendingAdmin(address payable newPendingAdmin)\n        external\n        returns (uint256)\n    {\n        // Check caller = admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK\n                );\n        }\n\n        // Save current value, if any, for inclusion in log\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store pendingAdmin with value newPendingAdmin\n        pendingAdmin = newPendingAdmin;\n\n        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)\n        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin\n     * @dev Admin function for pending admin to accept role and update admin\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _acceptAdmin() external returns (uint256) {\n        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)\n        if (msg.sender != pendingAdmin || msg.sender == address(0)) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK\n                );\n        }\n\n        // Save current values for inclusion in log\n        address oldAdmin = admin;\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store admin with value pendingAdmin\n        admin = pendingAdmin;\n\n        // Clear the pending value\n        pendingAdmin = address(0);\n\n        emit NewAdmin(oldAdmin, admin);\n        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sets a new comptroller for the market\n     * @dev Admin function to set a new comptroller\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setComptroller(ComptrollerInterface newComptroller)\n        public\n        returns (uint256)\n    {\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_COMPTROLLER_OWNER_CHECK\n                );\n        }\n\n        ComptrollerInterface oldComptroller = comptroller;\n        // Ensure invoke comptroller.isComptroller() returns true\n        require(newComptroller.isComptroller(), \"marker method returned false\");\n\n        // Set market's comptroller to newComptroller\n        comptroller = newComptroller;\n\n        // Emit NewComptroller(oldComptroller, newComptroller)\n        emit NewComptroller(oldComptroller, newComptroller);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh\n     * @dev Admin function to accrue interest and set a new reserve factor\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setReserveFactor(uint256 newReserveFactorMantissa)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reserve factor change failed.\n            return\n                fail(\n                    Error(error),\n                    FailureInfo.SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED\n                );\n        }\n        // _setReserveFactorFresh emits reserve-factor-specific logs on errors, so we don't need to.\n        return _setReserveFactorFresh(newReserveFactorMantissa);\n    }\n\n    /**\n     * @notice Sets a new reserve factor for the protocol (*requires fresh interest accrual)\n     * @dev Admin function to set a new reserve factor\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setReserveFactorFresh(uint256 newReserveFactorMantissa)\n        internal\n        returns (uint256)\n    {\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_RESERVE_FACTOR_ADMIN_CHECK\n                );\n        }\n\n        // Verify market's block number equals current block number\n        if (accrualBlockNumber != getBlockNumber()) {\n            return\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.SET_RESERVE_FACTOR_FRESH_CHECK\n                );\n        }\n\n        // Check newReserveFactor ≤ maxReserveFactor\n        if (newReserveFactorMantissa > reserveFactorMaxMantissa) {\n            return\n                fail(\n                    Error.BAD_INPUT,\n                    FailureInfo.SET_RESERVE_FACTOR_BOUNDS_CHECK\n                );\n        }\n\n        uint256 oldReserveFactorMantissa = reserveFactorMantissa;\n        reserveFactorMantissa = newReserveFactorMantissa;\n\n        emit NewReserveFactor(\n            oldReserveFactorMantissa,\n            newReserveFactorMantissa\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Accrues interest and reduces reserves by transferring from msg.sender\n     * @param addAmount Amount of addition to reserves\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _addReservesInternal(uint256 addAmount)\n        internal\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.\n            return\n                fail(\n                    Error(error),\n                    FailureInfo.ADD_RESERVES_ACCRUE_INTEREST_FAILED\n                );\n        }\n\n        // _addReservesFresh emits reserve-addition-specific logs on errors, so we don't need to.\n        (error, ) = _addReservesFresh(addAmount);\n        return error;\n    }\n\n    /**\n     * @notice Add reserves by transferring from caller\n     * @dev Requires fresh interest accrual\n     * @param addAmount Amount of addition to reserves\n     * @return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees\n     */\n    function _addReservesFresh(uint256 addAmount)\n        internal\n        returns (uint256, uint256)\n    {\n        // totalReserves + actualAddAmount\n        uint256 totalReservesNew;\n        uint256 actualAddAmount;\n\n        // We fail gracefully unless market's block number equals current block number\n        if (accrualBlockNumber != getBlockNumber()) {\n            return (\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.ADD_RESERVES_FRESH_CHECK\n                ),\n                actualAddAmount\n            );\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        /*\n         * We call doTransferIn for the caller and the addAmount\n         *  Note: The cToken must handle variations between ERC-20 and ETH underlying.\n         *  On success, the cToken holds an additional addAmount of cash.\n         *  doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.\n         *  it returns the amount actually transferred, in case of a fee.\n         */\n\n        actualAddAmount = doTransferIn(msg.sender, addAmount);\n\n        totalReservesNew = totalReserves + actualAddAmount;\n\n        /* Revert on overflow */\n        require(\n            totalReservesNew >= totalReserves,\n            \"add reserves unexpected overflow\"\n        );\n\n        // Store reserves[n+1] = reserves[n] + actualAddAmount\n        totalReserves = totalReservesNew;\n\n        /* Emit NewReserves(admin, actualAddAmount, reserves[n+1]) */\n        emit ReservesAdded(msg.sender, actualAddAmount, totalReservesNew);\n\n        /* Return (NO_ERROR, actualAddAmount) */\n        return (uint256(Error.NO_ERROR), actualAddAmount);\n    }\n\n    /**\n     * @notice Accrues interest and reduces reserves by transferring to admin\n     * @param reduceAmount Amount of reduction to reserves\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _reduceReserves(uint256 reduceAmount)\n        external\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.\n            return\n                fail(\n                    Error(error),\n                    FailureInfo.REDUCE_RESERVES_ACCRUE_INTEREST_FAILED\n                );\n        }\n        // _reduceReservesFresh emits reserve-reduction-specific logs on errors, so we don't need to.\n        return _reduceReservesFresh(reduceAmount);\n    }\n\n    /**\n     * @notice Reduces reserves by transferring to admin\n     * @dev Requires fresh interest accrual\n     * @param reduceAmount Amount of reduction to reserves\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _reduceReservesFresh(uint256 reduceAmount)\n        internal\n        returns (uint256)\n    {\n        // totalReserves - reduceAmount\n        uint256 totalReservesNew;\n\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.REDUCE_RESERVES_ADMIN_CHECK\n                );\n        }\n\n        // We fail gracefully unless market's block number equals current block number\n        if (accrualBlockNumber != getBlockNumber()) {\n            return\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.REDUCE_RESERVES_FRESH_CHECK\n                );\n        }\n\n        // Fail gracefully if protocol has insufficient underlying cash\n        if (getCashPrior() < reduceAmount) {\n            return\n                fail(\n                    Error.TOKEN_INSUFFICIENT_CASH,\n                    FailureInfo.REDUCE_RESERVES_CASH_NOT_AVAILABLE\n                );\n        }\n\n        // Check reduceAmount ≤ reserves[n] (totalReserves)\n        if (reduceAmount > totalReserves) {\n            return\n                fail(Error.BAD_INPUT, FailureInfo.REDUCE_RESERVES_VALIDATION);\n        }\n\n        /////////////////////////\n        // EFFECTS & INTERACTIONS\n        // (No safe failures beyond this point)\n\n        totalReservesNew = totalReserves - reduceAmount;\n        // We checked reduceAmount <= totalReserves above, so this should never revert.\n        require(\n            totalReservesNew <= totalReserves,\n            \"reduce reserves unexpected underflow\"\n        );\n\n        // Store reserves[n+1] = reserves[n] - reduceAmount\n        totalReserves = totalReservesNew;\n\n        // doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\n        doTransferOut(admin, reduceAmount);\n\n        emit ReservesReduced(admin, reduceAmount, totalReservesNew);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice accrues interest and updates the interest rate model using _setInterestRateModelFresh\n     * @dev Admin function to accrue interest and update the interest rate model\n     * @param newInterestRateModel the new interest rate model to use\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setInterestRateModel(InterestRateModel newInterestRateModel)\n        public\n        returns (uint256)\n    {\n        uint256 error = accrueInterest();\n        if (error != uint256(Error.NO_ERROR)) {\n            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted change of interest rate model failed\n            return\n                fail(\n                    Error(error),\n                    FailureInfo.SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED\n                );\n        }\n        // _setInterestRateModelFresh emits interest-rate-model-update-specific logs on errors, so we don't need to.\n        return _setInterestRateModelFresh(newInterestRateModel);\n    }\n\n    /**\n     * @notice updates the interest rate model (*requires fresh interest accrual)\n     * @dev Admin function to update the interest rate model\n     * @param newInterestRateModel the new interest rate model to use\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setInterestRateModelFresh(InterestRateModel newInterestRateModel)\n        internal\n        returns (uint256)\n    {\n        // Used to store old model for use in the event that is emitted on success\n        InterestRateModel oldInterestRateModel;\n\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_INTEREST_RATE_MODEL_OWNER_CHECK\n                );\n        }\n\n        // We fail gracefully unless market's block number equals current block number\n        if (accrualBlockNumber != getBlockNumber()) {\n            return\n                fail(\n                    Error.MARKET_NOT_FRESH,\n                    FailureInfo.SET_INTEREST_RATE_MODEL_FRESH_CHECK\n                );\n        }\n\n        // Track the market's current interest rate model\n        oldInterestRateModel = interestRateModel;\n\n        // Ensure invoke newInterestRateModel.isInterestRateModel() returns true\n        require(\n            newInterestRateModel.isInterestRateModel(),\n            \"marker method returned false\"\n        );\n\n        // Set the interest rate model to newInterestRateModel\n        interestRateModel = newInterestRateModel;\n\n        // Emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel)\n        emit NewMarketInterestRateModel(\n            oldInterestRateModel,\n            newInterestRateModel\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /*** Safe Token ***/\n\n    /**\n     * @notice Gets balance of this contract in terms of the underlying\n     * @dev This excludes the value of the current message, if any\n     * @return The quantity of underlying owned by this contract\n     */\n    function getCashPrior() internal view returns (uint256);\n\n    /**\n     * @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee.\n     *  This may revert due to insufficient balance or insufficient allowance.\n     */\n    function doTransferIn(address from, uint256 amount)\n        internal\n        returns (uint256);\n\n    /**\n     * @dev Performs a transfer out, ideally returning an explanatory error code upon failure tather than reverting.\n     *  If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract.\n     *  If caller has checked protocol's balance, and verified it is >= amount, this should not revert in normal conditions.\n     */\n    function doTransferOut(address payable to, uint256 amount) internal;\n\n    /*** Reentrancy Guard ***/\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     */\n    modifier nonReentrant() {\n        require(_notEntered, \"re-entered\");\n        _notEntered = false;\n        _;\n        _notEntered = true; // get a gas-refund post-Istanbul\n    }\n}\n\ncontract PriceOracle {\n    /// @notice Indicator that this is a PriceOracle contract (for inspection)\n    bool public constant isPriceOracle = true;\n\n    /**\n      * @notice Get the underlying price of a cToken asset\n      * @param cToken The cToken to get the underlying price of\n      * @return The underlying asset price mantissa (scaled by 1e18).\n      *  Zero means the price is unavailable.\n      */\n    function getUnderlyingPrice(CToken cToken) external view returns (uint);\n}\n\ncontract UnitrollerAdminStorage {\n    /**\n     * @notice Administrator for this contract\n     */\n    address public admin;\n\n    /**\n     * @notice Pending administrator for this contract\n     */\n    address public pendingAdmin;\n\n    /**\n     * @notice Active brains of Unitroller\n     */\n    address public comptrollerImplementation;\n\n    /**\n     * @notice Pending brains of Unitroller\n     */\n    address public pendingComptrollerImplementation;\n}\n\ncontract ComptrollerV1Storage is UnitrollerAdminStorage {\n    /**\n     * @notice Oracle which gives the price of any given asset\n     */\n    PriceOracle public oracle;\n\n    /**\n     * @notice Multiplier used to calculate the maximum repayAmount when liquidating a borrow\n     */\n    uint256 public closeFactorMantissa;\n\n    /**\n     * @notice Multiplier representing the discount on collateral that a liquidator receives\n     */\n    uint256 public liquidationIncentiveMantissa;\n\n    /**\n     * @notice Max number of assets a single account can participate in (borrow or use as collateral)\n     */\n    uint256 public maxAssets;\n\n    /**\n     * @notice Per-account mapping of \"assets you are in\", capped by maxAssets\n     */\n    mapping(address => CToken[]) public accountAssets;\n}\n\ncontract ComptrollerV2Storage is ComptrollerV1Storage {\n    struct Market {\n        /// @notice Whether or not this market is listed\n        bool isListed;\n        /**\n         * @notice Multiplier representing the most one can borrow against their collateral in this market.\n         *  For instance, 0.9 to allow borrowing 90% of collateral value.\n         *  Must be between 0 and 1, and stored as a mantissa.\n         */\n        uint256 collateralFactorMantissa;\n        /// @notice Per-market mapping of \"accounts in this asset\"\n        mapping(address => bool) accountMembership;\n        /// @notice Whether or not this market receives COMP\n        bool isComped;\n    }\n\n    /**\n     * @notice Official mapping of cTokens -> Market metadata\n     * @dev Used e.g. to determine if a market is supported\n     */\n    mapping(address => Market) public markets;\n\n    /**\n     * @notice The Pause Guardian can pause certain actions as a safety mechanism.\n     *  Actions which allow users to remove their own assets cannot be paused.\n     *  Liquidation / seizing / transfer can only be paused globally, not by market.\n     */\n    address public pauseGuardian;\n    bool public _mintGuardianPaused;\n    bool public _borrowGuardianPaused;\n    bool public transferGuardianPaused;\n    bool public seizeGuardianPaused;\n    mapping(address => bool) public mintGuardianPaused;\n    mapping(address => bool) public borrowGuardianPaused;\n}\n\ncontract ComptrollerV3Storage is ComptrollerV2Storage {\n    struct CompMarketState {\n        /// @notice The market's last updated compBorrowIndex or compSupplyIndex\n        uint224 index;\n        /// @notice The block number the index was last updated at\n        uint32 block;\n    }\n\n    /// @notice A list of all markets\n    CToken[] public allMarkets;\n\n    /// @notice The rate at which the flywheel distributes COMP, per block\n    uint256 public compRate;\n\n    /// @notice The portion of compRate that each market currently receives\n    mapping(address => uint256) public compSpeeds;\n\n    /// @notice The COMP market supply state for each market\n    mapping(address => CompMarketState) public compSupplyState;\n\n    /// @notice The COMP market borrow state for each market\n    mapping(address => CompMarketState) public compBorrowState;\n\n    /// @notice The COMP borrow index for each market for each supplier as of the last time they accrued COMP\n    mapping(address => mapping(address => uint256)) public compSupplierIndex;\n\n    /// @notice The COMP borrow index for each market for each borrower as of the last time they accrued COMP\n    mapping(address => mapping(address => uint256)) public compBorrowerIndex;\n\n    /// @notice The COMP accrued but not yet transferred to each user\n    mapping(address => uint256) public compAccrued;\n}\n\ncontract ComptrollerV4Storage is ComptrollerV3Storage {\n    // @notice The borrowCapGuardian can set borrowCaps to any number for any market. Lowering the borrow cap could disable borrowing on the given market.\n    address public borrowCapGuardian;\n\n    // @notice Borrow caps enforced by borrowAllowed for each cToken address. Defaults to zero which corresponds to unlimited borrowing.\n    mapping(address => uint256) public borrowCaps;\n}\n\ncontract ComptrollerV5Storage is ComptrollerV4Storage {\n    /// @notice The portion of COMP that each contributor receives per block\n    mapping(address => uint256) public compContributorSpeeds;\n\n    /// @notice Last block at which a contributor's COMP rewards have been allocated\n    mapping(address => uint256) public lastContributorBlock;\n}\n\ncontract ComptrollerV6Storage is ComptrollerV5Storage {\n    /**\n     * @notice Addition to the Pause Guardian storage slots in V2.\n     * Appended as V6 to avoid introducing storage slot conflicts.\n     */\n\n    /// @notice Whether a cToken is paused for borrowing or not\n    mapping(address => bool) public collateralGuardianPaused;\n}\n/**\n * @title ComptrollerCore\n * @dev Storage for the comptroller is at this address, while execution is delegated to the `comptrollerImplementation`.\n * CTokens should reference this contract as their comptroller.\n */\ncontract Unitroller is UnitrollerAdminStorage, ComptrollerErrorReporter {\n\n    /**\n      * @notice Emitted when pendingComptrollerImplementation is changed\n      */\n    event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);\n\n    /**\n      * @notice Emitted when pendingComptrollerImplementation is accepted, which means comptroller implementation is updated\n      */\n    event NewImplementation(address oldImplementation, address newImplementation);\n\n    /**\n      * @notice Emitted when pendingAdmin is changed\n      */\n    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\n\n    /**\n      * @notice Emitted when pendingAdmin is accepted, which means admin is updated\n      */\n    event NewAdmin(address oldAdmin, address newAdmin);\n\n    constructor() public {\n        // Set admin to caller\n        admin = msg.sender;\n    }\n\n    /*** Admin Functions ***/\n    function _setPendingImplementation(address newPendingImplementation) public returns (uint) {\n\n        if (msg.sender != admin) {\n            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK);\n        }\n\n        address oldPendingImplementation = pendingComptrollerImplementation;\n\n        pendingComptrollerImplementation = newPendingImplementation;\n\n        emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);\n\n        return uint(Error.NO_ERROR);\n    }\n\n    /**\n    * @notice Accepts new implementation of comptroller. msg.sender must be pendingImplementation\n    * @dev Admin function for new implementation to accept it's role as implementation\n    * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n    */\n    function _acceptImplementation() public returns (uint) {\n        // Check caller is pendingImplementation and pendingImplementation ≠ address(0)\n        if (msg.sender != pendingComptrollerImplementation || pendingComptrollerImplementation == address(0)) {\n            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK);\n        }\n\n        // Save current values for inclusion in log\n        address oldImplementation = comptrollerImplementation;\n        address oldPendingImplementation = pendingComptrollerImplementation;\n\n        comptrollerImplementation = pendingComptrollerImplementation;\n\n        pendingComptrollerImplementation = address(0);\n\n        emit NewImplementation(oldImplementation, comptrollerImplementation);\n        emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);\n\n        return uint(Error.NO_ERROR);\n    }\n\n\n    /**\n      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\n      * @param newPendingAdmin New pending admin.\n      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n      */\n    function _setPendingAdmin(address newPendingAdmin) public returns (uint) {\n        // Check caller = admin\n        if (msg.sender != admin) {\n            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);\n        }\n\n        // Save current value, if any, for inclusion in log\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store pendingAdmin with value newPendingAdmin\n        pendingAdmin = newPendingAdmin;\n\n        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)\n        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);\n\n        return uint(Error.NO_ERROR);\n    }\n\n    /**\n      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin\n      * @dev Admin function for pending admin to accept role and update admin\n      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n      */\n    function _acceptAdmin() public returns (uint) {\n        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)\n        if (msg.sender != pendingAdmin || msg.sender == address(0)) {\n            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);\n        }\n\n        // Save current values for inclusion in log\n        address oldAdmin = admin;\n        address oldPendingAdmin = pendingAdmin;\n\n        // Store admin with value pendingAdmin\n        admin = pendingAdmin;\n\n        // Clear the pending value\n        pendingAdmin = address(0);\n\n        emit NewAdmin(oldAdmin, admin);\n        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\n\n        return uint(Error.NO_ERROR);\n    }\n\n    /**\n     * @dev Delegates execution to an implementation contract.\n     * It returns to the external caller whatever the implementation returns\n     * or forwards reverts.\n     */\n    function () payable external {\n        // delegate all other functions to current implementation\n        (bool success, ) = comptrollerImplementation.delegatecall(msg.data);\n\n        assembly {\n              let free_mem_ptr := mload(0x40)\n              returndatacopy(free_mem_ptr, 0, returndatasize)\n\n              switch success\n              case 0 { revert(free_mem_ptr, returndatasize) }\n              default { return(free_mem_ptr, returndatasize) }\n        }\n    }\n}\ninterface IINV {\n    function balanceOf(address) external view returns (uint);\n    function transfer(address,uint) external returns (bool);\n    function transferFrom(address,address,uint) external returns (bool);\n    function allowance(address,address) external view returns (uint);\n    function delegates(address) external view returns (address);\n    function delegate(address) external;\n}\n\n/**\n * @title Compound's Comptroller Contract\n * @author Compound\n */\ncontract Comptroller is\n    ComptrollerV6Storage,\n    ComptrollerInterface,\n    ComptrollerErrorReporter,\n    ExponentialNoError\n{\n    /// @notice Emitted when an admin supports a market\n    event MarketListed(CToken cToken);\n\n    /// @notice Emitted when an account enters a market\n    event MarketEntered(CToken cToken, address account);\n\n    /// @notice Emitted when an account exits a market\n    event MarketExited(CToken cToken, address account);\n\n    /// @notice Emitted when close factor is changed by admin\n    event NewCloseFactor(\n        uint256 oldCloseFactorMantissa,\n        uint256 newCloseFactorMantissa\n    );\n\n    /// @notice Emitted when a collateral factor is changed by admin\n    event NewCollateralFactor(\n        CToken cToken,\n        uint256 oldCollateralFactorMantissa,\n        uint256 newCollateralFactorMantissa\n    );\n\n    /// @notice Emitted when liquidation incentive is changed by admin\n    event NewLiquidationIncentive(\n        uint256 oldLiquidationIncentiveMantissa,\n        uint256 newLiquidationIncentiveMantissa\n    );\n\n    /// @notice Emitted when price oracle is changed\n    event NewPriceOracle(\n        PriceOracle oldPriceOracle,\n        PriceOracle newPriceOracle\n    );\n\n    /// @notice Emitted when pause guardian is changed\n    event NewPauseGuardian(address oldPauseGuardian, address newPauseGuardian);\n\n    /// @notice Emitted when an action is paused globally\n    event ActionPaused(string action, bool pauseState);\n\n    /// @notice Emitted when an action is paused on a market\n    event ActionPaused(CToken cToken, string action, bool pauseState);\n\n    /// @notice Emitted when a new COMP speed is calculated for a market\n    event CompSpeedUpdated(CToken indexed cToken, uint256 newSpeed);\n\n    /// @notice Emitted when a new COMP speed is set for a contributor\n    event ContributorCompSpeedUpdated(\n        address indexed contributor,\n        uint256 newSpeed\n    );\n\n    /// @notice Emitted when COMP is distributed to a supplier\n    event DistributedSupplierComp(\n        CToken indexed cToken,\n        address indexed supplier,\n        uint256 compDelta,\n        uint256 compSupplyIndex\n    );\n\n    /// @notice Emitted when COMP is distributed to a borrower\n    event DistributedBorrowerComp(\n        CToken indexed cToken,\n        address indexed borrower,\n        uint256 compDelta,\n        uint256 compBorrowIndex\n    );\n\n    /// @notice Emitted when borrow cap for a cToken is changed\n    event NewBorrowCap(CToken indexed cToken, uint256 newBorrowCap);\n\n    /// @notice Emitted when borrow cap guardian is changed\n    event NewBorrowCapGuardian(\n        address oldBorrowCapGuardian,\n        address newBorrowCapGuardian\n    );\n\n    /// @notice Emitted when COMP is granted by admin\n    event CompGranted(address recipient, uint256 amount);\n\n    /// @notice The initial COMP index for a market\n    uint224 public constant compInitialIndex = 1e36;\n\n    // closeFactorMantissa must be strictly greater than this value\n    uint256 internal constant closeFactorMinMantissa = 0.05e18; // 0.05\n\n    // closeFactorMantissa must not exceed this value\n    uint256 internal constant closeFactorMaxMantissa = 0.9e18; // 0.9\n\n    // No collateralFactorMantissa may exceed this value\n    uint256 internal constant collateralFactorMaxMantissa = 0.9e18; // 0.9\n\n    constructor() public {\n        admin = msg.sender;\n    }\n\n    /*** Assets You Are In ***/\n\n    /**\n     * @notice Returns the assets an account has entered\n     * @param account The address of the account to pull assets for\n     * @return A dynamic list with the assets the account has entered\n     */\n    function getAssetsIn(address account)\n        external\n        view\n        returns (CToken[] memory)\n    {\n        CToken[] memory assetsIn = accountAssets[account];\n\n        return assetsIn;\n    }\n\n    /**\n     * @notice Returns whether the given account is entered in the given asset\n     * @param account The address of the account to check\n     * @param cToken The cToken to check\n     * @return True if the account is in the asset, otherwise false.\n     */\n    function checkMembership(address account, CToken cToken)\n        external\n        view\n        returns (bool)\n    {\n        return markets[address(cToken)].accountMembership[account];\n    }\n\n    /**\n     * @notice Add assets to be included in account liquidity calculation\n     * @param cTokens The list of addresses of the cToken markets to be enabled\n     * @return Success indicator for whether each corresponding market was entered\n     */\n    function enterMarkets(address[] memory cTokens)\n        public\n        returns (uint256[] memory)\n    {\n        uint256 len = cTokens.length;\n\n        uint256[] memory results = new uint256[](len);\n        for (uint256 i = 0; i < len; i++) {\n            CToken cToken = CToken(cTokens[i]);\n\n            results[i] = uint256(addToMarketInternal(cToken, msg.sender));\n        }\n\n        return results;\n    }\n\n    /**\n     * @notice Add the market to the borrower's \"assets in\" for liquidity calculations\n     * @param cToken The market to enter\n     * @param borrower The address of the account to modify\n     * @return Success indicator for whether the market was entered\n     */\n    function addToMarketInternal(CToken cToken, address borrower)\n        internal\n        returns (Error)\n    {\n        Market storage marketToJoin = markets[address(cToken)];\n\n        if (!marketToJoin.isListed) {\n            // market is not listed, cannot join\n            return Error.MARKET_NOT_LISTED;\n        }\n\n        if (marketToJoin.accountMembership[borrower] == true) {\n            // already joined\n            return Error.NO_ERROR;\n        }\n\n        // survived the gauntlet, add to list\n        // NOTE: we store these somewhat redundantly as a significant optimization\n        //  this avoids having to iterate through the list for the most common use cases\n        //  that is, only when we need to perform liquidity checks\n        //  and not whenever we want to check if an account is in a particular market\n        marketToJoin.accountMembership[borrower] = true;\n        accountAssets[borrower].push(cToken);\n\n        emit MarketEntered(cToken, borrower);\n\n        return Error.NO_ERROR;\n    }\n\n    /**\n     * @notice Removes asset from sender's account liquidity calculation\n     * @dev Sender must not have an outstanding borrow balance in the asset,\n     *  or be providing necessary collateral for an outstanding borrow.\n     * @param cTokenAddress The address of the asset to be removed\n     * @return Whether or not the account successfully exited the market\n     */\n    function exitMarket(address cTokenAddress) external returns (uint256) {\n        CToken cToken = CToken(cTokenAddress);\n        /* Get sender tokensHeld and amountOwed underlying from the cToken */\n        (uint256 oErr, uint256 tokensHeld, uint256 amountOwed, ) = cToken\n            .getAccountSnapshot(msg.sender);\n        require(oErr == 0, \"exitMarket: getAccountSnapshot failed\"); // semi-opaque error code\n\n        /* Fail if the sender has a borrow balance */\n        if (amountOwed != 0) {\n            return\n                fail(\n                    Error.NONZERO_BORROW_BALANCE,\n                    FailureInfo.EXIT_MARKET_BALANCE_OWED\n                );\n        }\n\n        /* Fail if the sender is not permitted to redeem all of their tokens */\n        uint256 allowed = redeemAllowedInternal(\n            cTokenAddress,\n            msg.sender,\n            tokensHeld\n        );\n        if (allowed != 0) {\n            return\n                failOpaque(\n                    Error.REJECTION,\n                    FailureInfo.EXIT_MARKET_REJECTION,\n                    allowed\n                );\n        }\n\n        Market storage marketToExit = markets[address(cToken)];\n\n        /* Return true if the sender is not already ‘in’ the market */\n        if (!marketToExit.accountMembership[msg.sender]) {\n            return uint256(Error.NO_ERROR);\n        }\n\n        /* Set cToken account membership to false */\n        delete marketToExit.accountMembership[msg.sender];\n\n        /* Delete cToken from the account’s list of assets */\n        // load into memory for faster iteration\n        CToken[] memory userAssetList = accountAssets[msg.sender];\n        uint256 len = userAssetList.length;\n        uint256 assetIndex = len;\n        for (uint256 i = 0; i < len; i++) {\n            if (userAssetList[i] == cToken) {\n                assetIndex = i;\n                break;\n            }\n        }\n\n        // We *must* have found the asset in the list or our redundant data structure is broken\n        assert(assetIndex < len);\n\n        // copy last item in list to location of item to be removed, reduce length by 1\n        CToken[] storage storedList = accountAssets[msg.sender];\n        storedList[assetIndex] = storedList[storedList.length - 1];\n        storedList.length--;\n\n        emit MarketExited(cToken, msg.sender);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /*** Policy Hooks ***/\n\n    /**\n     * @notice Checks if the account should be allowed to mint tokens in the given market\n     * @param cToken The market to verify the mint against\n     * @param minter The account which would get the minted tokens\n     * @param mintAmount The amount of underlying being supplied to the market in exchange for tokens\n     * @return 0 if the mint is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\n     */\n    function mintAllowed(\n        address cToken,\n        address minter,\n        uint256 mintAmount\n    ) external returns (uint256) {\n        // Pausing is a very serious situation - we revert to sound the alarms\n        require(!mintGuardianPaused[cToken], \"mint is paused\");\n\n        // Shh - currently unused\n        minter;\n        mintAmount;\n\n        if (!markets[cToken].isListed) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        // Keep the flywheel moving\n        updateCompSupplyIndex(cToken);\n        distributeSupplierComp(cToken, minter);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates mint and reverts on rejection. May emit logs.\n     * @param cToken Asset being minted\n     * @param minter The address minting the tokens\n     * @param actualMintAmount The amount of the underlying asset being minted\n     * @param mintTokens The number of tokens being minted\n     */\n    function mintVerify(\n        address cToken,\n        address minter,\n        uint256 actualMintAmount,\n        uint256 mintTokens\n    ) external {\n        // Shh - currently unused\n        cToken;\n        minter;\n        actualMintAmount;\n        mintTokens;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /**\n     * @notice Checks if the account should be allowed to redeem tokens in the given market\n     * @param cToken The market to verify the redeem against\n     * @param redeemer The account which would redeem the tokens\n     * @param redeemTokens The number of cTokens to exchange for the underlying asset in the market\n     * @return 0 if the redeem is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\n     */\n    function redeemAllowed(\n        address cToken,\n        address redeemer,\n        uint256 redeemTokens\n    ) external returns (uint256) {\n        uint256 allowed = redeemAllowedInternal(cToken, redeemer, redeemTokens);\n        if (allowed != uint256(Error.NO_ERROR)) {\n            return allowed;\n        }\n\n        // Keep the flywheel moving\n        updateCompSupplyIndex(cToken);\n        distributeSupplierComp(cToken, redeemer);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    function redeemAllowedInternal(\n        address cToken,\n        address redeemer,\n        uint256 redeemTokens\n    ) internal view returns (uint256) {\n        if (!markets[cToken].isListed) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        /* If the redeemer is not 'in' the market, then we can bypass the liquidity check */\n        if (!markets[cToken].accountMembership[redeemer]) {\n            return uint256(Error.NO_ERROR);\n        }\n\n        /* Otherwise, perform a hypothetical liquidity check to guard against shortfall */\n        (\n            Error err,\n            ,\n            uint256 shortfall\n        ) = getHypotheticalAccountLiquidityInternal(\n                redeemer,\n                CToken(cToken),\n                redeemTokens,\n                0\n            );\n        if (err != Error.NO_ERROR) {\n            return uint256(err);\n        }\n        if (shortfall > 0) {\n            return uint256(Error.INSUFFICIENT_LIQUIDITY);\n        }\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates redeem and reverts on rejection. May emit logs.\n     * @param cToken Asset being redeemed\n     * @param redeemer The address redeeming the tokens\n     * @param redeemAmount The amount of the underlying asset being redeemed\n     * @param redeemTokens The number of tokens being redeemed\n     */\n    function redeemVerify(\n        address cToken,\n        address redeemer,\n        uint256 redeemAmount,\n        uint256 redeemTokens\n    ) external {\n        // Shh - currently unused\n        cToken;\n        redeemer;\n\n        // Require tokens is zero or amount is also zero\n        if (redeemTokens == 0 && redeemAmount > 0) {\n            revert(\"redeemTokens zero\");\n        }\n    }\n\n    /**\n     * @notice Checks if the account should be allowed to borrow the underlying asset of the given market\n     * @param cToken The market to verify the borrow against\n     * @param borrower The account which would borrow the asset\n     * @param borrowAmount The amount of underlying the account would borrow\n     * @return 0 if the borrow is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\n     */\n    function borrowAllowed(\n        address cToken,\n        address borrower,\n        uint256 borrowAmount\n    ) external returns (uint256) {\n        // Pausing is a very serious situation - we revert to sound the alarms\n        require(!borrowGuardianPaused[cToken], \"borrow is paused\");\n\n        if (!markets[cToken].isListed) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        if (!markets[cToken].accountMembership[borrower]) {\n            // only cTokens may call borrowAllowed if borrower not in market\n            require(msg.sender == cToken, \"sender must be cToken\");\n\n            // attempt to add borrower to the market\n            Error err = addToMarketInternal(CToken(msg.sender), borrower);\n            if (err != Error.NO_ERROR) {\n                return uint256(err);\n            }\n\n            // it should be impossible to break the important invariant\n            assert(markets[cToken].accountMembership[borrower]);\n        }\n\n        if (oracle.getUnderlyingPrice(CToken(cToken)) == 0) {\n            return uint256(Error.PRICE_ERROR);\n        }\n\n        uint256 borrowCap = borrowCaps[cToken];\n        // Borrow cap of 0 corresponds to unlimited borrowing\n        if (borrowCap != 0) {\n            uint256 totalBorrows = CToken(cToken).totalBorrows();\n            uint256 nextTotalBorrows = add_(totalBorrows, borrowAmount);\n            require(nextTotalBorrows < borrowCap, \"market borrow cap reached\");\n        }\n\n        (\n            Error err,\n            ,\n            uint256 shortfall\n        ) = getHypotheticalAccountLiquidityInternal(\n                borrower,\n                CToken(cToken),\n                0,\n                borrowAmount\n            );\n        if (err != Error.NO_ERROR) {\n            return uint256(err);\n        }\n        if (shortfall > 0) {\n            return uint256(Error.INSUFFICIENT_LIQUIDITY);\n        }\n\n        // Keep the flywheel moving\n        Exp memory borrowIndex = Exp({mantissa: CToken(cToken).borrowIndex()});\n        distributeBorrowerComp(cToken, borrower, borrowIndex);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates borrow and reverts on rejection. May emit logs.\n     * @param cToken Asset whose underlying is being borrowed\n     * @param borrower The address borrowing the underlying\n     * @param borrowAmount The amount of the underlying asset requested to borrow\n     */\n    function borrowVerify(\n        address cToken,\n        address borrower,\n        uint256 borrowAmount\n    ) external {\n        // Shh - currently unused\n        cToken;\n        borrower;\n        borrowAmount;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /**\n     * @notice Checks if the account should be allowed to repay a borrow in the given market\n     * @param cToken The market to verify the repay against\n     * @param payer The account which would repay the asset\n     * @param borrower The account which would borrowed the asset\n     * @param repayAmount The amount of the underlying asset the account would repay\n     * @return 0 if the repay is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\n     */\n    function repayBorrowAllowed(\n        address cToken,\n        address payer,\n        address borrower,\n        uint256 repayAmount\n    ) external returns (uint256) {\n        // Shh - currently unused\n        payer;\n        borrower;\n        repayAmount;\n\n        if (!markets[cToken].isListed) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        // Keep the flywheel moving\n        Exp memory borrowIndex = Exp({mantissa: CToken(cToken).borrowIndex()});\n        distributeBorrowerComp(cToken, borrower, borrowIndex);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates repayBorrow and reverts on rejection. May emit logs.\n     * @param cToken Asset being repaid\n     * @param payer The address repaying the borrow\n     * @param borrower The address of the borrower\n     * @param actualRepayAmount The amount of underlying being repaid\n     */\n    function repayBorrowVerify(\n        address cToken,\n        address payer,\n        address borrower,\n        uint256 actualRepayAmount,\n        uint256 borrowerIndex\n    ) external {\n        // Shh - currently unused\n        cToken;\n        payer;\n        borrower;\n        actualRepayAmount;\n        borrowerIndex;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /**\n     * @notice Checks if the liquidation should be allowed to occur\n     * @param cTokenBorrowed Asset which was borrowed by the borrower\n     * @param cTokenCollateral Asset which was used as collateral and will be seized\n     * @param liquidator The address repaying the borrow and seizing the collateral\n     * @param borrower The address of the borrower\n     * @param repayAmount The amount of underlying being repaid\n     */\n    function liquidateBorrowAllowed(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        address liquidator,\n        address borrower,\n        uint256 repayAmount\n    ) external returns (uint256) {\n        // Shh - currently unused\n        liquidator;\n\n        if (\n            !markets[cTokenBorrowed].isListed ||\n            !markets[cTokenCollateral].isListed\n        ) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        /* The borrower must have shortfall in order to be liquidatable */\n        (Error err, , uint256 shortfall) = getAccountLiquidityInternal(\n            borrower\n        );\n        if (err != Error.NO_ERROR) {\n            return uint256(err);\n        }\n        if (shortfall == 0) {\n            return uint256(Error.INSUFFICIENT_SHORTFALL);\n        }\n\n        /* The liquidator may not repay more than what is allowed by the closeFactor */\n        uint256 borrowBalance = CToken(cTokenBorrowed).borrowBalanceStored(\n            borrower\n        );\n        uint256 maxClose = mul_ScalarTruncate(\n            Exp({mantissa: closeFactorMantissa}),\n            borrowBalance\n        );\n        if (repayAmount > maxClose) {\n            return uint256(Error.TOO_MUCH_REPAY);\n        }\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates liquidateBorrow and reverts on rejection. May emit logs.\n     * @param cTokenBorrowed Asset which was borrowed by the borrower\n     * @param cTokenCollateral Asset which was used as collateral and will be seized\n     * @param liquidator The address repaying the borrow and seizing the collateral\n     * @param borrower The address of the borrower\n     * @param actualRepayAmount The amount of underlying being repaid\n     */\n    function liquidateBorrowVerify(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        address liquidator,\n        address borrower,\n        uint256 actualRepayAmount,\n        uint256 seizeTokens\n    ) external {\n        // Shh - currently unused\n        cTokenBorrowed;\n        cTokenCollateral;\n        liquidator;\n        borrower;\n        actualRepayAmount;\n        seizeTokens;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /**\n     * @notice Checks if the seizing of assets should be allowed to occur\n     * @param cTokenCollateral Asset which was used as collateral and will be seized\n     * @param cTokenBorrowed Asset which was borrowed by the borrower\n     * @param liquidator The address repaying the borrow and seizing the collateral\n     * @param borrower The address of the borrower\n     * @param seizeTokens The number of collateral tokens to seize\n     */\n    function seizeAllowed(\n        address cTokenCollateral,\n        address cTokenBorrowed,\n        address liquidator,\n        address borrower,\n        uint256 seizeTokens\n    ) external returns (uint256) {\n        // Pausing is a very serious situation - we revert to sound the alarms\n        require(!seizeGuardianPaused, \"seize is paused\");\n\n        // Shh - currently unused\n        seizeTokens;\n\n        if (\n            !markets[cTokenCollateral].isListed ||\n            !markets[cTokenBorrowed].isListed\n        ) {\n            return uint256(Error.MARKET_NOT_LISTED);\n        }\n\n        if (\n            CToken(cTokenCollateral).comptroller() !=\n            CToken(cTokenBorrowed).comptroller()\n        ) {\n            return uint256(Error.COMPTROLLER_MISMATCH);\n        }\n\n        // Keep the flywheel moving\n        updateCompSupplyIndex(cTokenCollateral);\n        distributeSupplierComp(cTokenCollateral, borrower);\n        distributeSupplierComp(cTokenCollateral, liquidator);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates seize and reverts on rejection. May emit logs.\n     * @param cTokenCollateral Asset which was used as collateral and will be seized\n     * @param cTokenBorrowed Asset which was borrowed by the borrower\n     * @param liquidator The address repaying the borrow and seizing the collateral\n     * @param borrower The address of the borrower\n     * @param seizeTokens The number of collateral tokens to seize\n     */\n    function seizeVerify(\n        address cTokenCollateral,\n        address cTokenBorrowed,\n        address liquidator,\n        address borrower,\n        uint256 seizeTokens\n    ) external {\n        // Shh - currently unused\n        cTokenCollateral;\n        cTokenBorrowed;\n        liquidator;\n        borrower;\n        seizeTokens;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /**\n     * @notice Checks if the account should be allowed to transfer tokens in the given market\n     * @param cToken The market to verify the transfer against\n     * @param src The account which sources the tokens\n     * @param dst The account which receives the tokens\n     * @param transferTokens The number of cTokens to transfer\n     * @return 0 if the transfer is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\n     */\n    function transferAllowed(\n        address cToken,\n        address src,\n        address dst,\n        uint256 transferTokens\n    ) external returns (uint256) {\n        // Pausing is a very serious situation - we revert to sound the alarms\n        require(!transferGuardianPaused, \"transfer is paused\");\n\n        // Currently the only consideration is whether or not\n        //  the src is allowed to redeem this many tokens\n        uint256 allowed = redeemAllowedInternal(cToken, src, transferTokens);\n        if (allowed != uint256(Error.NO_ERROR)) {\n            return allowed;\n        }\n\n        // Keep the flywheel moving\n        updateCompSupplyIndex(cToken);\n        distributeSupplierComp(cToken, src);\n        distributeSupplierComp(cToken, dst);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Validates transfer and reverts on rejection. May emit logs.\n     * @param cToken Asset being transferred\n     * @param src The account which sources the tokens\n     * @param dst The account which receives the tokens\n     * @param transferTokens The number of cTokens to transfer\n     */\n    function transferVerify(\n        address cToken,\n        address src,\n        address dst,\n        uint256 transferTokens\n    ) external {\n        // Shh - currently unused\n        cToken;\n        src;\n        dst;\n        transferTokens;\n\n        // Shh - we don't ever want this hook to be marked pure\n        if (false) {\n            maxAssets = maxAssets;\n        }\n    }\n\n    /*** Liquidity/Liquidation Calculations ***/\n\n    /**\n     * @dev Local vars for avoiding stack-depth limits in calculating account liquidity.\n     *  Note that `cTokenBalance` is the number of cTokens the account owns in the market,\n     *  whereas `borrowBalance` is the amount of underlying that the account has borrowed.\n     */\n    struct AccountLiquidityLocalVars {\n        uint256 sumCollateral;\n        uint256 sumBorrowPlusEffects;\n        uint256 cTokenBalance;\n        uint256 borrowBalance;\n        uint256 exchangeRateMantissa;\n        uint256 oraclePriceMantissa;\n        Exp collateralFactor;\n        Exp exchangeRate;\n        Exp oraclePrice;\n        Exp tokensToDenom;\n    }\n\n    /**\n     * @notice Determine the current account liquidity wrt collateral requirements\n     * @return (possible error code (semi-opaque),\n                account liquidity in excess of collateral requirements,\n     *          account shortfall below collateral requirements)\n     */\n    function getAccountLiquidity(address account)\n        public\n        view\n        returns (\n            uint256,\n            uint256,\n            uint256\n        )\n    {\n        (\n            Error err,\n            uint256 liquidity,\n            uint256 shortfall\n        ) = getHypotheticalAccountLiquidityInternal(account, CToken(0), 0, 0);\n\n        return (uint256(err), liquidity, shortfall);\n    }\n\n    /**\n     * @notice Determine the current account liquidity wrt collateral requirements\n     * @return (possible error code,\n                account liquidity in excess of collateral requirements,\n     *          account shortfall below collateral requirements)\n     */\n    function getAccountLiquidityInternal(address account)\n        internal\n        view\n        returns (\n            Error,\n            uint256,\n            uint256\n        )\n    {\n        return\n            getHypotheticalAccountLiquidityInternal(account, CToken(0), 0, 0);\n    }\n\n    /**\n     * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed\n     * @param cTokenModify The market to hypothetically redeem/borrow in\n     * @param account The account to determine liquidity for\n     * @param redeemTokens The number of tokens to hypothetically redeem\n     * @param borrowAmount The amount of underlying to hypothetically borrow\n     * @return (possible error code (semi-opaque),\n                hypothetical account liquidity in excess of collateral requirements,\n     *          hypothetical account shortfall below collateral requirements)\n     */\n    function getHypotheticalAccountLiquidity(\n        address account,\n        address cTokenModify,\n        uint256 redeemTokens,\n        uint256 borrowAmount\n    )\n        public\n        view\n        returns (\n            uint256,\n            uint256,\n            uint256\n        )\n    {\n        (\n            Error err,\n            uint256 liquidity,\n            uint256 shortfall\n        ) = getHypotheticalAccountLiquidityInternal(\n                account,\n                CToken(cTokenModify),\n                redeemTokens,\n                borrowAmount\n            );\n        return (uint256(err), liquidity, shortfall);\n    }\n\n    /**\n     * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed\n     * @param cTokenModify The market to hypothetically redeem/borrow in\n     * @param account The account to determine liquidity for\n     * @param redeemTokens The number of tokens to hypothetically redeem\n     * @param borrowAmount The amount of underlying to hypothetically borrow\n     * @dev Note that we calculate the exchangeRateStored for each collateral cToken using stored data,\n     *  without calculating accumulated interest.\n     * @return (possible error code,\n                hypothetical account liquidity in excess of collateral requirements,\n     *          hypothetical account shortfall below collateral requirements)\n     */\n    function getHypotheticalAccountLiquidityInternal(\n        address account,\n        CToken cTokenModify,\n        uint256 redeemTokens,\n        uint256 borrowAmount\n    )\n        internal\n        view\n        returns (\n            Error,\n            uint256,\n            uint256\n        )\n    {\n        AccountLiquidityLocalVars memory vars; // Holds all our calculation results\n        uint256 oErr;\n\n        // For each asset the account is in\n        CToken[] memory assets = accountAssets[account];\n        for (uint256 i = 0; i < assets.length; i++) {\n            CToken asset = assets[i];\n\n            // Read the balances and exchange rate from the cToken\n            (\n                oErr,\n                vars.cTokenBalance,\n                vars.borrowBalance,\n                vars.exchangeRateMantissa\n            ) = asset.getAccountSnapshot(account);\n            if (oErr != 0) {\n                // semi-opaque error code, we assume NO_ERROR == 0 is invariant between upgrades\n                return (Error.SNAPSHOT_ERROR, 0, 0);\n            }\n\n            // Check if the collateral is paused, only for borrowing\n            if (\n                collateralGuardianPaused[address(asset)] == true &&\n                borrowAmount > 0 &&\n                vars.cTokenBalance > 0\n            ) {\n                return (Error.COLLATERAL_PAUSED, 0, 0);\n            }\n\n            vars.collateralFactor = Exp({\n                mantissa: markets[address(asset)].collateralFactorMantissa\n            });\n            vars.exchangeRate = Exp({mantissa: vars.exchangeRateMantissa});\n\n            // Get the normalized price of the asset\n            vars.oraclePriceMantissa = oracle.getUnderlyingPrice(asset);\n            if (vars.oraclePriceMantissa == 0) {\n                return (Error.PRICE_ERROR, 0, 0);\n            }\n            vars.oraclePrice = Exp({mantissa: vars.oraclePriceMantissa});\n\n            // Pre-compute a conversion factor from tokens -> ether (normalized price value)\n            vars.tokensToDenom = mul_(\n                mul_(vars.collateralFactor, vars.exchangeRate),\n                vars.oraclePrice\n            );\n\n            // sumCollateral += tokensToDenom * cTokenBalance\n            vars.sumCollateral = mul_ScalarTruncateAddUInt(\n                vars.tokensToDenom,\n                vars.cTokenBalance,\n                vars.sumCollateral\n            );\n\n            // sumBorrowPlusEffects += oraclePrice * borrowBalance\n            vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(\n                vars.oraclePrice,\n                vars.borrowBalance,\n                vars.sumBorrowPlusEffects\n            );\n\n            // Calculate effects of interacting with cTokenModify\n            if (asset == cTokenModify) {\n                // redeem effect\n                // sumBorrowPlusEffects += tokensToDenom * redeemTokens\n                vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(\n                    vars.tokensToDenom,\n                    redeemTokens,\n                    vars.sumBorrowPlusEffects\n                );\n\n                // borrow effect\n                // sumBorrowPlusEffects += oraclePrice * borrowAmount\n                vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(\n                    vars.oraclePrice,\n                    borrowAmount,\n                    vars.sumBorrowPlusEffects\n                );\n            }\n        }\n\n        // These are safe, as the underflow condition is checked first\n        if (vars.sumCollateral > vars.sumBorrowPlusEffects) {\n            return (\n                Error.NO_ERROR,\n                vars.sumCollateral - vars.sumBorrowPlusEffects,\n                0\n            );\n        } else {\n            return (\n                Error.NO_ERROR,\n                0,\n                vars.sumBorrowPlusEffects - vars.sumCollateral\n            );\n        }\n    }\n\n    /**\n     * @notice Calculate number of tokens of collateral asset to seize given an underlying amount\n     * @dev Used in liquidation (called in cToken.liquidateBorrowFresh)\n     * @param cTokenBorrowed The address of the borrowed cToken\n     * @param cTokenCollateral The address of the collateral cToken\n     * @param actualRepayAmount The amount of cTokenBorrowed underlying to convert into cTokenCollateral tokens\n     * @return (errorCode, number of cTokenCollateral tokens to be seized in a liquidation)\n     */\n    function liquidateCalculateSeizeTokens(\n        address cTokenBorrowed,\n        address cTokenCollateral,\n        uint256 actualRepayAmount\n    ) external view returns (uint256, uint256) {\n        /* Read oracle prices for borrowed and collateral markets */\n        uint256 priceBorrowedMantissa = oracle.getUnderlyingPrice(\n            CToken(cTokenBorrowed)\n        );\n        uint256 priceCollateralMantissa = oracle.getUnderlyingPrice(\n            CToken(cTokenCollateral)\n        );\n        if (priceBorrowedMantissa == 0 || priceCollateralMantissa == 0) {\n            return (uint256(Error.PRICE_ERROR), 0);\n        }\n\n        /*\n         * Get the exchange rate and calculate the number of collateral tokens to seize:\n         *  seizeAmount = actualRepayAmount * liquidationIncentive * priceBorrowed / priceCollateral\n         *  seizeTokens = seizeAmount / exchangeRate\n         *   = actualRepayAmount * (liquidationIncentive * priceBorrowed) / (priceCollateral * exchangeRate)\n         */\n        uint256 exchangeRateMantissa = CToken(cTokenCollateral)\n            .exchangeRateStored(); // Note: reverts on error\n        uint256 seizeTokens;\n        Exp memory numerator;\n        Exp memory denominator;\n        Exp memory ratio;\n\n        numerator = mul_(\n            Exp({mantissa: liquidationIncentiveMantissa}),\n            Exp({mantissa: priceBorrowedMantissa})\n        );\n        denominator = mul_(\n            Exp({mantissa: priceCollateralMantissa}),\n            Exp({mantissa: exchangeRateMantissa})\n        );\n        ratio = div_(numerator, denominator);\n\n        seizeTokens = mul_ScalarTruncate(ratio, actualRepayAmount);\n\n        return (uint256(Error.NO_ERROR), seizeTokens);\n    }\n\n    /*** Admin Functions ***/\n\n    /**\n     * @notice Sets a new price oracle for the comptroller\n     * @dev Admin function to set a new price oracle\n     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\n     */\n    function _setPriceOracle(PriceOracle newOracle) public returns (uint256) {\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK\n                );\n        }\n\n        // Track the old oracle for the comptroller\n        PriceOracle oldOracle = oracle;\n\n        // Set comptroller's oracle to newOracle\n        oracle = newOracle;\n\n        // Emit NewPriceOracle(oldOracle, newOracle)\n        emit NewPriceOracle(oldOracle, newOracle);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sets the closeFactor used when liquidating borrows\n     * @dev Admin function to set closeFactor\n     * @param newCloseFactorMantissa New close factor, scaled by 1e18\n     * @return uint 0=success, otherwise a failure\n     */\n    function _setCloseFactor(uint256 newCloseFactorMantissa)\n        external\n        returns (uint256)\n    {\n        // Check caller is admin\n        require(msg.sender == admin, \"only admin can set close factor\");\n\n        uint256 oldCloseFactorMantissa = closeFactorMantissa;\n        closeFactorMantissa = newCloseFactorMantissa;\n        emit NewCloseFactor(oldCloseFactorMantissa, closeFactorMantissa);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sets the collateralFactor for a market\n     * @dev Admin function to set per-market collateralFactor\n     * @param cToken The market to set the factor on\n     * @param newCollateralFactorMantissa The new collateral factor, scaled by 1e18\n     * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)\n     */\n    function _setCollateralFactor(\n        CToken cToken,\n        uint256 newCollateralFactorMantissa\n    ) external returns (uint256) {\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_COLLATERAL_FACTOR_OWNER_CHECK\n                );\n        }\n\n        // Verify market is listed\n        Market storage market = markets[address(cToken)];\n        if (!market.isListed) {\n            return\n                fail(\n                    Error.MARKET_NOT_LISTED,\n                    FailureInfo.SET_COLLATERAL_FACTOR_NO_EXISTS\n                );\n        }\n\n        Exp memory newCollateralFactorExp = Exp({\n            mantissa: newCollateralFactorMantissa\n        });\n\n        // Check collateral factor <= 0.9\n        Exp memory highLimit = Exp({mantissa: collateralFactorMaxMantissa});\n        if (lessThanExp(highLimit, newCollateralFactorExp)) {\n            return\n                fail(\n                    Error.INVALID_COLLATERAL_FACTOR,\n                    FailureInfo.SET_COLLATERAL_FACTOR_VALIDATION\n                );\n        }\n\n        // If collateral factor != 0, fail if price == 0\n        if (\n            newCollateralFactorMantissa != 0 &&\n            oracle.getUnderlyingPrice(cToken) == 0\n        ) {\n            return\n                fail(\n                    Error.PRICE_ERROR,\n                    FailureInfo.SET_COLLATERAL_FACTOR_WITHOUT_PRICE\n                );\n        }\n\n        // Set market's collateral factor to new collateral factor, remember old value\n        uint256 oldCollateralFactorMantissa = market.collateralFactorMantissa;\n        market.collateralFactorMantissa = newCollateralFactorMantissa;\n\n        // Emit event with asset, old collateral factor, and new collateral factor\n        emit NewCollateralFactor(\n            cToken,\n            oldCollateralFactorMantissa,\n            newCollateralFactorMantissa\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Sets liquidationIncentive\n     * @dev Admin function to set liquidationIncentive\n     * @param newLiquidationIncentiveMantissa New liquidationIncentive scaled by 1e18\n     * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)\n     */\n    function _setLiquidationIncentive(uint256 newLiquidationIncentiveMantissa)\n        external\n        returns (uint256)\n    {\n        // Check caller is admin\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK\n                );\n        }\n\n        // Save current value for use in log\n        uint256 oldLiquidationIncentiveMantissa = liquidationIncentiveMantissa;\n\n        // Set liquidation incentive to new incentive\n        liquidationIncentiveMantissa = newLiquidationIncentiveMantissa;\n\n        // Emit event with old incentive, new incentive\n        emit NewLiquidationIncentive(\n            oldLiquidationIncentiveMantissa,\n            newLiquidationIncentiveMantissa\n        );\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    /**\n     * @notice Add the market to the markets mapping and set it as listed\n     * @dev Admin function to set isListed and add support for the market\n     * @param cToken The address of the market (token) to list\n     * @return uint 0=success, otherwise a failure. (See enum Error for details)\n     */\n    function _supportMarket(CToken cToken) external returns (uint256) {\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SUPPORT_MARKET_OWNER_CHECK\n                );\n        }\n\n        if (markets[address(cToken)].isListed) {\n            return\n                fail(\n                    Error.MARKET_ALREADY_LISTED,\n                    FailureInfo.SUPPORT_MARKET_EXISTS\n                );\n        }\n\n        cToken.isCToken(); // Sanity check to make sure its really a CToken\n\n        // Note that isComped is not in active use anymore\n        markets[address(cToken)] = Market({\n            isListed: true,\n            isComped: false,\n            collateralFactorMantissa: 0\n        });\n\n        _addMarketInternal(address(cToken));\n\n        emit MarketListed(cToken);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    function _addMarketInternal(address cToken) internal {\n        for (uint256 i = 0; i < allMarkets.length; i++) {\n            require(allMarkets[i] != CToken(cToken), \"market already added\");\n        }\n        allMarkets.push(CToken(cToken));\n    }\n\n    /**\n     * @notice Set the given borrow caps for the given cToken markets. Borrowing that brings total borrows to or above borrow cap will revert.\n     * @dev Admin or borrowCapGuardian function to set the borrow caps. A borrow cap of 0 corresponds to unlimited borrowing.\n     * @param cTokens The addresses of the markets (tokens) to change the borrow caps for\n     * @param newBorrowCaps The new borrow cap values in underlying to be set. A value of 0 corresponds to unlimited borrowing.\n     */\n    function _setMarketBorrowCaps(\n        CToken[] calldata cTokens,\n        uint256[] calldata newBorrowCaps\n    ) external {\n        require(\n            msg.sender == admin || msg.sender == borrowCapGuardian,\n            \"only admin or borrow cap guardian can set borrow caps\"\n        );\n\n        uint256 numMarkets = cTokens.length;\n        uint256 numBorrowCaps = newBorrowCaps.length;\n\n        require(\n            numMarkets != 0 && numMarkets == numBorrowCaps,\n            \"invalid input\"\n        );\n\n        for (uint256 i = 0; i < numMarkets; i++) {\n            borrowCaps[address(cTokens[i])] = newBorrowCaps[i];\n            emit NewBorrowCap(cTokens[i], newBorrowCaps[i]);\n        }\n    }\n\n    /**\n     * @notice Admin function to change the Borrow Cap Guardian\n     * @param newBorrowCapGuardian The address of the new Borrow Cap Guardian\n     */\n    function _setBorrowCapGuardian(address newBorrowCapGuardian) external {\n        require(msg.sender == admin, \"only admin can set borrow cap guardian\");\n\n        // Save current value for inclusion in log\n        address oldBorrowCapGuardian = borrowCapGuardian;\n\n        // Store borrowCapGuardian with value newBorrowCapGuardian\n        borrowCapGuardian = newBorrowCapGuardian;\n\n        // Emit NewBorrowCapGuardian(OldBorrowCapGuardian, NewBorrowCapGuardian)\n        emit NewBorrowCapGuardian(oldBorrowCapGuardian, newBorrowCapGuardian);\n    }\n\n    /**\n     * @notice Admin function to change the Pause Guardian\n     * @param newPauseGuardian The address of the new Pause Guardian\n     * @return uint 0=success, otherwise a failure. (See enum Error for details)\n     */\n    function _setPauseGuardian(address newPauseGuardian)\n        public\n        returns (uint256)\n    {\n        if (msg.sender != admin) {\n            return\n                fail(\n                    Error.UNAUTHORIZED,\n                    FailureInfo.SET_PAUSE_GUARDIAN_OWNER_CHECK\n                );\n        }\n\n        // Save current value for inclusion in log\n        address oldPauseGuardian = pauseGuardian;\n\n        // Store pauseGuardian with value newPauseGuardian\n        pauseGuardian = newPauseGuardian;\n\n        // Emit NewPauseGuardian(OldPauseGuardian, NewPauseGuardian)\n        emit NewPauseGuardian(oldPauseGuardian, pauseGuardian);\n\n        return uint256(Error.NO_ERROR);\n    }\n\n    function _setMintPaused(CToken cToken, bool state) public returns (bool) {\n        require(\n            markets[address(cToken)].isListed,\n            \"cannot pause a market that is not listed\"\n        );\n        require(\n            msg.sender == pauseGuardian || msg.sender == admin,\n            \"only pause guardian and admin can pause\"\n        );\n        require(msg.sender == admin || state == true, \"only admin can unpause\");\n\n        mintGuardianPaused[address(cToken)] = state;\n        emit ActionPaused(cToken, \"Mint\", state);\n        return state;\n    }\n\n    function _setBorrowPaused(CToken cToken, bool state) public returns (bool) {\n        require(\n            markets[address(cToken)].isListed,\n            \"cannot pause a market that is not listed\"\n        );\n        require(\n            msg.sender == pauseGuardian || msg.sender == admin,\n            \"only pause guardian and admin can pause\"\n        );\n        require(msg.sender == admin || state == true, \"only admin can unpause\");\n\n        borrowGuardianPaused[address(cToken)] = state;\n        emit ActionPaused(cToken, \"Borrow\", state);\n        return state;\n    }\n\n    function _setTransferPaused(bool state) public returns (bool) {\n        require(\n            msg.sender == pauseGuardian || msg.sender == admin,\n            \"only pause guardian and admin can pause\"\n        );\n        require(msg.sender == admin || state == true, \"only admin can unpause\");\n\n        transferGuardianPaused = state;\n        emit ActionPaused(\"Transfer\", state);\n        return state;\n    }\n\n    function _setSeizePaused(bool state) public returns (bool) {\n        require(\n            msg.sender == pauseGuardian || msg.sender == admin,\n            \"only pause guardian and admin can pause\"\n        );\n        require(msg.sender == admin || state == true, \"only admin can unpause\");\n\n        seizeGuardianPaused = state;\n        emit ActionPaused(\"Seize\", state);\n        return state;\n    }\n\n    function _setCollateralPaused(CToken cToken, bool state)\n        public\n        returns (bool)\n    {\n        require(\n            markets[address(cToken)].isListed,\n            \"cannot pause a market that is not listed\"\n        );\n        require(\n            msg.sender == pauseGuardian || msg.sender == admin,\n            \"only pause guardian and admin can pause\"\n        );\n        require(msg.sender == admin || state == true, \"only admin can unpause\");\n\n        collateralGuardianPaused[address(cToken)] = state;\n        emit ActionPaused(cToken, \"Collateral\", state);\n        return state;\n    }\n\n    function _become(Unitroller unitroller) public {\n        require(\n            msg.sender == unitroller.admin(),\n            \"only unitroller admin can change brains\"\n        );\n        require(\n            unitroller._acceptImplementation() == 0,\n            \"change not authorized\"\n        );\n    }\n\n    /**\n     * @notice Checks caller is admin, or this contract is becoming the new implementation\n     */\n    function adminOrInitializing() internal view returns (bool) {\n        return msg.sender == admin || msg.sender == comptrollerImplementation;\n    }\n\n    /*** Comp Distribution ***/\n\n    /**\n     * @notice Set COMP speed for a single market\n     * @param cToken The market whose COMP speed to update\n     * @param compSpeed New COMP speed for market\n     */\n    function setCompSpeedInternal(CToken cToken, uint256 compSpeed) internal {\n        uint256 currentCompSpeed = compSpeeds[address(cToken)];\n        if (currentCompSpeed != 0) {\n            // note that COMP speed could be set to 0 to halt liquidity rewards for a market\n            updateCompSupplyIndex(address(cToken));\n        } else if (compSpeed != 0) {\n            // Add the COMP market\n            Market storage market = markets[address(cToken)];\n            require(market.isListed == true, \"comp market is not listed\");\n\n            if (\n                compSupplyState[address(cToken)].index == 0 &&\n                compSupplyState[address(cToken)].block == 0\n            ) {\n                compSupplyState[address(cToken)] = CompMarketState({\n                    index: compInitialIndex,\n                    block: safe32(\n                        getBlockNumber(),\n                        \"block number exceeds 32 bits\"\n                    )\n                });\n            }\n        }\n\n        if (currentCompSpeed != compSpeed) {\n            compSpeeds[address(cToken)] = compSpeed;\n            emit CompSpeedUpdated(cToken, compSpeed);\n        }\n    }\n\n    /**\n     * @notice Accrue COMP to the market by updating the supply index\n     * @param cToken The market whose supply index to update\n     */\n    function updateCompSupplyIndex(address cToken) internal {\n        CompMarketState storage supplyState = compSupplyState[cToken];\n        uint256 supplySpeed = compSpeeds[cToken];\n        uint256 blockNumber = getBlockNumber();\n        uint256 deltaBlocks = sub_(blockNumber, uint256(supplyState.block));\n        if (deltaBlocks > 0 && supplySpeed > 0) {\n            uint256 supplyTokens = CToken(cToken).totalSupply();\n            uint256 compAccrued = mul_(deltaBlocks, supplySpeed);\n            Double memory ratio = supplyTokens > 0\n                ? fraction(compAccrued, supplyTokens)\n                : Double({mantissa: 0});\n            Double memory index = add_(\n                Double({mantissa: supplyState.index}),\n                ratio\n            );\n            compSupplyState[cToken] = CompMarketState({\n                index: safe224(index.mantissa, \"new index exceeds 224 bits\"),\n                block: safe32(blockNumber, \"block number exceeds 32 bits\")\n            });\n        } else if (deltaBlocks > 0) {\n            supplyState.block = safe32(\n                blockNumber,\n                \"block number exceeds 32 bits\"\n            );\n        }\n    }\n\n    /**\n     * @notice Calculate COMP accrued by a supplier and possibly transfer it to them\n     * @param cToken The market in which the supplier is interacting\n     * @param supplier The address of the supplier to distribute COMP to\n     */\n    function distributeSupplierComp(address cToken, address supplier) internal {\n        CompMarketState storage supplyState = compSupplyState[cToken];\n        Double memory supplyIndex = Double({mantissa: supplyState.index});\n        Double memory supplierIndex = Double({\n            mantissa: compSupplierIndex[cToken][supplier]\n        });\n        compSupplierIndex[cToken][supplier] = supplyIndex.mantissa;\n\n        if (supplierIndex.mantissa == 0 && supplyIndex.mantissa > 0) {\n            supplierIndex.mantissa = compInitialIndex;\n        }\n\n        Double memory deltaIndex = sub_(supplyIndex, supplierIndex);\n        uint256 supplierTokens = CToken(cToken).balanceOf(supplier);\n        uint256 supplierDelta = mul_(supplierTokens, deltaIndex);\n        uint256 supplierAccrued = add_(compAccrued[supplier], supplierDelta);\n        compAccrued[supplier] = supplierAccrued;\n        emit DistributedSupplierComp(\n            CToken(cToken),\n            supplier,\n            supplierDelta,\n            supplyIndex.mantissa\n        );\n    }\n\n    /**\n     * @notice Calculate COMP accrued by a borrower and possibly transfer it to them\n     * @dev Borrowers will not begin to accrue until after the first interaction with the protocol.\n     * @param cToken The market in which the borrower is interacting\n     * @param borrower The address of the borrower to distribute COMP to\n     */\n    function distributeBorrowerComp(\n        address cToken,\n        address borrower,\n        Exp memory marketBorrowIndex\n    ) internal {\n        CompMarketState storage borrowState = compBorrowState[cToken];\n        Double memory borrowIndex = Double({mantissa: borrowState.index});\n        Double memory borrowerIndex = Double({\n            mantissa: compBorrowerIndex[cToken][borrower]\n        });\n        compBorrowerIndex[cToken][borrower] = borrowIndex.mantissa;\n\n        if (borrowerIndex.mantissa > 0) {\n            Double memory deltaIndex = sub_(borrowIndex, borrowerIndex);\n            uint256 borrowerAmount = div_(\n                CToken(cToken).borrowBalanceStored(borrower),\n                marketBorrowIndex\n            );\n            uint256 borrowerDelta = mul_(borrowerAmount, deltaIndex);\n            uint256 borrowerAccrued = add_(\n                compAccrued[borrower],\n                borrowerDelta\n            );\n            compAccrued[borrower] = borrowerAccrued;\n            emit DistributedBorrowerComp(\n                CToken(cToken),\n                borrower,\n                borrowerDelta,\n                borrowIndex.mantissa\n            );\n        }\n    }\n\n    /**\n     * @notice Calculate additional accrued COMP for a contributor since last accrual\n     * @param contributor The address to calculate contributor rewards for\n     */\n    function updateContributorRewards(address contributor) public {\n        uint256 compSpeed = compContributorSpeeds[contributor];\n        uint256 blockNumber = getBlockNumber();\n        uint256 deltaBlocks = sub_(\n            blockNumber,\n            lastContributorBlock[contributor]\n        );\n        if (deltaBlocks > 0 && compSpeed > 0) {\n            uint256 newAccrued = mul_(deltaBlocks, compSpeed);\n            uint256 contributorAccrued = add_(\n                compAccrued[contributor],\n                newAccrued\n            );\n\n            compAccrued[contributor] = contributorAccrued;\n            lastContributorBlock[contributor] = blockNumber;\n        }\n    }\n\n    /**\n     * @notice Claim all the comp accrued by holder in all markets\n     * @param holder The address to claim COMP for\n     */\n    function claimComp(address holder) public {\n        return claimComp(holder, allMarkets);\n    }\n\n    /**\n     * @notice Claim all the comp accrued by holder in the specified markets\n     * @param holder The address to claim COMP for\n     * @param cTokens The list of markets to claim COMP in\n     */\n    function claimComp(address holder, CToken[] memory cTokens) public {\n        address[] memory holders = new address[](1);\n        holders[0] = holder;\n        claimComp(holders, cTokens, true, true);\n    }\n\n    /**\n     * @notice Claim all comp accrued by the holders\n     * @param holders The addresses to claim COMP for\n     * @param cTokens The list of markets to claim COMP in\n     * @param borrowers Whether or not to claim COMP earned by borrowing\n     * @param suppliers Whether or not to claim COMP earned by supplying\n     */\n    function claimComp(\n        address[] memory holders,\n        CToken[] memory cTokens,\n        bool borrowers,\n        bool suppliers\n    ) public {\n        for (uint256 i = 0; i < cTokens.length; i++) {\n            CToken cToken = cTokens[i];\n            require(markets[address(cToken)].isListed, \"market must be listed\");\n            if (borrowers == true && address(cToken) != getXinvAddress()) {\n                Exp memory borrowIndex = Exp({mantissa: cToken.borrowIndex()});\n                for (uint256 j = 0; j < holders.length; j++) {\n                    distributeBorrowerComp(\n                        address(cToken),\n                        holders[j],\n                        borrowIndex\n                    );\n                    compAccrued[holders[j]] = grantCompInternal(\n                        holders[j],\n                        compAccrued[holders[j]]\n                    );\n                }\n            }\n            if (suppliers == true) {\n                updateCompSupplyIndex(address(cToken));\n                for (uint256 j = 0; j < holders.length; j++) {\n                    distributeSupplierComp(address(cToken), holders[j]);\n                    compAccrued[holders[j]] = grantCompInternal(\n                        holders[j],\n                        compAccrued[holders[j]]\n                    );\n                }\n            }\n        }\n    }\n\n    /**\n     * @notice Transfer COMP to the user\n     * @dev Note: If there is not enough COMP, we do not perform the transfer all.\n     * @param user The address of the user to transfer COMP to\n     * @param amount The amount of COMP to (possibly) transfer\n     * @return The amount of COMP which was NOT transferred to the user\n     */\n    function grantCompInternal(address user, uint256 amount)\n        internal\n        returns (uint256)\n    {\n        IINV comp = IINV(getCompAddress());\n        uint256 allowance = comp.allowance(getTreasuryAddress(), address(this));\n        uint256 balance = comp.balanceOf(getTreasuryAddress());\n        uint256 compRemaining = allowance < balance ? allowance : balance; // minimum\n        if (amount > 0 && amount <= compRemaining) {\n            comp.transferFrom(getTreasuryAddress(), user, amount);\n            return 0;\n        }\n        return amount;\n    }\n\n    /*** Comp Distribution Admin ***/\n\n    /**\n     * @notice Transfer COMP to the recipient\n     * @dev Note: If there is not enough COMP, we do not perform the transfer all.\n     * @param recipient The address of the recipient to transfer COMP to\n     * @param amount The amount of COMP to (possibly) transfer\n     */\n    function _grantComp(address recipient, uint256 amount) public {\n        require(adminOrInitializing(), \"only admin can grant comp\");\n        uint256 amountLeft = grantCompInternal(recipient, amount);\n        require(amountLeft == 0, \"insufficient comp for grant\");\n        emit CompGranted(recipient, amount);\n    }\n\n    /**\n     * @notice Set COMP speed for a single market\n     * @param cToken The market whose COMP speed to update\n     * @param compSpeed New COMP speed for market\n     */\n    function _setCompSpeed(CToken cToken, uint256 compSpeed) public {\n        require(adminOrInitializing(), \"only admin can set comp speed\");\n        setCompSpeedInternal(cToken, compSpeed);\n    }\n\n    /**\n     * @notice Set COMP speed for a single contributor\n     * @param contributor The contributor whose COMP speed to update\n     * @param compSpeed New COMP speed for contributor\n     */\n    function _setContributorCompSpeed(address contributor, uint256 compSpeed)\n        public\n    {\n        require(adminOrInitializing(), \"only admin can set comp speed\");\n\n        // note that COMP speed could be set to 0 to halt liquidity rewards for a contributor\n        updateContributorRewards(contributor);\n        if (compSpeed == 0) {\n            // release storage\n            delete lastContributorBlock[contributor];\n        } else {\n            lastContributorBlock[contributor] = getBlockNumber();\n        }\n        compContributorSpeeds[contributor] = compSpeed;\n\n        emit ContributorCompSpeedUpdated(contributor, compSpeed);\n    }\n\n    /**\n     * @notice Return all of the markets\n     * @dev The automatic getter may be used to access an individual market.\n     * @return The list of market addresses\n     */\n    function getAllMarkets() public view returns (CToken[] memory) {\n        return allMarkets;\n    }\n\n    function getBlockNumber() public view returns (uint256) {\n        return block.number;\n    }\n\n    /**\n     * @notice Return the address of the COMP token\n     * @return The address of COMP\n     */\n    function getCompAddress() public view returns (address) {\n        return 0x41D5D79431A913C4aE7d69a668ecdfE5fF9DFB68; // INV Token\n    }\n\n    /**\n     * @notice Return the address of the Inverse treasury\n     * @return The address of treasury\n     */\n    function getTreasuryAddress() public view returns (address) {\n        return 0x926dF14a23BE491164dCF93f4c468A50ef659D5B;\n    }\n\n    /**\n     * @notice Return the address of the xINV market\n     * @return The address of xINV\n     */\n    function getXinvAddress() public view returns (address) {\n        return 0x65b35d6Eb7006e0e607BC54EB2dFD459923476fE;\n    }\n}\n","deployed_bytecode":"0x608060405234801561001057600080fd5b50600436106104745760003560e01c80636d35bf9111610257578063bb82aa5e11610146578063dcfbc0c7116100c3578063e875544611610087578063e87554461461127d578063e9af029214611285578063eabe7d91146112ab578063ede4edd0146112e1578063f851a4401461130757610474565b8063dcfbc0c71461120b578063df87544214611213578063e002460414611241578063e4028eee14611249578063e6653f3d1461127557610474565b8063ca0af0431161010a578063ca0af0431461110f578063cc7ebdc41461113d578063d02f735114611163578063da3d454c146111a9578063dce15449146111df57610474565b8063bb82aa5e14610fb5578063bdcdc25814610fbd578063bea6b8b814610ff9578063c29982381461101f578063c488847b146110c057610474565b8063986ab838116101d4578063abfceffc11610198578063abfceffc14610edb578063ac0b0bb714610f51578063b0772d0b14610f59578063b21be7fd14610f61578063baa6d7d214610f8f57610474565b8063986ab83814610e5b5780639d1b5a0a14610e81578063a76b3fda14610e89578063a7f0e23114610eaf578063aa90075414610ed357610474565b80638c57804e1161021b5780638c57804e14610d985780638e8f294b14610dbe5780638ebf636414610e06578063929fe9a114610e2557806394b2294b14610e5357610474565b80636d35bf9114610cf6578063731f0c2b14610d3c578063741b252514610d625780637dc0d1d014610d8857806387f7630314610d9057610474565b806347ef3b3b116103735780635c778605116102f0578063641cb388116102b4578063641cb38814610b125780636810dfa614610b1a5780636a56947e14610c465780636b79c38d14610c825780636d154ea514610cd057610474565b80635c7786051461098c5780635ec88c79146109c25780635f5af1aa146109e85780635fc7e71e14610a0e578063607ef6c114610a5457610474565b80634fd42e17116103375780634fd42e17146108c457806351dff989146108e157806352d84d1e1461091d57806355ee1fe11461093a578063598ee1cb1461096057610474565b806347ef3b3b146107ba5780634a584432146108065780634ada90af1461082c5780634e79238f146108345780634ef4c3e11461088e57610474565b806326782247116104015780633bcf7ec1116103c55780633bcf7ec1146107145780633c94786f1461074257806341c728b91461074a57806342cbb15c14610786578063434caf251461078e57610474565b8063267822471461067e57806327efe3cb146106865780632d70db78146106b2578063317b0b77146106d1578063391957d7146106ee57610474565b80631d7b33d7116104485780631d7b33d71461059c5780631ededc91146105d457806321af45691461061657806324008a621461063a57806324a3d6221461067657610474565b80627e3dd21461047957806318c882a5146104955780631c3db2e0146104c35780631d504dc614610576575b600080fd5b61048161130f565b604080519115158252519081900360200190f35b610481600480360360408110156104ab57600080fd5b506001600160a01b0381351690602001351515611314565b610574600480360360408110156104d957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561050357600080fd5b82018360208201111561051557600080fd5b803590602001918460208302840111600160201b8311171561053657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506114b4945050505050565b005b6105746004803603602081101561058c57600080fd5b50356001600160a01b0316611516565b6105c2600480360360208110156105b257600080fd5b50356001600160a01b0316611675565b60408051918252519081900360200190f35b610574600480360360a08110156105ea57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135611687565b61061e61168e565b604080516001600160a01b039092168252519081900360200190f35b6105c26004803603608081101561065057600080fd5b506001600160a01b0381358116916020810135821691604082013516906060013561169d565b61061e61175a565b61061e611769565b6105746004803603604081101561069c57600080fd5b506001600160a01b038135169060200135611778565b610481600480360360208110156106c857600080fd5b5035151561187b565b6105c2600480360360208110156106e757600080fd5b50356119b5565b6105746004803603602081101561070457600080fd5b50356001600160a01b0316611a62565b6104816004803603604081101561072a57600080fd5b506001600160a01b0381351690602001351515611b0e565b610481611ca9565b6105746004803603608081101561076057600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611cb9565b6105c2611cbf565b610574600480360360408110156107a457600080fd5b506001600160a01b038135169060200135611cc4565b610574600480360360c08110156107d057600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611d2b565b6105c26004803603602081101561081c57600080fd5b50356001600160a01b0316611d33565b6105c2611d45565b6108706004803603608081101561084a57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611d4b565b60408051938452602084019290925282820152519081900360600190f35b6105c2600480360360608110156108a457600080fd5b506001600160a01b03813581169160208101359091169060400135611d85565b6105c2600480360360208110156108da57600080fd5b5035611e2b565b610574600480360360808110156108f757600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611e9b565b61061e6004803603602081101561093357600080fd5b5035611eef565b6105c26004803603602081101561095057600080fd5b50356001600160a01b0316611f16565b6105746004803603604081101561097657600080fd5b506001600160a01b038135169060200135611f9b565b610574600480360360608110156109a257600080fd5b506001600160a01b03813581169160208101359091169060400135612096565b610870600480360360208110156109d857600080fd5b50356001600160a01b031661209b565b6105c2600480360360208110156109fe57600080fd5b50356001600160a01b03166120d0565b6105c2600480360360a0811015610a2457600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612154565b61057460048036036040811015610a6a57600080fd5b810190602081018135600160201b811115610a8457600080fd5b820183602082011115610a9657600080fd5b803590602001918460208302840111600160201b83111715610ab757600080fd5b919390929091602081019035600160201b811115610ad457600080fd5b820183602082011115610ae657600080fd5b803590602001918460208302840111600160201b83111715610b0757600080fd5b5090925090506122b9565b61061e612449565b61057460048036036080811015610b3057600080fd5b810190602081018135600160201b811115610b4a57600080fd5b820183602082011115610b5c57600080fd5b803590602001918460208302840111600160201b83111715610b7d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610bcc57600080fd5b820183602082011115610bde57600080fd5b803590602001918460208302840111600160201b83111715610bff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505050803515159150602001351515612461565b61057460048036036080811015610c5c57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611cb9565b610ca860048036036020811015610c9857600080fd5b50356001600160a01b0316612705565b604080516001600160e01b03909316835263ffffffff90911660208301528051918290030190f35b61048160048036036020811015610ce657600080fd5b50356001600160a01b031661272f565b610574600480360360a0811015610d0c57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135611687565b61048160048036036020811015610d5257600080fd5b50356001600160a01b0316612744565b61057460048036036020811015610d7857600080fd5b50356001600160a01b0316612759565b61061e61281c565b61048161282b565b610ca860048036036020811015610dae57600080fd5b50356001600160a01b031661283b565b610de460048036036020811015610dd457600080fd5b50356001600160a01b0316612865565b6040805193151584526020840192909252151582820152519081900360600190f35b61048160048036036020811015610e1c57600080fd5b5035151561288b565b61048160048036036040811015610e3b57600080fd5b506001600160a01b03813581169160200135166129c4565b6105c26129f7565b6105c260048036036020811015610e7157600080fd5b50356001600160a01b03166129fd565b61061e612a0f565b6105c260048036036020811015610e9f57600080fd5b50356001600160a01b0316612a27565b610eb7612b84565b604080516001600160e01b039092168252519081900360200190f35b6105c2612b97565b610f0160048036036020811015610ef157600080fd5b50356001600160a01b0316612b9d565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610f3d578181015183820152602001610f25565b505050509050019250505060405180910390f35b610481612c26565b610f01612c36565b6105c260048036036040811015610f7757600080fd5b506001600160a01b0381358116916020013516612c98565b61048160048036036020811015610fa557600080fd5b50356001600160a01b0316612cb5565b61061e612cca565b6105c260048036036080811015610fd357600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135612cd9565b6105c26004803603602081101561100f57600080fd5b50356001600160a01b0316612d69565b610f016004803603602081101561103557600080fd5b810190602081018135600160201b81111561104f57600080fd5b82018360208201111561106157600080fd5b803590602001918460208302840111600160201b8311171561108257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612d7b945050505050565b6110f6600480360360608110156110d657600080fd5b506001600160a01b03813581169160208101359091169060400135612e12565b6040805192835260208301919091528051918290030190f35b6105c26004803603604081101561112557600080fd5b506001600160a01b038135811691602001351661303a565b6105c26004803603602081101561115357600080fd5b50356001600160a01b0316613057565b6105c2600480360360a081101561117957600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135613069565b6105c2600480360360608110156111bf57600080fd5b506001600160a01b0381358116916020810135909116906040013561321d565b61061e600480360360408110156111f557600080fd5b506001600160a01b0381351690602001356135ed565b61061e613622565b6104816004803603604081101561122957600080fd5b506001600160a01b0381351690602001351515613631565b61061e6137d2565b6105c26004803603604081101561125f57600080fd5b506001600160a01b0381351690602001356137ea565b61048161399a565b6105c26139aa565b6105746004803603602081101561129b57600080fd5b50356001600160a01b03166139b0565b6105c2600480360360608110156112c157600080fd5b506001600160a01b03813581169160208101359091169060400135613a14565b6105c2600480360360208110156112f757600080fd5b50356001600160a01b0316613a4f565b61061e613d62565b600181565b6001600160a01b03821660009081526009602052604081205460ff1661136b5760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b031633148061138e57506000546001600160a01b031633145b6113c95760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b03163314806113e457506001821515145b61142e576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b0383166000818152600c6020908152604091829020805486151560ff199091168117909155825193845283830152606090830181905260069083015265426f72726f7760d01b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150805b92915050565b6040805160018082528183019092526060916020808301908038833901905050905082816000815181106114e457fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506115118183600180612461565b505050565b806001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b15801561154f57600080fd5b505afa158015611563573d6000803e3d6000fd5b505050506040513d602081101561157957600080fd5b50516001600160a01b031633146115c15760405162461bcd60e51b81526004018080602001828103825260278152602001806155be6027913960400191505060405180910390fd5b806001600160a01b031663c1e803346040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156115fc57600080fd5b505af1158015611610573d6000803e3d6000fd5b505050506040513d602081101561162657600080fd5b505115611672576040805162461bcd60e51b815260206004820152601560248201527418da185b99d9481b9bdd08185d5d1a1bdc9a5e9959605a1b604482015290519081900360640190fd5b50565b600f6020526000908152604090205481565b5050505050565b6015546001600160a01b031681565b6001600160a01b03841660009081526009602052604081205460ff166116c557506009611752565b6116cd61542f565b6040518060200160405280876001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171157600080fd5b505afa158015611725573d6000803e3d6000fd5b505050506040513d602081101561173b57600080fd5b50519052905061174c868583613d71565b60009150505b949350505050565b600a546001600160a01b031681565b6001546001600160a01b031681565b611780613f3a565b6117d1576040805162461bcd60e51b815260206004820152601960248201527f6f6e6c792061646d696e2063616e206772616e7420636f6d7000000000000000604482015290519081900360640190fd5b60006117dd8383613f63565b90508015611832576040805162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e7420636f6d7020666f72206772616e740000000000604482015290519081900360640190fd5b604080516001600160a01b03851681526020810184905281517f98b2f82a3a07f223a0be64b3d0f47711c64dccd1feafb94aa28156b38cd9695c929181900390910190a1505050565b600a546000906001600160a01b03163314806118a157506000546001600160a01b031633145b6118dc5760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b03163314806118f757506001821515145b611941576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b600a8054831515600160b81b810260ff60b81b1990921691909117909155604080516020810192909252808252600582820152645365697a6560d81b6060830152517fef159d9a32b2472e32b098f954f3ce62d232939f1c207070b584df1814de2de09181900360800190a150805b919050565b600080546001600160a01b03163314611a15576040805162461bcd60e51b815260206004820152601f60248201527f6f6e6c792061646d696e2063616e2073657420636c6f736520666163746f7200604482015290519081900360640190fd5b6005805490839055604080518281526020810185905281517f3b9670cf975d26958e754b57098eaa2ac914d8d2a31b83257997b9f346110fd9929181900390910190a160005b9392505050565b6000546001600160a01b03163314611aab5760405162461bcd60e51b815260040180806020018281038252602681526020018061553e6026913960400191505060405180910390fd5b601580546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517feda98690e518e9a05f8ec6837663e188211b2da8f4906648b323f2c1d4434e29929181900390910190a15050565b6001600160a01b03821660009081526009602052604081205460ff16611b655760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b0316331480611b8857506000546001600160a01b031633145b611bc35760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b0316331480611bde57506001821515145b611c28576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b0383166000818152600b6020908152604091829020805486151560ff199091168117909155825193845283830152606090830181905260049083015263135a5b9d60e21b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150919050565b600a54600160a01b900460ff1681565b50505050565b435b90565b611ccc613f3a565b611d1d576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792061646d696e2063616e2073657420636f6d70207370656564000000604482015290519081900360640190fd5b611d278282614169565b5050565b505050505050565b60166020526000908152604090205481565b60065481565b600080600080600080611d608a8a8a8a61438e565b925092509250826012811115611d7257fe5b95509093509150505b9450945094915050565b6001600160a01b0383166000908152600b602052604081205460ff1615611de4576040805162461bcd60e51b815260206004820152600e60248201526d1b5a5b9d081a5cc81c185d5cd95960921b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff16611e0e5760095b9050611a5b565b611e178461471e565b611e2184846149c0565b6000949350505050565b600080546001600160a01b03163314611e5157611e4a6001600b614b9f565b90506119b0565b6006805490839055604080518281526020810185905281517faeba5a6c40a8ac138134bff1aaa65debf25971188a58804bad717f82f0ec1316929181900390910190a16000611a5b565b80158015611ea95750600082115b15611cb9576040805162461bcd60e51b815260206004820152601160248201527072656465656d546f6b656e73207a65726f60781b604482015290519081900360640190fd5b600d8181548110611efc57fe5b6000918252602090912001546001600160a01b0316905081565b600080546001600160a01b03163314611f3557611e4a60016010614b9f565b600480546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fd52b2b9b7e9ee655fcb95d2e5b9e0c9f69e7ef2b8e9d2d0ea78402d576d22e22929181900390910190a16000611a5b565b611fa3613f3a565b611ff4576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792061646d696e2063616e2073657420636f6d70207370656564000000604482015290519081900360640190fd5b611ffd82612759565b80612020576001600160a01b038216600090815260186020526040812055612042565b612028611cbf565b6001600160a01b0383166000908152601860205260409020555b6001600160a01b038216600081815260176020908152604091829020849055815184815291517f386537fa92edc3319af95f1f904dcf1900021e4f3f4e08169a577a09076e66b39281900390910190a25050565b611511565b6000806000806000806120b287600080600061438e565b9250925092508260128111156120c457fe5b97919650945092505050565b600080546001600160a01b031633146120ef57611e4a60016013614b9f565b600a80546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e9281900390910190a16000611a5b565b6001600160a01b03851660009081526009602052604081205460ff16158061219557506001600160a01b03851660009081526009602052604090205460ff16155b156121a45760095b90506122b0565b6000806121b085614c05565b919350909150600090508260128111156121c657fe5b146121e0578160128111156121d757fe5b925050506122b0565b806121ec5760036121d7565b6000886001600160a01b03166395dd9193876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d602081101561226e57600080fd5b5051604080516020810190915260055481529091506000906122909083614c25565b9050808611156122a75760119450505050506122b0565b60009450505050505b95945050505050565b6000546001600160a01b03163314806122dc57506015546001600160a01b031633145b6123175760405162461bcd60e51b81526004018080602001828103825260358152602001806155646035913960400191505060405180910390fd5b8281811580159061232757508082145b612368576040805162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a59081a5b9c1d5d609a1b604482015290519081900360640190fd5b60005b828110156124405784848281811061237f57fe5b905060200201356016600089898581811061239657fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508686828181106123d657fe5b905060200201356001600160a01b03166001600160a01b03167f6f1951b2aad10f3fc81b86d91105b413a5b3f847a34bbc5ce1904201b14438f686868481811061241c57fe5b905060200201356040518082815260200191505060405180910390a260010161236b565b50505050505050565b7365b35d6eb7006e0e607bc54eb2dfd459923476fe90565b60005b835181101561168757600084828151811061247b57fe5b6020908102919091018101516001600160a01b0381166000908152600990925260409091205490915060ff166124f0576040805162461bcd60e51b81526020600482015260156024820152741b585c9ad95d081b5d5cdd081899481b1a5cdd1959605a1b604482015290519081900360640190fd5b600184151514801561251b5750612505612449565b6001600160a01b0316816001600160a01b031614155b1561265a5761252861542f565b6040518060200160405280836001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561256c57600080fd5b505afa158015612580573d6000803e3d6000fd5b505050506040513d602081101561259657600080fd5b50519052905060005b8751811015612657576125c6838983815181106125b857fe5b602002602001015184613d71565b61261b8882815181106125d557fe5b6020026020010151601460008b85815181106125ed57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054613f63565b601460008a848151811061262b57fe5b6020908102919091018101516001600160a01b031682528101919091526040016000205560010161259f565b50505b600183151514156126fc5761266e8161471e565b60005b86518110156126fa576126978288838151811061268a57fe5b60200260200101516149c0565b6126be8782815181106126a657fe5b6020026020010151601460008a85815181106125ed57fe5b601460008984815181106126ce57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600101612671565b505b50600101612464565b6010602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b600c6020526000908152604090205460ff1681565b600b6020526000908152604090205460ff1681565b6001600160a01b0381166000908152601760205260408120549061277b611cbf565b6001600160a01b038416600090815260186020526040812054919250906127a3908390614c44565b90506000811180156127b55750600083115b15611cb95760006127c68285614c7e565b6001600160a01b038616600090815260146020526040812054919250906127ed9083614cc0565b6001600160a01b0387166000908152601460209081526040808320939093556018905220849055505050505050565b6004546001600160a01b031681565b600a54600160b01b900460ff1681565b6011602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b60096020526000908152604090208054600182015460039092015460ff91821692911683565b600a546000906001600160a01b03163314806128b157506000546001600160a01b031633145b6128ec5760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b031633148061290757506001821515145b612951576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b600a8054831515600160b01b810260ff60b01b1990921691909117909155604080516020810192909252808252600882820152672a3930b739b332b960c11b6060830152517fef159d9a32b2472e32b098f954f3ce62d232939f1c207070b584df1814de2de09181900360800190a15090565b6001600160a01b038082166000908152600960209081526040808320938616835260029093019052205460ff1692915050565b60075481565b60176020526000908152604090205481565b7341d5d79431a913c4ae7d69a668ecdfe5ff9dfb6890565b600080546001600160a01b03163314612a4657611e4a60016012614b9f565b6001600160a01b03821660009081526009602052604090205460ff1615612a7357611e4a600a6011614b9f565b816001600160a01b031663fe9c44ae6040518163ffffffff1660e01b815260040160206040518083038186803b158015612aac57600080fd5b505afa158015612ac0573d6000803e3d6000fd5b505050506040513d6020811015612ad657600080fd5b5050604080516060810182526001808252600060208381018281528486018381526001600160a01b03891684526009909252949091209251835490151560ff19918216178455935191830191909155516003909101805491151591909216179055612b4082614cf6565b604080516001600160a01b038416815290517fcf583bb0c569eb967f806b11601c4cb93c10310485c67add5f8362c2f212321f9181900360200190a1600092915050565b6ec097ce7bc90715b34b9f100000000081565b600e5481565b60608060086000846001600160a01b03166001600160a01b03168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015612c1957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612bfb575b5093979650505050505050565b600a54600160b81b900460ff1681565b6060600d805480602002602001604051908101604052809291908181526020018280548015612c8e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c70575b5050505050905090565b601260209081526000928352604080842090915290825290205481565b60196020526000908152604090205460ff1681565b6002546001600160a01b031681565b600a54600090600160b01b900460ff1615612d30576040805162461bcd60e51b81526020600482015260126024820152711d1c985b9cd9995c881a5cc81c185d5cd95960721b604482015290519081900360640190fd5b6000612d3d868685614dd4565b90508015612d4c579050611752565b612d558661471e565b612d5f86866149c0565b61174c86856149c0565b60186020526000908152604090205481565b6060600082519050606081604051908082528060200260200182016040528015612daf578160200160208202803883390190505b50905060005b82811015612e0a576000858281518110612dcb57fe5b60200260200101519050612ddf8133614e80565b6012811115612dea57fe5b838381518110612df657fe5b602090810291909101015250600101612db5565b509392505050565b600480546040805163fc57d4df60e01b81526001600160a01b038781169482019490945290516000938493849391169163fc57d4df91602480820192602092909190829003018186803b158015612e6857600080fd5b505afa158015612e7c573d6000803e3d6000fd5b505050506040513d6020811015612e9257600080fd5b5051600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051939450600093929091169163fc57d4df91602480820192602092909190829003018186803b158015612eeb57600080fd5b505afa158015612eff573d6000803e3d6000fd5b505050506040513d6020811015612f1557600080fd5b50519050811580612f24575080155b15612f3957600d935060009250613032915050565b6000866001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b158015612f7457600080fd5b505afa158015612f88573d6000803e3d6000fd5b505050506040513d6020811015612f9e57600080fd5b505190506000612fac61542f565b612fb461542f565b612fbc61542f565b612fe4604051806020016040528060065481525060405180602001604052808a815250614f76565b925061300c604051806020016040528088815250604051806020016040528088815250614f76565b91506130188383614fb5565b9050613024818b614c25565b600099509750505050505050505b935093915050565b601360209081526000928352604080842090915290825290205481565b60146020526000908152604090205481565b600a54600090600160b81b900460ff16156130bd576040805162461bcd60e51b815260206004820152600f60248201526e1cd95a5e99481a5cc81c185d5cd959608a1b604482015290519081900360640190fd5b6001600160a01b03861660009081526009602052604090205460ff1615806130fe57506001600160a01b03851660009081526009602052604090205460ff16155b1561310a57600961219d565b846001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561314357600080fd5b505afa158015613157573d6000803e3d6000fd5b505050506040513d602081101561316d57600080fd5b505160408051635fe3b56760e01b815290516001600160a01b0392831692891691635fe3b567916004808301926020929190829003018186803b1580156131b357600080fd5b505afa1580156131c7573d6000803e3d6000fd5b505050506040513d60208110156131dd57600080fd5b50516001600160a01b0316146131f457600261219d565b6131fd8661471e565b61320786846149c0565b61321186856149c0565b60009695505050505050565b6001600160a01b0383166000908152600c602052604081205460ff161561327e576040805162461bcd60e51b815260206004820152601060248201526f189bdc9c9bddc81a5cc81c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff166132a5576009611e07565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff1661339557336001600160a01b0385161461332b576040805162461bcd60e51b815260206004820152601560248201527439b2b73232b91036bab9ba1031329031aa37b5b2b760591b604482015290519081900360640190fd5b60006133373385614e80565b9050600081601281111561334757fe5b146133605780601281111561335857fe5b915050611a5b565b6001600160a01b038086166000908152600960209081526040808320938816835260029093019052205460ff1661339357fe5b505b600480546040805163fc57d4df60e01b81526001600160a01b03888116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b1580156133e657600080fd5b505afa1580156133fa573d6000803e3d6000fd5b505050506040513d602081101561341057600080fd5b505161341d57600d611e07565b6001600160a01b038416600090815260166020526040902054801561350a576000856001600160a01b03166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b15801561347757600080fd5b505afa15801561348b573d6000803e3d6000fd5b505050506040513d60208110156134a157600080fd5b5051905060006134b18286614cc0565b9050828110613507576040805162461bcd60e51b815260206004820152601960248201527f6d61726b657420626f72726f7720636170207265616368656400000000000000604482015290519081900360640190fd5b50505b60008061351a868860008861438e565b9193509091506000905082601281111561353057fe5b1461354b5781601281111561354157fe5b9350505050611a5b565b8015613558576004613541565b61356061542f565b6040518060200160405280896001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156135a457600080fd5b505afa1580156135b8573d6000803e3d6000fd5b505050506040513d60208110156135ce57600080fd5b5051905290506135df888883613d71565b600098975050505050505050565b6008602052816000526040600020818154811061360657fe5b6000918252602090912001546001600160a01b03169150829050565b6003546001600160a01b031681565b6001600160a01b03821660009081526009602052604081205460ff166136885760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b03163314806136ab57506000546001600160a01b031633145b6136e65760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b031633148061370157506001821515145b61374b576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b038316600081815260196020908152604091829020805486151560ff1990911681179091558251938452838301526060908301819052600a908301526910dbdb1b185d195c985b60b21b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150919050565b73926df14a23be491164dcf93f4c468a50ef659d5b90565b600080546001600160a01b031633146138105761380960016006614b9f565b90506114ae565b6001600160a01b0383166000908152600960205260409020805460ff166138455761383d60096007614b9f565b9150506114ae565b61384d61542f565b50604080516020810190915283815261386461542f565b506040805160208101909152670c7d713b49da000081526138858183614ff1565b156138a05761389660066008614b9f565b93505050506114ae565b84158015906139295750600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b1580156138fb57600080fd5b505afa15801561390f573d6000803e3d6000fd5b505050506040513d602081101561392557600080fd5b5051155b1561393a57613896600d6009614b9f565b60018301805490869055604080516001600160a01b03891681526020810183905280820188905290517f70483e6592cd5182d45ac970e05bc62cdcc90e9d8ef2c2dbe686cf383bcd7fc59181900360600190a16000979650505050505050565b600a54600160a81b900460ff1681565b60055481565b61167281600d805480602002602001604051908101604052809291908181526020018280548015613a0a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116139ec575b50505050506114b4565b600080613a22858585614dd4565b90508015613a31579050611a5b565b613a3a8561471e565b613a4485856149c0565b600095945050505050565b6000808290506000806000836001600160a01b031663c37f68e2336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b158015613ab057600080fd5b505afa158015613ac4573d6000803e3d6000fd5b505050506040513d6080811015613ada57600080fd5b508051602082015160409092015190945090925090508215613b2d5760405162461bcd60e51b81526004018080602001828103825260258152602001806155996025913960400191505060405180910390fd5b8015613b4a57613b3f600c6002614b9f565b9450505050506119b0565b6000613b57873385614dd4565b90508015613b7857613b6c600e600383614ff8565b955050505050506119b0565b6001600160a01b0385166000908152600960209081526040808320338452600281019092529091205460ff16613bb757600096505050505050506119b0565b3360009081526002820160209081526040808320805460ff191690556008825291829020805483518184028101840190945280845260609392830182828015613c2957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613c0b575b5050835193945083925060009150505b82811015613c7e57896001600160a01b0316848281518110613c5757fe5b60200260200101516001600160a01b03161415613c7657809150613c7e565b600101613c39565b50818110613c8857fe5b336000908152600860205260409020805481906000198101908110613ca957fe5b9060005260206000200160009054906101000a90046001600160a01b0316818381548110613cd357fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558054613d0c826000198301615442565b50604080516001600160a01b038c16815233602082015281517fe699a64c18b07ac5b7301aa273f36a2287239eb9501d81950672794afba29a0d929181900390910190a160009c9b505050505050505050505050565b6000546001600160a01b031681565b6001600160a01b0383166000908152601160205260409020613d9161542f565b50604080516020810190915281546001600160e01b03168152613db261542f565b5060408051602080820183526001600160a01b0380891660009081526013835284812091891680825282845294812080548552865195909152915291909155805115611d2b57613e0061542f565b613e0a838361505e565b90506000613e99886001600160a01b03166395dd9193896040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015613e6757600080fd5b505afa158015613e7b573d6000803e3d6000fd5b505050506040513d6020811015613e9157600080fd5b505187615083565b90506000613ea782846150a1565b6001600160a01b03891660009081526014602052604081205491925090613ece9083614cc0565b6001600160a01b03808b166000818152601460209081526040918290208590558a5182518881529182015281519495509193928e16927f1fc3ecc087d8d2d15e23d0032af5a47059c3892d003d8e139fdcb6bb327c99a69281900390910190a350505050505050505050565b600080546001600160a01b0316331480613f5e57506002546001600160a01b031633145b905090565b600080613f6e612a0f565b90506000816001600160a01b031663dd62ed3e613f896137d2565b604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152306024830152516044808301926020929190829003018186803b158015613fd457600080fd5b505afa158015613fe8573d6000803e3d6000fd5b505050506040513d6020811015613ffe57600080fd5b5051905060006001600160a01b0383166370a0823161401b6137d2565b6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561406157600080fd5b505afa158015614075573d6000803e3d6000fd5b505050506040513d602081101561408b57600080fd5b50519050600081831061409e57816140a0565b825b90506000861180156140b25750808611155b1561415e57836001600160a01b03166323b872dd6140ce6137d2565b604080516001600160e01b031960e085901b1681526001600160a01b039283166004820152918b166024830152604482018a90525160648083019260209291908290030181600087803b15801561412457600080fd5b505af1158015614138573d6000803e3d6000fd5b505050506040513d602081101561414e57600080fd5b50600095506114ae945050505050565b509395945050505050565b6001600160a01b0382166000908152600f60205260409020548015614196576141918361471e565b614332565b8115614332576001600160a01b0383166000908152600960205260409020805460ff16151560011461420f576040805162461bcd60e51b815260206004820152601960248201527f636f6d70206d61726b6574206973206e6f74206c697374656400000000000000604482015290519081900360640190fd5b6001600160a01b0384166000908152601060205260409020546001600160e01b031615801561426157506001600160a01b038416600090815260106020526040902054600160e01b900463ffffffff16155b156143305760405180604001604052806ec097ce7bc90715b34b9f10000000006001600160e01b031681526020016142d561429a611cbf565b6040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b63ffffffff9081169091526001600160a01b0386166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555b505b818114611511576001600160a01b0383166000818152600f6020908152604091829020859055815185815291517f2ab93f65628379309f36cb125e90d7c902454a545c4f8b8cb0794af75c24b8079281900390910190a2505050565b600080600061439b615466565b6001600160a01b0388166000908152600860209081526040808320805482518185028101850190935280835260609383018282801561440357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116143e5575b50939450600093505050505b81518110156146df57600082828151811061442657fe5b60200260200101519050806001600160a01b031663c37f68e28d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b15801561448657600080fd5b505afa15801561449a573d6000803e3d6000fd5b505050506040513d60808110156144b057600080fd5b508051602082015160408084015160609485015160808b01529389019390935291870191909152935083156144f55750600f965060009550859450611d7b9350505050565b6001600160a01b03811660009081526019602052604090205460ff16151560011480156145225750600089115b8015614532575060008560400151115b1561454d57506012965060009550859450611d7b9350505050565b60408051602080820183526001600160a01b0380851660008181526009845285902060010154845260c08a01939093528351808301855260808a0151815260e08a015260048054855163fc57d4df60e01b815291820194909452935192169263fc57d4df9260248083019392829003018186803b1580156145cd57600080fd5b505afa1580156145e1573d6000803e3d6000fd5b505050506040513d60208110156145f757600080fd5b505160a0860181905261461a5750600d965060009550859450611d7b9350505050565b604080516020810190915260a0860151815261010086015260c085015160e08601516146549161464991614f76565b866101000151614f76565b61012086018190526040860151865161466e92919061516a565b85526101008501516060860151602087015161468b92919061516a565b60208601526001600160a01b03818116908c1614156146d6576146b88561012001518b876020015161516a565b602086018190526101008601516146d0918b9061516a565b60208601525b5060010161440f565b506020830151835111156147055750506020810151905160009450039150829050611d7b565b5050805160209091015160009450849350039050611d7b565b6001600160a01b0381166000908152601060209081526040808320600f909252822054909161474b611cbf565b835490915060009061476b908390600160e01b900463ffffffff16614c44565b905060008111801561477d5750600083115b15614955576000856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156147bd57600080fd5b505afa1580156147d1573d6000803e3d6000fd5b505050506040513d60208110156147e757600080fd5b5051905060006147f78386614c7e565b905061480161542f565b6000831161481e5760405180602001604052806000815250614828565b6148288284615192565b905061483261542f565b604080516020810190915288546001600160e01b0316815261485490836151c7565b905060405180604001604052806148a483600001516040518060400160405280601a81526020017f6e657720696e64657820657863656564732032323420626974730000000000008152506151ec565b6001600160e01b031681526020016148f1886040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b63ffffffff9081169091526001600160a01b038b166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555061168792505050565b80156116875761499a826040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b845463ffffffff91909116600160e01b026001600160e01b039091161784555050505050565b6001600160a01b03821660009081526010602052604090206149e061542f565b50604080516020810190915281546001600160e01b03168152614a0161542f565b5060408051602080820183526001600160a01b03808816600090815260128352848120918816808252828452948120805485528651959091529152919091558051158015614a4f5750815115155b15614a67576ec097ce7bc90715b34b9f100000000081525b614a6f61542f565b614a79838361505e565b90506000866001600160a01b03166370a08231876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015614ad357600080fd5b505afa158015614ae7573d6000803e3d6000fd5b505050506040513d6020811015614afd57600080fd5b505190506000614b0d82846150a1565b6001600160a01b03881660009081526014602052604081205491925090614b349083614cc0565b6001600160a01b03808a166000818152601460209081526040918290208590558a5182518881529182015281519495509193928d16927f2caecd17d02f56fa897705dcc740da2d237c373f70686f4e0d9bd3bf0400ea7a9281900390910190a3505050505050505050565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa0836012811115614bce57fe5b836013811115614bda57fe5b604080519283526020830191909152600082820152519081900360600190a1826012811115611a5b57fe5b6000806000614c1884600080600061438e565b9250925092509193909250565b6000614c2f61542f565b614c398484615241565b905061175281615262565b6000611a5b8383604051806040016040528060158152602001747375627472616374696f6e20756e646572666c6f7760581b815250615271565b6000611a5b83836040518060400160405280601781526020017f6d756c7469706c69636174696f6e206f766572666c6f770000000000000000008152506152cb565b6000611a5b8383604051806040016040528060118152602001706164646974696f6e206f766572666c6f7760781b81525061534a565b60005b600d54811015614d8157816001600160a01b0316600d8281548110614d1a57fe5b6000918252602090912001546001600160a01b03161415614d79576040805162461bcd60e51b81526020600482015260146024820152731b585c9ad95d08185b1c9958591e48185919195960621b604482015290519081900360640190fd5b600101614cf9565b50600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831660009081526009602052604081205460ff16614dfb576009611e07565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff16614e33576000611e07565b600080614e43858786600061438e565b91935090915060009050826012811115614e5957fe5b14614e7357816012811115614e6a57fe5b92505050611a5b565b8015613211576004614e6a565b6001600160a01b0382166000908152600960205260408120805460ff16614eab5760099150506114ae565b6001600160a01b038316600090815260028201602052604090205460ff16151560011415614edd5760009150506114ae565b6001600160a01b0380841660008181526002840160209081526040808320805460ff19166001908117909155600883528184208054918201815584529282902090920180549489166001600160a01b031990951685179055815193845283019190915280517f3ab23ab0d51cccc0c3085aec51f99228625aa1a922b3a8ca89a26b0f2027a1a59281900390910190a15060009392505050565b614f7e61542f565b6040518060200160405280670de0b6b3a7640000614fa486600001518660000151614c7e565b81614fab57fe5b0490529392505050565b614fbd61542f565b6040518060200160405280614fe8614fe18660000151670de0b6b3a7640000614c7e565b855161539f565b90529392505050565b5190511090565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa084601281111561502757fe5b84601381111561503357fe5b604080519283526020830191909152818101859052519081900360600190a183601281111561175257fe5b61506661542f565b6040518060200160405280614fe885600001518560000151614c44565b6000611a5b61509a84670de0b6b3a7640000614c7e565b835161539f565b60006ec097ce7bc90715b34b9f10000000006150c1848460000151614c7e565b816150c857fe5b049392505050565b600081600160201b84106151625760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561512757818101518382015260200161510f565b50505050905090810190601f1680156151545780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b600061517461542f565b61517e8585615241565b90506122b061518c82615262565b84614cc0565b61519a61542f565b6040518060200160405280614fe86151c1866ec097ce7bc90715b34b9f1000000000614c7e565b8561539f565b6151cf61542f565b6040518060200160405280614fe885600001518560000151614cc0565b600081600160e01b84106151625760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b61524961542f565b6040518060200160405280614fe8856000015185614c7e565b51670de0b6b3a7640000900490565b600081848411156152c35760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b505050900390565b60008315806152d8575082155b156152e557506000611a5b565b838302838582816152f257fe5b041483906153415760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b50949350505050565b600083830182858210156153415760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b6000611a5b83836040518060400160405280600e81526020016d646976696465206279207a65726f60901b8152506000818361541c5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b5082848161542657fe5b04949350505050565b6040518060200160405280600081525090565b815481835581811115611511576000838152602090206115119181019083016154d0565b6040518061014001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016154a461542f565b81526020016154b161542f565b81526020016154be61542f565b81526020016154cb61542f565b905290565b611cc191905b808211156154ea57600081556001016154d6565b509056fe63616e6e6f742070617573652061206d61726b65742074686174206973206e6f74206c69737465646f6e6c7920706175736520677561726469616e20616e642061646d696e2063616e2070617573656f6e6c792061646d696e2063616e2073657420626f72726f772063617020677561726469616e6f6e6c792061646d696e206f7220626f72726f772063617020677561726469616e2063616e2073657420626f72726f772063617073657869744d61726b65743a206765744163636f756e74536e617073686f74206661696c65646f6e6c7920756e6974726f6c6c65722061646d696e2063616e206368616e676520627261696e73a265627a7a72315820247d83c3f5dec80e7618305c55231aa7b691acde7f1f776dc38e3ae9bf90217564736f6c63430005110032","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"optimizer":{"enabled":true,"runs":200}},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":null,"compiler_version":"0.5.17+commit.d19bba13","is_verified_via_verifier_alliance":true,"verified_at":"2025-10-18T21:22:33.978493Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x608060405234801561001057600080fd5b50600080546001600160a01b0319163317905561561980620000336000396000f3fe608060405234801561001057600080fd5b50600436106104745760003560e01c80636d35bf9111610257578063bb82aa5e11610146578063dcfbc0c7116100c3578063e875544611610087578063e87554461461127d578063e9af029214611285578063eabe7d91146112ab578063ede4edd0146112e1578063f851a4401461130757610474565b8063dcfbc0c71461120b578063df87544214611213578063e002460414611241578063e4028eee14611249578063e6653f3d1461127557610474565b8063ca0af0431161010a578063ca0af0431461110f578063cc7ebdc41461113d578063d02f735114611163578063da3d454c146111a9578063dce15449146111df57610474565b8063bb82aa5e14610fb5578063bdcdc25814610fbd578063bea6b8b814610ff9578063c29982381461101f578063c488847b146110c057610474565b8063986ab838116101d4578063abfceffc11610198578063abfceffc14610edb578063ac0b0bb714610f51578063b0772d0b14610f59578063b21be7fd14610f61578063baa6d7d214610f8f57610474565b8063986ab83814610e5b5780639d1b5a0a14610e81578063a76b3fda14610e89578063a7f0e23114610eaf578063aa90075414610ed357610474565b80638c57804e1161021b5780638c57804e14610d985780638e8f294b14610dbe5780638ebf636414610e06578063929fe9a114610e2557806394b2294b14610e5357610474565b80636d35bf9114610cf6578063731f0c2b14610d3c578063741b252514610d625780637dc0d1d014610d8857806387f7630314610d9057610474565b806347ef3b3b116103735780635c778605116102f0578063641cb388116102b4578063641cb38814610b125780636810dfa614610b1a5780636a56947e14610c465780636b79c38d14610c825780636d154ea514610cd057610474565b80635c7786051461098c5780635ec88c79146109c25780635f5af1aa146109e85780635fc7e71e14610a0e578063607ef6c114610a5457610474565b80634fd42e17116103375780634fd42e17146108c457806351dff989146108e157806352d84d1e1461091d57806355ee1fe11461093a578063598ee1cb1461096057610474565b806347ef3b3b146107ba5780634a584432146108065780634ada90af1461082c5780634e79238f146108345780634ef4c3e11461088e57610474565b806326782247116104015780633bcf7ec1116103c55780633bcf7ec1146107145780633c94786f1461074257806341c728b91461074a57806342cbb15c14610786578063434caf251461078e57610474565b8063267822471461067e57806327efe3cb146106865780632d70db78146106b2578063317b0b77146106d1578063391957d7146106ee57610474565b80631d7b33d7116104485780631d7b33d71461059c5780631ededc91146105d457806321af45691461061657806324008a621461063a57806324a3d6221461067657610474565b80627e3dd21461047957806318c882a5146104955780631c3db2e0146104c35780631d504dc614610576575b600080fd5b61048161130f565b604080519115158252519081900360200190f35b610481600480360360408110156104ab57600080fd5b506001600160a01b0381351690602001351515611314565b610574600480360360408110156104d957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561050357600080fd5b82018360208201111561051557600080fd5b803590602001918460208302840111600160201b8311171561053657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506114b4945050505050565b005b6105746004803603602081101561058c57600080fd5b50356001600160a01b0316611516565b6105c2600480360360208110156105b257600080fd5b50356001600160a01b0316611675565b60408051918252519081900360200190f35b610574600480360360a08110156105ea57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135611687565b61061e61168e565b604080516001600160a01b039092168252519081900360200190f35b6105c26004803603608081101561065057600080fd5b506001600160a01b0381358116916020810135821691604082013516906060013561169d565b61061e61175a565b61061e611769565b6105746004803603604081101561069c57600080fd5b506001600160a01b038135169060200135611778565b610481600480360360208110156106c857600080fd5b5035151561187b565b6105c2600480360360208110156106e757600080fd5b50356119b5565b6105746004803603602081101561070457600080fd5b50356001600160a01b0316611a62565b6104816004803603604081101561072a57600080fd5b506001600160a01b0381351690602001351515611b0e565b610481611ca9565b6105746004803603608081101561076057600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611cb9565b6105c2611cbf565b610574600480360360408110156107a457600080fd5b506001600160a01b038135169060200135611cc4565b610574600480360360c08110156107d057600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611d2b565b6105c26004803603602081101561081c57600080fd5b50356001600160a01b0316611d33565b6105c2611d45565b6108706004803603608081101561084a57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611d4b565b60408051938452602084019290925282820152519081900360600190f35b6105c2600480360360608110156108a457600080fd5b506001600160a01b03813581169160208101359091169060400135611d85565b6105c2600480360360208110156108da57600080fd5b5035611e2b565b610574600480360360808110156108f757600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611e9b565b61061e6004803603602081101561093357600080fd5b5035611eef565b6105c26004803603602081101561095057600080fd5b50356001600160a01b0316611f16565b6105746004803603604081101561097657600080fd5b506001600160a01b038135169060200135611f9b565b610574600480360360608110156109a257600080fd5b506001600160a01b03813581169160208101359091169060400135612096565b610870600480360360208110156109d857600080fd5b50356001600160a01b031661209b565b6105c2600480360360208110156109fe57600080fd5b50356001600160a01b03166120d0565b6105c2600480360360a0811015610a2457600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612154565b61057460048036036040811015610a6a57600080fd5b810190602081018135600160201b811115610a8457600080fd5b820183602082011115610a9657600080fd5b803590602001918460208302840111600160201b83111715610ab757600080fd5b919390929091602081019035600160201b811115610ad457600080fd5b820183602082011115610ae657600080fd5b803590602001918460208302840111600160201b83111715610b0757600080fd5b5090925090506122b9565b61061e612449565b61057460048036036080811015610b3057600080fd5b810190602081018135600160201b811115610b4a57600080fd5b820183602082011115610b5c57600080fd5b803590602001918460208302840111600160201b83111715610b7d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610bcc57600080fd5b820183602082011115610bde57600080fd5b803590602001918460208302840111600160201b83111715610bff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505050803515159150602001351515612461565b61057460048036036080811015610c5c57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611cb9565b610ca860048036036020811015610c9857600080fd5b50356001600160a01b0316612705565b604080516001600160e01b03909316835263ffffffff90911660208301528051918290030190f35b61048160048036036020811015610ce657600080fd5b50356001600160a01b031661272f565b610574600480360360a0811015610d0c57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135611687565b61048160048036036020811015610d5257600080fd5b50356001600160a01b0316612744565b61057460048036036020811015610d7857600080fd5b50356001600160a01b0316612759565b61061e61281c565b61048161282b565b610ca860048036036020811015610dae57600080fd5b50356001600160a01b031661283b565b610de460048036036020811015610dd457600080fd5b50356001600160a01b0316612865565b6040805193151584526020840192909252151582820152519081900360600190f35b61048160048036036020811015610e1c57600080fd5b5035151561288b565b61048160048036036040811015610e3b57600080fd5b506001600160a01b03813581169160200135166129c4565b6105c26129f7565b6105c260048036036020811015610e7157600080fd5b50356001600160a01b03166129fd565b61061e612a0f565b6105c260048036036020811015610e9f57600080fd5b50356001600160a01b0316612a27565b610eb7612b84565b604080516001600160e01b039092168252519081900360200190f35b6105c2612b97565b610f0160048036036020811015610ef157600080fd5b50356001600160a01b0316612b9d565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610f3d578181015183820152602001610f25565b505050509050019250505060405180910390f35b610481612c26565b610f01612c36565b6105c260048036036040811015610f7757600080fd5b506001600160a01b0381358116916020013516612c98565b61048160048036036020811015610fa557600080fd5b50356001600160a01b0316612cb5565b61061e612cca565b6105c260048036036080811015610fd357600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135612cd9565b6105c26004803603602081101561100f57600080fd5b50356001600160a01b0316612d69565b610f016004803603602081101561103557600080fd5b810190602081018135600160201b81111561104f57600080fd5b82018360208201111561106157600080fd5b803590602001918460208302840111600160201b8311171561108257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612d7b945050505050565b6110f6600480360360608110156110d657600080fd5b506001600160a01b03813581169160208101359091169060400135612e12565b6040805192835260208301919091528051918290030190f35b6105c26004803603604081101561112557600080fd5b506001600160a01b038135811691602001351661303a565b6105c26004803603602081101561115357600080fd5b50356001600160a01b0316613057565b6105c2600480360360a081101561117957600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135613069565b6105c2600480360360608110156111bf57600080fd5b506001600160a01b0381358116916020810135909116906040013561321d565b61061e600480360360408110156111f557600080fd5b506001600160a01b0381351690602001356135ed565b61061e613622565b6104816004803603604081101561122957600080fd5b506001600160a01b0381351690602001351515613631565b61061e6137d2565b6105c26004803603604081101561125f57600080fd5b506001600160a01b0381351690602001356137ea565b61048161399a565b6105c26139aa565b6105746004803603602081101561129b57600080fd5b50356001600160a01b03166139b0565b6105c2600480360360608110156112c157600080fd5b506001600160a01b03813581169160208101359091169060400135613a14565b6105c2600480360360208110156112f757600080fd5b50356001600160a01b0316613a4f565b61061e613d62565b600181565b6001600160a01b03821660009081526009602052604081205460ff1661136b5760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b031633148061138e57506000546001600160a01b031633145b6113c95760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b03163314806113e457506001821515145b61142e576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b0383166000818152600c6020908152604091829020805486151560ff199091168117909155825193845283830152606090830181905260069083015265426f72726f7760d01b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150805b92915050565b6040805160018082528183019092526060916020808301908038833901905050905082816000815181106114e457fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506115118183600180612461565b505050565b806001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b15801561154f57600080fd5b505afa158015611563573d6000803e3d6000fd5b505050506040513d602081101561157957600080fd5b50516001600160a01b031633146115c15760405162461bcd60e51b81526004018080602001828103825260278152602001806155be6027913960400191505060405180910390fd5b806001600160a01b031663c1e803346040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156115fc57600080fd5b505af1158015611610573d6000803e3d6000fd5b505050506040513d602081101561162657600080fd5b505115611672576040805162461bcd60e51b815260206004820152601560248201527418da185b99d9481b9bdd08185d5d1a1bdc9a5e9959605a1b604482015290519081900360640190fd5b50565b600f6020526000908152604090205481565b5050505050565b6015546001600160a01b031681565b6001600160a01b03841660009081526009602052604081205460ff166116c557506009611752565b6116cd61542f565b6040518060200160405280876001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171157600080fd5b505afa158015611725573d6000803e3d6000fd5b505050506040513d602081101561173b57600080fd5b50519052905061174c868583613d71565b60009150505b949350505050565b600a546001600160a01b031681565b6001546001600160a01b031681565b611780613f3a565b6117d1576040805162461bcd60e51b815260206004820152601960248201527f6f6e6c792061646d696e2063616e206772616e7420636f6d7000000000000000604482015290519081900360640190fd5b60006117dd8383613f63565b90508015611832576040805162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e7420636f6d7020666f72206772616e740000000000604482015290519081900360640190fd5b604080516001600160a01b03851681526020810184905281517f98b2f82a3a07f223a0be64b3d0f47711c64dccd1feafb94aa28156b38cd9695c929181900390910190a1505050565b600a546000906001600160a01b03163314806118a157506000546001600160a01b031633145b6118dc5760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b03163314806118f757506001821515145b611941576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b600a8054831515600160b81b810260ff60b81b1990921691909117909155604080516020810192909252808252600582820152645365697a6560d81b6060830152517fef159d9a32b2472e32b098f954f3ce62d232939f1c207070b584df1814de2de09181900360800190a150805b919050565b600080546001600160a01b03163314611a15576040805162461bcd60e51b815260206004820152601f60248201527f6f6e6c792061646d696e2063616e2073657420636c6f736520666163746f7200604482015290519081900360640190fd5b6005805490839055604080518281526020810185905281517f3b9670cf975d26958e754b57098eaa2ac914d8d2a31b83257997b9f346110fd9929181900390910190a160005b9392505050565b6000546001600160a01b03163314611aab5760405162461bcd60e51b815260040180806020018281038252602681526020018061553e6026913960400191505060405180910390fd5b601580546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517feda98690e518e9a05f8ec6837663e188211b2da8f4906648b323f2c1d4434e29929181900390910190a15050565b6001600160a01b03821660009081526009602052604081205460ff16611b655760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b0316331480611b8857506000546001600160a01b031633145b611bc35760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b0316331480611bde57506001821515145b611c28576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b0383166000818152600b6020908152604091829020805486151560ff199091168117909155825193845283830152606090830181905260049083015263135a5b9d60e21b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150919050565b600a54600160a01b900460ff1681565b50505050565b435b90565b611ccc613f3a565b611d1d576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792061646d696e2063616e2073657420636f6d70207370656564000000604482015290519081900360640190fd5b611d278282614169565b5050565b505050505050565b60166020526000908152604090205481565b60065481565b600080600080600080611d608a8a8a8a61438e565b925092509250826012811115611d7257fe5b95509093509150505b9450945094915050565b6001600160a01b0383166000908152600b602052604081205460ff1615611de4576040805162461bcd60e51b815260206004820152600e60248201526d1b5a5b9d081a5cc81c185d5cd95960921b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff16611e0e5760095b9050611a5b565b611e178461471e565b611e2184846149c0565b6000949350505050565b600080546001600160a01b03163314611e5157611e4a6001600b614b9f565b90506119b0565b6006805490839055604080518281526020810185905281517faeba5a6c40a8ac138134bff1aaa65debf25971188a58804bad717f82f0ec1316929181900390910190a16000611a5b565b80158015611ea95750600082115b15611cb9576040805162461bcd60e51b815260206004820152601160248201527072656465656d546f6b656e73207a65726f60781b604482015290519081900360640190fd5b600d8181548110611efc57fe5b6000918252602090912001546001600160a01b0316905081565b600080546001600160a01b03163314611f3557611e4a60016010614b9f565b600480546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fd52b2b9b7e9ee655fcb95d2e5b9e0c9f69e7ef2b8e9d2d0ea78402d576d22e22929181900390910190a16000611a5b565b611fa3613f3a565b611ff4576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792061646d696e2063616e2073657420636f6d70207370656564000000604482015290519081900360640190fd5b611ffd82612759565b80612020576001600160a01b038216600090815260186020526040812055612042565b612028611cbf565b6001600160a01b0383166000908152601860205260409020555b6001600160a01b038216600081815260176020908152604091829020849055815184815291517f386537fa92edc3319af95f1f904dcf1900021e4f3f4e08169a577a09076e66b39281900390910190a25050565b611511565b6000806000806000806120b287600080600061438e565b9250925092508260128111156120c457fe5b97919650945092505050565b600080546001600160a01b031633146120ef57611e4a60016013614b9f565b600a80546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e9281900390910190a16000611a5b565b6001600160a01b03851660009081526009602052604081205460ff16158061219557506001600160a01b03851660009081526009602052604090205460ff16155b156121a45760095b90506122b0565b6000806121b085614c05565b919350909150600090508260128111156121c657fe5b146121e0578160128111156121d757fe5b925050506122b0565b806121ec5760036121d7565b6000886001600160a01b03166395dd9193876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d602081101561226e57600080fd5b5051604080516020810190915260055481529091506000906122909083614c25565b9050808611156122a75760119450505050506122b0565b60009450505050505b95945050505050565b6000546001600160a01b03163314806122dc57506015546001600160a01b031633145b6123175760405162461bcd60e51b81526004018080602001828103825260358152602001806155646035913960400191505060405180910390fd5b8281811580159061232757508082145b612368576040805162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a59081a5b9c1d5d609a1b604482015290519081900360640190fd5b60005b828110156124405784848281811061237f57fe5b905060200201356016600089898581811061239657fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508686828181106123d657fe5b905060200201356001600160a01b03166001600160a01b03167f6f1951b2aad10f3fc81b86d91105b413a5b3f847a34bbc5ce1904201b14438f686868481811061241c57fe5b905060200201356040518082815260200191505060405180910390a260010161236b565b50505050505050565b7365b35d6eb7006e0e607bc54eb2dfd459923476fe90565b60005b835181101561168757600084828151811061247b57fe5b6020908102919091018101516001600160a01b0381166000908152600990925260409091205490915060ff166124f0576040805162461bcd60e51b81526020600482015260156024820152741b585c9ad95d081b5d5cdd081899481b1a5cdd1959605a1b604482015290519081900360640190fd5b600184151514801561251b5750612505612449565b6001600160a01b0316816001600160a01b031614155b1561265a5761252861542f565b6040518060200160405280836001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561256c57600080fd5b505afa158015612580573d6000803e3d6000fd5b505050506040513d602081101561259657600080fd5b50519052905060005b8751811015612657576125c6838983815181106125b857fe5b602002602001015184613d71565b61261b8882815181106125d557fe5b6020026020010151601460008b85815181106125ed57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054613f63565b601460008a848151811061262b57fe5b6020908102919091018101516001600160a01b031682528101919091526040016000205560010161259f565b50505b600183151514156126fc5761266e8161471e565b60005b86518110156126fa576126978288838151811061268a57fe5b60200260200101516149c0565b6126be8782815181106126a657fe5b6020026020010151601460008a85815181106125ed57fe5b601460008984815181106126ce57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002055600101612671565b505b50600101612464565b6010602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b600c6020526000908152604090205460ff1681565b600b6020526000908152604090205460ff1681565b6001600160a01b0381166000908152601760205260408120549061277b611cbf565b6001600160a01b038416600090815260186020526040812054919250906127a3908390614c44565b90506000811180156127b55750600083115b15611cb95760006127c68285614c7e565b6001600160a01b038616600090815260146020526040812054919250906127ed9083614cc0565b6001600160a01b0387166000908152601460209081526040808320939093556018905220849055505050505050565b6004546001600160a01b031681565b600a54600160b01b900460ff1681565b6011602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b60096020526000908152604090208054600182015460039092015460ff91821692911683565b600a546000906001600160a01b03163314806128b157506000546001600160a01b031633145b6128ec5760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b031633148061290757506001821515145b612951576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b600a8054831515600160b01b810260ff60b01b1990921691909117909155604080516020810192909252808252600882820152672a3930b739b332b960c11b6060830152517fef159d9a32b2472e32b098f954f3ce62d232939f1c207070b584df1814de2de09181900360800190a15090565b6001600160a01b038082166000908152600960209081526040808320938616835260029093019052205460ff1692915050565b60075481565b60176020526000908152604090205481565b7341d5d79431a913c4ae7d69a668ecdfe5ff9dfb6890565b600080546001600160a01b03163314612a4657611e4a60016012614b9f565b6001600160a01b03821660009081526009602052604090205460ff1615612a7357611e4a600a6011614b9f565b816001600160a01b031663fe9c44ae6040518163ffffffff1660e01b815260040160206040518083038186803b158015612aac57600080fd5b505afa158015612ac0573d6000803e3d6000fd5b505050506040513d6020811015612ad657600080fd5b5050604080516060810182526001808252600060208381018281528486018381526001600160a01b03891684526009909252949091209251835490151560ff19918216178455935191830191909155516003909101805491151591909216179055612b4082614cf6565b604080516001600160a01b038416815290517fcf583bb0c569eb967f806b11601c4cb93c10310485c67add5f8362c2f212321f9181900360200190a1600092915050565b6ec097ce7bc90715b34b9f100000000081565b600e5481565b60608060086000846001600160a01b03166001600160a01b03168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015612c1957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612bfb575b5093979650505050505050565b600a54600160b81b900460ff1681565b6060600d805480602002602001604051908101604052809291908181526020018280548015612c8e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c70575b5050505050905090565b601260209081526000928352604080842090915290825290205481565b60196020526000908152604090205460ff1681565b6002546001600160a01b031681565b600a54600090600160b01b900460ff1615612d30576040805162461bcd60e51b81526020600482015260126024820152711d1c985b9cd9995c881a5cc81c185d5cd95960721b604482015290519081900360640190fd5b6000612d3d868685614dd4565b90508015612d4c579050611752565b612d558661471e565b612d5f86866149c0565b61174c86856149c0565b60186020526000908152604090205481565b6060600082519050606081604051908082528060200260200182016040528015612daf578160200160208202803883390190505b50905060005b82811015612e0a576000858281518110612dcb57fe5b60200260200101519050612ddf8133614e80565b6012811115612dea57fe5b838381518110612df657fe5b602090810291909101015250600101612db5565b509392505050565b600480546040805163fc57d4df60e01b81526001600160a01b038781169482019490945290516000938493849391169163fc57d4df91602480820192602092909190829003018186803b158015612e6857600080fd5b505afa158015612e7c573d6000803e3d6000fd5b505050506040513d6020811015612e9257600080fd5b5051600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051939450600093929091169163fc57d4df91602480820192602092909190829003018186803b158015612eeb57600080fd5b505afa158015612eff573d6000803e3d6000fd5b505050506040513d6020811015612f1557600080fd5b50519050811580612f24575080155b15612f3957600d935060009250613032915050565b6000866001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b158015612f7457600080fd5b505afa158015612f88573d6000803e3d6000fd5b505050506040513d6020811015612f9e57600080fd5b505190506000612fac61542f565b612fb461542f565b612fbc61542f565b612fe4604051806020016040528060065481525060405180602001604052808a815250614f76565b925061300c604051806020016040528088815250604051806020016040528088815250614f76565b91506130188383614fb5565b9050613024818b614c25565b600099509750505050505050505b935093915050565b601360209081526000928352604080842090915290825290205481565b60146020526000908152604090205481565b600a54600090600160b81b900460ff16156130bd576040805162461bcd60e51b815260206004820152600f60248201526e1cd95a5e99481a5cc81c185d5cd959608a1b604482015290519081900360640190fd5b6001600160a01b03861660009081526009602052604090205460ff1615806130fe57506001600160a01b03851660009081526009602052604090205460ff16155b1561310a57600961219d565b846001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561314357600080fd5b505afa158015613157573d6000803e3d6000fd5b505050506040513d602081101561316d57600080fd5b505160408051635fe3b56760e01b815290516001600160a01b0392831692891691635fe3b567916004808301926020929190829003018186803b1580156131b357600080fd5b505afa1580156131c7573d6000803e3d6000fd5b505050506040513d60208110156131dd57600080fd5b50516001600160a01b0316146131f457600261219d565b6131fd8661471e565b61320786846149c0565b61321186856149c0565b60009695505050505050565b6001600160a01b0383166000908152600c602052604081205460ff161561327e576040805162461bcd60e51b815260206004820152601060248201526f189bdc9c9bddc81a5cc81c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff166132a5576009611e07565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff1661339557336001600160a01b0385161461332b576040805162461bcd60e51b815260206004820152601560248201527439b2b73232b91036bab9ba1031329031aa37b5b2b760591b604482015290519081900360640190fd5b60006133373385614e80565b9050600081601281111561334757fe5b146133605780601281111561335857fe5b915050611a5b565b6001600160a01b038086166000908152600960209081526040808320938816835260029093019052205460ff1661339357fe5b505b600480546040805163fc57d4df60e01b81526001600160a01b03888116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b1580156133e657600080fd5b505afa1580156133fa573d6000803e3d6000fd5b505050506040513d602081101561341057600080fd5b505161341d57600d611e07565b6001600160a01b038416600090815260166020526040902054801561350a576000856001600160a01b03166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b15801561347757600080fd5b505afa15801561348b573d6000803e3d6000fd5b505050506040513d60208110156134a157600080fd5b5051905060006134b18286614cc0565b9050828110613507576040805162461bcd60e51b815260206004820152601960248201527f6d61726b657420626f72726f7720636170207265616368656400000000000000604482015290519081900360640190fd5b50505b60008061351a868860008861438e565b9193509091506000905082601281111561353057fe5b1461354b5781601281111561354157fe5b9350505050611a5b565b8015613558576004613541565b61356061542f565b6040518060200160405280896001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156135a457600080fd5b505afa1580156135b8573d6000803e3d6000fd5b505050506040513d60208110156135ce57600080fd5b5051905290506135df888883613d71565b600098975050505050505050565b6008602052816000526040600020818154811061360657fe5b6000918252602090912001546001600160a01b03169150829050565b6003546001600160a01b031681565b6001600160a01b03821660009081526009602052604081205460ff166136885760405162461bcd60e51b81526004018080602001828103825260288152602001806154ef6028913960400191505060405180910390fd5b600a546001600160a01b03163314806136ab57506000546001600160a01b031633145b6136e65760405162461bcd60e51b81526004018080602001828103825260278152602001806155176027913960400191505060405180910390fd5b6000546001600160a01b031633148061370157506001821515145b61374b576040805162461bcd60e51b81526020600482015260166024820152756f6e6c792061646d696e2063616e20756e706175736560501b604482015290519081900360640190fd5b6001600160a01b038316600081815260196020908152604091829020805486151560ff1990911681179091558251938452838301526060908301819052600a908301526910dbdb1b185d195c985b60b21b6080830152517f71aec636243f9709bb0007ae15e9afb8150ab01716d75fd7573be5cc096e03b09181900360a00190a150919050565b73926df14a23be491164dcf93f4c468a50ef659d5b90565b600080546001600160a01b031633146138105761380960016006614b9f565b90506114ae565b6001600160a01b0383166000908152600960205260409020805460ff166138455761383d60096007614b9f565b9150506114ae565b61384d61542f565b50604080516020810190915283815261386461542f565b506040805160208101909152670c7d713b49da000081526138858183614ff1565b156138a05761389660066008614b9f565b93505050506114ae565b84158015906139295750600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b1580156138fb57600080fd5b505afa15801561390f573d6000803e3d6000fd5b505050506040513d602081101561392557600080fd5b5051155b1561393a57613896600d6009614b9f565b60018301805490869055604080516001600160a01b03891681526020810183905280820188905290517f70483e6592cd5182d45ac970e05bc62cdcc90e9d8ef2c2dbe686cf383bcd7fc59181900360600190a16000979650505050505050565b600a54600160a81b900460ff1681565b60055481565b61167281600d805480602002602001604051908101604052809291908181526020018280548015613a0a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116139ec575b50505050506114b4565b600080613a22858585614dd4565b90508015613a31579050611a5b565b613a3a8561471e565b613a4485856149c0565b600095945050505050565b6000808290506000806000836001600160a01b031663c37f68e2336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b158015613ab057600080fd5b505afa158015613ac4573d6000803e3d6000fd5b505050506040513d6080811015613ada57600080fd5b508051602082015160409092015190945090925090508215613b2d5760405162461bcd60e51b81526004018080602001828103825260258152602001806155996025913960400191505060405180910390fd5b8015613b4a57613b3f600c6002614b9f565b9450505050506119b0565b6000613b57873385614dd4565b90508015613b7857613b6c600e600383614ff8565b955050505050506119b0565b6001600160a01b0385166000908152600960209081526040808320338452600281019092529091205460ff16613bb757600096505050505050506119b0565b3360009081526002820160209081526040808320805460ff191690556008825291829020805483518184028101840190945280845260609392830182828015613c2957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613c0b575b5050835193945083925060009150505b82811015613c7e57896001600160a01b0316848281518110613c5757fe5b60200260200101516001600160a01b03161415613c7657809150613c7e565b600101613c39565b50818110613c8857fe5b336000908152600860205260409020805481906000198101908110613ca957fe5b9060005260206000200160009054906101000a90046001600160a01b0316818381548110613cd357fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558054613d0c826000198301615442565b50604080516001600160a01b038c16815233602082015281517fe699a64c18b07ac5b7301aa273f36a2287239eb9501d81950672794afba29a0d929181900390910190a160009c9b505050505050505050505050565b6000546001600160a01b031681565b6001600160a01b0383166000908152601160205260409020613d9161542f565b50604080516020810190915281546001600160e01b03168152613db261542f565b5060408051602080820183526001600160a01b0380891660009081526013835284812091891680825282845294812080548552865195909152915291909155805115611d2b57613e0061542f565b613e0a838361505e565b90506000613e99886001600160a01b03166395dd9193896040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015613e6757600080fd5b505afa158015613e7b573d6000803e3d6000fd5b505050506040513d6020811015613e9157600080fd5b505187615083565b90506000613ea782846150a1565b6001600160a01b03891660009081526014602052604081205491925090613ece9083614cc0565b6001600160a01b03808b166000818152601460209081526040918290208590558a5182518881529182015281519495509193928e16927f1fc3ecc087d8d2d15e23d0032af5a47059c3892d003d8e139fdcb6bb327c99a69281900390910190a350505050505050505050565b600080546001600160a01b0316331480613f5e57506002546001600160a01b031633145b905090565b600080613f6e612a0f565b90506000816001600160a01b031663dd62ed3e613f896137d2565b604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152306024830152516044808301926020929190829003018186803b158015613fd457600080fd5b505afa158015613fe8573d6000803e3d6000fd5b505050506040513d6020811015613ffe57600080fd5b5051905060006001600160a01b0383166370a0823161401b6137d2565b6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561406157600080fd5b505afa158015614075573d6000803e3d6000fd5b505050506040513d602081101561408b57600080fd5b50519050600081831061409e57816140a0565b825b90506000861180156140b25750808611155b1561415e57836001600160a01b03166323b872dd6140ce6137d2565b604080516001600160e01b031960e085901b1681526001600160a01b039283166004820152918b166024830152604482018a90525160648083019260209291908290030181600087803b15801561412457600080fd5b505af1158015614138573d6000803e3d6000fd5b505050506040513d602081101561414e57600080fd5b50600095506114ae945050505050565b509395945050505050565b6001600160a01b0382166000908152600f60205260409020548015614196576141918361471e565b614332565b8115614332576001600160a01b0383166000908152600960205260409020805460ff16151560011461420f576040805162461bcd60e51b815260206004820152601960248201527f636f6d70206d61726b6574206973206e6f74206c697374656400000000000000604482015290519081900360640190fd5b6001600160a01b0384166000908152601060205260409020546001600160e01b031615801561426157506001600160a01b038416600090815260106020526040902054600160e01b900463ffffffff16155b156143305760405180604001604052806ec097ce7bc90715b34b9f10000000006001600160e01b031681526020016142d561429a611cbf565b6040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b63ffffffff9081169091526001600160a01b0386166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555b505b818114611511576001600160a01b0383166000818152600f6020908152604091829020859055815185815291517f2ab93f65628379309f36cb125e90d7c902454a545c4f8b8cb0794af75c24b8079281900390910190a2505050565b600080600061439b615466565b6001600160a01b0388166000908152600860209081526040808320805482518185028101850190935280835260609383018282801561440357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116143e5575b50939450600093505050505b81518110156146df57600082828151811061442657fe5b60200260200101519050806001600160a01b031663c37f68e28d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b15801561448657600080fd5b505afa15801561449a573d6000803e3d6000fd5b505050506040513d60808110156144b057600080fd5b508051602082015160408084015160609485015160808b01529389019390935291870191909152935083156144f55750600f965060009550859450611d7b9350505050565b6001600160a01b03811660009081526019602052604090205460ff16151560011480156145225750600089115b8015614532575060008560400151115b1561454d57506012965060009550859450611d7b9350505050565b60408051602080820183526001600160a01b0380851660008181526009845285902060010154845260c08a01939093528351808301855260808a0151815260e08a015260048054855163fc57d4df60e01b815291820194909452935192169263fc57d4df9260248083019392829003018186803b1580156145cd57600080fd5b505afa1580156145e1573d6000803e3d6000fd5b505050506040513d60208110156145f757600080fd5b505160a0860181905261461a5750600d965060009550859450611d7b9350505050565b604080516020810190915260a0860151815261010086015260c085015160e08601516146549161464991614f76565b866101000151614f76565b61012086018190526040860151865161466e92919061516a565b85526101008501516060860151602087015161468b92919061516a565b60208601526001600160a01b03818116908c1614156146d6576146b88561012001518b876020015161516a565b602086018190526101008601516146d0918b9061516a565b60208601525b5060010161440f565b506020830151835111156147055750506020810151905160009450039150829050611d7b565b5050805160209091015160009450849350039050611d7b565b6001600160a01b0381166000908152601060209081526040808320600f909252822054909161474b611cbf565b835490915060009061476b908390600160e01b900463ffffffff16614c44565b905060008111801561477d5750600083115b15614955576000856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156147bd57600080fd5b505afa1580156147d1573d6000803e3d6000fd5b505050506040513d60208110156147e757600080fd5b5051905060006147f78386614c7e565b905061480161542f565b6000831161481e5760405180602001604052806000815250614828565b6148288284615192565b905061483261542f565b604080516020810190915288546001600160e01b0316815261485490836151c7565b905060405180604001604052806148a483600001516040518060400160405280601a81526020017f6e657720696e64657820657863656564732032323420626974730000000000008152506151ec565b6001600160e01b031681526020016148f1886040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b63ffffffff9081169091526001600160a01b038b166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555061168792505050565b80156116875761499a826040518060400160405280601c81526020017f626c6f636b206e756d62657220657863656564732033322062697473000000008152506150d0565b845463ffffffff91909116600160e01b026001600160e01b039091161784555050505050565b6001600160a01b03821660009081526010602052604090206149e061542f565b50604080516020810190915281546001600160e01b03168152614a0161542f565b5060408051602080820183526001600160a01b03808816600090815260128352848120918816808252828452948120805485528651959091529152919091558051158015614a4f5750815115155b15614a67576ec097ce7bc90715b34b9f100000000081525b614a6f61542f565b614a79838361505e565b90506000866001600160a01b03166370a08231876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015614ad357600080fd5b505afa158015614ae7573d6000803e3d6000fd5b505050506040513d6020811015614afd57600080fd5b505190506000614b0d82846150a1565b6001600160a01b03881660009081526014602052604081205491925090614b349083614cc0565b6001600160a01b03808a166000818152601460209081526040918290208590558a5182518881529182015281519495509193928d16927f2caecd17d02f56fa897705dcc740da2d237c373f70686f4e0d9bd3bf0400ea7a9281900390910190a3505050505050505050565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa0836012811115614bce57fe5b836013811115614bda57fe5b604080519283526020830191909152600082820152519081900360600190a1826012811115611a5b57fe5b6000806000614c1884600080600061438e565b9250925092509193909250565b6000614c2f61542f565b614c398484615241565b905061175281615262565b6000611a5b8383604051806040016040528060158152602001747375627472616374696f6e20756e646572666c6f7760581b815250615271565b6000611a5b83836040518060400160405280601781526020017f6d756c7469706c69636174696f6e206f766572666c6f770000000000000000008152506152cb565b6000611a5b8383604051806040016040528060118152602001706164646974696f6e206f766572666c6f7760781b81525061534a565b60005b600d54811015614d8157816001600160a01b0316600d8281548110614d1a57fe5b6000918252602090912001546001600160a01b03161415614d79576040805162461bcd60e51b81526020600482015260146024820152731b585c9ad95d08185b1c9958591e48185919195960621b604482015290519081900360640190fd5b600101614cf9565b50600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831660009081526009602052604081205460ff16614dfb576009611e07565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff16614e33576000611e07565b600080614e43858786600061438e565b91935090915060009050826012811115614e5957fe5b14614e7357816012811115614e6a57fe5b92505050611a5b565b8015613211576004614e6a565b6001600160a01b0382166000908152600960205260408120805460ff16614eab5760099150506114ae565b6001600160a01b038316600090815260028201602052604090205460ff16151560011415614edd5760009150506114ae565b6001600160a01b0380841660008181526002840160209081526040808320805460ff19166001908117909155600883528184208054918201815584529282902090920180549489166001600160a01b031990951685179055815193845283019190915280517f3ab23ab0d51cccc0c3085aec51f99228625aa1a922b3a8ca89a26b0f2027a1a59281900390910190a15060009392505050565b614f7e61542f565b6040518060200160405280670de0b6b3a7640000614fa486600001518660000151614c7e565b81614fab57fe5b0490529392505050565b614fbd61542f565b6040518060200160405280614fe8614fe18660000151670de0b6b3a7640000614c7e565b855161539f565b90529392505050565b5190511090565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa084601281111561502757fe5b84601381111561503357fe5b604080519283526020830191909152818101859052519081900360600190a183601281111561175257fe5b61506661542f565b6040518060200160405280614fe885600001518560000151614c44565b6000611a5b61509a84670de0b6b3a7640000614c7e565b835161539f565b60006ec097ce7bc90715b34b9f10000000006150c1848460000151614c7e565b816150c857fe5b049392505050565b600081600160201b84106151625760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561512757818101518382015260200161510f565b50505050905090810190601f1680156151545780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b600061517461542f565b61517e8585615241565b90506122b061518c82615262565b84614cc0565b61519a61542f565b6040518060200160405280614fe86151c1866ec097ce7bc90715b34b9f1000000000614c7e565b8561539f565b6151cf61542f565b6040518060200160405280614fe885600001518560000151614cc0565b600081600160e01b84106151625760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b61524961542f565b6040518060200160405280614fe8856000015185614c7e565b51670de0b6b3a7640000900490565b600081848411156152c35760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b505050900390565b60008315806152d8575082155b156152e557506000611a5b565b838302838582816152f257fe5b041483906153415760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b50949350505050565b600083830182858210156153415760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b6000611a5b83836040518060400160405280600e81526020016d646976696465206279207a65726f60901b8152506000818361541c5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561512757818101518382015260200161510f565b5082848161542657fe5b04949350505050565b6040518060200160405280600081525090565b815481835581811115611511576000838152602090206115119181019083016154d0565b6040518061014001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016154a461542f565b81526020016154b161542f565b81526020016154be61542f565b81526020016154cb61542f565b905290565b611cc191905b808211156154ea57600081556001016154d6565b509056fe63616e6e6f742070617573652061206d61726b65742074686174206973206e6f74206c69737465646f6e6c7920706175736520677561726469616e20616e642061646d696e2063616e2070617573656f6e6c792061646d696e2063616e2073657420626f72726f772063617020677561726469616e6f6e6c792061646d696e206f7220626f72726f772063617020677561726469616e2063616e2073657420626f72726f772063617073657869744d61726b65743a206765744163636f756e74536e617073686f74206661696c65646f6e6c7920756e6974726f6c6c65722061646d696e2063616e206368616e676520627261696e73a265627a7a72315820247d83c3f5dec80e7618305c55231aa7b691acde7f1f776dc38e3ae9bf90217564736f6c63430005110032","name":"Comptroller","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"default","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"action","type":"string"},{"indexed":false,"internalType":"bool","name":"pauseState","type":"bool"}],"name":"ActionPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"string","name":"action","type":"string"},{"indexed":false,"internalType":"bool","name":"pauseState","type":"bool"}],"name":"ActionPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CompGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newSpeed","type":"uint256"}],"name":"CompSpeedUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contributor","type":"address"},{"indexed":false,"internalType":"uint256","name":"newSpeed","type":"uint256"}],"name":"ContributorCompSpeedUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"compDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"compBorrowIndex","type":"uint256"}],"name":"DistributedBorrowerComp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":true,"internalType":"address","name":"supplier","type":"address"},{"indexed":false,"internalType":"uint256","name":"compDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"compSupplyIndex","type":"uint256"}],"name":"DistributedSupplierComp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"error","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"info","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"detail","type":"uint256"}],"name":"Failure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketExited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract CToken","name":"cToken","type":"address"}],"name":"MarketListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newBorrowCap","type":"uint256"}],"name":"NewBorrowCap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldBorrowCapGuardian","type":"address"},{"indexed":false,"internalType":"address","name":"newBorrowCapGuardian","type":"address"}],"name":"NewBorrowCapGuardian","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldCloseFactorMantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCloseFactorMantissa","type":"uint256"}],"name":"NewCloseFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract CToken","name":"cToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldCollateralFactorMantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCollateralFactorMantissa","type":"uint256"}],"name":"NewCollateralFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldLiquidationIncentiveMantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newLiquidationIncentiveMantissa","type":"uint256"}],"name":"NewLiquidationIncentive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPauseGuardian","type":"address"},{"indexed":false,"internalType":"address","name":"newPauseGuardian","type":"address"}],"name":"NewPauseGuardian","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract PriceOracle","name":"oldPriceOracle","type":"address"},{"indexed":false,"internalType":"contract PriceOracle","name":"newPriceOracle","type":"address"}],"name":"NewPriceOracle","type":"event"},{"constant":false,"inputs":[{"internalType":"contract Unitroller","name":"unitroller","type":"address"}],"name":"_become","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"_borrowGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"_grantComp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"_mintGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newBorrowCapGuardian","type":"address"}],"name":"_setBorrowCapGuardian","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"_setBorrowPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newCloseFactorMantissa","type":"uint256"}],"name":"_setCloseFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"},{"internalType":"uint256","name":"newCollateralFactorMantissa","type":"uint256"}],"name":"_setCollateralFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"_setCollateralPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"},{"internalType":"uint256","name":"compSpeed","type":"uint256"}],"name":"_setCompSpeed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"contributor","type":"address"},{"internalType":"uint256","name":"compSpeed","type":"uint256"}],"name":"_setContributorCompSpeed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newLiquidationIncentiveMantissa","type":"uint256"}],"name":"_setLiquidationIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken[]","name":"cTokens","type":"address[]"},{"internalType":"uint256[]","name":"newBorrowCaps","type":"uint256[]"}],"name":"_setMarketBorrowCaps","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"_setMintPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPauseGuardian","type":"address"}],"name":"_setPauseGuardian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract PriceOracle","name":"newOracle","type":"address"}],"name":"_setPriceOracle","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"_setSeizePaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"_setTransferPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract CToken","name":"cToken","type":"address"}],"name":"_supportMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"accountAssets","outputs":[{"internalType":"contract CToken","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allMarkets","outputs":[{"internalType":"contract CToken","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"borrowAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"borrowCapGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"borrowCaps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"borrowGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"borrowVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"contract CToken","name":"cToken","type":"address"}],"name":"checkMembership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"contract CToken[]","name":"cTokens","type":"address[]"}],"name":"claimComp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"holders","type":"address[]"},{"internalType":"contract CToken[]","name":"cTokens","type":"address[]"},{"internalType":"bool","name":"borrowers","type":"bool"},{"internalType":"bool","name":"suppliers","type":"bool"}],"name":"claimComp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"claimComp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"closeFactorMantissa","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"collateralGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compAccrued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compBorrowState","outputs":[{"internalType":"uint224","name":"index","type":"uint224"},{"internalType":"uint32","name":"block","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"compBorrowerIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compContributorSpeeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"compInitialIndex","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"compRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compSpeeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"compSupplierIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"compSupplyState","outputs":[{"internalType":"uint224","name":"index","type":"uint224"},{"internalType":"uint32","name":"block","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"comptrollerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"cTokens","type":"address[]"}],"name":"enterMarkets","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cTokenAddress","type":"address"}],"name":"exitMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getAllMarkets","outputs":[{"internalType":"contract CToken[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAssetsIn","outputs":[{"internalType":"contract CToken[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCompAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"cTokenModify","type":"address"},{"internalType":"uint256","name":"redeemTokens","type":"uint256"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"getHypotheticalAccountLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTreasuryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getXinvAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isComptroller","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastContributorBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cTokenBorrowed","type":"address"},{"internalType":"address","name":"cTokenCollateral","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"repayAmount","type":"uint256"}],"name":"liquidateBorrowAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cTokenBorrowed","type":"address"},{"internalType":"address","name":"cTokenCollateral","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"actualRepayAmount","type":"uint256"},{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"liquidateBorrowVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"cTokenBorrowed","type":"address"},{"internalType":"address","name":"cTokenCollateral","type":"address"},{"internalType":"uint256","name":"actualRepayAmount","type":"uint256"}],"name":"liquidateCalculateSeizeTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationIncentiveMantissa","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"markets","outputs":[{"internalType":"bool","name":"isListed","type":"bool"},{"internalType":"uint256","name":"collateralFactorMantissa","type":"uint256"},{"internalType":"bool","name":"isComped","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"mintAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"actualMintAmount","type":"uint256"},{"internalType":"uint256","name":"mintTokens","type":"uint256"}],"name":"mintVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"oracle","outputs":[{"internalType":"contract PriceOracle","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pauseGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingComptrollerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"redeemAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"redeemVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"repayAmount","type":"uint256"}],"name":"repayBorrowAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"actualRepayAmount","type":"uint256"},{"internalType":"uint256","name":"borrowerIndex","type":"uint256"}],"name":"repayBorrowVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cTokenCollateral","type":"address"},{"internalType":"address","name":"cTokenBorrowed","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"seizeAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"seizeGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cTokenCollateral","type":"address"},{"internalType":"address","name":"cTokenBorrowed","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"seizeVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"transferTokens","type":"uint256"}],"name":"transferAllowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"transferGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"cToken","type":"address"},{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"transferTokens","type":"uint256"}],"name":"transferVerify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"contributor","type":"address"}],"name":"updateContributorRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":null}