Contract 0xf6c14d4dfe45c132822ce28c646753c54994e59c

 

Contract Overview

Venus: Comptroller
Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4a8e481723842a508f2273020c62fbd2e7658e22da1165df62c6c8f5a2474201Enter Markets74321382021-05-15 13:34:49257 days 6 hrs ago0x51b4158037f4e21ea2e08f88e75908ff18c46701 IN  Venus: Comptroller0 BNB0.000119895
0xd00fd0950efd2974576327b851cad62e29271c6698bddeeae669e4aef631102bEnter Markets74295652021-05-15 11:22:46257 days 8 hrs ago0x51b4158037f4e21ea2e08f88e75908ff18c46701 IN  Venus: Comptroller0 BNB0.000119895
0x0c229b16b1a26507a02924389e3c25a73a7295fe1bf1720bec3cdb9bd6298849Claim Venus26614112020-11-29 14:14:21424 days 5 hrs ago0xaae3a24e505b929ac6e171e214894f95b37eecf4 IN  Venus: Comptroller0 BNB0.00047562
0xbb829394070423a7878ea1ca39de25eef5ffc5b4506e04856019d620f112cb4eRefresh Venus Sp...26425122020-11-28 22:29:08424 days 21 hrs agoACryptoS: Deployer IN  Venus: Comptroller0 BNB0.0004976
0x304add2fe9640ac43b85d266a4f0f004012b38101ae186f58e1957fd56ccf968_become24716942020-11-22 23:54:55430 days 20 hrs agoVenus: Deployer IN  Venus: Comptroller0 BNB0.00086418
0x93ae2283d6b032574e47971effe97b77c1bd918714ea9d84597f7e522d32b4620x6080604024715892020-11-22 23:49:40430 days 20 hrs agoVenus: Deployer IN  Create: Comptroller0 BNB0.1034409
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Comptroller

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity Multiple files format)

File 1 of 17: Comptroller.sol
pragma solidity ^0.5.16;

import "./VToken.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./PriceOracle.sol";
import "./ComptrollerInterface.sol";
import "./ComptrollerStorage.sol";
import "./Unitroller.sol";
import "./XVS.sol";

/**
 * @title Venus's Comptroller Contract
 * @author Venus
 */
contract Comptroller is ComptrollerStorage, ComptrollerInterface, ComptrollerErrorReporter, Exponential {
    /// @notice Emitted when an admin supports a market
    event MarketListed(VToken vToken);

    /// @notice Emitted when an account enters a market
    event MarketEntered(VToken vToken, address account);

    /// @notice Emitted when an account exits a market
    event MarketExited(VToken vToken, address account);

    /// @notice Emitted when close factor is changed by admin
    event NewCloseFactor(uint oldCloseFactorMantissa, uint newCloseFactorMantissa);

    /// @notice Emitted when a collateral factor is changed by admin
    event NewCollateralFactor(VToken vToken, uint oldCollateralFactorMantissa, uint newCollateralFactorMantissa);

    /// @notice Emitted when liquidation incentive is changed by admin
    event NewLiquidationIncentive(uint oldLiquidationIncentiveMantissa, uint newLiquidationIncentiveMantissa);

    /// @notice Emitted when maxAssets is changed by admin
    event NewMaxAssets(uint oldMaxAssets, uint newMaxAssets);

    /// @notice Emitted when price oracle is changed
    event NewPriceOracle(PriceOracle oldPriceOracle, PriceOracle newPriceOracle);

    /// @notice Emitted when pause guardian is changed
    event NewPauseGuardian(address oldPauseGuardian, address newPauseGuardian);

    /// @notice Emitted when an action is paused globally
    event ActionPaused(string action, bool pauseState);

    /// @notice Emitted when an action is paused on a market
    event ActionPaused(VToken vToken, string action, bool pauseState);

    /// @notice Emitted when market venus status is changed
    event MarketVenus(VToken vToken, bool isVenus);

    /// @notice Emitted when Venus rate is changed
    event NewVenusRate(uint oldVenusRate, uint newVenusRate);

    /// @notice Emitted when a new Venus speed is calculated for a market
    event VenusSpeedUpdated(VToken indexed vToken, uint newSpeed);

    /// @notice Emitted when XVS is distributed to a supplier
    event DistributedSupplierVenus(VToken indexed vToken, address indexed supplier, uint venusDelta, uint venusSupplyIndex);

    /// @notice Emitted when XVS is distributed to a borrower
    event DistributedBorrowerVenus(VToken indexed vToken, address indexed borrower, uint venusDelta, uint venusBorrowIndex);

    /// @notice Emitted when VAIController is changed
    event NewVAIController(VAIControllerInterface oldVAIController, VAIControllerInterface newVAIController);

    /// @notice Emitted when VAI mint rate is changed by admin
    event NewVAIMintRate(uint oldVAIMintRate, uint newVAIMintRate);

    /// @notice Emitted when protocol state is changed by admin
    event ActionProtocolPaused(bool state);

    /// @notice The threshold above which the flywheel transfers XVS, in wei
    uint public constant venusClaimThreshold = 0.001e18;

    /// @notice The initial Venus index for a market
    uint224 public constant venusInitialIndex = 1e36;

    // closeFactorMantissa must be strictly greater than this value
    uint internal constant closeFactorMinMantissa = 0.05e18; // 0.05

    // closeFactorMantissa must not exceed this value
    uint internal constant closeFactorMaxMantissa = 0.9e18; // 0.9

    // No collateralFactorMantissa may exceed this value
    uint internal constant collateralFactorMaxMantissa = 0.9e18; // 0.9

    // liquidationIncentiveMantissa must be no less than this value
    uint internal constant liquidationIncentiveMinMantissa = 1.0e18; // 1.0

    // liquidationIncentiveMantissa must be no greater than this value
    uint internal constant liquidationIncentiveMaxMantissa = 1.5e18; // 1.5

    constructor() public {
        admin = msg.sender;
    }

    modifier onlyProtocolAllowed {
        require(protocolPaused == false, "protocol is paused");
        _;
    }

    /*** Assets You Are In ***/

    /**
     * @notice Returns the assets an account has entered
     * @param account The address of the account to pull assets for
     * @return A dynamic list with the assets the account has entered
     */
    function getAssetsIn(address account) external view returns (VToken[] memory) {
        return accountAssets[account];
    }

    /**
     * @notice Returns whether the given account is entered in the given asset
     * @param account The address of the account to check
     * @param vToken The vToken to check
     * @return True if the account is in the asset, otherwise false.
     */
    function checkMembership(address account, VToken vToken) external view returns (bool) {
        return markets[address(vToken)].accountMembership[account];
    }

    /**
     * @notice Add assets to be included in account liquidity calculation
     * @param vTokens The list of addresses of the vToken markets to be enabled
     * @return Success indicator for whether each corresponding market was entered
     */
    function enterMarkets(address[] memory vTokens) public returns (uint[] memory) {
        uint len = vTokens.length;

        uint[] memory results = new uint[](len);
        for (uint i = 0; i < len; i++) {
            VToken vToken = VToken(vTokens[i]);

            results[i] = uint(addToMarketInternal(vToken, msg.sender));
        }

        return results;
    }

    /**
     * @notice Add the market to the borrower's "assets in" for liquidity calculations
     * @param vToken The market to enter
     * @param borrower The address of the account to modify
     * @return Success indicator for whether the market was entered
     */
    function addToMarketInternal(VToken vToken, address borrower) internal returns (Error) {
        Market storage marketToJoin = markets[address(vToken)];

        if (!marketToJoin.isListed) {
            // market is not listed, cannot join
            return Error.MARKET_NOT_LISTED;
        }

        if (marketToJoin.accountMembership[borrower] == true) {
            // already joined
            return Error.NO_ERROR;
        }

        if (accountAssets[borrower].length >= maxAssets)  {
            // no space, cannot join
            return Error.TOO_MANY_ASSETS;
        }

        // survived the gauntlet, add to list
        // NOTE: we store these somewhat redundantly as a significant optimization
        //  this avoids having to iterate through the list for the most common use cases
        //  that is, only when we need to perform liquidity checks
        //  and not whenever we want to check if an account is in a particular market
        marketToJoin.accountMembership[borrower] = true;
        accountAssets[borrower].push(vToken);

        emit MarketEntered(vToken, borrower);

        return Error.NO_ERROR;
    }

    /**
     * @notice Removes asset from sender's account liquidity calculation
     * @dev Sender must not have an outstanding borrow balance in the asset,
     *  or be providing necessary collateral for an outstanding borrow.
     * @param vTokenAddress The address of the asset to be removed
     * @return Whether or not the account successfully exited the market
     */
    function exitMarket(address vTokenAddress) external returns (uint) {
        VToken vToken = VToken(vTokenAddress);
        /* Get sender tokensHeld and amountOwed underlying from the vToken */
        (uint oErr, uint tokensHeld, uint amountOwed, ) = vToken.getAccountSnapshot(msg.sender);
        require(oErr == 0, "getAccountSnapshot failed"); // semi-opaque error code

        /* Fail if the sender has a borrow balance */
        if (amountOwed != 0) {
            return fail(Error.NONZERO_BORROW_BALANCE, FailureInfo.EXIT_MARKET_BALANCE_OWED);
        }

        /* Fail if the sender is not permitted to redeem all of their tokens */
        uint allowed = redeemAllowedInternal(vTokenAddress, msg.sender, tokensHeld);
        if (allowed != 0) {
            return failOpaque(Error.REJECTION, FailureInfo.EXIT_MARKET_REJECTION, allowed);
        }

        Market storage marketToExit = markets[address(vToken)];

        /* Return true if the sender is not already ‘in’ the market */
        if (!marketToExit.accountMembership[msg.sender]) {
            return uint(Error.NO_ERROR);
        }

        /* Set vToken account membership to false */
        delete marketToExit.accountMembership[msg.sender];

        /* Delete vToken from the account’s list of assets */
        // In order to delete vToken, copy last item in list to location of item to be removed, reduce length by 1
        VToken[] storage userAssetList = accountAssets[msg.sender];
        uint len = userAssetList.length;
        uint i;
        for (; i < len; i++) {
            if (userAssetList[i] == vToken) {
                userAssetList[i] = userAssetList[len - 1];
                userAssetList.length--;
                break;
            }
        }

        // We *must* have found the asset in the list or our redundant data structure is broken
        assert(i < len);

        emit MarketExited(vToken, msg.sender);

        return uint(Error.NO_ERROR);
    }

    /*** Policy Hooks ***/

    /**
     * @notice Checks if the account should be allowed to mint tokens in the given market
     * @param vToken The market to verify the mint against
     * @param minter The account which would get the minted tokens
     * @param mintAmount The amount of underlying being supplied to the market in exchange for tokens
     * @return 0 if the mint is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)
     */
    function mintAllowed(address vToken, address minter, uint mintAmount) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!mintGuardianPaused[vToken], "mint is paused");

        // Shh - currently unused
        mintAmount;

        if (!markets[vToken].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        // Keep the flywheel moving
        updateVenusSupplyIndex(vToken);
        distributeSupplierVenus(vToken, minter, false);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates mint and reverts on rejection. May emit logs.
     * @param vToken Asset being minted
     * @param minter The address minting the tokens
     * @param actualMintAmount The amount of the underlying asset being minted
     * @param mintTokens The number of tokens being minted
     */
    function mintVerify(address vToken, address minter, uint actualMintAmount, uint mintTokens) external {
        // Shh - currently unused
        vToken;
        minter;
        actualMintAmount;
        mintTokens;
    }

    /**
     * @notice Checks if the account should be allowed to redeem tokens in the given market
     * @param vToken The market to verify the redeem against
     * @param redeemer The account which would redeem the tokens
     * @param redeemTokens The number of vTokens to exchange for the underlying asset in the market
     * @return 0 if the redeem is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)
     */
    function redeemAllowed(address vToken, address redeemer, uint redeemTokens) external onlyProtocolAllowed returns (uint) {
        uint allowed = redeemAllowedInternal(vToken, redeemer, redeemTokens);
        if (allowed != uint(Error.NO_ERROR)) {
            return allowed;
        }

        // Keep the flywheel moving
        updateVenusSupplyIndex(vToken);
        distributeSupplierVenus(vToken, redeemer, false);

        return uint(Error.NO_ERROR);
    }

    function redeemAllowedInternal(address vToken, address redeemer, uint redeemTokens) internal view returns (uint) {
        if (!markets[vToken].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        /* If the redeemer is not 'in' the market, then we can bypass the liquidity check */
        if (!markets[vToken].accountMembership[redeemer]) {
            return uint(Error.NO_ERROR);
        }

        /* Otherwise, perform a hypothetical liquidity check to guard against shortfall */
        (Error err, , uint shortfall) = getHypotheticalAccountLiquidityInternal(redeemer, VToken(vToken), redeemTokens, 0);
        if (err != Error.NO_ERROR) {
            return uint(err);
        }
        if (shortfall > 0) {
            return uint(Error.INSUFFICIENT_LIQUIDITY);
        }

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates redeem and reverts on rejection. May emit logs.
     * @param vToken Asset being redeemed
     * @param redeemer The address redeeming the tokens
     * @param redeemAmount The amount of the underlying asset being redeemed
     * @param redeemTokens The number of tokens being redeemed
     */
    function redeemVerify(address vToken, address redeemer, uint redeemAmount, uint redeemTokens) external {
        // Shh - currently unused
        vToken;
        redeemer;

        // Require tokens is zero or amount is also zero
        require(redeemTokens != 0 || redeemAmount == 0, "redeemTokens zero");
    }

    /**
     * @notice Checks if the account should be allowed to borrow the underlying asset of the given market
     * @param vToken The market to verify the borrow against
     * @param borrower The account which would borrow the asset
     * @param borrowAmount The amount of underlying the account would borrow
     * @return 0 if the borrow is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)
     */
    function borrowAllowed(address vToken, address borrower, uint borrowAmount) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!borrowGuardianPaused[vToken], "borrow is paused");

        if (!markets[vToken].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        if (!markets[vToken].accountMembership[borrower]) {
            // only vTokens may call borrowAllowed if borrower not in market
            require(msg.sender == vToken, "sender must be vToken");

            // attempt to add borrower to the market
            Error err = addToMarketInternal(VToken(vToken), borrower);
            if (err != Error.NO_ERROR) {
                return uint(err);
            }
        }

        if (oracle.getUnderlyingPrice(VToken(vToken)) == 0) {
            return uint(Error.PRICE_ERROR);
        }

        (Error err, , uint shortfall) = getHypotheticalAccountLiquidityInternal(borrower, VToken(vToken), 0, borrowAmount);
        if (err != Error.NO_ERROR) {
            return uint(err);
        }
        if (shortfall > 0) {
            return uint(Error.INSUFFICIENT_LIQUIDITY);
        }

        // Keep the flywheel moving
        Exp memory borrowIndex = Exp({mantissa: VToken(vToken).borrowIndex()});
        updateVenusBorrowIndex(vToken, borrowIndex);
        distributeBorrowerVenus(vToken, borrower, borrowIndex, false);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates borrow and reverts on rejection. May emit logs.
     * @param vToken Asset whose underlying is being borrowed
     * @param borrower The address borrowing the underlying
     * @param borrowAmount The amount of the underlying asset requested to borrow
     */
    function borrowVerify(address vToken, address borrower, uint borrowAmount) external {
        // Shh - currently unused
        vToken;
        borrower;
        borrowAmount;

        // Shh - we don't ever want this hook to be marked pure
        if (false) {
            maxAssets = maxAssets;
        }
    }

    /**
     * @notice Checks if the account should be allowed to repay a borrow in the given market
     * @param vToken The market to verify the repay against
     * @param payer The account which would repay the asset
     * @param borrower The account which would borrowed the asset
     * @param repayAmount The amount of the underlying asset the account would repay
     * @return 0 if the repay is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)
     */
    function repayBorrowAllowed(
        address vToken,
        address payer,
        address borrower,
        uint repayAmount) external onlyProtocolAllowed returns (uint) {
        // Shh - currently unused
        payer;
        borrower;
        repayAmount;

        if (!markets[vToken].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        // Keep the flywheel moving
        Exp memory borrowIndex = Exp({mantissa: VToken(vToken).borrowIndex()});
        updateVenusBorrowIndex(vToken, borrowIndex);
        distributeBorrowerVenus(vToken, borrower, borrowIndex, false);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates repayBorrow and reverts on rejection. May emit logs.
     * @param vToken Asset being repaid
     * @param payer The address repaying the borrow
     * @param borrower The address of the borrower
     * @param actualRepayAmount The amount of underlying being repaid
     */
    function repayBorrowVerify(
        address vToken,
        address payer,
        address borrower,
        uint actualRepayAmount,
        uint borrowerIndex) external {
        // Shh - currently unused
        vToken;
        payer;
        borrower;
        actualRepayAmount;
        borrowerIndex;

        // Shh - we don't ever want this hook to be marked pure
        if (false) {
            maxAssets = maxAssets;
        }
    }

    /**
     * @notice Checks if the liquidation should be allowed to occur
     * @param vTokenBorrowed Asset which was borrowed by the borrower
     * @param vTokenCollateral Asset which was used as collateral and will be seized
     * @param liquidator The address repaying the borrow and seizing the collateral
     * @param borrower The address of the borrower
     * @param repayAmount The amount of underlying being repaid
     */
    function liquidateBorrowAllowed(
        address vTokenBorrowed,
        address vTokenCollateral,
        address liquidator,
        address borrower,
        uint repayAmount) external onlyProtocolAllowed returns (uint) {
        // Shh - currently unused
        liquidator;

        if (!markets[vTokenBorrowed].isListed || !markets[vTokenCollateral].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        /* The borrower must have shortfall in order to be liquidatable */
        (Error err, , uint shortfall) = getAccountLiquidityInternal(borrower);
        if (err != Error.NO_ERROR) {
            return uint(err);
        }
        if (shortfall == 0) {
            return uint(Error.INSUFFICIENT_SHORTFALL);
        }

        /* The liquidator may not repay more than what is allowed by the closeFactor */
        uint borrowBalance = VToken(vTokenBorrowed).borrowBalanceStored(borrower);
        (MathError mathErr, uint maxClose) = mulScalarTruncate(Exp({mantissa: closeFactorMantissa}), borrowBalance);
        if (mathErr != MathError.NO_ERROR) {
            return uint(Error.MATH_ERROR);
        }
        if (repayAmount > maxClose) {
            return uint(Error.TOO_MUCH_REPAY);
        }

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates liquidateBorrow and reverts on rejection. May emit logs.
     * @param vTokenBorrowed Asset which was borrowed by the borrower
     * @param vTokenCollateral Asset which was used as collateral and will be seized
     * @param liquidator The address repaying the borrow and seizing the collateral
     * @param borrower The address of the borrower
     * @param actualRepayAmount The amount of underlying being repaid
     */
    function liquidateBorrowVerify(
        address vTokenBorrowed,
        address vTokenCollateral,
        address liquidator,
        address borrower,
        uint actualRepayAmount,
        uint seizeTokens) external {
        // Shh - currently unused
        vTokenBorrowed;
        vTokenCollateral;
        liquidator;
        borrower;
        actualRepayAmount;
        seizeTokens;

        // Shh - we don't ever want this hook to be marked pure
        if (false) {
            maxAssets = maxAssets;
        }
    }

    /**
     * @notice Checks if the seizing of assets should be allowed to occur
     * @param vTokenCollateral Asset which was used as collateral and will be seized
     * @param vTokenBorrowed Asset which was borrowed by the borrower
     * @param liquidator The address repaying the borrow and seizing the collateral
     * @param borrower The address of the borrower
     * @param seizeTokens The number of collateral tokens to seize
     */
    function seizeAllowed(
        address vTokenCollateral,
        address vTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!seizeGuardianPaused, "seize is paused");

        // Shh - currently unused
        seizeTokens;

        if (!markets[vTokenCollateral].isListed || !markets[vTokenBorrowed].isListed) {
            return uint(Error.MARKET_NOT_LISTED);
        }

        if (VToken(vTokenCollateral).comptroller() != VToken(vTokenBorrowed).comptroller()) {
            return uint(Error.COMPTROLLER_MISMATCH);
        }

        // Keep the flywheel moving
        updateVenusSupplyIndex(vTokenCollateral);
        distributeSupplierVenus(vTokenCollateral, borrower, false);
        distributeSupplierVenus(vTokenCollateral, liquidator, false);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates seize and reverts on rejection. May emit logs.
     * @param vTokenCollateral Asset which was used as collateral and will be seized
     * @param vTokenBorrowed Asset which was borrowed by the borrower
     * @param liquidator The address repaying the borrow and seizing the collateral
     * @param borrower The address of the borrower
     * @param seizeTokens The number of collateral tokens to seize
     */
    function seizeVerify(
        address vTokenCollateral,
        address vTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external {
        // Shh - currently unused
        vTokenCollateral;
        vTokenBorrowed;
        liquidator;
        borrower;
        seizeTokens;

        // Shh - we don't ever want this hook to be marked pure
        if (false) {
            maxAssets = maxAssets;
        }
    }

    /**
     * @notice Checks if the account should be allowed to transfer tokens in the given market
     * @param vToken The market to verify the transfer against
     * @param src The account which sources the tokens
     * @param dst The account which receives the tokens
     * @param transferTokens The number of vTokens to transfer
     * @return 0 if the transfer is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)
     */
    function transferAllowed(address vToken, address src, address dst, uint transferTokens) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!transferGuardianPaused, "transfer is paused");

        // Currently the only consideration is whether or not
        //  the src is allowed to redeem this many tokens
        uint allowed = redeemAllowedInternal(vToken, src, transferTokens);
        if (allowed != uint(Error.NO_ERROR)) {
            return allowed;
        }

        // Keep the flywheel moving
        updateVenusSupplyIndex(vToken);
        distributeSupplierVenus(vToken, src, false);
        distributeSupplierVenus(vToken, dst, false);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Validates transfer and reverts on rejection. May emit logs.
     * @param vToken Asset being transferred
     * @param src The account which sources the tokens
     * @param dst The account which receives the tokens
     * @param transferTokens The number of vTokens to transfer
     */
    function transferVerify(address vToken, address src, address dst, uint transferTokens) external {
        // Shh - currently unused
        vToken;
        src;
        dst;
        transferTokens;

        // Shh - we don't ever want this hook to be marked pure
        if (false) {
            maxAssets = maxAssets;
        }
    }

    /*** Liquidity/Liquidation Calculations ***/

    /**
     * @dev Local vars for avoiding stack-depth limits in calculating account liquidity.
     *  Note that `vTokenBalance` is the number of vTokens the account owns in the market,
     *  whereas `borrowBalance` is the amount of underlying that the account has borrowed.
     */
    struct AccountLiquidityLocalVars {
        uint sumCollateral;
        uint sumBorrowPlusEffects;
        uint vTokenBalance;
        uint borrowBalance;
        uint exchangeRateMantissa;
        uint oraclePriceMantissa;
        Exp collateralFactor;
        Exp exchangeRate;
        Exp oraclePrice;
        Exp tokensToDenom;
    }

    /**
     * @notice Determine the current account liquidity wrt collateral requirements
     * @return (possible error code (semi-opaque),
                account liquidity in excess of collateral requirements,
     *          account shortfall below collateral requirements)
     */
    function getAccountLiquidity(address account) public view returns (uint, uint, uint) {
        (Error err, uint liquidity, uint shortfall) = getHypotheticalAccountLiquidityInternal(account, VToken(0), 0, 0);

        return (uint(err), liquidity, shortfall);
    }

    /**
     * @notice Determine the current account liquidity wrt collateral requirements
     * @return (possible error code,
                account liquidity in excess of collateral requirements,
     *          account shortfall below collateral requirements)
     */
    function getAccountLiquidityInternal(address account) internal view returns (Error, uint, uint) {
        return getHypotheticalAccountLiquidityInternal(account, VToken(0), 0, 0);
    }

    /**
     * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed
     * @param vTokenModify The market to hypothetically redeem/borrow in
     * @param account The account to determine liquidity for
     * @param redeemTokens The number of tokens to hypothetically redeem
     * @param borrowAmount The amount of underlying to hypothetically borrow
     * @return (possible error code (semi-opaque),
                hypothetical account liquidity in excess of collateral requirements,
     *          hypothetical account shortfall below collateral requirements)
     */
    function getHypotheticalAccountLiquidity(
        address account,
        address vTokenModify,
        uint redeemTokens,
        uint borrowAmount) public view returns (uint, uint, uint) {
        (Error err, uint liquidity, uint shortfall) = getHypotheticalAccountLiquidityInternal(account, VToken(vTokenModify), redeemTokens, borrowAmount);
        return (uint(err), liquidity, shortfall);
    }

    /**
     * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed
     * @param vTokenModify The market to hypothetically redeem/borrow in
     * @param account The account to determine liquidity for
     * @param redeemTokens The number of tokens to hypothetically redeem
     * @param borrowAmount The amount of underlying to hypothetically borrow
     * @dev Note that we calculate the exchangeRateStored for each collateral vToken using stored data,
     *  without calculating accumulated interest.
     * @return (possible error code,
                hypothetical account liquidity in excess of collateral requirements,
     *          hypothetical account shortfall below collateral requirements)
     */
    function getHypotheticalAccountLiquidityInternal(
        address account,
        VToken vTokenModify,
        uint redeemTokens,
        uint borrowAmount) internal view returns (Error, uint, uint) {

        AccountLiquidityLocalVars memory vars; // Holds all our calculation results
        uint oErr;
        MathError mErr;

        // For each asset the account is in
        VToken[] memory assets = accountAssets[account];
        for (uint i = 0; i < assets.length; i++) {
            VToken asset = assets[i];

            // Read the balances and exchange rate from the vToken
            (oErr, vars.vTokenBalance, vars.borrowBalance, vars.exchangeRateMantissa) = asset.getAccountSnapshot(account);
            if (oErr != 0) { // semi-opaque error code, we assume NO_ERROR == 0 is invariant between upgrades
                return (Error.SNAPSHOT_ERROR, 0, 0);
            }
            vars.collateralFactor = Exp({mantissa: markets[address(asset)].collateralFactorMantissa});
            vars.exchangeRate = Exp({mantissa: vars.exchangeRateMantissa});

            // Get the normalized price of the asset
            vars.oraclePriceMantissa = oracle.getUnderlyingPrice(asset);
            if (vars.oraclePriceMantissa == 0) {
                return (Error.PRICE_ERROR, 0, 0);
            }
            vars.oraclePrice = Exp({mantissa: vars.oraclePriceMantissa});

            // Pre-compute a conversion factor from tokens -> bnb (normalized price value)
            (mErr, vars.tokensToDenom) = mulExp3(vars.collateralFactor, vars.exchangeRate, vars.oraclePrice);
            if (mErr != MathError.NO_ERROR) {
                return (Error.MATH_ERROR, 0, 0);
            }

            // sumCollateral += tokensToDenom * vTokenBalance
            (mErr, vars.sumCollateral) = mulScalarTruncateAddUInt(vars.tokensToDenom, vars.vTokenBalance, vars.sumCollateral);
            if (mErr != MathError.NO_ERROR) {
                return (Error.MATH_ERROR, 0, 0);
            }

            // sumBorrowPlusEffects += oraclePrice * borrowBalance
            (mErr, vars.sumBorrowPlusEffects) = mulScalarTruncateAddUInt(vars.oraclePrice, vars.borrowBalance, vars.sumBorrowPlusEffects);
            if (mErr != MathError.NO_ERROR) {
                return (Error.MATH_ERROR, 0, 0);
            }

            // Calculate effects of interacting with vTokenModify
            if (asset == vTokenModify) {
                // redeem effect
                // sumBorrowPlusEffects += tokensToDenom * redeemTokens
                (mErr, vars.sumBorrowPlusEffects) = mulScalarTruncateAddUInt(vars.tokensToDenom, redeemTokens, vars.sumBorrowPlusEffects);
                if (mErr != MathError.NO_ERROR) {
                    return (Error.MATH_ERROR, 0, 0);
                }

                // borrow effect
                // sumBorrowPlusEffects += oraclePrice * borrowAmount
                (mErr, vars.sumBorrowPlusEffects) = mulScalarTruncateAddUInt(vars.oraclePrice, borrowAmount, vars.sumBorrowPlusEffects);
                if (mErr != MathError.NO_ERROR) {
                    return (Error.MATH_ERROR, 0, 0);
                }
            }
        }

        /// @dev VAI Integration^
        (mErr, vars.sumBorrowPlusEffects) = addUInt(vars.sumBorrowPlusEffects, mintedVAIs[account]);
        if (mErr != MathError.NO_ERROR) {
            return (Error.MATH_ERROR, 0, 0);
        }
        /// @dev VAI Integration$

        // These are safe, as the underflow condition is checked first
        if (vars.sumCollateral > vars.sumBorrowPlusEffects) {
            return (Error.NO_ERROR, vars.sumCollateral - vars.sumBorrowPlusEffects, 0);
        } else {
            return (Error.NO_ERROR, 0, vars.sumBorrowPlusEffects - vars.sumCollateral);
        }
    }

    /**
     * @notice Calculate number of tokens of collateral asset to seize given an underlying amount
     * @dev Used in liquidation (called in vToken.liquidateBorrowFresh)
     * @param vTokenBorrowed The address of the borrowed vToken
     * @param vTokenCollateral The address of the collateral vToken
     * @param actualRepayAmount The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens
     * @return (errorCode, number of vTokenCollateral tokens to be seized in a liquidation)
     */
    function liquidateCalculateSeizeTokens(address vTokenBorrowed, address vTokenCollateral, uint actualRepayAmount) external view returns (uint, uint) {
        /* Read oracle prices for borrowed and collateral markets */
        uint priceBorrowedMantissa = oracle.getUnderlyingPrice(VToken(vTokenBorrowed));
        uint priceCollateralMantissa = oracle.getUnderlyingPrice(VToken(vTokenCollateral));
        if (priceBorrowedMantissa == 0 || priceCollateralMantissa == 0) {
            return (uint(Error.PRICE_ERROR), 0);
        }

        /*
         * Get the exchange rate and calculate the number of collateral tokens to seize:
         *  seizeAmount = actualRepayAmount * liquidationIncentive * priceBorrowed / priceCollateral
         *  seizeTokens = seizeAmount / exchangeRate
         *   = actualRepayAmount * (liquidationIncentive * priceBorrowed) / (priceCollateral * exchangeRate)
         */
        uint exchangeRateMantissa = VToken(vTokenCollateral).exchangeRateStored(); // Note: reverts on error
        uint seizeTokens;
        Exp memory numerator;
        Exp memory denominator;
        Exp memory ratio;
        MathError mathErr;

        (mathErr, numerator) = mulExp(liquidationIncentiveMantissa, priceBorrowedMantissa);
        if (mathErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0);
        }

        (mathErr, denominator) = mulExp(priceCollateralMantissa, exchangeRateMantissa);
        if (mathErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0);
        }

        (mathErr, ratio) = divExp(numerator, denominator);
        if (mathErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0);
        }

        (mathErr, seizeTokens) = mulScalarTruncate(ratio, actualRepayAmount);
        if (mathErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0);
        }

        return (uint(Error.NO_ERROR), seizeTokens);
    }

    /*** Admin Functions ***/

    /**
      * @notice Sets a new price oracle for the comptroller
      * @dev Admin function to set a new price oracle
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setPriceOracle(PriceOracle newOracle) public returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK);
        }

        // Track the old oracle for the comptroller
        PriceOracle oldOracle = oracle;

        // Set comptroller's oracle to newOracle
        oracle = newOracle;

        // Emit NewPriceOracle(oldOracle, newOracle)
        emit NewPriceOracle(oldOracle, newOracle);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sets the closeFactor used when liquidating borrows
      * @dev Admin function to set closeFactor
      * @param newCloseFactorMantissa New close factor, scaled by 1e18
      * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)
      */
    function _setCloseFactor(uint newCloseFactorMantissa) external returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_CLOSE_FACTOR_OWNER_CHECK);
        }

        Exp memory newCloseFactorExp = Exp({mantissa: newCloseFactorMantissa});
        Exp memory lowLimit = Exp({mantissa: closeFactorMinMantissa});
        if (lessThanOrEqualExp(newCloseFactorExp, lowLimit)) {
            return fail(Error.INVALID_CLOSE_FACTOR, FailureInfo.SET_CLOSE_FACTOR_VALIDATION);
        }

        Exp memory highLimit = Exp({mantissa: closeFactorMaxMantissa});
        if (lessThanExp(highLimit, newCloseFactorExp)) {
            return fail(Error.INVALID_CLOSE_FACTOR, FailureInfo.SET_CLOSE_FACTOR_VALIDATION);
        }

        uint oldCloseFactorMantissa = closeFactorMantissa;
        closeFactorMantissa = newCloseFactorMantissa;
        emit NewCloseFactor(oldCloseFactorMantissa, closeFactorMantissa);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sets the collateralFactor for a market
      * @dev Admin function to set per-market collateralFactor
      * @param vToken The market to set the factor on
      * @param newCollateralFactorMantissa The new collateral factor, scaled by 1e18
      * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)
      */
    function _setCollateralFactor(VToken vToken, uint newCollateralFactorMantissa) external returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_COLLATERAL_FACTOR_OWNER_CHECK);
        }

        // Verify market is listed
        Market storage market = markets[address(vToken)];
        if (!market.isListed) {
            return fail(Error.MARKET_NOT_LISTED, FailureInfo.SET_COLLATERAL_FACTOR_NO_EXISTS);
        }

        Exp memory newCollateralFactorExp = Exp({mantissa: newCollateralFactorMantissa});

        // Check collateral factor <= 0.9
        Exp memory highLimit = Exp({mantissa: collateralFactorMaxMantissa});
        if (lessThanExp(highLimit, newCollateralFactorExp)) {
            return fail(Error.INVALID_COLLATERAL_FACTOR, FailureInfo.SET_COLLATERAL_FACTOR_VALIDATION);
        }

        // If collateral factor != 0, fail if price == 0
        if (newCollateralFactorMantissa != 0 && oracle.getUnderlyingPrice(vToken) == 0) {
            return fail(Error.PRICE_ERROR, FailureInfo.SET_COLLATERAL_FACTOR_WITHOUT_PRICE);
        }

        // Set market's collateral factor to new collateral factor, remember old value
        uint oldCollateralFactorMantissa = market.collateralFactorMantissa;
        market.collateralFactorMantissa = newCollateralFactorMantissa;

        // Emit event with asset, old collateral factor, and new collateral factor
        emit NewCollateralFactor(vToken, oldCollateralFactorMantissa, newCollateralFactorMantissa);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sets maxAssets which controls how many markets can be entered
      * @dev Admin function to set maxAssets
      * @param newMaxAssets New max assets
      * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)
      */
    function _setMaxAssets(uint newMaxAssets) external returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_MAX_ASSETS_OWNER_CHECK);
        }

        uint oldMaxAssets = maxAssets;
        maxAssets = newMaxAssets;
        emit NewMaxAssets(oldMaxAssets, newMaxAssets);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sets liquidationIncentive
      * @dev Admin function to set liquidationIncentive
      * @param newLiquidationIncentiveMantissa New liquidationIncentive scaled by 1e18
      * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)
      */
    function _setLiquidationIncentive(uint newLiquidationIncentiveMantissa) external returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK);
        }

        // Check de-scaled min <= newLiquidationIncentive <= max
        Exp memory newLiquidationIncentive = Exp({mantissa: newLiquidationIncentiveMantissa});
        Exp memory minLiquidationIncentive = Exp({mantissa: liquidationIncentiveMinMantissa});
        if (lessThanExp(newLiquidationIncentive, minLiquidationIncentive)) {
            return fail(Error.INVALID_LIQUIDATION_INCENTIVE, FailureInfo.SET_LIQUIDATION_INCENTIVE_VALIDATION);
        }

        Exp memory maxLiquidationIncentive = Exp({mantissa: liquidationIncentiveMaxMantissa});
        if (lessThanExp(maxLiquidationIncentive, newLiquidationIncentive)) {
            return fail(Error.INVALID_LIQUIDATION_INCENTIVE, FailureInfo.SET_LIQUIDATION_INCENTIVE_VALIDATION);
        }

        // Save current value for use in log
        uint oldLiquidationIncentiveMantissa = liquidationIncentiveMantissa;

        // Set liquidation incentive to new incentive
        liquidationIncentiveMantissa = newLiquidationIncentiveMantissa;

        // Emit event with old incentive, new incentive
        emit NewLiquidationIncentive(oldLiquidationIncentiveMantissa, newLiquidationIncentiveMantissa);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Add the market to the markets mapping and set it as listed
      * @dev Admin function to set isListed and add support for the market
      * @param vToken The address of the market (token) to list
      * @return uint 0=success, otherwise a failure. (See enum Error for details)
      */
    function _supportMarket(VToken vToken) external returns (uint) {
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SUPPORT_MARKET_OWNER_CHECK);
        }

        if (markets[address(vToken)].isListed) {
            return fail(Error.MARKET_ALREADY_LISTED, FailureInfo.SUPPORT_MARKET_EXISTS);
        }

        vToken.isVToken(); // Sanity check to make sure its really a VToken

        markets[address(vToken)] = Market({isListed: true, isVenus: false, collateralFactorMantissa: 0});

        _addMarketInternal(address(vToken));

        emit MarketListed(vToken);

        return uint(Error.NO_ERROR);
    }

    function _addMarketInternal(address vToken) internal {
        for (uint i = 0; i < allMarkets.length; i ++) {
            require(allMarkets[i] != VToken(vToken), "market already added");
        }
        allMarkets.push(VToken(vToken));
    }

    /**
     * @notice Admin function to change the Pause Guardian
     * @param newPauseGuardian The address of the new Pause Guardian
     * @return uint 0=success, otherwise a failure. (See enum Error for details)
     */
    function _setPauseGuardian(address newPauseGuardian) public returns (uint) {
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PAUSE_GUARDIAN_OWNER_CHECK);
        }

        // Save current value for inclusion in log
        address oldPauseGuardian = pauseGuardian;

        // Store pauseGuardian with value newPauseGuardian
        pauseGuardian = newPauseGuardian;

        // Emit NewPauseGuardian(OldPauseGuardian, NewPauseGuardian)
        emit NewPauseGuardian(oldPauseGuardian, pauseGuardian);

        return uint(Error.NO_ERROR);
    }

    function _setVAIMintRate(uint newVAIMintRate) external returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_VAI_MINT_RATE_CHECK);
        }

        uint oldVAIMintRate = vaiMintRate;
        vaiMintRate = newVAIMintRate;
        emit NewVAIMintRate(oldVAIMintRate, newVAIMintRate);

        return uint(Error.NO_ERROR);
    }

    function _become(Unitroller unitroller) public {
        require(msg.sender == unitroller.admin(), "only unitroller admin can");
        require(unitroller._acceptImplementation() == 0, "not authorized");
    }

    /*** Venus Distribution ***/

    /**
     * @notice Recalculate and update Venus speeds for all Venus markets
     */
    function refreshVenusSpeeds() public {
        require(msg.sender == tx.origin, "only externally owned accounts can");
        refreshVenusSpeedsInternal();
    }

    function refreshVenusSpeedsInternal() internal {
        uint i;
        VToken vToken;
        for (i = 0; i < allMarkets.length; i++) {
            vToken = allMarkets[i];
            Exp memory borrowIndex = Exp({mantissa: vToken.borrowIndex()});
            updateVenusSupplyIndex(address(vToken));
            updateVenusBorrowIndex(address(vToken), borrowIndex);
        }

        Exp memory totalUtility = Exp({mantissa: 0});
        Exp[] memory utilities = new Exp[](allMarkets.length);
        for (i = 0; i < allMarkets.length; i++) {
            vToken = allMarkets[i];
            if (markets[address(vToken)].isVenus) {
                Exp memory assetPrice = Exp({mantissa: oracle.getUnderlyingPrice(vToken)});
                Exp memory utility = mul_(assetPrice, vToken.totalBorrows());
                utilities[i] = utility;
                totalUtility = add_(totalUtility, utility);
            }
        }

        for (i = 0; i < allMarkets.length; i++) {
            vToken = allMarkets[i];
            uint newSpeed = totalUtility.mantissa > 0 ? mul_(venusRate, div_(utilities[i], totalUtility)) : 0;
            venusSpeeds[address(vToken)] = newSpeed;
            emit VenusSpeedUpdated(vToken, newSpeed);
        }
    }

    /**
     * @notice Accrue XVS to the market by updating the supply index
     * @param vToken The market whose supply index to update
     */
    function updateVenusSupplyIndex(address vToken) internal {
        VenusMarketState storage supplyState = venusSupplyState[vToken];
        uint supplySpeed = venusSpeeds[vToken];
        uint blockNumber = getBlockNumber();
        uint deltaBlocks = sub_(blockNumber, uint(supplyState.block));
        if (deltaBlocks > 0 && supplySpeed > 0) {
            uint supplyTokens = VToken(vToken).totalSupply();
            uint venusAccrued = mul_(deltaBlocks, supplySpeed);
            Double memory ratio = supplyTokens > 0 ? fraction(venusAccrued, supplyTokens) : Double({mantissa: 0});
            Double memory index = add_(Double({mantissa: supplyState.index}), ratio);
            venusSupplyState[vToken] = VenusMarketState({
                index: safe224(index.mantissa, "new index overflows"),
                block: safe32(blockNumber, "block number overflows")
            });
        } else if (deltaBlocks > 0) {
            supplyState.block = safe32(blockNumber, "block number overflows");
        }
    }

    /**
     * @notice Accrue XVS to the market by updating the borrow index
     * @param vToken The market whose borrow index to update
     */
    function updateVenusBorrowIndex(address vToken, Exp memory marketBorrowIndex) internal {
        VenusMarketState storage borrowState = venusBorrowState[vToken];
        uint borrowSpeed = venusSpeeds[vToken];
        uint blockNumber = getBlockNumber();
        uint deltaBlocks = sub_(blockNumber, uint(borrowState.block));
        if (deltaBlocks > 0 && borrowSpeed > 0) {
            uint borrowAmount = div_(VToken(vToken).totalBorrows(), marketBorrowIndex);
            uint venusAccrued = mul_(deltaBlocks, borrowSpeed);
            Double memory ratio = borrowAmount > 0 ? fraction(venusAccrued, borrowAmount) : Double({mantissa: 0});
            Double memory index = add_(Double({mantissa: borrowState.index}), ratio);
            venusBorrowState[vToken] = VenusMarketState({
                index: safe224(index.mantissa, "new index overflows"),
                block: safe32(blockNumber, "block number overflows")
            });
        } else if (deltaBlocks > 0) {
            borrowState.block = safe32(blockNumber, "block number overflows");
        }
    }

    /**
     * @notice Calculate XVS accrued by a supplier and possibly transfer it to them
     * @param vToken The market in which the supplier is interacting
     * @param supplier The address of the supplier to distribute XVS to
     */
    function distributeSupplierVenus(address vToken, address supplier, bool distributeAll) internal {
        VenusMarketState storage supplyState = venusSupplyState[vToken];
        Double memory supplyIndex = Double({mantissa: supplyState.index});
        Double memory supplierIndex = Double({mantissa: venusSupplierIndex[vToken][supplier]});
        venusSupplierIndex[vToken][supplier] = supplyIndex.mantissa;

        if (supplierIndex.mantissa == 0 && supplyIndex.mantissa > 0) {
            supplierIndex.mantissa = venusInitialIndex;
        }

        Double memory deltaIndex = sub_(supplyIndex, supplierIndex);
        uint supplierTokens = VToken(vToken).balanceOf(supplier);
        uint supplierDelta = mul_(supplierTokens, deltaIndex);
        uint supplierAccrued = add_(venusAccrued[supplier], supplierDelta);
        venusAccrued[supplier] = transferXVS(supplier, supplierAccrued, distributeAll ? 0 : venusClaimThreshold);
        emit DistributedSupplierVenus(VToken(vToken), supplier, supplierDelta, supplyIndex.mantissa);
    }

    /**
     * @notice Calculate XVS accrued by a borrower and possibly transfer it to them
     * @dev Borrowers will not begin to accrue until after the first interaction with the protocol.
     * @param vToken The market in which the borrower is interacting
     * @param borrower The address of the borrower to distribute XVS to
     */
    function distributeBorrowerVenus(address vToken, address borrower, Exp memory marketBorrowIndex, bool distributeAll) internal {
        VenusMarketState storage borrowState = venusBorrowState[vToken];
        Double memory borrowIndex = Double({mantissa: borrowState.index});
        Double memory borrowerIndex = Double({mantissa: venusBorrowerIndex[vToken][borrower]});
        venusBorrowerIndex[vToken][borrower] = borrowIndex.mantissa;

        if (borrowerIndex.mantissa > 0) {
            Double memory deltaIndex = sub_(borrowIndex, borrowerIndex);
            uint borrowerAmount = div_(VToken(vToken).borrowBalanceStored(borrower), marketBorrowIndex);
            uint borrowerDelta = mul_(borrowerAmount, deltaIndex);
            uint borrowerAccrued = add_(venusAccrued[borrower], borrowerDelta);
            venusAccrued[borrower] = transferXVS(borrower, borrowerAccrued, distributeAll ? 0 : venusClaimThreshold);
            emit DistributedBorrowerVenus(VToken(vToken), borrower, borrowerDelta, borrowIndex.mantissa);
        }
    }

    /**
     * @notice Transfer XVS to the user, if they are above the threshold
     * @dev Note: If there is not enough XVS, we do not perform the transfer all.
     * @param user The address of the user to transfer XVS to
     * @param userAccrued The amount of XVS to (possibly) transfer
     * @return The amount of XVS which was NOT transferred to the user
     */
    function transferXVS(address user, uint userAccrued, uint threshold) internal returns (uint) {
        if (userAccrued >= threshold && userAccrued > 0) {
            XVS xvs = XVS(getXVSAddress());
            uint xvsRemaining = xvs.balanceOf(address(this));
            if (userAccrued <= xvsRemaining) {
                xvs.transfer(user, userAccrued);
                return 0;
            }
        }
        return userAccrued;
    }

    /**
     * @notice Claim all the xvs accrued by holder in all markets
     * @param holder The address to claim XVS for
     */
    function claimVenus(address holder) public {
        return claimVenus(holder, allMarkets);
    }

    /**
     * @notice Claim all the xvs accrued by holder in the specified markets
     * @param holder The address to claim XVS for
     * @param vTokens The list of markets to claim XVS in
     */
    function claimVenus(address holder, VToken[] memory vTokens) public {
        address[] memory holders = new address[](1);
        holders[0] = holder;
        claimVenus(holders, vTokens, true, true);
    }

    /**
     * @notice Claim all xvs accrued by the holders
     * @param holders The addresses to claim XVS for
     * @param vTokens The list of markets to claim XVS in
     * @param borrowers Whether or not to claim XVS earned by borrowing
     * @param suppliers Whether or not to claim XVS earned by supplying
     */
    function claimVenus(address[] memory holders, VToken[] memory vTokens, bool borrowers, bool suppliers) public {
        uint j;
        for (uint i = 0; i < vTokens.length; i++) {
            VToken vToken = vTokens[i];
            require(markets[address(vToken)].isListed, "not listed market");
            if (borrowers == true) {
                Exp memory borrowIndex = Exp({mantissa: vToken.borrowIndex()});
                updateVenusBorrowIndex(address(vToken), borrowIndex);
                for (j = 0; j < holders.length; j++) {
                    distributeBorrowerVenus(address(vToken), holders[j], borrowIndex, true);
                }
            }
            if (suppliers == true) {
                updateVenusSupplyIndex(address(vToken));
                for (j = 0; j < holders.length; j++) {
                    distributeSupplierVenus(address(vToken), holders[j], true);
                }
            }
        }
    }

    /*** Venus Distribution Admin ***/

    /**
     * @notice Set the amount of XVS distributed per block
     * @param venusRate_ The amount of XVS wei per block to distribute
     */
    function _setVenusRate(uint venusRate_) public {
        require(msg.sender == admin, "only admin can");

        uint oldRate = venusRate;
        venusRate = venusRate_;
        emit NewVenusRate(oldRate, venusRate_);

        refreshVenusSpeedsInternal();
    }

    /**
     * @notice Add markets to venusMarkets, allowing them to earn XVS in the flywheel
     * @param vTokens The addresses of the markets to add
     */
    function _addVenusMarkets(address[] memory vTokens) public {
        require(msg.sender == admin, "only admin can");

        for (uint i = 0; i < vTokens.length; i++) {
            _addVenusMarketInternal(vTokens[i]);
        }

        refreshVenusSpeedsInternal();
    }

    function _addVenusMarketInternal(address vToken) internal {
        Market storage market = markets[vToken];
        require(market.isListed == true, "venus market is not listed");
        require(market.isVenus == false, "venus market already added");

        market.isVenus = true;
        emit MarketVenus(VToken(vToken), true);

        if (venusSupplyState[vToken].index == 0 && venusSupplyState[vToken].block == 0) {
            venusSupplyState[vToken] = VenusMarketState({
                index: venusInitialIndex,
                block: safe32(getBlockNumber(), "block number overflows")
            });
        }

        if (venusBorrowState[vToken].index == 0 && venusBorrowState[vToken].block == 0) {
            venusBorrowState[vToken] = VenusMarketState({
                index: venusInitialIndex,
                block: safe32(getBlockNumber(), "block number overflows")
            });
        }
    }

    /**
     * @notice Remove a market from venusMarkets, preventing it from earning XVS in the flywheel
     * @param vToken The address of the market to drop
     */
    function _dropVenusMarket(address vToken) public {
        require(msg.sender == admin, "only admin can");

        Market storage market = markets[vToken];
        require(market.isVenus == true, "not venus market");

        market.isVenus = false;
        emit MarketVenus(VToken(vToken), false);

        refreshVenusSpeedsInternal();
    }

    /**
     * @notice Return all of the markets
     * @dev The automatic getter may be used to access an individual market.
     * @return The list of market addresses
     */
    function getAllMarkets() public view returns (VToken[] memory) {
        return allMarkets;
    }

    function getBlockNumber() public view returns (uint) {
        return block.number;
    }

    /**
     * @notice Return the address of the XVS token
     * @return The address of XVS
     */
   function getXVSAddress() public view returns (address) {
        return 0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63;
    }

    /**
      * @notice Sets a new VAI controller
      * @dev Admin function to set a new VAI controller
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setVAIController(VAIControllerInterface vaiController_) public returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_VAICONTROLLER_OWNER_CHECK);
        }

        VAIControllerInterface oldRate = vaiController;
        vaiController = vaiController_;
        emit NewVAIController(oldRate, vaiController_);
    }

    /**
     * @notice Get the minted VAI amount of the `owner`
     * @param owner The address of the account to query
     * @return The number of minted VAI by `owner`
     */
    function mintedVAIOf(address owner) external view returns (uint) {
        return mintedVAIs[owner];
    }

    /**
     * @notice Set the minted VAI amount of the `owner`
     * @param owner The address of the account to set
     * @param amount The amount of VAI to set to the account
     * @return The number of minted VAI by `owner`
     */
    function setMintedVAIOf(address owner, uint amount) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!mintVAIGuardianPaused && !repayVAIGuardianPaused, "VAI is paused");
        // Check caller is vaiController
        if (msg.sender != address(vaiController)) {
            return fail(Error.REJECTION, FailureInfo.SET_MINTED_VAI_REJECTION);
        }
        mintedVAIs[owner] = amount;

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Get Mintable VAI amount
     */
    function getMintableVAI(address minter) public view returns (uint, uint) {
        return vaiController.getMintableVAI(minter);
    }

    /**
     * @notice Mint VAI
     */
    function mintVAI(uint mintVAIAmount) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!mintVAIGuardianPaused, "mintVAI is paused");
        return vaiController.mintVAI(msg.sender, mintVAIAmount);
    }

    /**
     * @notice Repay VAI
     */
    function repayVAI(uint repayVAIAmount) external onlyProtocolAllowed returns (uint) {
        // Pausing is a very serious situation - we revert to sound the alarms
        require(!repayVAIGuardianPaused, "repayVAI is paused");
        return vaiController.repayVAI(msg.sender, repayVAIAmount);
    }

    /**
     * @notice Get the VAI Mint Rate
     */
    function getVAIMintRate() external view returns (uint) {
        return vaiMintRate;
    }

    /**
     * @notice Set whole protocol pause/unpause state
     */
    function _setProtocolPaused(bool state) public returns(bool) {
        require(msg.sender == admin, "only admin can");

        protocolPaused = state;
        emit ActionProtocolPaused(state);
        return state;
    }
}

File 2 of 17: BEP20Interface.sol
pragma solidity ^0.5.16;

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

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

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

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

  /**
   * @dev Returns the bep token owner.
   */
  function getOwner() external view returns (address);

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

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

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

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

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

  /**
   * @dev Emitted when `value` tokens are moved from one account (`from`) to
   * another (`to`).
   *
   * Note that `value` may be zero.
   */
  event Transfer(address indexed from, address indexed to, uint256 value);

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

File 3 of 17: CarefulMath.sol
pragma solidity ^0.5.16;

/**
  * @title Careful Math
  * @author Venus
  * @notice Derived from OpenZeppelin's SafeMath library
  *         https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
  */
contract CarefulMath {

    /**
     * @dev Possible error codes that we can return
     */
    enum MathError {
        NO_ERROR,
        DIVISION_BY_ZERO,
        INTEGER_OVERFLOW,
        INTEGER_UNDERFLOW
    }

    /**
    * @dev Multiplies two numbers, returns an error on overflow.
    */
    function mulUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (a == 0) {
            return (MathError.NO_ERROR, 0);
        }

        uint c = a * b;

        if (c / a != b) {
            return (MathError.INTEGER_OVERFLOW, 0);
        } else {
            return (MathError.NO_ERROR, c);
        }
    }

    /**
    * @dev Integer division of two numbers, truncating the quotient.
    */
    function divUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (b == 0) {
            return (MathError.DIVISION_BY_ZERO, 0);
        }

        return (MathError.NO_ERROR, a / b);
    }

    /**
    * @dev Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
    */
    function subUInt(uint a, uint b) internal pure returns (MathError, uint) {
        if (b <= a) {
            return (MathError.NO_ERROR, a - b);
        } else {
            return (MathError.INTEGER_UNDERFLOW, 0);
        }
    }

    /**
    * @dev Adds two numbers, returns an error on overflow.
    */
    function addUInt(uint a, uint b) internal pure returns (MathError, uint) {
        uint c = a + b;

        if (c >= a) {
            return (MathError.NO_ERROR, c);
        } else {
            return (MathError.INTEGER_OVERFLOW, 0);
        }
    }

    /**
    * @dev add a and b and then subtract c
    */
    function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
        (MathError err0, uint sum) = addUInt(a, b);

        if (err0 != MathError.NO_ERROR) {
            return (err0, 0);
        }

        return subUInt(sum, c);
    }
}

File 4 of 17: ComptrollerInterface.sol
pragma solidity ^0.5.16;

contract ComptrollerInterface {
    /// @notice Indicator that this is a Comptroller contract (for inspection)
    bool public constant isComptroller = true;

    /*** Assets You Are In ***/

    function enterMarkets(address[] calldata vTokens) external returns (uint[] memory);
    function exitMarket(address vToken) external returns (uint);

    /*** Policy Hooks ***/

    function mintAllowed(address vToken, address minter, uint mintAmount) external returns (uint);
    function mintVerify(address vToken, address minter, uint mintAmount, uint mintTokens) external;

    function redeemAllowed(address vToken, address redeemer, uint redeemTokens) external returns (uint);
    function redeemVerify(address vToken, address redeemer, uint redeemAmount, uint redeemTokens) external;

    function borrowAllowed(address vToken, address borrower, uint borrowAmount) external returns (uint);
    function borrowVerify(address vToken, address borrower, uint borrowAmount) external;

    function repayBorrowAllowed(
        address vToken,
        address payer,
        address borrower,
        uint repayAmount) external returns (uint);
    function repayBorrowVerify(
        address vToken,
        address payer,
        address borrower,
        uint repayAmount,
        uint borrowerIndex) external;

    function liquidateBorrowAllowed(
        address vTokenBorrowed,
        address vTokenCollateral,
        address liquidator,
        address borrower,
        uint repayAmount) external returns (uint);
    function liquidateBorrowVerify(
        address vTokenBorrowed,
        address vTokenCollateral,
        address liquidator,
        address borrower,
        uint repayAmount,
        uint seizeTokens) external;

    function seizeAllowed(
        address vTokenCollateral,
        address vTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external returns (uint);
    function seizeVerify(
        address vTokenCollateral,
        address vTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external;

    function transferAllowed(address vToken, address src, address dst, uint transferTokens) external returns (uint);
    function transferVerify(address vToken, address src, address dst, uint transferTokens) external;

    /*** Liquidity/Liquidation Calculations ***/

    function liquidateCalculateSeizeTokens(
        address vTokenBorrowed,
        address vTokenCollateral,
        uint repayAmount) external view returns (uint, uint);

    function mintedVAIOf(address owner) external view returns (uint);
    function setMintedVAIOf(address owner, uint amount) external returns (uint);
    function getVAIMintRate() external view returns (uint);
}

File 5 of 17: ComptrollerStorage.sol
pragma solidity ^0.5.16;

import "./VToken.sol";
import "./PriceOracle.sol";
import "./VAIControllerInterface.sol";

contract UnitrollerAdminStorage {
    /**
    * @notice Administrator for this contract
    */
    address public admin;

    /**
    * @notice Pending administrator for this contract
    */
    address public pendingAdmin;

    /**
    * @notice Active brains of Unitroller
    */
    address public comptrollerImplementation;

    /**
    * @notice Pending brains of Unitroller
    */
    address public pendingComptrollerImplementation;
}

contract ComptrollerStorage is UnitrollerAdminStorage {

    /**
     * @notice Oracle which gives the price of any given asset
     */
    PriceOracle public oracle;

    /**
     * @notice Multiplier used to calculate the maximum repayAmount when liquidating a borrow
     */
    uint public closeFactorMantissa;

    /**
     * @notice Multiplier representing the discount on collateral that a liquidator receives
     */
    uint public liquidationIncentiveMantissa;

    /**
     * @notice Max number of assets a single account can participate in (borrow or use as collateral)
     */
    uint public maxAssets;

    /**
     * @notice Per-account mapping of "assets you are in", capped by maxAssets
     */
    mapping(address => VToken[]) public accountAssets;

    struct Market {
        /// @notice Whether or not this market is listed
        bool isListed;

        /**
         * @notice Multiplier representing the most one can borrow against their collateral in this market.
         *  For instance, 0.9 to allow borrowing 90% of collateral value.
         *  Must be between 0 and 1, and stored as a mantissa.
         */
        uint collateralFactorMantissa;

        /// @notice Per-market mapping of "accounts in this asset"
        mapping(address => bool) accountMembership;

        /// @notice Whether or not this market receives XVS
        bool isVenus;
    }

    /**
     * @notice Official mapping of vTokens -> Market metadata
     * @dev Used e.g. to determine if a market is supported
     */
    mapping(address => Market) public markets;

    /**
     * @notice The Pause Guardian can pause certain actions as a safety mechanism.
     *  Actions which allow users to remove their own assets cannot be paused.
     *  Liquidation / seizing / transfer can only be paused globally, not by market.
     */
    address public pauseGuardian;
    bool public _mintGuardianPaused;
    bool public _borrowGuardianPaused;
    bool public transferGuardianPaused;
    bool public seizeGuardianPaused;
    mapping(address => bool) public mintGuardianPaused;
    mapping(address => bool) public borrowGuardianPaused;

    struct VenusMarketState {
        /// @notice The market's last updated venusBorrowIndex or venusSupplyIndex
        uint224 index;

        /// @notice The block number the index was last updated at
        uint32 block;
    }

    /// @notice A list of all markets
    VToken[] public allMarkets;

    /// @notice The rate at which the flywheel distributes XVS, per block
    uint public venusRate;

    /// @notice The portion of venusRate that each market currently receives
    mapping(address => uint) public venusSpeeds;

    /// @notice The Venus market supply state for each market
    mapping(address => VenusMarketState) public venusSupplyState;

    /// @notice The Venus market borrow state for each market
    mapping(address => VenusMarketState) public venusBorrowState;

    /// @notice The Venus borrow index for each market for each supplier as of the last time they accrued XVS
    mapping(address => mapping(address => uint)) public venusSupplierIndex;

    /// @notice The Venus borrow index for each market for each borrower as of the last time they accrued XVS
    mapping(address => mapping(address => uint)) public venusBorrowerIndex;

    /// @notice The XVS accrued but not yet transferred to each user
    mapping(address => uint) public venusAccrued;

    /// @notice The Address of VAIController
    VAIControllerInterface public vaiController;

    /// @notice The minted VAI amount to each user
    mapping(address => uint) public mintedVAIs;

    /// @notice VAI Mint Rate as a percentage
    uint public vaiMintRate;

    /**
     * @notice The Pause Guardian can pause certain actions as a safety mechanism.
     */
    bool public mintVAIGuardianPaused;
    bool public repayVAIGuardianPaused;

    /**
     * @notice Pause/Unpause whole protocol actions
     */
    bool public protocolPaused;
}

File 6 of 17: EIP20Interface.sol
pragma solidity ^0.5.16;

/**
 * @title BEP 20 Token Standard Interface
 *  https://eips.ethereum.org/EIPS/eip-20
 */
interface EIP20Interface {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);

    /**
      * @notice Get the total number of tokens in circulation
      * @return The supply of tokens
      */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Gets the balance of the specified address
     * @param owner The address from which the balance will be retrieved
     * @return The balance
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
      * @notice Transfer `amount` tokens from `msg.sender` to `dst`
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return Whether or not the transfer succeeded
      */
    function transfer(address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Transfer `amount` tokens from `src` to `dst`
      * @param src The address of the source account
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return Whether or not the transfer succeeded
      */
    function transferFrom(address src, address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Approve `spender` to transfer up to `amount` from `src`
      * @dev This will overwrite the approval amount for `spender`
      * @param spender The address of the account which may transfer tokens
      * @param amount The number of tokens that are approved (-1 means infinite)
      * @return Whether or not the approval succeeded
      */
    function approve(address spender, uint256 amount) external returns (bool success);

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return The number of tokens allowed to be spent (-1 means infinite)
      */
    function allowance(address owner, address spender) external view returns (uint256 remaining);

    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Approval(address indexed owner, address indexed spender, uint256 amount);
}

File 7 of 17: EIP20NonStandardInterface.sol
pragma solidity ^0.5.16;

/**
 * @title EIP20NonStandardInterface
 * @dev Version of BEP20 with no return values for `transfer` and `transferFrom`
 *  See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
 */
interface EIP20NonStandardInterface {

    /**
     * @notice Get the total number of tokens in circulation
     * @return The supply of tokens
     */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Gets the balance of the specified address
     * @param owner The address from which the balance will be retrieved
     * @return The balance
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    ///
    /// !!!!!!!!!!!!!!
    /// !!! NOTICE !!! `transfer` does not return a value, in violation of the BEP-20 specification
    /// !!!!!!!!!!!!!!
    ///

    /**
      * @notice Transfer `amount` tokens from `msg.sender` to `dst`
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      */
    function transfer(address dst, uint256 amount) external;

    ///
    /// !!!!!!!!!!!!!!
    /// !!! NOTICE !!! `transferFrom` does not return a value, in violation of the BEP-20 specification
    /// !!!!!!!!!!!!!!
    ///

    /**
      * @notice Transfer `amount` tokens from `src` to `dst`
      * @param src The address of the source account
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      */
    function transferFrom(address src, address dst, uint256 amount) external;

    /**
      * @notice Approve `spender` to transfer up to `amount` from `src`
      * @dev This will overwrite the approval amount for `spender`
      * @param spender The address of the account which may transfer tokens
      * @param amount The number of tokens that are approved
      * @return Whether or not the approval succeeded
      */
    function approve(address spender, uint256 amount) external returns (bool success);

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return The number of tokens allowed to be spent
      */
    function allowance(address owner, address spender) external view returns (uint256 remaining);

    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Approval(address indexed owner, address indexed spender, uint256 amount);
}

File 8 of 17: ErrorReporter.sol
pragma solidity ^0.5.16;

contract ComptrollerErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED,
        COMPTROLLER_MISMATCH,
        INSUFFICIENT_SHORTFALL,
        INSUFFICIENT_LIQUIDITY,
        INVALID_CLOSE_FACTOR,
        INVALID_COLLATERAL_FACTOR,
        INVALID_LIQUIDATION_INCENTIVE,
        MARKET_NOT_ENTERED, // no longer possible
        MARKET_NOT_LISTED,
        MARKET_ALREADY_LISTED,
        MATH_ERROR,
        NONZERO_BORROW_BALANCE,
        PRICE_ERROR,
        REJECTION,
        SNAPSHOT_ERROR,
        TOO_MANY_ASSETS,
        TOO_MUCH_REPAY,
        NONZERO_MINTEDVAI_BALANCE,
        /// @dev VAI Integration^
        INSUFFICIENT_BALANCE_FOR_VAI
        /// @dev VAI Integration$
    }

    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,
        EXIT_MARKET_BALANCE_OWED,
        EXIT_MARKET_REJECTION,
        SET_CLOSE_FACTOR_OWNER_CHECK,
        SET_CLOSE_FACTOR_VALIDATION,
        SET_COLLATERAL_FACTOR_OWNER_CHECK,
        SET_COLLATERAL_FACTOR_NO_EXISTS,
        SET_COLLATERAL_FACTOR_VALIDATION,
        SET_COLLATERAL_FACTOR_WITHOUT_PRICE,
        SET_IMPLEMENTATION_OWNER_CHECK,
        SET_LIQUIDATION_INCENTIVE_OWNER_CHECK,
        SET_LIQUIDATION_INCENTIVE_VALIDATION,
        SET_MAX_ASSETS_OWNER_CHECK,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_PENDING_IMPLEMENTATION_OWNER_CHECK,
        SET_PRICE_ORACLE_OWNER_CHECK,
        SUPPORT_MARKET_EXISTS,
        SUPPORT_MARKET_OWNER_CHECK,
        SET_PAUSE_GUARDIAN_OWNER_CHECK,
        SET_VAI_MINT_RATE_CHECK,
        SET_VAICONTROLLER_OWNER_CHECK,
        SET_MINTED_VAI_REJECTION
    }

    /**
      * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
      * contract-specific code that enables us to report opaque error codes from upgradeable contracts.
      **/
    event Failure(uint error, uint info, uint detail);

    /**
      * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
      */
    function fail(Error err, FailureInfo info) internal returns (uint) {
        emit Failure(uint(err), uint(info), 0);

        return uint(err);
    }

    /**
      * @dev use this when reporting an opaque error from an upgradeable collaborator contract
      */
    function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
        emit Failure(uint(err), uint(info), opaqueError);

        return uint(err);
    }
}

contract TokenErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED,
        BAD_INPUT,
        COMPTROLLER_REJECTION,
        COMPTROLLER_CALCULATION_ERROR,
        INTEREST_RATE_MODEL_ERROR,
        INVALID_ACCOUNT_PAIR,
        INVALID_CLOSE_AMOUNT_REQUESTED,
        INVALID_COLLATERAL_FACTOR,
        MATH_ERROR,
        MARKET_NOT_FRESH,
        MARKET_NOT_LISTED,
        TOKEN_INSUFFICIENT_ALLOWANCE,
        TOKEN_INSUFFICIENT_BALANCE,
        TOKEN_INSUFFICIENT_CASH,
        TOKEN_TRANSFER_IN_FAILED,
        TOKEN_TRANSFER_OUT_FAILED,
        TOKEN_PRICE_ERROR
    }

    /*
     * Note: FailureInfo (but not Error) is kept in alphabetical order
     *       This is because FailureInfo grows significantly faster, and
     *       the order of Error has some meaning, while the order of FailureInfo
     *       is entirely arbitrary.
     */
    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED,
        ACCRUE_INTEREST_BORROW_RATE_CALCULATION_FAILED,
        ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED,
        ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED,
        ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED,
        ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED,
        BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
        BORROW_ACCRUE_INTEREST_FAILED,
        BORROW_CASH_NOT_AVAILABLE,
        BORROW_FRESHNESS_CHECK,
        BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
        BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,
        BORROW_MARKET_NOT_LISTED,
        BORROW_COMPTROLLER_REJECTION,
        LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED,
        LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED,
        LIQUIDATE_COLLATERAL_FRESHNESS_CHECK,
        LIQUIDATE_COMPTROLLER_REJECTION,
        LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED,
        LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX,
        LIQUIDATE_CLOSE_AMOUNT_IS_ZERO,
        LIQUIDATE_FRESHNESS_CHECK,
        LIQUIDATE_LIQUIDATOR_IS_BORROWER,
        LIQUIDATE_REPAY_BORROW_FRESH_FAILED,
        LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED,
        LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED,
        LIQUIDATE_SEIZE_COMPTROLLER_REJECTION,
        LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER,
        LIQUIDATE_SEIZE_TOO_MUCH,
        MINT_ACCRUE_INTEREST_FAILED,
        MINT_COMPTROLLER_REJECTION,
        MINT_EXCHANGE_CALCULATION_FAILED,
        MINT_EXCHANGE_RATE_READ_FAILED,
        MINT_FRESHNESS_CHECK,
        MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,
        MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
        MINT_TRANSFER_IN_FAILED,
        MINT_TRANSFER_IN_NOT_POSSIBLE,
        REDEEM_ACCRUE_INTEREST_FAILED,
        REDEEM_COMPTROLLER_REJECTION,
        REDEEM_EXCHANGE_TOKENS_CALCULATION_FAILED,
        REDEEM_EXCHANGE_AMOUNT_CALCULATION_FAILED,
        REDEEM_EXCHANGE_RATE_READ_FAILED,
        REDEEM_FRESHNESS_CHECK,
        REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,
        REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
        REDEEM_TRANSFER_OUT_NOT_POSSIBLE,
        REDUCE_RESERVES_ACCRUE_INTEREST_FAILED,
        REDUCE_RESERVES_ADMIN_CHECK,
        REDUCE_RESERVES_CASH_NOT_AVAILABLE,
        REDUCE_RESERVES_FRESH_CHECK,
        REDUCE_RESERVES_VALIDATION,
        REPAY_BEHALF_ACCRUE_INTEREST_FAILED,
        REPAY_BORROW_ACCRUE_INTEREST_FAILED,
        REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
        REPAY_BORROW_COMPTROLLER_REJECTION,
        REPAY_BORROW_FRESHNESS_CHECK,
        REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,
        REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
        REPAY_BORROW_TRANSFER_IN_NOT_POSSIBLE,
        SET_COLLATERAL_FACTOR_OWNER_CHECK,
        SET_COLLATERAL_FACTOR_VALIDATION,
        SET_COMPTROLLER_OWNER_CHECK,
        SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED,
        SET_INTEREST_RATE_MODEL_FRESH_CHECK,
        SET_INTEREST_RATE_MODEL_OWNER_CHECK,
        SET_MAX_ASSETS_OWNER_CHECK,
        SET_ORACLE_MARKET_NOT_LISTED,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED,
        SET_RESERVE_FACTOR_ADMIN_CHECK,
        SET_RESERVE_FACTOR_FRESH_CHECK,
        SET_RESERVE_FACTOR_BOUNDS_CHECK,
        TRANSFER_COMPTROLLER_REJECTION,
        TRANSFER_NOT_ALLOWED,
        TRANSFER_NOT_ENOUGH,
        TRANSFER_TOO_MUCH,
        ADD_RESERVES_ACCRUE_INTEREST_FAILED,
        ADD_RESERVES_FRESH_CHECK,
        ADD_RESERVES_TRANSFER_IN_NOT_POSSIBLE,
        TOKEN_GET_UNDERLYING_PRICE_ERROR,
        REPAY_VAI_COMPTROLLER_REJECTION,
        REPAY_VAI_FRESHNESS_CHECK,
        VAI_MINT_EXCHANGE_CALCULATION_FAILED,
        VAI_MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED
    }

    /**
      * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
      * contract-specific code that enables us to report opaque error codes from upgradeable contracts.
      **/
    event Failure(uint error, uint info, uint detail);

    /**
      * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
      */
    function fail(Error err, FailureInfo info) internal returns (uint) {
        emit Failure(uint(err), uint(info), 0);

        return uint(err);
    }

    /**
      * @dev use this when reporting an opaque error from an upgradeable collaborator contract
      */
    function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
        emit Failure(uint(err), uint(info), opaqueError);

        return uint(err);
    }
}

contract VAIControllerErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED,
        REJECTION,
        SNAPSHOT_ERROR,
        PRICE_ERROR,
        MATH_ERROR,
        INSUFFICIENT_BALANCE_FOR_VAI
    }

    enum FailureInfo {
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_PENDING_IMPLEMENTATION_OWNER_CHECK,
        SET_COMPTROLLER_OWNER_CHECK,
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,
        VAI_MINT_REJECTION,
        VAI_BURN_REJECTION
    }

    /**
      * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
      * contract-specific code that enables us to report opaque error codes from upgradeable contracts.
      **/
    event Failure(uint error, uint info, uint detail);

    /**
      * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
      */
    function fail(Error err, FailureInfo info) internal returns (uint) {
        emit Failure(uint(err), uint(info), 0);

        return uint(err);
    }

    /**
      * @dev use this when reporting an opaque error from an upgradeable collaborator contract
      */
    function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
        emit Failure(uint(err), uint(info), opaqueError);

        return uint(err);
    }
}

File 9 of 17: Exponential.sol
pragma solidity ^0.5.16;

import "./CarefulMath.sol";

/**
 * @title Exponential module for storing fixed-precision decimals
 * @author Venus
 * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
 *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
 *         `Exp({mantissa: 5100000000000000000})`.
 */
contract Exponential is CarefulMath {
    uint constant expScale = 1e18;
    uint constant doubleScale = 1e36;
    uint constant halfExpScale = expScale/2;
    uint constant mantissaOne = expScale;

    struct Exp {
        uint mantissa;
    }

    struct Double {
        uint mantissa;
    }

    /**
     * @dev Creates an exponential from numerator and denominator values.
     *      Note: Returns an error if (`num` * 10e18) > MAX_INT,
     *            or if `denom` is zero.
     */
    function getExp(uint num, uint denom) internal pure returns (MathError, Exp memory) {
        (MathError err0, uint scaledNumerator) = mulUInt(num, expScale);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        (MathError err1, uint rational) = divUInt(scaledNumerator, denom);
        if (err1 != MathError.NO_ERROR) {
            return (err1, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: rational}));
    }

    /**
     * @dev Adds two exponentials, returning a new exponential.
     */
    function addExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {
        (MathError error, uint result) = addUInt(a.mantissa, b.mantissa);

        return (error, Exp({mantissa: result}));
    }

    /**
     * @dev Subtracts two exponentials, returning a new exponential.
     */
    function subExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {
        (MathError error, uint result) = subUInt(a.mantissa, b.mantissa);

        return (error, Exp({mantissa: result}));
    }

    /**
     * @dev Multiply an Exp by a scalar, returning a new Exp.
     */
    function mulScalar(Exp memory a, uint scalar) internal pure returns (MathError, Exp memory) {
        (MathError err0, uint scaledMantissa) = mulUInt(a.mantissa, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: scaledMantissa}));
    }

    /**
     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
     */
    function mulScalarTruncate(Exp memory a, uint scalar) internal pure returns (MathError, uint) {
        (MathError err, Exp memory product) = mulScalar(a, scalar);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return (MathError.NO_ERROR, truncate(product));
    }

    /**
     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
     */
    function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) internal pure returns (MathError, uint) {
        (MathError err, Exp memory product) = mulScalar(a, scalar);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return addUInt(truncate(product), addend);
    }

    /**
     * @dev Divide an Exp by a scalar, returning a new Exp.
     */
    function divScalar(Exp memory a, uint scalar) internal pure returns (MathError, Exp memory) {
        (MathError err0, uint descaledMantissa) = divUInt(a.mantissa, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        return (MathError.NO_ERROR, Exp({mantissa: descaledMantissa}));
    }

    /**
     * @dev Divide a scalar by an Exp, returning a new Exp.
     */
    function divScalarByExp(uint scalar, Exp memory divisor) internal pure returns (MathError, Exp memory) {
        /*
          We are doing this as:
          getExp(mulUInt(expScale, scalar), divisor.mantissa)

          How it works:
          Exp = a / b;
          Scalar = s;
          `s / (a / b)` = `b * s / a` and since for an Exp `a = mantissa, b = expScale`
        */
        (MathError err0, uint numerator) = mulUInt(expScale, scalar);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }
        return getExp(numerator, divisor.mantissa);
    }

    /**
     * @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.
     */
    function divScalarByExpTruncate(uint scalar, Exp memory divisor) internal pure returns (MathError, uint) {
        (MathError err, Exp memory fraction) = divScalarByExp(scalar, divisor);
        if (err != MathError.NO_ERROR) {
            return (err, 0);
        }

        return (MathError.NO_ERROR, truncate(fraction));
    }

    /**
     * @dev Multiplies two exponentials, returning a new exponential.
     */
    function mulExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {

        (MathError err0, uint doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa);
        if (err0 != MathError.NO_ERROR) {
            return (err0, Exp({mantissa: 0}));
        }

        // We add half the scale before dividing so that we get rounding instead of truncation.
        //  See "Listing 6" and text above it at https://accu.org/index.php/journals/1717
        // Without this change, a result like 6.6...e-19 will be truncated to 0 instead of being rounded to 1e-18.
        (MathError err1, uint doubleScaledProductWithHalfScale) = addUInt(halfExpScale, doubleScaledProduct);
        if (err1 != MathError.NO_ERROR) {
            return (err1, Exp({mantissa: 0}));
        }

        (MathError err2, uint product) = divUInt(doubleScaledProductWithHalfScale, expScale);
        // The only error `div` can return is MathError.DIVISION_BY_ZERO but we control `expScale` and it is not zero.
        assert(err2 == MathError.NO_ERROR);

        return (MathError.NO_ERROR, Exp({mantissa: product}));
    }

    /**
     * @dev Multiplies two exponentials given their mantissas, returning a new exponential.
     */
    function mulExp(uint a, uint b) internal pure returns (MathError, Exp memory) {
        return mulExp(Exp({mantissa: a}), Exp({mantissa: b}));
    }

    /**
     * @dev Multiplies three exponentials, returning a new exponential.
     */
    function mulExp3(Exp memory a, Exp memory b, Exp memory c) internal pure returns (MathError, Exp memory) {
        (MathError err, Exp memory ab) = mulExp(a, b);
        if (err != MathError.NO_ERROR) {
            return (err, ab);
        }
        return mulExp(ab, c);
    }

    /**
     * @dev Divides two exponentials, returning a new exponential.
     *     (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,
     *  which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)
     */
    function divExp(Exp memory a, Exp memory b) internal pure returns (MathError, Exp memory) {
        return getExp(a.mantissa, b.mantissa);
    }

    /**
     * @dev Truncates the given exp to a whole number value.
     *      For example, truncate(Exp{mantissa: 15 * expScale}) = 15
     */
    function truncate(Exp memory exp) internal pure returns (uint) {
        // Note: We are not using careful math here as we're performing a division that cannot fail
        return exp.mantissa / expScale;
    }

    /**
     * @dev Checks if first Exp is less than second Exp.
     */
    function lessThanExp(Exp memory left, Exp memory right) internal pure returns (bool) {
        return left.mantissa < right.mantissa;
    }

    /**
     * @dev Checks if left Exp <= right Exp.
     */
    function lessThanOrEqualExp(Exp memory left, Exp memory right) internal pure returns (bool) {
        return left.mantissa <= right.mantissa;
    }

    /**
     * @dev Checks if left Exp > right Exp.
     */
    function greaterThanExp(Exp memory left, Exp memory right) internal pure returns (bool) {
        return left.mantissa > right.mantissa;
    }

    /**
     * @dev returns true if Exp is exactly zero
     */
    function isZeroExp(Exp memory value) internal pure returns (bool) {
        return value.mantissa == 0;
    }

    function safe224(uint n, string memory errorMessage) internal pure returns (uint224) {
        require(n < 2**224, errorMessage);
        return uint224(n);
    }

    function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function add_(Exp memory a, Exp memory b) internal pure returns (Exp memory) {
        return Exp({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(Double memory a, Double memory b) internal pure returns (Double memory) {
        return Double({mantissa: add_(a.mantissa, b.mantissa)});
    }

    function add_(uint a, uint b) internal pure returns (uint) {
        return add_(a, b, "addition overflow");
    }

    function add_(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        uint c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub_(Exp memory a, Exp memory b) internal pure returns (Exp memory) {
        return Exp({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(Double memory a, Double memory b) internal pure returns (Double memory) {
        return Double({mantissa: sub_(a.mantissa, b.mantissa)});
    }

    function sub_(uint a, uint b) internal pure returns (uint) {
        return sub_(a, b, "subtraction underflow");
    }

    function sub_(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function mul_(Exp memory a, Exp memory b) internal pure returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});
    }

    function mul_(Exp memory a, uint b) internal pure returns (Exp memory) {
        return Exp({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Exp memory b) internal pure returns (uint) {
        return mul_(a, b.mantissa) / expScale;
    }

    function mul_(Double memory a, Double memory b) internal pure returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});
    }

    function mul_(Double memory a, uint b) internal pure returns (Double memory) {
        return Double({mantissa: mul_(a.mantissa, b)});
    }

    function mul_(uint a, Double memory b) internal pure returns (uint) {
        return mul_(a, b.mantissa) / doubleScale;
    }

    function mul_(uint a, uint b) internal pure returns (uint) {
        return mul_(a, b, "multiplication overflow");
    }

    function mul_(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        if (a == 0 || b == 0) {
            return 0;
        }
        uint c = a * b;
        require(c / a == b, errorMessage);
        return c;
    }

    function div_(Exp memory a, Exp memory b) internal pure returns (Exp memory) {
        return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});
    }

    function div_(Exp memory a, uint b) internal pure returns (Exp memory) {
        return Exp({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Exp memory b) internal pure returns (uint) {
        return div_(mul_(a, expScale), b.mantissa);
    }

    function div_(Double memory a, Double memory b) internal pure returns (Double memory) {
        return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});
    }

    function div_(Double memory a, uint b) internal pure returns (Double memory) {
        return Double({mantissa: div_(a.mantissa, b)});
    }

    function div_(uint a, Double memory b) internal pure returns (uint) {
        return div_(mul_(a, doubleScale), b.mantissa);
    }

    function div_(uint a, uint b) internal pure returns (uint) {
        return div_(a, b, "divide by zero");
    }

    function div_(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
        require(b > 0, errorMessage);
        return a / b;
    }

    function fraction(uint a, uint b) internal pure returns (Double memory) {
        return Double({mantissa: div_(mul_(a, doubleScale), b)});
    }
}

File 10 of 17: InterestRateModel.sol
pragma solidity ^0.5.16;

/**
  * @title Venus's InterestRateModel Interface
  * @author Venus
  */
contract InterestRateModel {
    /// @notice Indicator that this is an InterestRateModel contract (for inspection)
    bool public constant isInterestRateModel = true;

    /**
      * @notice Calculates the current borrow interest rate per block
      * @param cash The total amount of cash the market has
      * @param borrows The total amount of borrows the market has outstanding
      * @param reserves The total amnount of reserves the market has
      * @return The borrow rate per block (as a percentage, and scaled by 1e18)
      */
    function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);

    /**
      * @notice Calculates the current supply interest rate per block
      * @param cash The total amount of cash the market has
      * @param borrows The total amount of borrows the market has outstanding
      * @param reserves The total amnount of reserves the market has
      * @param reserveFactorMantissa The current reserve factor the market has
      * @return The supply rate per block (as a percentage, and scaled by 1e18)
      */
    function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint);

}

File 11 of 17: PriceOracle.sol
pragma solidity ^0.5.16;

import "./VToken.sol";

contract PriceOracle {
    /// @notice Indicator that this is a PriceOracle contract (for inspection)
    bool public constant isPriceOracle = true;

    /**
      * @notice Get the underlying price of a vToken asset
      * @param vToken The vToken to get the underlying price of
      * @return The underlying asset price mantissa (scaled by 1e18).
      *  Zero means the price is unavailable.
      */
    function getUnderlyingPrice(VToken vToken) external view returns (uint);
}

File 12 of 17: Unitroller.sol
pragma solidity ^0.5.16;

import "./ErrorReporter.sol";
import "./ComptrollerStorage.sol";
/**
 * @title ComptrollerCore
 * @dev Storage for the comptroller is at this address, while execution is delegated to the `comptrollerImplementation`.
 * VTokens should reference this contract as their comptroller.
 */
contract Unitroller is UnitrollerAdminStorage, ComptrollerErrorReporter {

    /**
      * @notice Emitted when pendingComptrollerImplementation is changed
      */
    event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);

    /**
      * @notice Emitted when pendingComptrollerImplementation is accepted, which means comptroller implementation is updated
      */
    event NewImplementation(address oldImplementation, address newImplementation);

    /**
      * @notice Emitted when pendingAdmin is changed
      */
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /**
      * @notice Emitted when pendingAdmin is accepted, which means admin is updated
      */
    event NewAdmin(address oldAdmin, address newAdmin);

    constructor() public {
        // Set admin to caller
        admin = msg.sender;
    }

    /*** Admin Functions ***/
    function _setPendingImplementation(address newPendingImplementation) public returns (uint) {

        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK);
        }

        address oldPendingImplementation = pendingComptrollerImplementation;

        pendingComptrollerImplementation = newPendingImplementation;

        emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);

        return uint(Error.NO_ERROR);
    }

    /**
    * @notice Accepts new implementation of comptroller. msg.sender must be pendingImplementation
    * @dev Admin function for new implementation to accept it's role as implementation
    * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
    */
    function _acceptImplementation() public returns (uint) {
        // Check caller is pendingImplementation and pendingImplementation ≠ address(0)
        if (msg.sender != pendingComptrollerImplementation || pendingComptrollerImplementation == address(0)) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK);
        }

        // Save current values for inclusion in log
        address oldImplementation = comptrollerImplementation;
        address oldPendingImplementation = pendingComptrollerImplementation;

        comptrollerImplementation = pendingComptrollerImplementation;

        pendingComptrollerImplementation = address(0);

        emit NewImplementation(oldImplementation, comptrollerImplementation);
        emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);

        return uint(Error.NO_ERROR);
    }


    /**
      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @param newPendingAdmin New pending admin.
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setPendingAdmin(address newPendingAdmin) public returns (uint) {
        // Check caller = admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);
        }

        // Save current value, if any, for inclusion in log
        address oldPendingAdmin = pendingAdmin;

        // Store pendingAdmin with value newPendingAdmin
        pendingAdmin = newPendingAdmin;

        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
      * @dev Admin function for pending admin to accept role and update admin
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _acceptAdmin() public returns (uint) {
        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)
        if (msg.sender != pendingAdmin || msg.sender == address(0)) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);
        }

        // Save current values for inclusion in log
        address oldAdmin = admin;
        address oldPendingAdmin = pendingAdmin;

        // Store admin with value pendingAdmin
        admin = pendingAdmin;

        // Clear the pending value
        pendingAdmin = address(0);

        emit NewAdmin(oldAdmin, admin);
        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
     * @dev Delegates execution to an implementation contract.
     * It returns to the external caller whatever the implementation returns
     * or forwards reverts.
     */
    function () external payable {
        // delegate all other functions to current implementation
        (bool success, ) = comptrollerImplementation.delegatecall(msg.data);

        assembly {
              let free_mem_ptr := mload(0x40)
              returndatacopy(free_mem_ptr, 0, returndatasize)

              switch success
              case 0 { revert(free_mem_ptr, returndatasize) }
              default { return(free_mem_ptr, returndatasize) }
        }
    }
}

File 13 of 17: VAIControllerInterface.sol
pragma solidity ^0.5.16;

contract VAIControllerInterface {
    function getMintableVAI(address minter) public view returns (uint, uint);
    function mintVAI(address minter, uint mintVAIAmount) external returns (uint);
    function repayVAI(address repayer, uint repayVAIAmount) external returns (uint);
}

File 14 of 17: VBep20.sol
pragma solidity ^0.5.16;

import "./VToken.sol";

/**
 * @title Venus's VBep20 Contract
 * @notice VTokens which wrap an EIP-20 underlying
 * @author Venus
 */
contract VBep20 is VToken, VBep20Interface {
    /**
     * @notice Initialize the new money market
     * @param underlying_ The address of the underlying asset
     * @param comptroller_ The address of the Comptroller
     * @param interestRateModel_ The address of the interest rate model
     * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18
     * @param name_ BEP-20 name of this token
     * @param symbol_ BEP-20 symbol of this token
     * @param decimals_ BEP-20 decimal precision of this token
     */
    function initialize(address underlying_,
                        ComptrollerInterface comptroller_,
                        InterestRateModel interestRateModel_,
                        uint initialExchangeRateMantissa_,
                        string memory name_,
                        string memory symbol_,
                        uint8 decimals_) public {
        // VToken initialize does the bulk of the work
        super.initialize(comptroller_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_);

        // Set underlying and sanity check it
        underlying = underlying_;
        EIP20Interface(underlying).totalSupply();
    }

    /*** User Interface ***/

    /**
     * @notice Sender supplies assets into the market and receives vTokens in exchange
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param mintAmount The amount of the underlying asset to supply
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function mint(uint mintAmount) external returns (uint) {
        (uint err,) = mintInternal(mintAmount);
        return err;
    }

    /**
     * @notice Sender redeems vTokens in exchange for the underlying asset
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param redeemTokens The number of vTokens to redeem into underlying
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function redeem(uint redeemTokens) external returns (uint) {
        return redeemInternal(redeemTokens);
    }

    /**
     * @notice Sender redeems vTokens in exchange for a specified amount of underlying asset
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param redeemAmount The amount of underlying to redeem
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function redeemUnderlying(uint redeemAmount) external returns (uint) {
        return redeemUnderlyingInternal(redeemAmount);
    }

    /**
      * @notice Sender borrows assets from the protocol to their own address
      * @param borrowAmount The amount of the underlying asset to borrow
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function borrow(uint borrowAmount) external returns (uint) {
        return borrowInternal(borrowAmount);
    }

    /**
     * @notice Sender repays their own borrow
     * @param repayAmount The amount to repay
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function repayBorrow(uint repayAmount) external returns (uint) {
        (uint err,) = repayBorrowInternal(repayAmount);
        return err;
    }

    /**
     * @notice Sender repays a borrow belonging to borrower
     * @param borrower the account with the debt being payed off
     * @param repayAmount The amount to repay
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint) {
        (uint err,) = repayBorrowBehalfInternal(borrower, repayAmount);
        return err;
    }

    /**
     * @notice The sender liquidates the borrowers collateral.
     *  The collateral seized is transferred to the liquidator.
     * @param borrower The borrower of this vToken to be liquidated
     * @param repayAmount The amount of the underlying borrowed asset to repay
     * @param vTokenCollateral The market in which to seize collateral from the borrower
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function liquidateBorrow(address borrower, uint repayAmount, VTokenInterface vTokenCollateral) external returns (uint) {
        (uint err,) = liquidateBorrowInternal(borrower, repayAmount, vTokenCollateral);
        return err;
    }

    /**
     * @notice The sender adds to reserves.
     * @param addAmount The amount fo underlying token to add as reserves
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _addReserves(uint addAmount) external returns (uint) {
        return _addReservesInternal(addAmount);
    }

    /*** Safe Token ***/

    /**
     * @notice Gets balance of this contract in terms of the underlying
     * @dev This excludes the value of the current message, if any
     * @return The quantity of underlying tokens owned by this contract
     */
    function getCashPrior() internal view returns (uint) {
        EIP20Interface token = EIP20Interface(underlying);
        return token.balanceOf(address(this));
    }

    /**
     * @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case.
     *      This will revert due to insufficient balance or insufficient allowance.
     *      This function returns the actual amount received,
     *      which may be less than `amount` if there is a fee attached to the transfer.
     *
     *      Note: This wrapper safely handles non-standard BEP-20 tokens that do not return a value.
     *            See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
     */
    function doTransferIn(address from, uint amount) internal returns (uint) {
        EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying);
        uint balanceBefore = EIP20Interface(underlying).balanceOf(address(this));
        token.transferFrom(from, address(this), amount);

        bool success;
        assembly {
            switch returndatasize()
                case 0 {                       // This is a non-standard BEP-20
                    success := not(0)          // set success to true
                }
                case 32 {                      // This is a compliant BEP-20
                    returndatacopy(0, 0, 32)
                    success := mload(0)        // Set `success = returndata` of external call
                }
                default {                      // This is an excessively non-compliant BEP-20, revert.
                    revert(0, 0)
                }
        }
        require(success, "TOKEN_TRANSFER_IN_FAILED");

        // Calculate the amount that was *actually* transferred
        uint balanceAfter = EIP20Interface(underlying).balanceOf(address(this));
        require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
        return balanceAfter - balanceBefore;   // underflow already checked above, just subtract
    }

    /**
     * @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory
     *      error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to
     *      insufficient cash held in this contract. If caller has checked protocol's balance prior to this call, and verified
     *      it is >= amount, this should not revert in normal conditions.
     *
     *      Note: This wrapper safely handles non-standard BEP-20 tokens that do not return a value.
     *            See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
     */
    function doTransferOut(address payable to, uint amount) internal {
        EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying);
        token.transfer(to, amount);

        bool success;
        assembly {
            switch returndatasize()
                case 0 {                      // This is a non-standard BEP-20
                    success := not(0)          // set success to true
                }
                case 32 {                     // This is a complaint BEP-20
                    returndatacopy(0, 0, 32)
                    success := mload(0)        // Set `success = returndata` of external call
                }
                default {                     // This is an excessively non-compliant BEP-20, revert.
                    revert(0, 0)
                }
        }
        require(success, "TOKEN_TRANSFER_OUT_FAILED");
    }
}

File 15 of 17: VToken.sol
pragma solidity ^0.5.16;

import "./ComptrollerInterface.sol";
import "./VTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";
import "./InterestRateModel.sol";

/**
 * @title Venus's VToken Contract
 * @notice Abstract base for VTokens
 * @author Venus
 */
contract VToken is VTokenInterface, Exponential, TokenErrorReporter {
    /**
     * @notice Initialize the money market
     * @param comptroller_ The address of the Comptroller
     * @param interestRateModel_ The address of the interest rate model
     * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18
     * @param name_ EIP-20 name of this token
     * @param symbol_ EIP-20 symbol of this token
     * @param decimals_ EIP-20 decimal precision of this token
     */
    function initialize(ComptrollerInterface comptroller_,
                        InterestRateModel interestRateModel_,
                        uint initialExchangeRateMantissa_,
                        string memory name_,
                        string memory symbol_,
                        uint8 decimals_) public {
        require(msg.sender == admin, "only admin may initialize the market");
        require(accrualBlockNumber == 0 && borrowIndex == 0, "market may only be initialized once");

        // Set initial exchange rate
        initialExchangeRateMantissa = initialExchangeRateMantissa_;
        require(initialExchangeRateMantissa > 0, "initial exchange rate must be greater than zero.");

        // Set the comptroller
        uint err = _setComptroller(comptroller_);
        require(err == uint(Error.NO_ERROR), "setting comptroller failed");

        // Initialize block number and borrow index (block number mocks depend on comptroller being set)
        accrualBlockNumber = getBlockNumber();
        borrowIndex = mantissaOne;

        // Set the interest rate model (depends on block number / borrow index)
        err = _setInterestRateModelFresh(interestRateModel_);
        require(err == uint(Error.NO_ERROR), "setting interest rate model failed");

        name = name_;
        symbol = symbol_;
        decimals = decimals_;

        // The counter starts true to prevent changing it from zero to non-zero (i.e. smaller cost/refund)
        _notEntered = true;
    }

    /**
     * @notice Transfer `tokens` tokens from `src` to `dst` by `spender`
     * @dev Called by both `transfer` and `transferFrom` internally
     * @param spender The address of the account performing the transfer
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param tokens The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) {
        /* Fail if transfer not allowed */
        uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens);
        if (allowed != 0) {
            return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRANSFER_COMPTROLLER_REJECTION, allowed);
        }

        /* Do not allow self-transfers */
        if (src == dst) {
            return fail(Error.BAD_INPUT, FailureInfo.TRANSFER_NOT_ALLOWED);
        }

        /* Get the allowance, infinite for the account owner */
        uint startingAllowance = 0;
        if (spender == src) {
            startingAllowance = uint(-1);
        } else {
            startingAllowance = transferAllowances[src][spender];
        }

        /* Do the calculations, checking for {under,over}flow */
        MathError mathErr;
        uint allowanceNew;
        uint srvTokensNew;
        uint dstTokensNew;

        (mathErr, allowanceNew) = subUInt(startingAllowance, tokens);
        if (mathErr != MathError.NO_ERROR) {
            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ALLOWED);
        }

        (mathErr, srvTokensNew) = subUInt(accountTokens[src], tokens);
        if (mathErr != MathError.NO_ERROR) {
            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ENOUGH);
        }

        (mathErr, dstTokensNew) = addUInt(accountTokens[dst], tokens);
        if (mathErr != MathError.NO_ERROR) {
            return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_TOO_MUCH);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        accountTokens[src] = srvTokensNew;
        accountTokens[dst] = dstTokensNew;

        /* Eat some of the allowance (if necessary) */
        if (startingAllowance != uint(-1)) {
            transferAllowances[src][spender] = allowanceNew;
        }

        /* We emit a Transfer event */
        emit Transfer(src, dst, tokens);

        comptroller.transferVerify(address(this), src, dst, tokens);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint256 amount) external nonReentrant returns (bool) {
        return transferTokens(msg.sender, msg.sender, dst, amount) == uint(Error.NO_ERROR);
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(address src, address dst, uint256 amount) external nonReentrant returns (bool) {
        return transferTokens(msg.sender, src, dst, amount) == uint(Error.NO_ERROR);
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        address src = msg.sender;
        transferAllowances[src][spender] = amount;
        emit Approval(src, spender, amount);
        return true;
    }

    /**
     * @notice Get the current allowance from `owner` for `spender`
     * @param owner The address of the account which owns the tokens to be spent
     * @param spender The address of the account which may transfer tokens
     * @return The number of tokens allowed to be spent (-1 means infinite)
     */
    function allowance(address owner, address spender) external view returns (uint256) {
        return transferAllowances[owner][spender];
    }

    /**
     * @notice Get the token balance of the `owner`
     * @param owner The address of the account to query
     * @return The number of tokens owned by `owner`
     */
    function balanceOf(address owner) external view returns (uint256) {
        return accountTokens[owner];
    }

    /**
     * @notice Get the underlying balance of the `owner`
     * @dev This also accrues interest in a transaction
     * @param owner The address of the account to query
     * @return The amount of underlying owned by `owner`
     */
    function balanceOfUnderlying(address owner) external returns (uint) {
        Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});
        (MathError mErr, uint balance) = mulScalarTruncate(exchangeRate, accountTokens[owner]);
        require(mErr == MathError.NO_ERROR, "balance could not be calculated");
        return balance;
    }

    /**
     * @notice Get a snapshot of the account's balances, and the cached exchange rate
     * @dev This is used by comptroller to more efficiently perform liquidity checks.
     * @param account Address of the account to snapshot
     * @return (possible error, token balance, borrow balance, exchange rate mantissa)
     */
    function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint) {
        uint vTokenBalance = accountTokens[account];
        uint borrowBalance;
        uint exchangeRateMantissa;

        MathError mErr;

        (mErr, borrowBalance) = borrowBalanceStoredInternal(account);
        if (mErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0, 0, 0);
        }

        (mErr, exchangeRateMantissa) = exchangeRateStoredInternal();
        if (mErr != MathError.NO_ERROR) {
            return (uint(Error.MATH_ERROR), 0, 0, 0);
        }

        return (uint(Error.NO_ERROR), vTokenBalance, borrowBalance, exchangeRateMantissa);
    }

    /**
     * @dev Function to simply retrieve block number
     *  This exists mainly for inheriting test contracts to stub this result.
     */
    function getBlockNumber() internal view returns (uint) {
        return block.number;
    }

    /**
     * @notice Returns the current per-block borrow interest rate for this vToken
     * @return The borrow interest rate per block, scaled by 1e18
     */
    function borrowRatePerBlock() external view returns (uint) {
        return interestRateModel.getBorrowRate(getCashPrior(), totalBorrows, totalReserves);
    }

    /**
     * @notice Returns the current per-block supply interest rate for this vToken
     * @return The supply interest rate per block, scaled by 1e18
     */
    function supplyRatePerBlock() external view returns (uint) {
        return interestRateModel.getSupplyRate(getCashPrior(), totalBorrows, totalReserves, reserveFactorMantissa);
    }

    /**
     * @notice Returns the current total borrows plus accrued interest
     * @return The total borrows with interest
     */
    function totalBorrowsCurrent() external nonReentrant returns (uint) {
        require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
        return totalBorrows;
    }

    /**
     * @notice Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex
     * @param account The address whose balance should be calculated after updating borrowIndex
     * @return The calculated balance
     */
    function borrowBalanceCurrent(address account) external nonReentrant returns (uint) {
        require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
        return borrowBalanceStored(account);
    }

    /**
     * @notice Return the borrow balance of account based on stored data
     * @param account The address whose balance should be calculated
     * @return The calculated balance
     */
    function borrowBalanceStored(address account) public view returns (uint) {
        (MathError err, uint result) = borrowBalanceStoredInternal(account);
        require(err == MathError.NO_ERROR, "borrowBalanceStored: borrowBalanceStoredInternal failed");
        return result;
    }

    /**
     * @notice Return the borrow balance of account based on stored data
     * @param account The address whose balance should be calculated
     * @return (error code, the calculated balance or 0 if error code is non-zero)
     */
    function borrowBalanceStoredInternal(address account) internal view returns (MathError, uint) {
        /* Note: we do not assert that the market is up to date */
        MathError mathErr;
        uint principalTimesIndex;
        uint result;

        /* Get borrowBalance and borrowIndex */
        BorrowSnapshot storage borrowSnapshot = accountBorrows[account];

        /* If borrowBalance = 0 then borrowIndex is likely also 0.
         * Rather than failing the calculation with a division by 0, we immediately return 0 in this case.
         */
        if (borrowSnapshot.principal == 0) {
            return (MathError.NO_ERROR, 0);
        }

        /* Calculate new borrow balance using the interest index:
         *  recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex
         */
        (mathErr, principalTimesIndex) = mulUInt(borrowSnapshot.principal, borrowIndex);
        if (mathErr != MathError.NO_ERROR) {
            return (mathErr, 0);
        }

        (mathErr, result) = divUInt(principalTimesIndex, borrowSnapshot.interestIndex);
        if (mathErr != MathError.NO_ERROR) {
            return (mathErr, 0);
        }

        return (MathError.NO_ERROR, result);
    }

    /**
     * @notice Accrue interest then return the up-to-date exchange rate
     * @return Calculated exchange rate scaled by 1e18
     */
    function exchangeRateCurrent() public nonReentrant returns (uint) {
        require(accrueInterest() == uint(Error.NO_ERROR), "accrue interest failed");
        return exchangeRateStored();
    }

    /**
     * @notice Calculates the exchange rate from the underlying to the VToken
     * @dev This function does not accrue interest before calculating the exchange rate
     * @return Calculated exchange rate scaled by 1e18
     */
    function exchangeRateStored() public view returns (uint) {
        (MathError err, uint result) = exchangeRateStoredInternal();
        require(err == MathError.NO_ERROR, "exchangeRateStored: exchangeRateStoredInternal failed");
        return result;
    }

    /**
     * @notice Calculates the exchange rate from the underlying to the VToken
     * @dev This function does not accrue interest before calculating the exchange rate
     * @return (error code, calculated exchange rate scaled by 1e18)
     */
    function exchangeRateStoredInternal() internal view returns (MathError, uint) {
        uint _totalSupply = totalSupply;
        if (_totalSupply == 0) {
            /*
             * If there are no tokens minted:
             *  exchangeRate = initialExchangeRate
             */
            return (MathError.NO_ERROR, initialExchangeRateMantissa);
        } else {
            /*
             * Otherwise:
             *  exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply
             */
            uint totalCash = getCashPrior();
            uint cashPlusBorrowsMinusReserves;
            Exp memory exchangeRate;
            MathError mathErr;

            (mathErr, cashPlusBorrowsMinusReserves) = addThenSubUInt(totalCash, totalBorrows, totalReserves);
            if (mathErr != MathError.NO_ERROR) {
                return (mathErr, 0);
            }

            (mathErr, exchangeRate) = getExp(cashPlusBorrowsMinusReserves, _totalSupply);
            if (mathErr != MathError.NO_ERROR) {
                return (mathErr, 0);
            }

            return (MathError.NO_ERROR, exchangeRate.mantissa);
        }
    }

    /**
     * @notice Get cash balance of this vToken in the underlying asset
     * @return The quantity of underlying asset owned by this contract
     */
    function getCash() external view returns (uint) {
        return getCashPrior();
    }

    /**
     * @notice Applies accrued interest to total borrows and reserves
     * @dev This calculates interest accrued from the last checkpointed block
     *   up to the current block and writes new checkpoint to storage.
     */
    function accrueInterest() public returns (uint) {
        /* Remember the initial block number */
        uint currentBlockNumber = getBlockNumber();
        uint accrualBlockNumberPrior = accrualBlockNumber;

        /* Short-circuit accumulating 0 interest */
        if (accrualBlockNumberPrior == currentBlockNumber) {
            return uint(Error.NO_ERROR);
        }

        /* Read the previous values out of storage */
        uint cashPrior = getCashPrior();
        uint borrowsPrior = totalBorrows;
        uint reservesPrior = totalReserves;
        uint borrowIndexPrior = borrowIndex;

        /* Calculate the current borrow interest rate */
        uint borrowRateMantissa = interestRateModel.getBorrowRate(cashPrior, borrowsPrior, reservesPrior);
        require(borrowRateMantissa <= borrowRateMaxMantissa, "borrow rate is absurdly high");

        /* Calculate the number of blocks elapsed since the last accrual */
        (MathError mathErr, uint blockDelta) = subUInt(currentBlockNumber, accrualBlockNumberPrior);
        require(mathErr == MathError.NO_ERROR, "could not calculate block delta");

        /*
         * Calculate the interest accumulated into borrows and reserves and the new index:
         *  simpleInterestFactor = borrowRate * blockDelta
         *  interestAccumulated = simpleInterestFactor * totalBorrows
         *  totalBorrowsNew = interestAccumulated + totalBorrows
         *  totalReservesNew = interestAccumulated * reserveFactor + totalReserves
         *  borrowIndexNew = simpleInterestFactor * borrowIndex + borrowIndex
         */

        Exp memory simpleInterestFactor;
        uint interestAccumulated;
        uint totalBorrowsNew;
        uint totalReservesNew;
        uint borrowIndexNew;

        (mathErr, simpleInterestFactor) = mulScalar(Exp({mantissa: borrowRateMantissa}), blockDelta);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED, uint(mathErr));
        }

        (mathErr, interestAccumulated) = mulScalarTruncate(simpleInterestFactor, borrowsPrior);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED, uint(mathErr));
        }

        (mathErr, totalBorrowsNew) = addUInt(interestAccumulated, borrowsPrior);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED, uint(mathErr));
        }

        (mathErr, totalReservesNew) = mulScalarTruncateAddUInt(Exp({mantissa: reserveFactorMantissa}), interestAccumulated, reservesPrior);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED, uint(mathErr));
        }

        (mathErr, borrowIndexNew) = mulScalarTruncateAddUInt(simpleInterestFactor, borrowIndexPrior, borrowIndexPrior);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED, uint(mathErr));
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /* We write the previously calculated values into storage */
        accrualBlockNumber = currentBlockNumber;
        borrowIndex = borrowIndexNew;
        totalBorrows = totalBorrowsNew;
        totalReserves = totalReservesNew;

        /* We emit an AccrueInterest event */
        emit AccrueInterest(cashPrior, interestAccumulated, borrowIndexNew, totalBorrowsNew);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Sender supplies assets into the market and receives vTokens in exchange
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param mintAmount The amount of the underlying asset to supply
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.
     */
    function mintInternal(uint mintAmount) internal nonReentrant returns (uint, uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
            return (fail(Error(error), FailureInfo.MINT_ACCRUE_INTEREST_FAILED), 0);
        }
        // mintFresh emits the actual Mint event if successful and logs on errors, so we don't need to
        return mintFresh(msg.sender, mintAmount);
    }

    struct MintLocalVars {
        Error err;
        MathError mathErr;
        uint exchangeRateMantissa;
        uint mintTokens;
        uint totalSupplyNew;
        uint accountTokensNew;
        uint actualMintAmount;
    }

    /**
     * @notice User supplies assets into the market and receives vTokens in exchange
     * @dev Assumes interest has already been accrued up to the current block
     * @param minter The address of the account which is supplying the assets
     * @param mintAmount The amount of the underlying asset to supply
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.
     */
    function mintFresh(address minter, uint mintAmount) internal returns (uint, uint) {
        /* Fail if mint not allowed */
        uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount);
        if (allowed != 0) {
            return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.MINT_COMPTROLLER_REJECTION, allowed), 0);
        }

        /* Verify market's block number equals current block number */
        if (accrualBlockNumber != getBlockNumber()) {
            return (fail(Error.MARKET_NOT_FRESH, FailureInfo.MINT_FRESHNESS_CHECK), 0);
        }

        MintLocalVars memory vars;

        (vars.mathErr, vars.exchangeRateMantissa) = exchangeRateStoredInternal();
        if (vars.mathErr != MathError.NO_ERROR) {
            return (failOpaque(Error.MATH_ERROR, FailureInfo.MINT_EXCHANGE_RATE_READ_FAILED, uint(vars.mathErr)), 0);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /*
         *  We call `doTransferIn` for the minter and the mintAmount.
         *  Note: The vToken must handle variations between BEP-20 and BNB underlying.
         *  `doTransferIn` reverts if anything goes wrong, since we can't be sure if
         *  side-effects occurred. The function returns the amount actually transferred,
         *  in case of a fee. On success, the vToken holds an additional `actualMintAmount`
         *  of cash.
         */
        vars.actualMintAmount = doTransferIn(minter, mintAmount);

        /*
         * We get the current exchange rate and calculate the number of vTokens to be minted:
         *  mintTokens = actualMintAmount / exchangeRate
         */

        (vars.mathErr, vars.mintTokens) = divScalarByExpTruncate(vars.actualMintAmount, Exp({mantissa: vars.exchangeRateMantissa}));
        require(vars.mathErr == MathError.NO_ERROR, "MINT_EXCHANGE_CALCULATION_FAILED");

        /*
         * We calculate the new total supply of vTokens and minter token balance, checking for overflow:
         *  totalSupplyNew = totalSupply + mintTokens
         *  accountTokensNew = accountTokens[minter] + mintTokens
         */
        (vars.mathErr, vars.totalSupplyNew) = addUInt(totalSupply, vars.mintTokens);
        require(vars.mathErr == MathError.NO_ERROR, "MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED");

        (vars.mathErr, vars.accountTokensNew) = addUInt(accountTokens[minter], vars.mintTokens);
        require(vars.mathErr == MathError.NO_ERROR, "MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED");

        /* We write previously calculated values into storage */
        totalSupply = vars.totalSupplyNew;
        accountTokens[minter] = vars.accountTokensNew;

        /* We emit a Mint event, and a Transfer event */
        emit Mint(minter, vars.actualMintAmount, vars.mintTokens);
        emit Transfer(address(this), minter, vars.mintTokens);

        /* We call the defense hook */
        comptroller.mintVerify(address(this), minter, vars.actualMintAmount, vars.mintTokens);

        return (uint(Error.NO_ERROR), vars.actualMintAmount);
    }

    /**
     * @notice Sender redeems vTokens in exchange for the underlying asset
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param redeemTokens The number of vTokens to redeem into underlying
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function redeemInternal(uint redeemTokens) internal nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
            return fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);
        }
        // redeemFresh emits redeem-specific logs on errors, so we don't need to
        return redeemFresh(msg.sender, redeemTokens, 0);
    }

    /**
     * @notice Sender redeems vTokens in exchange for a specified amount of underlying asset
     * @dev Accrues interest whether or not the operation succeeds, unless reverted
     * @param redeemAmount The amount of underlying to receive from redeeming vTokens
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function redeemUnderlyingInternal(uint redeemAmount) internal nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
            return fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);
        }
        // redeemFresh emits redeem-specific logs on errors, so we don't need to
        return redeemFresh(msg.sender, 0, redeemAmount);
    }

    struct RedeemLocalVars {
        Error err;
        MathError mathErr;
        uint exchangeRateMantissa;
        uint redeemTokens;
        uint redeemAmount;
        uint totalSupplyNew;
        uint accountTokensNew;
    }

    /**
     * @notice User redeems vTokens in exchange for the underlying asset
     * @dev Assumes interest has already been accrued up to the current block
     * @param redeemer The address of the account which is redeeming the tokens
     * @param redeemTokensIn The number of vTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)
     * @param redeemAmountIn The number of underlying tokens to receive from redeeming vTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function redeemFresh(address payable redeemer, uint redeemTokensIn, uint redeemAmountIn) internal returns (uint) {
        require(redeemTokensIn == 0 || redeemAmountIn == 0, "one of redeemTokensIn or redeemAmountIn must be zero");

        RedeemLocalVars memory vars;

        /* exchangeRate = invoke Exchange Rate Stored() */
        (vars.mathErr, vars.exchangeRateMantissa) = exchangeRateStoredInternal();
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.REDEEM_EXCHANGE_RATE_READ_FAILED, uint(vars.mathErr));
        }

        /* If redeemTokensIn > 0: */
        if (redeemTokensIn > 0) {
            /*
             * We calculate the exchange rate and the amount of underlying to be redeemed:
             *  redeemTokens = redeemTokensIn
             *  redeemAmount = redeemTokensIn x exchangeRateCurrent
             */
            vars.redeemTokens = redeemTokensIn;

            (vars.mathErr, vars.redeemAmount) = mulScalarTruncate(Exp({mantissa: vars.exchangeRateMantissa}), redeemTokensIn);
            if (vars.mathErr != MathError.NO_ERROR) {
                return failOpaque(Error.MATH_ERROR, FailureInfo.REDEEM_EXCHANGE_TOKENS_CALCULATION_FAILED, uint(vars.mathErr));
            }
        } else {
            /*
             * We get the current exchange rate and calculate the amount to be redeemed:
             *  redeemTokens = redeemAmountIn / exchangeRate
             *  redeemAmount = redeemAmountIn
             */

            (vars.mathErr, vars.redeemTokens) = divScalarByExpTruncate(redeemAmountIn, Exp({mantissa: vars.exchangeRateMantissa}));
            if (vars.mathErr != MathError.NO_ERROR) {
                return failOpaque(Error.MATH_ERROR, FailureInfo.REDEEM_EXCHANGE_AMOUNT_CALCULATION_FAILED, uint(vars.mathErr));
            }

            vars.redeemAmount = redeemAmountIn;
        }

        /* Fail if redeem not allowed */
        uint allowed = comptroller.redeemAllowed(address(this), redeemer, vars.redeemTokens);
        if (allowed != 0) {
            return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.REDEEM_COMPTROLLER_REJECTION, allowed);
        }

        /* Verify market's block number equals current block number */
        if (accrualBlockNumber != getBlockNumber()) {
            return fail(Error.MARKET_NOT_FRESH, FailureInfo.REDEEM_FRESHNESS_CHECK);
        }

        /*
         * We calculate the new total supply and redeemer balance, checking for underflow:
         *  totalSupplyNew = totalSupply - redeemTokens
         *  accountTokensNew = accountTokens[redeemer] - redeemTokens
         */
        (vars.mathErr, vars.totalSupplyNew) = subUInt(totalSupply, vars.redeemTokens);
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED, uint(vars.mathErr));
        }

        (vars.mathErr, vars.accountTokensNew) = subUInt(accountTokens[redeemer], vars.redeemTokens);
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED, uint(vars.mathErr));
        }

        /* Fail gracefully if protocol has insufficient cash */
        if (getCashPrior() < vars.redeemAmount) {
            return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.REDEEM_TRANSFER_OUT_NOT_POSSIBLE);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /*
         * We invoke doTransferOut for the redeemer and the redeemAmount.
         *  Note: The vToken must handle variations between BEP-20 and BNB underlying.
         *  On success, the vToken has redeemAmount less of cash.
         *  doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
         */
        doTransferOut(redeemer, vars.redeemAmount);

        /* We write previously calculated values into storage */
        totalSupply = vars.totalSupplyNew;
        accountTokens[redeemer] = vars.accountTokensNew;

        /* We emit a Transfer event, and a Redeem event */
        emit Transfer(redeemer, address(this), vars.redeemTokens);
        emit Redeem(redeemer, vars.redeemAmount, vars.redeemTokens);

        /* We call the defense hook */
        comptroller.redeemVerify(address(this), redeemer, vars.redeemAmount, vars.redeemTokens);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sender borrows assets from the protocol to their own address
      * @param borrowAmount The amount of the underlying asset to borrow
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function borrowInternal(uint borrowAmount) internal nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
            return fail(Error(error), FailureInfo.BORROW_ACCRUE_INTEREST_FAILED);
        }
        // borrowFresh emits borrow-specific logs on errors, so we don't need to
        return borrowFresh(msg.sender, borrowAmount);
    }

    struct BorrowLocalVars {
        MathError mathErr;
        uint accountBorrows;
        uint accountBorrowsNew;
        uint totalBorrowsNew;
    }

    /**
      * @notice Users borrow assets from the protocol to their own address
      * @param borrowAmount The amount of the underlying asset to borrow
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function borrowFresh(address payable borrower, uint borrowAmount) internal returns (uint) {
        /* Fail if borrow not allowed */
        uint allowed = comptroller.borrowAllowed(address(this), borrower, borrowAmount);
        if (allowed != 0) {
            return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.BORROW_COMPTROLLER_REJECTION, allowed);
        }

        /* Verify market's block number equals current block number */
        if (accrualBlockNumber != getBlockNumber()) {
            return fail(Error.MARKET_NOT_FRESH, FailureInfo.BORROW_FRESHNESS_CHECK);
        }

        /* Fail gracefully if protocol has insufficient underlying cash */
        if (getCashPrior() < borrowAmount) {
            return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.BORROW_CASH_NOT_AVAILABLE);
        }

        BorrowLocalVars memory vars;

        /*
         * We calculate the new borrower and total borrow balances, failing on overflow:
         *  accountBorrowsNew = accountBorrows + borrowAmount
         *  totalBorrowsNew = totalBorrows + borrowAmount
         */
        (vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(borrower);
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED, uint(vars.mathErr));
        }

        (vars.mathErr, vars.accountBorrowsNew) = addUInt(vars.accountBorrows, borrowAmount);
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED, uint(vars.mathErr));
        }

        (vars.mathErr, vars.totalBorrowsNew) = addUInt(totalBorrows, borrowAmount);
        if (vars.mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED, uint(vars.mathErr));
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /*
         * We invoke doTransferOut for the borrower and the borrowAmount.
         *  Note: The vToken must handle variations between BEP-20 and BNB underlying.
         *  On success, the vToken borrowAmount less of cash.
         *  doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
         */
        doTransferOut(borrower, borrowAmount);

        /* We write the previously calculated values into storage */
        accountBorrows[borrower].principal = vars.accountBorrowsNew;
        accountBorrows[borrower].interestIndex = borrowIndex;
        totalBorrows = vars.totalBorrowsNew;

        /* We emit a Borrow event */
        emit Borrow(borrower, borrowAmount, vars.accountBorrowsNew, vars.totalBorrowsNew);

        /* We call the defense hook */
        comptroller.borrowVerify(address(this), borrower, borrowAmount);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Sender repays their own borrow
     * @param repayAmount The amount to repay
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
     */
    function repayBorrowInternal(uint repayAmount) internal nonReentrant returns (uint, uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
            return (fail(Error(error), FailureInfo.REPAY_BORROW_ACCRUE_INTEREST_FAILED), 0);
        }
        // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to
        return repayBorrowFresh(msg.sender, msg.sender, repayAmount);
    }

    /**
     * @notice Sender repays a borrow belonging to borrower
     * @param borrower the account with the debt being payed off
     * @param repayAmount The amount to repay
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
     */
    function repayBorrowBehalfInternal(address borrower, uint repayAmount) internal nonReentrant returns (uint, uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
            return (fail(Error(error), FailureInfo.REPAY_BEHALF_ACCRUE_INTEREST_FAILED), 0);
        }
        // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to
        return repayBorrowFresh(msg.sender, borrower, repayAmount);
    }

    struct RepayBorrowLocalVars {
        Error err;
        MathError mathErr;
        uint repayAmount;
        uint borrowerIndex;
        uint accountBorrows;
        uint accountBorrowsNew;
        uint totalBorrowsNew;
        uint actualRepayAmount;
    }

    /**
     * @notice Borrows are repaid by another user (possibly the borrower).
     * @param payer the account paying off the borrow
     * @param borrower the account with the debt being payed off
     * @param repayAmount the amount of undelrying tokens being returned
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
     */
    function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal returns (uint, uint) {
        /* Fail if repayBorrow not allowed */
        uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount);
        if (allowed != 0) {
            return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.REPAY_BORROW_COMPTROLLER_REJECTION, allowed), 0);
        }

        /* Verify market's block number equals current block number */
        if (accrualBlockNumber != getBlockNumber()) {
            return (fail(Error.MARKET_NOT_FRESH, FailureInfo.REPAY_BORROW_FRESHNESS_CHECK), 0);
        }

        RepayBorrowLocalVars memory vars;

        /* We remember the original borrowerIndex for verification purposes */
        vars.borrowerIndex = accountBorrows[borrower].interestIndex;

        /* We fetch the amount the borrower owes, with accumulated interest */
        (vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(borrower);
        if (vars.mathErr != MathError.NO_ERROR) {
            return (failOpaque(Error.MATH_ERROR, FailureInfo.REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED, uint(vars.mathErr)), 0);
        }

        /* If repayAmount == -1, repayAmount = accountBorrows */
        if (repayAmount == uint(-1)) {
            vars.repayAmount = vars.accountBorrows;
        } else {
            vars.repayAmount = repayAmount;
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /*
         * We call doTransferIn for the payer and the repayAmount
         *  Note: The vToken must handle variations between BEP-20 and BNB underlying.
         *  On success, the vToken holds an additional repayAmount of cash.
         *  doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.
         *   it returns the amount actually transferred, in case of a fee.
         */
        vars.actualRepayAmount = doTransferIn(payer, vars.repayAmount);

        /*
         * We calculate the new borrower and total borrow balances, failing on underflow:
         *  accountBorrowsNew = accountBorrows - actualRepayAmount
         *  totalBorrowsNew = totalBorrows - actualRepayAmount
         */
        (vars.mathErr, vars.accountBorrowsNew) = subUInt(vars.accountBorrows, vars.actualRepayAmount);
        require(vars.mathErr == MathError.NO_ERROR, "REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED");

        (vars.mathErr, vars.totalBorrowsNew) = subUInt(totalBorrows, vars.actualRepayAmount);
        require(vars.mathErr == MathError.NO_ERROR, "REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED");

        /* We write the previously calculated values into storage */
        accountBorrows[borrower].principal = vars.accountBorrowsNew;
        accountBorrows[borrower].interestIndex = borrowIndex;
        totalBorrows = vars.totalBorrowsNew;

        /* We emit a RepayBorrow event */
        emit RepayBorrow(payer, borrower, vars.actualRepayAmount, vars.accountBorrowsNew, vars.totalBorrowsNew);

        /* We call the defense hook */
        comptroller.repayBorrowVerify(address(this), payer, borrower, vars.actualRepayAmount, vars.borrowerIndex);

        return (uint(Error.NO_ERROR), vars.actualRepayAmount);
    }

    /**
     * @notice The sender liquidates the borrowers collateral.
     *  The collateral seized is transferred to the liquidator.
     * @param borrower The borrower of this vToken to be liquidated
     * @param vTokenCollateral The market in which to seize collateral from the borrower
     * @param repayAmount The amount of the underlying borrowed asset to repay
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
     */
    function liquidateBorrowInternal(address borrower, uint repayAmount, VTokenInterface vTokenCollateral) internal nonReentrant returns (uint, uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed
            return (fail(Error(error), FailureInfo.LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED), 0);
        }

        error = vTokenCollateral.accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed
            return (fail(Error(error), FailureInfo.LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED), 0);
        }

        // liquidateBorrowFresh emits borrow-specific logs on errors, so we don't need to
        return liquidateBorrowFresh(msg.sender, borrower, repayAmount, vTokenCollateral);
    }

    /**
     * @notice The liquidator liquidates the borrowers collateral.
     *  The collateral seized is transferred to the liquidator.
     * @param borrower The borrower of this vToken to be liquidated
     * @param liquidator The address repaying the borrow and seizing collateral
     * @param vTokenCollateral The market in which to seize collateral from the borrower
     * @param repayAmount The amount of the underlying borrowed asset to repay
     * @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
     */
    function liquidateBorrowFresh(address liquidator, address borrower, uint repayAmount, VTokenInterface vTokenCollateral) internal returns (uint, uint) {
        /* Fail if liquidate not allowed */
        uint allowed = comptroller.liquidateBorrowAllowed(address(this), address(vTokenCollateral), liquidator, borrower, repayAmount);
        if (allowed != 0) {
            return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.LIQUIDATE_COMPTROLLER_REJECTION, allowed), 0);
        }

        /* Verify market's block number equals current block number */
        if (accrualBlockNumber != getBlockNumber()) {
            return (fail(Error.MARKET_NOT_FRESH, FailureInfo.LIQUIDATE_FRESHNESS_CHECK), 0);
        }

        /* Verify vTokenCollateral market's block number equals current block number */
        if (vTokenCollateral.accrualBlockNumber() != getBlockNumber()) {
            return (fail(Error.MARKET_NOT_FRESH, FailureInfo.LIQUIDATE_COLLATERAL_FRESHNESS_CHECK), 0);
        }

        /* Fail if borrower = liquidator */
        if (borrower == liquidator) {
            return (fail(Error.INVALID_ACCOUNT_PAIR, FailureInfo.LIQUIDATE_LIQUIDATOR_IS_BORROWER), 0);
        }

        /* Fail if repayAmount = 0 */
        if (repayAmount == 0) {
            return (fail(Error.INVALID_CLOSE_AMOUNT_REQUESTED, FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_ZERO), 0);
        }

        /* Fail if repayAmount = -1 */
        if (repayAmount == uint(-1)) {
            return (fail(Error.INVALID_CLOSE_AMOUNT_REQUESTED, FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX), 0);
        }


        /* Fail if repayBorrow fails */
        (uint repayBorrowError, uint actualRepayAmount) = repayBorrowFresh(liquidator, borrower, repayAmount);
        if (repayBorrowError != uint(Error.NO_ERROR)) {
            return (fail(Error(repayBorrowError), FailureInfo.LIQUIDATE_REPAY_BORROW_FRESH_FAILED), 0);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /* We calculate the number of collateral tokens that will be seized */
        (uint amountSeizeError, uint seizeTokens) = comptroller.liquidateCalculateSeizeTokens(address(this), address(vTokenCollateral), actualRepayAmount);
        require(amountSeizeError == uint(Error.NO_ERROR), "LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED");

        /* Revert if borrower collateral token balance < seizeTokens */
        require(vTokenCollateral.balanceOf(borrower) >= seizeTokens, "LIQUIDATE_SEIZE_TOO_MUCH");

        // If this is also the collateral, run seizeInternal to avoid re-entrancy, otherwise make an external call
        uint seizeError;
        if (address(vTokenCollateral) == address(this)) {
            seizeError = seizeInternal(address(this), liquidator, borrower, seizeTokens);
        } else {
            seizeError = vTokenCollateral.seize(liquidator, borrower, seizeTokens);
        }

        /* Revert if seize tokens fails (since we cannot be sure of side effects) */
        require(seizeError == uint(Error.NO_ERROR), "token seizure failed");

        /* We emit a LiquidateBorrow event */
        emit LiquidateBorrow(liquidator, borrower, actualRepayAmount, address(vTokenCollateral), seizeTokens);

        /* We call the defense hook */
        comptroller.liquidateBorrowVerify(address(this), address(vTokenCollateral), liquidator, borrower, actualRepayAmount, seizeTokens);

        return (uint(Error.NO_ERROR), actualRepayAmount);
    }

    /**
     * @notice Transfers collateral tokens (this market) to the liquidator.
     * @dev Will fail unless called by another vToken during the process of liquidation.
     *  Its absolutely critical to use msg.sender as the borrowed vToken and not a parameter.
     * @param liquidator The account receiving seized collateral
     * @param borrower The account having collateral seized
     * @param seizeTokens The number of vTokens to seize
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function seize(address liquidator, address borrower, uint seizeTokens) external nonReentrant returns (uint) {
        return seizeInternal(msg.sender, liquidator, borrower, seizeTokens);
    }

    /**
     * @notice Transfers collateral tokens (this market) to the liquidator.
     * @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another VToken.
     *  Its absolutely critical to use msg.sender as the seizer vToken and not a parameter.
     * @param seizerToken The contract seizing the collateral (i.e. borrowed vToken)
     * @param liquidator The account receiving seized collateral
     * @param borrower The account having collateral seized
     * @param seizeTokens The number of vTokens to seize
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function seizeInternal(address seizerToken, address liquidator, address borrower, uint seizeTokens) internal returns (uint) {
        /* Fail if seize not allowed */
        uint allowed = comptroller.seizeAllowed(address(this), seizerToken, liquidator, borrower, seizeTokens);
        if (allowed != 0) {
            return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.LIQUIDATE_SEIZE_COMPTROLLER_REJECTION, allowed);
        }

        /* Fail if borrower = liquidator */
        if (borrower == liquidator) {
            return fail(Error.INVALID_ACCOUNT_PAIR, FailureInfo.LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER);
        }

        MathError mathErr;
        uint borrowerTokensNew;
        uint liquidatorTokensNew;

        /*
         * We calculate the new borrower and liquidator token balances, failing on underflow/overflow:
         *  borrowerTokensNew = accountTokens[borrower] - seizeTokens
         *  liquidatorTokensNew = accountTokens[liquidator] + seizeTokens
         */
        (mathErr, borrowerTokensNew) = subUInt(accountTokens[borrower], seizeTokens);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED, uint(mathErr));
        }

        (mathErr, liquidatorTokensNew) = addUInt(accountTokens[liquidator], seizeTokens);
        if (mathErr != MathError.NO_ERROR) {
            return failOpaque(Error.MATH_ERROR, FailureInfo.LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED, uint(mathErr));
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /* We write the previously calculated values into storage */
        accountTokens[borrower] = borrowerTokensNew;
        accountTokens[liquidator] = liquidatorTokensNew;

        /* Emit a Transfer event */
        emit Transfer(borrower, liquidator, seizeTokens);

        /* We call the defense hook */
        comptroller.seizeVerify(address(this), seizerToken, liquidator, borrower, seizeTokens);

        return uint(Error.NO_ERROR);
    }


    /*** Admin Functions ***/

    /**
      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @param newPendingAdmin New pending admin.
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setPendingAdmin(address payable newPendingAdmin) external returns (uint) {
        // Check caller = admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);
        }

        // Save current value, if any, for inclusion in log
        address oldPendingAdmin = pendingAdmin;

        // Store pendingAdmin with value newPendingAdmin
        pendingAdmin = newPendingAdmin;

        // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
      * @dev Admin function for pending admin to accept role and update admin
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _acceptAdmin() external returns (uint) {
        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)
        if (msg.sender != pendingAdmin || msg.sender == address(0)) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);
        }

        // Save current values for inclusion in log
        address oldAdmin = admin;
        address oldPendingAdmin = pendingAdmin;

        // Store admin with value pendingAdmin
        admin = pendingAdmin;

        // Clear the pending value
        pendingAdmin = address(0);

        emit NewAdmin(oldAdmin, admin);
        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice Sets a new comptroller for the market
      * @dev Admin function to set a new comptroller
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setComptroller(ComptrollerInterface newComptroller) public returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_COMPTROLLER_OWNER_CHECK);
        }

        ComptrollerInterface oldComptroller = comptroller;
        // Ensure invoke comptroller.isComptroller() returns true
        require(newComptroller.isComptroller(), "marker method returned false");

        // Set market's comptroller to newComptroller
        comptroller = newComptroller;

        // Emit NewComptroller(oldComptroller, newComptroller)
        emit NewComptroller(oldComptroller, newComptroller);

        return uint(Error.NO_ERROR);
    }

    /**
      * @notice accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh
      * @dev Admin function to accrue interest and set a new reserve factor
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setReserveFactor(uint newReserveFactorMantissa) external nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reserve factor change failed.
            return fail(Error(error), FailureInfo.SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED);
        }
        // _setReserveFactorFresh emits reserve-factor-specific logs on errors, so we don't need to.
        return _setReserveFactorFresh(newReserveFactorMantissa);
    }

    /**
      * @notice Sets a new reserve factor for the protocol (*requires fresh interest accrual)
      * @dev Admin function to set a new reserve factor
      * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
      */
    function _setReserveFactorFresh(uint newReserveFactorMantissa) internal returns (uint) {
        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_RESERVE_FACTOR_ADMIN_CHECK);
        }

        // Verify market's block number equals current block number
        if (accrualBlockNumber != getBlockNumber()) {
            return fail(Error.MARKET_NOT_FRESH, FailureInfo.SET_RESERVE_FACTOR_FRESH_CHECK);
        }

        // Check newReserveFactor ≤ maxReserveFactor
        if (newReserveFactorMantissa > reserveFactorMaxMantissa) {
            return fail(Error.BAD_INPUT, FailureInfo.SET_RESERVE_FACTOR_BOUNDS_CHECK);
        }

        uint oldReserveFactorMantissa = reserveFactorMantissa;
        reserveFactorMantissa = newReserveFactorMantissa;

        emit NewReserveFactor(oldReserveFactorMantissa, newReserveFactorMantissa);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice Accrues interest and reduces reserves by transferring from msg.sender
     * @param addAmount Amount of addition to reserves
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _addReservesInternal(uint addAmount) internal nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.
            return fail(Error(error), FailureInfo.ADD_RESERVES_ACCRUE_INTEREST_FAILED);
        }

        // _addReservesFresh emits reserve-addition-specific logs on errors, so we don't need to.
        (error, ) = _addReservesFresh(addAmount);
        return error;
    }

    /**
     * @notice Add reserves by transferring from caller
     * @dev Requires fresh interest accrual
     * @param addAmount Amount of addition to reserves
     * @return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees
     */
    function _addReservesFresh(uint addAmount) internal returns (uint, uint) {
        // totalReserves + actualAddAmount
        uint totalReservesNew;
        uint actualAddAmount;

        // We fail gracefully unless market's block number equals current block number
        if (accrualBlockNumber != getBlockNumber()) {
            return (fail(Error.MARKET_NOT_FRESH, FailureInfo.ADD_RESERVES_FRESH_CHECK), actualAddAmount);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        /*
         * We call doTransferIn for the caller and the addAmount
         *  Note: The vToken must handle variations between BEP-20 and BNB underlying.
         *  On success, the vToken holds an additional addAmount of cash.
         *  doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.
         *  it returns the amount actually transferred, in case of a fee.
         */

        actualAddAmount = doTransferIn(msg.sender, addAmount);

        totalReservesNew = totalReserves + actualAddAmount;

        /* Revert on overflow */
        require(totalReservesNew >= totalReserves, "add reserves unexpected overflow");

        // Store reserves[n+1] = reserves[n] + actualAddAmount
        totalReserves = totalReservesNew;

        /* Emit NewReserves(admin, actualAddAmount, reserves[n+1]) */
        emit ReservesAdded(msg.sender, actualAddAmount, totalReservesNew);

        /* Return (NO_ERROR, actualAddAmount) */
        return (uint(Error.NO_ERROR), actualAddAmount);
    }


    /**
     * @notice Accrues interest and reduces reserves by transferring to admin
     * @param reduceAmount Amount of reduction to reserves
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _reduceReserves(uint reduceAmount) external nonReentrant returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.
            return fail(Error(error), FailureInfo.REDUCE_RESERVES_ACCRUE_INTEREST_FAILED);
        }
        // _reduceReservesFresh emits reserve-reduction-specific logs on errors, so we don't need to.
        return _reduceReservesFresh(reduceAmount);
    }

    /**
     * @notice Reduces reserves by transferring to admin
     * @dev Requires fresh interest accrual
     * @param reduceAmount Amount of reduction to reserves
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _reduceReservesFresh(uint reduceAmount) internal returns (uint) {
        // totalReserves - reduceAmount
        uint totalReservesNew;

        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.REDUCE_RESERVES_ADMIN_CHECK);
        }

        // We fail gracefully unless market's block number equals current block number
        if (accrualBlockNumber != getBlockNumber()) {
            return fail(Error.MARKET_NOT_FRESH, FailureInfo.REDUCE_RESERVES_FRESH_CHECK);
        }

        // Fail gracefully if protocol has insufficient underlying cash
        if (getCashPrior() < reduceAmount) {
            return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.REDUCE_RESERVES_CASH_NOT_AVAILABLE);
        }

        // Check reduceAmount ≤ reserves[n] (totalReserves)
        if (reduceAmount > totalReserves) {
            return fail(Error.BAD_INPUT, FailureInfo.REDUCE_RESERVES_VALIDATION);
        }

        /////////////////////////
        // EFFECTS & INTERACTIONS
        // (No safe failures beyond this point)

        totalReservesNew = totalReserves - reduceAmount;
        // We checked reduceAmount <= totalReserves above, so this should never revert.
        require(totalReservesNew <= totalReserves, "reduce reserves unexpected underflow");

        // Store reserves[n+1] = reserves[n] - reduceAmount
        totalReserves = totalReservesNew;

        // doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
        doTransferOut(admin, reduceAmount);

        emit ReservesReduced(admin, reduceAmount, totalReservesNew);

        return uint(Error.NO_ERROR);
    }

    /**
     * @notice accrues interest and updates the interest rate model using _setInterestRateModelFresh
     * @dev Admin function to accrue interest and update the interest rate model
     * @param newInterestRateModel the new interest rate model to use
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _setInterestRateModel(InterestRateModel newInterestRateModel) public returns (uint) {
        uint error = accrueInterest();
        if (error != uint(Error.NO_ERROR)) {
            // 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
            return fail(Error(error), FailureInfo.SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED);
        }
        // _setInterestRateModelFresh emits interest-rate-model-update-specific logs on errors, so we don't need to.
        return _setInterestRateModelFresh(newInterestRateModel);
    }

    /**
     * @notice updates the interest rate model (*requires fresh interest accrual)
     * @dev Admin function to update the interest rate model
     * @param newInterestRateModel the new interest rate model to use
     * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
     */
    function _setInterestRateModelFresh(InterestRateModel newInterestRateModel) internal returns (uint) {

        // Used to store old model for use in the event that is emitted on success
        InterestRateModel oldInterestRateModel;

        // Check caller is admin
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_INTEREST_RATE_MODEL_OWNER_CHECK);
        }

        // We fail gracefully unless market's block number equals current block number
        if (accrualBlockNumber != getBlockNumber()) {
            return fail(Error.MARKET_NOT_FRESH, FailureInfo.SET_INTEREST_RATE_MODEL_FRESH_CHECK);
        }

        // Track the market's current interest rate model
        oldInterestRateModel = interestRateModel;

        // Ensure invoke newInterestRateModel.isInterestRateModel() returns true
        require(newInterestRateModel.isInterestRateModel(), "marker method returned false");

        // Set the interest rate model to newInterestRateModel
        interestRateModel = newInterestRateModel;

        // Emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel)
        emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel);

        return uint(Error.NO_ERROR);
    }

    /*** Safe Token ***/

    /**
     * @notice Gets balance of this contract in terms of the underlying
     * @dev This excludes the value of the current message, if any
     * @return The quantity of underlying owned by this contract
     */
    function getCashPrior() internal view returns (uint);

    /**
     * @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee.
     *  This may revert due to insufficient balance or insufficient allowance.
     */
    function doTransferIn(address from, uint amount) internal returns (uint);

    /**
     * @dev Performs a transfer out, ideally returning an explanatory error code upon failure tather than reverting.
     *  If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract.
     *  If caller has checked protocol's balance, and verified it is >= amount, this should not revert in normal conditions.
     */
    function doTransferOut(address payable to, uint amount) internal;


    /*** Reentrancy Guard ***/

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     */
    modifier nonReentrant() {
        require(_notEntered, "re-entered");
        _notEntered = false;
        _;
        _notEntered = true; // get a gas-refund post-Istanbul
    }
}

File 16 of 17: VTokenInterfaces.sol
pragma solidity ^0.5.16;

import "./ComptrollerInterface.sol";
import "./InterestRateModel.sol";

contract VTokenStorage {
    /**
     * @dev Guard variable for re-entrancy checks
     */
    bool internal _notEntered;

    /**
     * @notice EIP-20 token name for this token
     */
    string public name;

    /**
     * @notice EIP-20 token symbol for this token
     */
    string public symbol;

    /**
     * @notice EIP-20 token decimals for this token
     */
    uint8 public decimals;

    /**
     * @notice Maximum borrow rate that can ever be applied (.0005% / block)
     */

    uint internal constant borrowRateMaxMantissa = 0.0005e16;

    /**
     * @notice Maximum fraction of interest that can be set aside for reserves
     */
    uint internal constant reserveFactorMaxMantissa = 1e18;

    /**
     * @notice Administrator for this contract
     */
    address payable public admin;

    /**
     * @notice Pending administrator for this contract
     */
    address payable public pendingAdmin;

    /**
     * @notice Contract which oversees inter-vToken operations
     */
    ComptrollerInterface public comptroller;

    /**
     * @notice Model which tells what the current interest rate should be
     */
    InterestRateModel public interestRateModel;

    /**
     * @notice Initial exchange rate used when minting the first VTokens (used when totalSupply = 0)
     */
    uint internal initialExchangeRateMantissa;

    /**
     * @notice Fraction of interest currently set aside for reserves
     */
    uint public reserveFactorMantissa;

    /**
     * @notice Block number that interest was last accrued at
     */
    uint public accrualBlockNumber;

    /**
     * @notice Accumulator of the total earned interest rate since the opening of the market
     */
    uint public borrowIndex;

    /**
     * @notice Total amount of outstanding borrows of the underlying in this market
     */
    uint public totalBorrows;

    /**
     * @notice Total amount of reserves of the underlying held in this market
     */
    uint public totalReserves;

    /**
     * @notice Total number of tokens in circulation
     */
    uint public totalSupply;

    /**
     * @notice Official record of token balances for each account
     */
    mapping (address => uint) internal accountTokens;

    /**
     * @notice Approved token transfer amounts on behalf of others
     */
    mapping (address => mapping (address => uint)) internal transferAllowances;

    /**
     * @notice Container for borrow balance information
     * @member principal Total balance (with accrued interest), after applying the most recent balance-changing action
     * @member interestIndex Global borrowIndex as of the most recent balance-changing action
     */
    struct BorrowSnapshot {
        uint principal;
        uint interestIndex;
    }

    /**
     * @notice Mapping of account addresses to outstanding borrow balances
     */
    mapping(address => BorrowSnapshot) internal accountBorrows;
}

contract VTokenInterface is VTokenStorage {
    /**
     * @notice Indicator that this is a VToken contract (for inspection)
     */
    bool public constant isVToken = true;


    /*** Market Events ***/

    /**
     * @notice Event emitted when interest is accrued
     */
    event AccrueInterest(uint cashPrior, uint interestAccumulated, uint borrowIndex, uint totalBorrows);

    /**
     * @notice Event emitted when tokens are minted
     */
    event Mint(address minter, uint mintAmount, uint mintTokens);

    /**
     * @notice Event emitted when tokens are redeemed
     */
    event Redeem(address redeemer, uint redeemAmount, uint redeemTokens);

    /**
     * @notice Event emitted when underlying is borrowed
     */
    event Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows);

    /**
     * @notice Event emitted when a borrow is repaid
     */
    event RepayBorrow(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows);

    /**
     * @notice Event emitted when a borrow is liquidated
     */
    event LiquidateBorrow(address liquidator, address borrower, uint repayAmount, address vTokenCollateral, uint seizeTokens);


    /*** Admin Events ***/

    /**
     * @notice Event emitted when pendingAdmin is changed
     */
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /**
     * @notice Event emitted when pendingAdmin is accepted, which means admin is updated
     */
    event NewAdmin(address oldAdmin, address newAdmin);

    /**
     * @notice Event emitted when comptroller is changed
     */
    event NewComptroller(ComptrollerInterface oldComptroller, ComptrollerInterface newComptroller);

    /**
     * @notice Event emitted when interestRateModel is changed
     */
    event NewMarketInterestRateModel(InterestRateModel oldInterestRateModel, InterestRateModel newInterestRateModel);

    /**
     * @notice Event emitted when the reserve factor is changed
     */
    event NewReserveFactor(uint oldReserveFactorMantissa, uint newReserveFactorMantissa);

    /**
     * @notice Event emitted when the reserves are added
     */
    event ReservesAdded(address benefactor, uint addAmount, uint newTotalReserves);

    /**
     * @notice Event emitted when the reserves are reduced
     */
    event ReservesReduced(address admin, uint reduceAmount, uint newTotalReserves);

    /**
     * @notice EIP20 Transfer event
     */
    event Transfer(address indexed from, address indexed to, uint amount);

    /**
     * @notice EIP20 Approval event
     */
    event Approval(address indexed owner, address indexed spender, uint amount);

    /**
     * @notice Failure event
     */
    event Failure(uint error, uint info, uint detail);


    /*** User Interface ***/

    function transfer(address dst, uint amount) external returns (bool);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function approve(address spender, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function balanceOfUnderlying(address owner) external returns (uint);
    function getAccountSnapshot(address account) external view returns (uint, uint, uint, uint);
    function borrowRatePerBlock() external view returns (uint);
    function supplyRatePerBlock() external view returns (uint);
    function totalBorrowsCurrent() external returns (uint);
    function borrowBalanceCurrent(address account) external returns (uint);
    function borrowBalanceStored(address account) public view returns (uint);
    function exchangeRateCurrent() public returns (uint);
    function exchangeRateStored() public view returns (uint);
    function getCash() external view returns (uint);
    function accrueInterest() public returns (uint);
    function seize(address liquidator, address borrower, uint seizeTokens) external returns (uint);


    /*** Admin Functions ***/

    function _setPendingAdmin(address payable newPendingAdmin) external returns (uint);
    function _acceptAdmin() external returns (uint);
    function _setComptroller(ComptrollerInterface newComptroller) public returns (uint);
    function _setReserveFactor(uint newReserveFactorMantissa) external returns (uint);
    function _reduceReserves(uint reduceAmount) external returns (uint);
    function _setInterestRateModel(InterestRateModel newInterestRateModel) public returns (uint);
}

contract VBep20Storage {
    /**
     * @notice Underlying asset for this VToken
     */
    address public underlying;
}

contract VBep20Interface is VBep20Storage {

    /*** User Interface ***/

    function mint(uint mintAmount) external returns (uint);
    function redeem(uint redeemTokens) external returns (uint);
    function redeemUnderlying(uint redeemAmount) external returns (uint);
    function borrow(uint borrowAmount) external returns (uint);
    function repayBorrow(uint repayAmount) external returns (uint);
    function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint);
    function liquidateBorrow(address borrower, uint repayAmount, VTokenInterface vTokenCollateral) external returns (uint);


    /*** Admin Functions ***/

    function _addReserves(uint addAmount) external returns (uint);
}

contract VDelegationStorage {
    /**
     * @notice Implementation address for this contract
     */
    address public implementation;
}

contract VDelegatorInterface is VDelegationStorage {
    /**
     * @notice Emitted when implementation is changed
     */
    event NewImplementation(address oldImplementation, address newImplementation);

    /**
     * @notice Called by the admin to update the implementation of the delegator
     * @param implementation_ The address of the new implementation for delegation
     * @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
     * @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation
     */
    function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public;
}

contract VDelegateInterface is VDelegationStorage {
    /**
     * @notice Called by the delegator on a delegate to initialize it for duty
     * @dev Should revert if any issues arise which make it unfit for delegation
     * @param data The encoded bytes data for any initialization
     */
    function _becomeImplementation(bytes memory data) public;

    /**
     * @notice Called by the delegator on a delegate to forfeit its responsibility
     */
    function _resignImplementation() public;
}

File 17 of 17: XVS.sol
pragma solidity ^0.5.16;

contract Owned {

    address public owner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner, "Should be owner");
        _;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        owner = newOwner;
        emit OwnershipTransferred(owner, newOwner);
    }
}

contract Tokenlock is Owned {
    /// @notice Indicates if token is locked
    uint8 isLocked = 0;

    event Freezed();
    event UnFreezed();

    modifier validLock {
        require(isLocked == 0, "Token is locked");
        _;
    }

    function freeze() public onlyOwner {
        isLocked = 1;

        emit Freezed();
    }

    function unfreeze() public onlyOwner {
        isLocked = 0;

        emit UnFreezed();
    }
}

contract XVS is Tokenlock {
    /// @notice BEP-20 token name for this token
    string public constant name = "Venus";

    /// @notice BEP-20 token symbol for this token
    string public constant symbol = "XVS";

    /// @notice BEP-20 token decimals for this token
    uint8 public constant decimals = 18;

    /// @notice Total number of tokens in circulation
    uint public constant totalSupply = 30000000e18; // 30 million XVS

    /// @notice Allowance amounts on behalf of others
    mapping (address => mapping (address => uint96)) internal allowances;

    /// @notice Official record of token balances for each account
    mapping (address => uint96) internal balances;

    /// @notice A record of each accounts delegate
    mapping (address => address) public delegates;

    /// @notice A checkpoint for marking number of votes from a given block
    struct Checkpoint {
        uint32 fromBlock;
        uint96 votes;
    }

    /// @notice A record of votes checkpoints for each account, by index
    mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;

    /// @notice The number of checkpoints for each account
    mapping (address => uint32) public numCheckpoints;

    /// @notice The EIP-712 typehash for the contract's domain
    bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");

    /// @notice The EIP-712 typehash for the delegation struct used by the contract
    bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

    /// @notice A record of states for signing / validating signatures
    mapping (address => uint) public nonces;

    /// @notice An event thats emitted when an account changes its delegate
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    /// @notice An event thats emitted when a delegate account's vote balance changes
    event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);

    /// @notice The standard BEP-20 transfer event
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /// @notice The standard BEP-20 approval event
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /**
     * @notice Construct a new XVS token
     * @param account The initial account to grant all the tokens
     */
    constructor(address account) public {
        balances[account] = uint96(totalSupply);
        emit Transfer(address(0), account, totalSupply);
    }

    /**
     * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
     * @param account The address of the account holding the funds
     * @param spender The address of the account spending the funds
     * @return The number of tokens approved
     */
    function allowance(address account, address spender) external view returns (uint) {
        return allowances[account][spender];
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     * @param spender The address of the account which may transfer tokens
     * @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint rawAmount) external validLock returns (bool) {
        uint96 amount;
        if (rawAmount == uint(-1)) {
            amount = uint96(-1);
        } else {
            amount = safe96(rawAmount, "XVS::approve: amount exceeds 96 bits");
        }

        allowances[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);
        return true;
    }

    /**
     * @notice Get the number of tokens held by the `account`
     * @param account The address of the account to get the balance of
     * @return The number of tokens held
     */
    function balanceOf(address account) external view returns (uint) {
        return balances[account];
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint rawAmount) external validLock returns (bool) {
        uint96 amount = safe96(rawAmount, "XVS::transfer: amount exceeds 96 bits");
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param rawAmount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(address src, address dst, uint rawAmount) external validLock returns (bool) {
        address spender = msg.sender;
        uint96 spenderAllowance = allowances[src][spender];
        uint96 amount = safe96(rawAmount, "XVS::approve: amount exceeds 96 bits");

        if (spender != src && spenderAllowance != uint96(-1)) {
            uint96 newAllowance = sub96(spenderAllowance, amount, "XVS::transferFrom: transfer amount exceeds spender allowance");
            allowances[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }

    /**
     * @notice Delegate votes from `msg.sender` to `delegatee`
     * @param delegatee The address to delegate votes to
     */
    function delegate(address delegatee) public validLock {
        return _delegate(msg.sender, delegatee);
    }

    /**
     * @notice Delegates votes from signatory to `delegatee`
     * @param delegatee The address to delegate votes to
     * @param nonce The contract state required to match the signature
     * @param expiry The time at which to expire the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public validLock {
        bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
        bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
        address signatory = ecrecover(digest, v, r, s);
        require(signatory != address(0), "XVS::delegateBySig: invalid signature");
        require(nonce == nonces[signatory]++, "XVS::delegateBySig: invalid nonce");
        require(now <= expiry, "XVS::delegateBySig: signature expired");
        return _delegate(signatory, delegatee);
    }

    /**
     * @notice Gets the current votes balance for `account`
     * @param account The address to get votes balance
     * @return The number of current votes for `account`
     */
    function getCurrentVotes(address account) external view returns (uint96) {
        uint32 nCheckpoints = numCheckpoints[account];
        return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
    }

    /**
     * @notice Determine the prior number of votes for an account as of a block number
     * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
     * @param account The address of the account to check
     * @param blockNumber The block number to get the vote balance at
     * @return The number of votes the account had as of the given block
     */
    function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
        require(blockNumber < block.number, "XVS::getPriorVotes: not yet determined");

        uint32 nCheckpoints = numCheckpoints[account];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
            return checkpoints[account][nCheckpoints - 1].votes;
        }

        // Next check implicit zero balance
        if (checkpoints[account][0].fromBlock > blockNumber) {
            return 0;
        }

        uint32 lower = 0;
        uint32 upper = nCheckpoints - 1;
        while (upper > lower) {
            uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            Checkpoint memory cp = checkpoints[account][center];
            if (cp.fromBlock == blockNumber) {
                return cp.votes;
            } else if (cp.fromBlock < blockNumber) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return checkpoints[account][lower].votes;
    }

    function _delegate(address delegator, address delegatee) internal {
        address currentDelegate = delegates[delegator];
        uint96 delegatorBalance = balances[delegator];
        delegates[delegator] = delegatee;

        emit DelegateChanged(delegator, currentDelegate, delegatee);

        _moveDelegates(currentDelegate, delegatee, delegatorBalance);
    }

    function _transferTokens(address src, address dst, uint96 amount) internal {
        require(src != address(0), "XVS::_transferTokens: cannot transfer from the zero address");
        require(dst != address(0), "XVS::_transferTokens: cannot transfer to the zero address");

        balances[src] = sub96(balances[src], amount, "XVS::_transferTokens: transfer amount exceeds balance");
        balances[dst] = add96(balances[dst], amount, "XVS::_transferTokens: transfer amount overflows");
        emit Transfer(src, dst, amount);

        _moveDelegates(delegates[src], delegates[dst], amount);
    }

    function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
        if (srcRep != dstRep && amount > 0) {
            if (srcRep != address(0)) {
                uint32 srcRepNum = numCheckpoints[srcRep];
                uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
                uint96 srcRepNew = sub96(srcRepOld, amount, "XVS::_moveVotes: vote amount underflows");
                _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
            }

            if (dstRep != address(0)) {
                uint32 dstRepNum = numCheckpoints[dstRep];
                uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
                uint96 dstRepNew = add96(dstRepOld, amount, "XVS::_moveVotes: vote amount overflows");
                _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
            }
        }
    }

    function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
      uint32 blockNumber = safe32(block.number, "XVS::_writeCheckpoint: block number exceeds 32 bits");

      if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
          checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
      } else {
          checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
          numCheckpoints[delegatee] = nCheckpoints + 1;
      }

      emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
    }

    function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
        require(n < 2**96, errorMessage);
        return uint96(n);
    }

    function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
        uint96 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function getChainId() internal pure returns (uint) {
        uint256 chainId;
        assembly { chainId := chainid() }
        return chainId;
    }
}

Contract Security Audit

Contract 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 VToken","name":"vToken","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":"bool","name":"state","type":"bool"}],"name":"ActionProtocolPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VToken","name":"vToken","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"venusDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"venusBorrowIndex","type":"uint256"}],"name":"DistributedBorrowerVenus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VToken","name":"vToken","type":"address"},{"indexed":true,"internalType":"address","name":"supplier","type":"address"},{"indexed":false,"internalType":"uint256","name":"venusDelta","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"venusSupplyIndex","type":"uint256"}],"name":"DistributedSupplierVenus","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 VToken","name":"vToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract VToken","name":"vToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketExited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract VToken","name":"vToken","type":"address"}],"name":"MarketListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract VToken","name":"vToken","type":"address"},{"indexed":false,"internalType":"bool","name":"isVenus","type":"bool"}],"name":"MarketVenus","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 VToken","name":"vToken","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":"uint256","name":"oldMaxAssets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMaxAssets","type":"uint256"}],"name":"NewMaxAssets","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract VAIControllerInterface","name":"oldVAIController","type":"address"},{"indexed":false,"internalType":"contract VAIControllerInterface","name":"newVAIController","type":"address"}],"name":"NewVAIController","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldVAIMintRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newVAIMintRate","type":"uint256"}],"name":"NewVAIMintRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldVenusRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newVenusRate","type":"uint256"}],"name":"NewVenusRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract VToken","name":"vToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newSpeed","type":"uint256"}],"name":"VenusSpeedUpdated","type":"event"},{"constant":false,"inputs":[{"internalType":"address[]","name":"vTokens","type":"address[]"}],"name":"_addVenusMarkets","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"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":"vToken","type":"address"}],"name":"_dropVenusMarket","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":"uint256","name":"newCloseFactorMantissa","type":"uint256"}],"name":"_setCloseFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract VToken","name":"vToken","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":"uint256","name":"newLiquidationIncentiveMantissa","type":"uint256"}],"name":"_setLiquidationIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newMaxAssets","type":"uint256"}],"name":"_setMaxAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"_setProtocolPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract VAIControllerInterface","name":"vaiController_","type":"address"}],"name":"_setVAIController","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newVAIMintRate","type":"uint256"}],"name":"_setVAIMintRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"venusRate_","type":"uint256"}],"name":"_setVenusRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract VToken","name":"vToken","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 VToken","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 VToken","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","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":[{"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":"vToken","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 VToken","name":"vToken","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 VToken[]","name":"vTokens","type":"address[]"}],"name":"claimVenus","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"claimVenus","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"holders","type":"address[]"},{"internalType":"contract VToken[]","name":"vTokens","type":"address[]"},{"internalType":"bool","name":"borrowers","type":"bool"},{"internalType":"bool","name":"suppliers","type":"bool"}],"name":"claimVenus","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":[],"name":"comptrollerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"vTokens","type":"address[]"}],"name":"enterMarkets","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vTokenAddress","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 VToken[]","name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAssetsIn","outputs":[{"internalType":"contract VToken[]","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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"vTokenModify","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":[{"internalType":"address","name":"minter","type":"address"}],"name":"getMintableVAI","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getVAIMintRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getXVSAddress","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":false,"inputs":[{"internalType":"address","name":"vTokenBorrowed","type":"address"},{"internalType":"address","name":"vTokenCollateral","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":"vTokenBorrowed","type":"address"},{"internalType":"address","name":"vTokenCollateral","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":"vTokenBorrowed","type":"address"},{"internalType":"address","name":"vTokenCollateral","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":"isVenus","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":"vToken","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":"uint256","name":"mintVAIAmount","type":"uint256"}],"name":"mintVAI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"mintVAIGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","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":[{"internalType":"address","name":"owner","type":"address"}],"name":"mintedVAIOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedVAIs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":true,"inputs":[],"name":"protocolPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","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":"vToken","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":[],"name":"refreshVenusSpeeds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","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":"vToken","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":"uint256","name":"repayVAIAmount","type":"uint256"}],"name":"repayVAI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"repayVAIGuardianPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vTokenCollateral","type":"address"},{"internalType":"address","name":"vTokenBorrowed","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":"vTokenCollateral","type":"address"},{"internalType":"address","name":"vTokenBorrowed","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":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setMintedVAIOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","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":"vToken","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":true,"inputs":[],"name":"vaiController","outputs":[{"internalType":"contract VAIControllerInterface","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vaiMintRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"venusAccrued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"venusBorrowState","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":"venusBorrowerIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"venusClaimThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"venusInitialIndex","outputs":[{"internalType":"uint224","name":"","type":"uint224"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"venusRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"venusSpeeds","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":"venusSupplierIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"venusSupplyState","outputs":[{"internalType":"uint224","name":"index","type":"uint224"},{"internalType":"uint32","name":"block","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b03191633179055615c3c80620000336000396000f3fe608060405234801561001057600080fd5b50600436106104955760003560e01c80636d35bf9111610262578063bb82aa5e11610151578063da3d454c116100ce578063e6653f3d11610092578063e6653f3d14611205578063e87554461461120d578063eabe7d9114611215578063ede4edd01461124b578063f851a44014611271578063fd51a3ad1461127957610495565b8063da3d454c14611149578063dce154491461117f578063dcfbc0c7146111ab578063e37d4b79146111b3578063e4028eee146111d957610495565b8063c488847b11610115578063c488847b14610f60578063c5b4db5514610f96578063d02f735114610fba578063d09c54ba14611000578063d9226ced1461112c57610495565b8063bb82aa5e14610e6b578063bdcdc25814610e73578063bec04f7214610eaf578063bf32442d14610eb7578063c299823814610ebf57610495565b80639254f5e5116101df578063abfceffc116101a3578063abfceffc14610d71578063ac0b0bb714610de7578063adcd5fb914610def578063b0772d0b14610e15578063b8324c7c14610e1d57610495565b80639254f5e514610ce7578063929fe9a114610cef57806394b2294b14610d1d5780639cfdd9e614610d25578063a76b3fda14610d4b57610495565b806386df31ee1161022657806386df31ee14610bb8578063879c2e1d14610c6957806387f7630314610c715780638a7dc16514610c795780638e8f294b14610c9f57610495565b80636d35bf9114610b1f5780636fe74a2114610b65578063731f0c2b14610b825780637655138314610ba85780637dc0d1d014610bb057610495565b8063425fad581161038957806351dff989116103065780635ec88c79116102ca5780635ec88c7914610a235780635f5af1aa14610a495780635fc7e71e14610a6f57806365af42e314610ab55780636a56947e14610abd5780636d154ea514610af957610495565b806351dff9891461096657806352d84d1e146109a257806355ee1fe1146109bf57806359e4d967146109e55780635c778605146109ed57610495565b806347ef3b3b1161034d57806347ef3b3b146108655780634ada90af146108b15780634e79238f146108b95780634ef4c3e1146109135780634fd42e171461094957610495565b8063425fad581461077157806342cbb15c1461077957806343eb1b641461078157806344927f49146108225780634712ee7d1461084857610495565b806326782247116104175780633785d1d6116103db5780633785d1d6146106b85780633c94786f146106f75780634088c73e146106ff57806341a18d2c1461070757806341c728b91461073557610495565b806326782247146106315780632a6a6065146106395780632bc7e29e146106585780632ec041241461067e578063317b0b771461069b57610495565b80631d504dc61161045e5780631d504dc61461054c5780631ededc911461057257806320fa42b1146105b457806324008a62146105d157806324a3d6221461060d57610495565b80627e3dd21461049a57806308e0225c146104b657806312a2adc7146104f65780631abcaa77146105005780631cb8126e14610526575b600080fd5b6104a26112a5565b604080519115158252519081900360200190f35b6104e4600480360360408110156104cc57600080fd5b506001600160a01b03813581169160200135166112aa565b60408051918252519081900360200190f35b6104fe6112c7565b005b6104e46004803603602081101561051657600080fd5b50356001600160a01b031661130f565b6104fe6004803603602081101561053c57600080fd5b50356001600160a01b0316611321565b6104fe6004803603602081101561056257600080fd5b50356001600160a01b0316611436565b6104fe600480360360a081101561058857600080fd5b506001600160a01b038135811691602081013582169160408201351690606081013590608001356115a4565b6104fe600480360360208110156105ca57600080fd5b50356115ab565b6104e4600480360360808110156105e757600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611646565b61061561175e565b604080516001600160a01b039092168252519081900360200190f35b61061561176d565b6104a26004803603602081101561064f57600080fd5b5035151561177c565b6104e46004803603602081101561066e57600080fd5b50356001600160a01b0316611823565b6104e46004803603602081101561069457600080fd5b5035611835565b6104e4600480360360208110156106b157600080fd5b50356118a8565b6106de600480360360208110156106ce57600080fd5b50356001600160a01b03166119b2565b6040805192835260208301919091528051918290030190f35b6104a2611a3c565b6104a2611a4c565b6104e46004803603604081101561071d57600080fd5b506001600160a01b0381358116916020013516611a55565b6104fe6004803603608081101561074b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611a72565b6104a2611a78565b6104e4611a87565b6104fe6004803603602081101561079757600080fd5b810190602081018135600160201b8111156107b157600080fd5b8201836020820111156107c357600080fd5b803590602001918460208302840111600160201b831117156107e457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611a8c945050505050565b6104e46004803603602081101561083857600080fd5b50356001600160a01b0316611b15565b6104e46004803603602081101561085e57600080fd5b5035611b30565b6104fe600480360360c081101561087b57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611c51565b6104e4611c59565b6108f5600480360360808110156108cf57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611c5f565b60408051938452602084019290925282820152519081900360600190f35b6104e46004803603606081101561092957600080fd5b506001600160a01b03813581169160208101359091169060400135611c99565b6104e46004803603602081101561095f57600080fd5b5035611d90565b6104fe6004803603608081101561097c57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135611e84565b610615600480360360208110156109b857600080fd5b5035611ed5565b6104e4600480360360208110156109d557600080fd5b50356001600160a01b0316611efc565b6104e4611f81565b6104fe60048036036060811015610a0357600080fd5b506001600160a01b03813581169160208101359091169060400135611f87565b6108f560048036036020811015610a3957600080fd5b50356001600160a01b0316611f8c565b6104e460048036036020811015610a5f57600080fd5b50356001600160a01b0316611fc1565b6104e4600480360360a0811015610a8557600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612045565b6104e461221b565b6104fe60048036036080811015610ad357600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135612226565b6104a260048036036020811015610b0f57600080fd5b50356001600160a01b031661222b565b6104fe600480360360a0811015610b3557600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013590911690608001356115a4565b6104e460048036036020811015610b7b57600080fd5b5035612240565b6104a260048036036020811015610b9857600080fd5b50356001600160a01b0316612335565b6104a261234a565b610615612358565b6104fe60048036036040811015610bce57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610bf857600080fd5b820183602082011115610c0a57600080fd5b803590602001918460208302840111600160201b83111715610c2b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612367945050505050565b6104e46123c4565b6104a26123ca565b6104e460048036036020811015610c8f57600080fd5b50356001600160a01b03166123da565b610cc560048036036020811015610cb557600080fd5b50356001600160a01b03166123ec565b6040805193151584526020840192909252151582820152519081900360600190f35b610615612412565b6104a260048036036040811015610d0557600080fd5b506001600160a01b0381358116916020013516612421565b6104e4612455565b6104e460048036036020811015610d3b57600080fd5b50356001600160a01b031661245b565b6104e460048036036020811015610d6157600080fd5b50356001600160a01b03166124df565b610d9760048036036020811015610d8757600080fd5b50356001600160a01b031661263c565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610dd3578181015183820152602001610dbb565b505050509050019250505060405180910390f35b6104a26126b2565b6104fe60048036036020811015610e0557600080fd5b50356001600160a01b03166126c2565b610d97612726565b610e4360048036036020811015610e3357600080fd5b50356001600160a01b0316612788565b604080516001600160e01b03909316835263ffffffff90911660208301528051918290030190f35b6106156127b2565b6104e460048036036080811015610e8957600080fd5b506001600160a01b038135811691602081013582169160408201351690606001356127c1565b6104e46128a1565b6106156128a7565b610d9760048036036020811015610ed557600080fd5b810190602081018135600160201b811115610eef57600080fd5b820183602082011115610f0157600080fd5b803590602001918460208302840111600160201b83111715610f2257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506128bf945050505050565b6106de60048036036060811015610f7657600080fd5b506001600160a01b03813581169160208101359091169060400135612956565b610f9e612bcb565b604080516001600160e01b039092168252519081900360200190f35b6104e4600480360360a0811015610fd057600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612bde565b6104fe6004803603608081101561101657600080fd5b810190602081018135600160201b81111561103057600080fd5b82018360208201111561104257600080fd5b803590602001918460208302840111600160201b8311171561106357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156110b257600080fd5b8201836020820111156110c457600080fd5b803590602001918460208302840111600160201b831117156110e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505050803515159150602001351515612de2565b6104e46004803603602081101561114257600080fd5b5035612f8f565b6104e46004803603606081101561115f57600080fd5b506001600160a01b03813581169160208101359091169060400135612ff8565b6106156004803603604081101561119557600080fd5b506001600160a01b038135169060200135613301565b610615613336565b610e43600480360360208110156111c957600080fd5b50356001600160a01b0316613345565b6104e4600480360360408110156111ef57600080fd5b506001600160a01b03813516906020013561336f565b6104a261351f565b6104e461352f565b6104e46004803603606081101561122b57600080fd5b506001600160a01b03813581169160208101359091169060400135613535565b6104e46004803603602081101561126157600080fd5b50356001600160a01b03166135c0565b61061561387c565b6104e46004803603604081101561128f57600080fd5b506001600160a01b03813516906020013561388b565b600181565b601360209081526000928352604080842090915290825290205481565b3332146113055760405162461bcd60e51b8152600401808060200182810382526022815260200180615be66022913960400191505060405180910390fd5b61130d613976565b565b600f6020526000908152604090205481565b6000546001600160a01b03163314611371576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b6001600160a01b0381166000908152600960205260409020600381015460ff1615156001146113da576040805162461bcd60e51b815260206004820152601060248201526f1b9bdd081d995b9d5cc81b585c9ad95d60821b604482015290519081900360640190fd5b60038101805460ff19169055604080516001600160a01b03841681526000602082015281517f5f4087bd98874c2fa3ea4474bc7c58b711b23fff45cd2f456e358b4b33ee9025929181900390910190a1611432613976565b5050565b806001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b15801561146f57600080fd5b505afa158015611483573d6000803e3d6000fd5b505050506040513d602081101561149957600080fd5b50516001600160a01b031633146114f7576040805162461bcd60e51b815260206004820152601960248201527f6f6e6c7920756e6974726f6c6c65722061646d696e2063616e00000000000000604482015290519081900360640190fd5b806001600160a01b031663c1e803346040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561153257600080fd5b505af1158015611546573d6000803e3d6000fd5b505050506040513d602081101561155c57600080fd5b5051156115a1576040805162461bcd60e51b815260206004820152600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b604482015290519081900360640190fd5b50565b5050505050565b6000546001600160a01b031633146115fb576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b600e805490829055604080518281526020810184905281517f5c37806eedc7b8c869503478c1753afec9fe3a9847d6b4ff288080bebe15dd34929181900390910190a1611432613976565b60185460009062010000900460ff1615611695576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b6001600160a01b03851660009081526009602052604090205460ff166116bd57506009611756565b6116c5615b06565b6040518060200160405280876001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561170957600080fd5b505afa15801561171d573d6000803e3d6000fd5b505050506040513d602081101561173357600080fd5b5051905290506117438682613cf2565b6117508685836000613f86565b60009150505b949350505050565b600a546001600160a01b031681565b6001546001600160a01b031681565b600080546001600160a01b031633146117cd576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b6018805483151562010000810262ff0000199092169190911790915560408051918252517fd7500633dd3ddd74daa7af62f8c8404c7fe4a81da179998db851696bed004b389181900360200190a150805b919050565b60166020526000908152604090205481565b600080546001600160a01b0316331461185b5761185460016014614171565b905061181e565b6017805490839055604080518281526020810185905281517f73747d68b346dce1e932bcd238282e7ac84c01569e1f8d0469c222fdc6e9d5a4929181900390910190a160005b9392505050565b600080546001600160a01b031633146118c75761185460016004614171565b6118cf615b06565b5060408051602081019091528281526118e6615b06565b50604080516020810190915266b1a2bc2ec50000815261190682826141d7565b1561191f57611916600580614171565b9250505061181e565b611927615b06565b506040805160208101909152670c7d713b49da0000815261194881846141df565b1561196257611958600580614171565b935050505061181e565b6005805490869055604080518281526020810188905281517f3b9670cf975d26958e754b57098eaa2ac914d8d2a31b83257997b9f346110fd9929181900390910190a160005b9695505050505050565b60155460408051631bc2e8eb60e11b81526001600160a01b03848116600483015282516000948594921692633785d1d6926024808301939192829003018186803b1580156119ff57600080fd5b505afa158015611a13573d6000803e3d6000fd5b505050506040513d6040811015611a2957600080fd5b5080516020909101519092509050915091565b600a54600160a01b900460ff1681565b60185460ff1681565b601260209081526000928352604080842090915290825290205481565b50505050565b60185462010000900460ff1681565b435b90565b6000546001600160a01b03163314611adc576040805162461bcd60e51b815260206004820152600e60248201526d37b7363c9030b236b4b71031b0b760911b604482015290519081900360640190fd5b60005b8151811015611b0c57611b04828281518110611af757fe5b60200260200101516141e6565b600101611adf565b506115a1613976565b6001600160a01b031660009081526016602052604090205490565b60185460009062010000900460ff1615611b7f576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b60185460ff1615611bcb576040805162461bcd60e51b81526020600482015260116024820152701b5a5b9d159052481a5cc81c185d5cd959607a1b604482015290519081900360640190fd5b60155460408051630d00083160e01b81523360048201526024810185905290516001600160a01b0390921691630d000831916044808201926020929091908290030181600087803b158015611c1f57600080fd5b505af1158015611c33573d6000803e3d6000fd5b505050506040513d6020811015611c4957600080fd5b505192915050565b505050505050565b60065481565b600080600080600080611c748a8a8a8a61450c565b925092509250826013811115611c8657fe5b95509093509150505b9450945094915050565b60185460009062010000900460ff1615611ce8576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b6001600160a01b0384166000908152600b602052604090205460ff1615611d47576040805162461bcd60e51b815260206004820152600e60248201526d1b5a5b9d081a5cc81c185d5cd95960921b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff16611d715760095b90506118a1565b611d7a84614989565b611d8684846000614c13565b6000949350505050565b600080546001600160a01b03163314611daf576118546001600b614171565b611db7615b06565b506040805160208101909152828152611dce615b06565b506040805160208101909152670de0b6b3a76400008152611def82826141df565b15611e00576119166007600c614171565b611e08615b06565b5060408051602081019091526714d1120d7b1600008152611e2981846141df565b15611e3a576119586007600c614171565b6006805490869055604080518281526020810188905281517faeba5a6c40a8ac138134bff1aaa65debf25971188a58804bad717f82f0ec1316929181900390910190a160006119a8565b80151580611e90575081155b611a72576040805162461bcd60e51b815260206004820152601160248201527072656465656d546f6b656e73207a65726f60781b604482015290519081900360640190fd5b600d8181548110611ee257fe5b6000918252602090912001546001600160a01b0316905081565b600080546001600160a01b03163314611f1b5761185460016010614171565b600480546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fd52b2b9b7e9ee655fcb95d2e5b9e0c9f69e7ef2b8e9d2d0ea78402d576d22e22929181900390910190a160006118a1565b60175490565b505050565b600080600080600080611fa387600080600061450c565b925092509250826013811115611fb557fe5b97919650945092505050565b600080546001600160a01b03163314611fe05761185460016013614171565b600a80546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517f0613b6ee6a04f0d09f390e4d9318894b9f6ac7fd83897cd8d18896ba579c401e9281900390910190a160006118a1565b60185460009062010000900460ff1615612094576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b6001600160a01b03861660009081526009602052604090205460ff1615806120d557506001600160a01b03851660009081526009602052604090205460ff16155b156120e45760095b9050612212565b6000806120f085614e0b565b9193509091506000905082601381111561210657fe5b146121205781601381111561211757fe5b92505050612212565b8061212c576003612117565b6000886001600160a01b03166395dd9193876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561218457600080fd5b505afa158015612198573d6000803e3d6000fd5b505050506040513d60208110156121ae57600080fd5b50516040805160208101909152600554815290915060009081906121d29084614e2b565b909250905060008260038111156121e557fe5b146121f957600b5b95505050505050612212565b808711156122085760116121ed565b6000955050505050505b95945050505050565b66038d7ea4c6800081565b611a72565b600c6020526000908152604090205460ff1681565b60185460009062010000900460ff161561228f576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b601854610100900460ff16156122e1576040805162461bcd60e51b81526020600482015260126024820152711c995c185e559052481a5cc81c185d5cd95960721b604482015290519081900360640190fd5b6015546040805163bca07ad560e01b81523360048201526024810185905290516001600160a01b039092169163bca07ad5916044808201926020929091908290030181600087803b158015611c1f57600080fd5b600b6020526000908152604090205460ff1681565b601854610100900460ff1681565b6004546001600160a01b031681565b60408051600180825281830190925260609160208083019080388339019050509050828160008151811061239757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050611f878183600180612de2565b600e5481565b600a54600160b01b900460ff1681565b60146020526000908152604090205481565b60096020526000908152604090208054600182015460039092015460ff91821692911683565b6015546001600160a01b031681565b6001600160a01b038082166000908152600960209081526040808320938616835260029093019052205460ff165b92915050565b60075481565b600080546001600160a01b0316331461247a5761185460016015614171565b601580546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fe1ddcb2dab8e5b03cfc8c67a0d5861d91d16f7bd2612fd381faf4541d212c9b2929181900390910190a150919050565b600080546001600160a01b031633146124fe5761185460016012614171565b6001600160a01b03821660009081526009602052604090205460ff161561252b57611854600a6011614171565b816001600160a01b0316633d9ea3a16040518163ffffffff1660e01b815260040160206040518083038186803b15801561256457600080fd5b505afa158015612578573d6000803e3d6000fd5b505050506040513d602081101561258e57600080fd5b5050604080516060810182526001808252600060208381018281528486018381526001600160a01b03891684526009909252949091209251835490151560ff199182161784559351918301919091555160039091018054911515919092161790556125f882614e7f565b604080516001600160a01b038416815290517fcf583bb0c569eb967f806b11601c4cb93c10310485c67add5f8362c2f212321f9181900360200190a1600092915050565b6001600160a01b0381166000908152600860209081526040918290208054835181840281018401909452808452606093928301828280156126a657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612688575b50505050509050919050565b600a54600160b81b900460ff1681565b6115a181600d80548060200260200160405190810160405280929190818152602001828054801561271c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116126fe575b5050505050612367565b6060600d80548060200260200160405190810160405280929190818152602001828054801561277e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612760575b5050505050905090565b6010602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b6002546001600160a01b031681565b60185460009062010000900460ff1615612810576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b600a54600160b01b900460ff1615612864576040805162461bcd60e51b81526020600482015260126024820152711d1c985b9cd9995c881a5cc81c185d5cd95960721b604482015290519081900360640190fd5b6000612871868685614f5d565b90508015612880579050611756565b61288986614989565b61289586866000614c13565b61175086856000614c13565b60175481565b73cf6bb5389c92bdda8a3747ddb454cb7a64626c6390565b60606000825190506060816040519080825280602002602001820160405280156128f3578160200160208202803883390190505b50905060005b8281101561294e57600085828151811061290f57fe5b602002602001015190506129238133615000565b601381111561292e57fe5b83838151811061293a57fe5b6020908102919091010152506001016128f9565b509392505050565b600480546040805163fc57d4df60e01b81526001600160a01b038781169482019490945290516000938493849391169163fc57d4df91602480820192602092909190829003018186803b1580156129ac57600080fd5b505afa1580156129c0573d6000803e3d6000fd5b505050506040513d60208110156129d657600080fd5b5051600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051939450600093929091169163fc57d4df91602480820192602092909190829003018186803b158015612a2f57600080fd5b505afa158015612a43573d6000803e3d6000fd5b505050506040513d6020811015612a5957600080fd5b50519050811580612a68575080155b15612a7d57600d935060009250612bc3915050565b6000866001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b158015612ab857600080fd5b505afa158015612acc573d6000803e3d6000fd5b505050506040513d6020811015612ae257600080fd5b505190506000612af0615b06565b612af8615b06565b612b00615b06565b6000612b0e60065489615121565b945090506000816003811115612b2057fe5b14612b3c57600b5b995060009850612bc3975050505050505050565b612b468787615121565b935090506000816003811115612b5857fe5b14612b6457600b612b28565b612b6e848461515c565b925090506000816003811115612b8057fe5b14612b8c57600b612b28565b612b96828c614e2b565b955090506000816003811115612ba857fe5b14612bb457600b612b28565b60009950939750505050505050505b935093915050565b6ec097ce7bc90715b34b9f100000000081565b60185460009062010000900460ff1615612c2d576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b600a54600160b81b900460ff1615612c7e576040805162461bcd60e51b815260206004820152600f60248201526e1cd95a5e99481a5cc81c185d5cd959608a1b604482015290519081900360640190fd5b6001600160a01b03861660009081526009602052604090205460ff161580612cbf57506001600160a01b03851660009081526009602052604090205460ff16155b15612ccb5760096120dd565b846001600160a01b0316635fe3b5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612d0457600080fd5b505afa158015612d18573d6000803e3d6000fd5b505050506040513d6020811015612d2e57600080fd5b505160408051635fe3b56760e01b815290516001600160a01b0392831692891691635fe3b567916004808301926020929190829003018186803b158015612d7457600080fd5b505afa158015612d88573d6000803e3d6000fd5b505050506040513d6020811015612d9e57600080fd5b50516001600160a01b031614612db55760026120dd565b612dbe86614989565b612dca86846000614c13565b612dd686856000614c13565b60009695505050505050565b6000805b8451811015611c51576000858281518110612dfd57fe5b6020908102919091018101516001600160a01b0381166000908152600990925260409091205490915060ff16612e6e576040805162461bcd60e51b81526020600482015260116024820152701b9bdd081b1a5cdd1959081b585c9ad95d607a1b604482015290519081900360640190fd5b60018515151415612f3a57612e81615b06565b6040518060200160405280836001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ec557600080fd5b505afa158015612ed9573d6000803e3d6000fd5b505050506040513d6020811015612eef57600080fd5b505190529050612eff8282613cf2565b600093505b8751841015612f3857612f2d82898681518110612f1d57fe5b6020026020010151836001613f86565b600190930192612f04565b505b60018415151415612f8657612f4e81614989565b600092505b8651831015612f8657612f7b81888581518110612f6c57fe5b60200260200101516001614c13565b600190920191612f53565b50600101612de6565b600080546001600160a01b03163314612fae576118546001600d614171565b6007805490839055604080518281526020810185905281517f7093cf1eb653f749c3ff531d6df7f92764536a7fa0d13530cd26e070780c32ea929181900390910190a160006118a1565b60185460009062010000900460ff1615613047576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b6001600160a01b0384166000908152600c602052604090205460ff16156130a8576040805162461bcd60e51b815260206004820152601060248201526f189bdc9c9bddc81a5cc81c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602052604090205460ff166130cf576009611d6a565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff1661318c57336001600160a01b03851614613155576040805162461bcd60e51b815260206004820152601560248201527439b2b73232b91036bab9ba103132903b2a37b5b2b760591b604482015290519081900360640190fd5b60006131618585615000565b9050600081601381111561317157fe5b1461318a5780601381111561318257fe5b9150506118a1565b505b600480546040805163fc57d4df60e01b81526001600160a01b03888116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b1580156131dd57600080fd5b505afa1580156131f1573d6000803e3d6000fd5b505050506040513d602081101561320757600080fd5b505161321457600d611d6a565b600080613224858760008761450c565b9193509091506000905082601381111561323a57fe5b146132545781601381111561324b57fe5b925050506118a1565b801561326157600461324b565b613269615b06565b6040518060200160405280886001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156132ad57600080fd5b505afa1580156132c1573d6000803e3d6000fd5b505050506040513d60208110156132d757600080fd5b5051905290506132e78782613cf2565b6132f48787836000613f86565b6000979650505050505050565b6008602052816000526040600020818154811061331a57fe5b6000918252602090912001546001600160a01b03169150829050565b6003546001600160a01b031681565b6011602052600090815260409020546001600160e01b03811690600160e01b900463ffffffff1682565b600080546001600160a01b031633146133955761338e60016006614171565b905061244f565b6001600160a01b0383166000908152600960205260409020805460ff166133ca576133c260096007614171565b91505061244f565b6133d2615b06565b5060408051602081019091528381526133e9615b06565b506040805160208101909152670c7d713b49da0000815261340a81836141df565b156134255761341b60066008614171565b935050505061244f565b84158015906134ae5750600480546040805163fc57d4df60e01b81526001600160a01b038a8116948201949094529051929091169163fc57d4df91602480820192602092909190829003018186803b15801561348057600080fd5b505afa158015613494573d6000803e3d6000fd5b505050506040513d60208110156134aa57600080fd5b5051155b156134bf5761341b600d6009614171565b60018301805490869055604080516001600160a01b03891681526020810183905280820188905290517f70483e6592cd5182d45ac970e05bc62cdcc90e9d8ef2c2dbe686cf383bcd7fc59181900360600190a16000979650505050505050565b600a54600160a81b900460ff1681565b60055481565b60185460009062010000900460ff1615613584576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b6000613591858585614f5d565b905080156135a05790506118a1565b6135a985614989565b6135b585856000614c13565b600095945050505050565b6000808290506000806000836001600160a01b031663c37f68e2336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b15801561362157600080fd5b505afa158015613635573d6000803e3d6000fd5b505050506040513d608081101561364b57600080fd5b5080516020820151604090920151909450909250905082156136b4576040805162461bcd60e51b815260206004820152601960248201527f6765744163636f756e74536e617073686f74206661696c656400000000000000604482015290519081900360640190fd5b80156136d1576136c6600c6002614171565b94505050505061181e565b60006136de873385614f5d565b905080156136ff576136f3600e600383615174565b9550505050505061181e565b6001600160a01b0385166000908152600960209081526040808320338452600281019092529091205460ff1661373e576000965050505050505061181e565b3360009081526002820160209081526040808320805460ff1916905560089091528120805490915b8181101561381f57886001600160a01b031683828154811061378457fe5b6000918252602090912001546001600160a01b03161415613817578260018303815481106137ae57fe5b9060005260206000200160009054906101000a90046001600160a01b03168382815481106137d857fe5b600091825260209091200180546001600160a01b0319166001600160a01b03929092169190911790558254613811846000198301615b19565b5061381f565b600101613766565b81811061382857fe5b604080516001600160a01b038b16815233602082015281517fe699a64c18b07ac5b7301aa273f36a2287239eb9501d81950672794afba29a0d929181900390910190a160009b9a5050505050505050505050565b6000546001600160a01b031681565b60185460009062010000900460ff16156138da576040805162461bcd60e51b81526020600482015260126024820152600080516020615bc6833981519152604482015290519081900360640190fd5b60185460ff161580156138f55750601854610100900460ff16155b613936576040805162461bcd60e51b815260206004820152600d60248201526c159052481a5cc81c185d5cd959609a1b604482015290519081900360640190fd5b6015546001600160a01b031633146139545761338e600e6016614171565b6001600160a01b03831660009081526016602052604081208390559392505050565b6000805b600d54821015613a4357600d828154811061399157fe5b6000918252602090912001546001600160a01b031690506139b0615b06565b6040518060200160405280836001600160a01b031663aa5af0fd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156139f457600080fd5b505afa158015613a08573d6000803e3d6000fd5b505050506040513d6020811015613a1e57600080fd5b505190529050613a2d82614989565b613a378282613cf2565b5060019091019061397a565b613a4b615b06565b6040518060200160405280600081525090506060600d80549050604051908082528060200260200182016040528015613a9e57816020015b613a8b615b06565b815260200190600190039081613a835790505b509050600093505b600d54841015613c2757600d8481548110613abd57fe5b60009182526020808320909101546001600160a01b0316808352600990915260409091206003015490935060ff1615613c1c57613af8615b06565b60408051602080820180845260045463fc57d4df60e01b9091526001600160a01b03888116602485015293519293849391169163fc57d4df916044808601929190818703018186803b158015613b4d57600080fd5b505afa158015613b61573d6000803e3d6000fd5b505050506040513d6020811015613b7757600080fd5b505190529050613b85615b06565b613bf382866001600160a01b03166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b158015613bc257600080fd5b505afa158015613bd6573d6000803e3d6000fd5b505050506040513d6020811015613bec57600080fd5b50516151da565b905080838781518110613c0257fe5b6020026020010181905250613c178482615204565b935050505b600190930192613aa6565b600093505b600d54841015611a7257600d8481548110613c4357fe5b600091825260208220015483516001600160a01b039091169450613c68576000613c90565b613c90600e54613c8b848881518110613c7d57fe5b602002602001015186615229565b61525c565b6001600160a01b0385166000818152600f60209081526040918290208490558151848152915193945091927f2a0ce45ba05a83e75ba21e1a10d6b48a8395028cc6e1ae66f6c313648379d548929181900390910190a250600190930192613c2c565b6001600160a01b0382166000908152601160209081526040808320600f9092528220549091613d1f611a87565b8354909150600090613d3f908390600160e01b900463ffffffff16615284565b9050600081118015613d515750600083115b15613f21576000613dc6876001600160a01b03166347bd37186040518163ffffffff1660e01b815260040160206040518083038186803b158015613d9457600080fd5b505afa158015613da8573d6000803e3d6000fd5b505050506040513d6020811015613dbe57600080fd5b5051876152be565b90506000613dd483866152dc565b9050613dde615b06565b60008311613dfb5760405180602001604052806000815250613e05565b613e05828461531e565b9050613e0f615b06565b604080516020810190915288546001600160e01b03168152613e319083615204565b90506040518060400160405280613e778360000151604051806040016040528060138152602001726e657720696e646578206f766572666c6f777360681b815250615353565b6001600160e01b03168152602001613ebd8860405180604001604052806016815260200175626c6f636b206e756d626572206f766572666c6f777360501b8152506153ed565b63ffffffff9081169091526001600160a01b038c166000908152601160209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b0319909416939093171691909117905550611c5192505050565b8015611c5157613f5f8260405180604001604052806016815260200175626c6f636b206e756d626572206f766572666c6f777360501b8152506153ed565b845463ffffffff91909116600160e01b026001600160e01b03909116178455505050505050565b6001600160a01b0384166000908152601160205260409020613fa6615b06565b50604080516020810190915281546001600160e01b03168152613fc7615b06565b5060408051602080820183526001600160a01b03808a16600090815260138352848120918a168082528284529481208054855286519590915291529190915580511561416857614015615b06565b61401f8383615442565b905060006140ae896001600160a01b03166395dd91938a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561407c57600080fd5b505afa158015614090573d6000803e3d6000fd5b505050506040513d60208110156140a657600080fd5b5051886152be565b905060006140bc8284615467565b6001600160a01b038a16600090815260146020526040812054919250906140e39083615487565b90506141048a828a6140fc5766038d7ea4c680006140ff565b60005b6154bd565b6001600160a01b03808c1660008181526014602090815260409182902094909455895181518781529485015280519193928f16927f837bdc11fca9f17ce44167944475225a205279b17e88c791c3b1f66f354668fb929081900390910190a3505050505b50505050505050565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa08360138111156141a057fe5b8360168111156141ac57fe5b604080519283526020830191909152600082820152519081900360600190a18260138111156118a157fe5b519051111590565b5190511090565b6001600160a01b0381166000908152600960205260409020805460ff161515600114614259576040805162461bcd60e51b815260206004820152601a60248201527f76656e7573206d61726b6574206973206e6f74206c6973746564000000000000604482015290519081900360640190fd5b600381015460ff16156142b3576040805162461bcd60e51b815260206004820152601a60248201527f76656e7573206d61726b657420616c7265616479206164646564000000000000604482015290519081900360640190fd5b60038101805460ff19166001908117909155604080516001600160a01b0385168152602081019290925280517f5f4087bd98874c2fa3ea4474bc7c58b711b23fff45cd2f456e358b4b33ee90259281900390910190a16001600160a01b0382166000908152601060205260409020546001600160e01b031615801561435b57506001600160a01b038216600090815260106020526040902054600160e01b900463ffffffff16155b156144235760405180604001604052806ec097ce7bc90715b34b9f10000000006001600160e01b031681526020016143c8614394611a87565b60405180604001604052806016815260200175626c6f636b206e756d626572206f766572666c6f777360501b8152506153ed565b63ffffffff9081169091526001600160a01b0384166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555b6001600160a01b0382166000908152601160205260409020546001600160e01b031615801561447557506001600160a01b038216600090815260116020526040902054600160e01b900463ffffffff16155b156114325760405180604001604052806ec097ce7bc90715b34b9f10000000006001600160e01b031681526020016144ae614394611a87565b63ffffffff9081169091526001600160a01b0384166000908152601160209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b031990941693909317169190911790555050565b6000806000614519615b3d565b6001600160a01b03881660009081526008602090815260408083208054825181850281018501909352808352849360609392919083018282801561458657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614568575b50939450600093505050505b81518110156148e25760008282815181106145a957fe5b60200260200101519050806001600160a01b031663c37f68e28e6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060806040518083038186803b15801561460957600080fd5b505afa15801561461d573d6000803e3d6000fd5b505050506040513d608081101561463357600080fd5b508051602082015160408084015160609485015160808c0152938a019390935291880191909152945084156146795750600f975060009650869550611c8f945050505050565b60408051602080820183526001600160a01b0380851660008181526009845285902060010154845260c08b01939093528351808301855260808b0151815260e08b015260048054855163fc57d4df60e01b815291820194909452935192169263fc57d4df9260248083019392829003018186803b1580156146f957600080fd5b505afa15801561470d573d6000803e3d6000fd5b505050506040513d602081101561472357600080fd5b505160a087018190526147475750600d975060009650869550611c8f945050505050565b604080516020810190915260a08701518152610100870181905260c087015160e088015161477492615602565b6101208801529350600084600381111561478a57fe5b146147a65750600b975060009650869550611c8f945050505050565b6147be8661012001518760400151886000015161565a565b8752935060008460038111156147d057fe5b146147ec5750600b975060009650869550611c8f945050505050565b6148048661010001518760600151886020015161565a565b60208801529350600084600381111561481957fe5b146148355750600b975060009650869550611c8f945050505050565b8b6001600160a01b0316816001600160a01b031614156148d9576148638661012001518c886020015161565a565b60208801529350600084600381111561487857fe5b146148945750600b975060009650869550611c8f945050505050565b6148a88661010001518b886020015161565a565b6020880152935060008460038111156148bd57fe5b146148d95750600b975060009650869550611c8f945050505050565b50600101614592565b506149168460200151601660008e6001600160a01b03166001600160a01b03168152602001908152602001600020546156a3565b60208601529150600082600381111561492b57fe5b146149455750600b955060009450849350611c8f92505050565b60208401518451111561496b575050506020810151905160009450039150829050611c8f565b5050815160209092015160009550859450919091039150611c8f9050565b6001600160a01b0381166000908152601060209081526040808320600f90925282205490916149b6611a87565b83549091506000906149d6908390600160e01b900463ffffffff16615284565b90506000811180156149e85750600083115b15614baf576000856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015614a2857600080fd5b505afa158015614a3c573d6000803e3d6000fd5b505050506040513d6020811015614a5257600080fd5b505190506000614a6283866152dc565b9050614a6c615b06565b60008311614a895760405180602001604052806000815250614a93565b614a93828461531e565b9050614a9d615b06565b604080516020810190915288546001600160e01b03168152614abf9083615204565b90506040518060400160405280614b058360000151604051806040016040528060138152602001726e657720696e646578206f766572666c6f777360681b815250615353565b6001600160e01b03168152602001614b4b8860405180604001604052806016815260200175626c6f636b206e756d626572206f766572666c6f777360501b8152506153ed565b63ffffffff9081169091526001600160a01b038b166000908152601060209081526040909120835181549490920151909216600160e01b026001600160e01b039182166001600160e01b03199094169390931716919091179055506115a492505050565b80156115a457614bed8260405180604001604052806016815260200175626c6f636b206e756d626572206f766572666c6f777360501b8152506153ed565b845463ffffffff91909116600160e01b026001600160e01b039091161784555050505050565b6001600160a01b0383166000908152601060205260409020614c33615b06565b50604080516020810190915281546001600160e01b03168152614c54615b06565b5060408051602080820183526001600160a01b03808916600090815260128352848120918916808252828452948120805485528651959091529152919091558051158015614ca25750815115155b15614cba576ec097ce7bc90715b34b9f100000000081525b614cc2615b06565b614ccc8383615442565b90506000876001600160a01b03166370a08231886040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015614d2657600080fd5b505afa158015614d3a573d6000803e3d6000fd5b505050506040513d6020811015614d5057600080fd5b505190506000614d608284615467565b6001600160a01b03891660009081526014602052604081205491925090614d879083615487565b9050614da089828a6140fc5766038d7ea4c680006140ff565b6001600160a01b03808b1660008181526014602090815260409182902094909455895181518781529485015280519193928e16927ffa9d964d891991c113b49e3db1932abd6c67263d387119707aafdd6c4010a3a9929081900390910190a350505050505050505050565b6000806000614e1e84600080600061450c565b9250925092509193909250565b6000806000614e38615b06565b614e4286866156c9565b90925090506000826003811115614e5557fe5b14614e665750915060009050614e78565b6000614e7182615731565b9350935050505b9250929050565b60005b600d54811015614f0a57816001600160a01b0316600d8281548110614ea357fe5b6000918252602090912001546001600160a01b03161415614f02576040805162461bcd60e51b81526020600482015260146024820152731b585c9ad95d08185b1c9958591e48185919195960621b604482015290519081900360640190fd5b600101614e82565b50600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831660009081526009602052604081205460ff16614f84576009611d6a565b6001600160a01b038085166000908152600960209081526040808320938716835260029093019052205460ff16614fbc576000611d6a565b600080614fcc858786600061450c565b91935090915060009050826013811115614fe257fe5b14614ff35781601381111561324b57fe5b8015612dd657600461324b565b6001600160a01b0382166000908152600960205260408120805460ff1661502b57600991505061244f565b6001600160a01b038316600090815260028201602052604090205460ff1615156001141561505d57600091505061244f565b6007546001600160a01b0384166000908152600860205260409020541061508857601091505061244f565b6001600160a01b0380841660008181526002840160209081526040808320805460ff19166001908117909155600883528184208054918201815584529282902090920180549489166001600160a01b031990951685179055815193845283019190915280517f3ab23ab0d51cccc0c3085aec51f99228625aa1a922b3a8ca89a26b0f2027a1a59281900390910190a15060009392505050565b600061512b615b06565b615151604051806020016040528086815250604051806020016040528086815250615740565b915091509250929050565b6000615166615b06565b835183516151519190615829565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa08460138111156151a357fe5b8460168111156151af57fe5b604080519283526020830191909152818101859052519081900360600190a183601381111561175657fe5b6151e2615b06565b60405180602001604052806151fb8560000151856152dc565b90529392505050565b61520c615b06565b60405180602001604052806151fb85600001518560000151615487565b615231615b06565b60405180602001604052806151fb6152558660000151670de0b6b3a76400006152dc565b85516158d9565b6000670de0b6b3a76400006152758484600001516152dc565b8161527c57fe5b049392505050565b60006118a18383604051806040016040528060158152602001747375627472616374696f6e20756e646572666c6f7760581b81525061590c565b60006118a16152d584670de0b6b3a76400006152dc565b83516158d9565b60006118a183836040518060400160405280601781526020017f6d756c7469706c69636174696f6e206f766572666c6f77000000000000000000815250615966565b615326615b06565b60405180602001604052806151fb61534d866ec097ce7bc90715b34b9f10000000006152dc565b856158d9565b600081600160e01b84106153e55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156153aa578181015183820152602001615392565b50505050905090810190601f1680156153d75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b600081600160201b84106153e55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156153aa578181015183820152602001615392565b61544a615b06565b60405180602001604052806151fb85600001518560000151615284565b60006ec097ce7bc90715b34b9f10000000006152758484600001516152dc565b60006118a18383604051806040016040528060118152602001706164646974696f6e206f766572666c6f7760781b8152506159e5565b60008183101580156154cf5750600083115b156155fa5760006154de6128a7565b604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561552a57600080fd5b505afa15801561553e573d6000803e3d6000fd5b505050506040513d602081101561555457600080fd5b505190508085116155f757816001600160a01b031663a9059cbb87876040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156155bf57600080fd5b505af11580156155d3573d6000803e3d6000fd5b505050506040513d60208110156155e957600080fd5b50600093506118a192505050565b50505b509092915050565b600061560c615b06565b6000615616615b06565b6156208787615740565b9092509050600082600381111561563357fe5b14615642579092509050612bc3565b61564c8186615740565b935093505050935093915050565b6000806000615667615b06565b61567187876156c9565b9092509050600082600381111561568457fe5b146156955750915060009050612bc3565b61564c6156a182615731565b865b6000808383018481106156bb57600092509050614e78565b506002915060009050614e78565b60006156d3615b06565b6000806156e4866000015186615a3a565b909250905060008260038111156156f757fe5b1461571657506040805160208101909152600081529092509050614e78565b60408051602081019091529081526000969095509350505050565b51670de0b6b3a7640000900490565b600061574a615b06565b60008061575f86600001518660000151615a3a565b9092509050600082600381111561577257fe5b1461579157506040805160208101909152600081529092509050614e78565b6000806157a66706f05b59d3b20000846156a3565b909250905060008260038111156157b957fe5b146157db57506040805160208101909152600081529094509250614e78915050565b6000806157f083670de0b6b3a7640000615a79565b9092509050600082600381111561580357fe5b1461580a57fe5b604080516020810190915290815260009a909950975050505050505050565b6000615833615b06565b60008061584886670de0b6b3a7640000615a3a565b9092509050600082600381111561585b57fe5b1461587a57506040805160208101909152600081529092509050614e78565b6000806158878388615a79565b9092509050600082600381111561589a57fe5b146158bc57506040805160208101909152600081529094509250614e78915050565b604080516020810190915290815260009890975095505050505050565b60006118a183836040518060400160405280600e81526020016d646976696465206279207a65726f60901b815250615aa4565b6000818484111561595e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156153aa578181015183820152602001615392565b505050900390565b6000831580615973575082155b15615980575060006118a1565b8383028385828161598d57fe5b041483906159dc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156153aa578181015183820152602001615392565b50949350505050565b600083830182858210156159dc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156153aa578181015183820152602001615392565b60008083615a4d57506000905080614e78565b83830283858281615a5a57fe5b0414615a6e57506002915060009050614e78565b600092509050614e78565b60008082615a8d5750600190506000614e78565b6000838581615a9857fe5b04915091509250929050565b60008183615af35760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156153aa578181015183820152602001615392565b50828481615afd57fe5b04949350505050565b6040518060200160405280600081525090565b815481835581811115611f8757600083815260209020611f87918101908301615ba7565b604051806101400160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001615b7b615b06565b8152602001615b88615b06565b8152602001615b95615b06565b8152602001615ba2615b06565b905290565b611a8991905b80821115615bc15760008155600101615bad565b509056fe70726f746f636f6c2069732070617573656400000000000000000000000000006f6e6c792065787465726e616c6c79206f776e6564206163636f756e74732063616ea265627a7a7231582094811a5cdf0431b17bfc13edc492b96cb51c6ac605263ece3abc38d3b4a2c70b64736f6c63430005110032

Deployed ByteCode Sourcemap

319:58730:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;319:58730:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;141:41:3;;;:::i;:::-;;;;;;;;;;;;;;;;;;3791:70:4;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3791:70:4;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;43861:162:2;;;:::i;:::-;;3186:43:4;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3186:43:4;-1:-1:-1;;;;;3186:43:4;;:::i;55091:344:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;55091:344:2;-1:-1:-1;;;;;55091:344:2;;:::i;43522:210::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;43522:210:2;-1:-1:-1;;;;;43522:210:2;;:::i;17359:441::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;17359:441:2;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;53288:264::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;53288:264:2;;:::i;16398:648::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;16398:648:2;;;;;;;;;;;;;;;;;;;;;;:::i;2401:28:4:-;;;:::i;:::-;;;;-1:-1:-1;;;;;2401:28:4;;;;;;;;;;;;;;312:27;;;:::i;58826:221:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;58826:221:2;;;;:::i;4134:42:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4134:42:4;-1:-1:-1;;;;;4134:42:4;;:::i;43098:418:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;43098:418:2;;:::i;35600:1029::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;35600:1029:2;;:::i;57781:133::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;57781:133:2;-1:-1:-1;;;;;57781:133:2;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2435:31:4;;;:::i;4358:33::-;;;:::i;3604:70::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3604:70:4;;;;;;;;;;:::i;10741:220:2:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;10741:220:2;;;;;;;;;;;;;;;;;;;;;;:::i;4506:26:4:-;;;:::i;55722:89:2:-;;;:::i;53718:273::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;53718:273:2;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;53718:273:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;53718:273:2;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;53718:273:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;53718:273:2;;-1:-1:-1;53718:273:2;;-1:-1:-1;;;;;53718:273:2:i;56846:106::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;56846:106:2;-1:-1:-1;;;;;56846:106:2;;:::i;57960:294::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;57960:294:2;;:::i;19988:527::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;19988:527:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;989:40:4:-;;;:::i;27076:401:2:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;27076:401:2;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;9826:592;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;9826:592:2;;;;;;;;;;;;;;;;;:::i;39570:1476::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;39570:1476:2;;:::i;13056:314::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;13056:314:2;;;;;;;;;;;;;;;;;;;;;;:::i;2974:26:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2974:26:4;;:::i;34751:556:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;34751:556:2;-1:-1:-1;;;;;34751:556:2;;:::i;58660:90::-;;;:::i;15599:312::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;15599:312:2;;;;;;;;;;;;;;;;;:::i;25723:264::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;25723:264:2;-1:-1:-1;;;;;25723:264:2;;:::i;42500:592::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;42500:592:2;-1:-1:-1;;;;;42500:592:2;;:::i;18244:1280::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;18244:1280:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;3135:51::-;;;:::i;24417:334::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;24417:334:2;;;;;;;;;;;;;;;;;;;;;;:::i;2644:52:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2644:52:4;-1:-1:-1;;;;;2644:52:4;;:::i;22402:458:2:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;22402:458:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;58301:300::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;58301:300:2;;:::i;2588:50:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2588:50:4;-1:-1:-1;;;;;2588:50:4;;:::i;4397:34::-;;;:::i;700:25::-;;;:::i;51620:207:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;51620:207:2;;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;51620:207:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;51620:207:2;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;51620:207:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;51620:207:2;;-1:-1:-1;51620:207:2;;-1:-1:-1;;;;;51620:207:2:i;3081:21:4:-;;;:::i;2511:34::-;;;:::i;3937:44::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3937:44:4;-1:-1:-1;;;;;3937:44:4;;:::i;2090:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2090:41:4;-1:-1:-1;;;;;2090:41:4;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4033:43;;;:::i;4800:161:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4800:161:2;;;;;;;;;;:::i;1154:21:4:-;;;:::i;56247:414:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;56247:414:2;-1:-1:-1;;;;;56247:414:2;;:::i;41365:653::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;41365:653:2;-1:-1:-1;;;;;41365:653:2;;:::i;4407:124::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4407:124:2;-1:-1:-1;;;;;4407:124:2;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;4407:124:2;;;;;;;;;;;;;;;;;2551:31:4;;;:::i;51317:97:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;51317:97:2;-1:-1:-1;;;;;51317:97:2;;:::i;55619:::-;;;:::i;3298:60:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3298:60:4;-1:-1:-1;;;;;3298:60:4;;:::i;:::-;;;;-1:-1:-1;;;;;3298:60:4;;;;;;;;;;;;;;;;;;;;;;403:40;;;:::i;23317:784:2:-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;23317:784:2;;;;;;;;;;;;;;;;;;;;;;:::i;4229:23:4:-;;;:::i;55917:121:2:-;;;:::i;5220:368::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5220:368:2;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;5220:368:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;5220:368:2;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;5220:368:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;5220:368:2;;-1:-1:-1;5220:368:2;;-1:-1:-1;;;;;5220:368:2:i;32546:1949::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;32546:1949:2;;;;;;;;;;;;;;;;;:::i;3246:48::-;;;:::i;:::-;;;;-1:-1:-1;;;;;3246:48:2;;;;;;;;;;;;;;20968:983;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;20968:983:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;52156:940::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;52156:940:2;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;52156:940:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;52156:940:2;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;52156:940:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;52156:940:2;;;;;;;;-1:-1:-1;52156:940:2;;-1:-1:-1;;;;;5:28;;2:2;;;46:1;43;36:12;2:2;52156:940:2;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;52156:940:2;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;-1:-1;;;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;52156:940:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;52156:940:2;;-1:-1:-1;;;;52156:940:2;;;;;-1:-1:-1;52156:940:2;;;;;;:::i;38874:403::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38874:403:2;;:::i;13802:1498::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;13802:1498:2;;;;;;;;;;;;;;;;;:::i;1277:49:4:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1277:49:4;;;;;;;;:::i;508:47::-;;;:::i;3427:60::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3427:60:4;-1:-1:-1;;;;;3427:60:4;;:::i;36994:1606:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;36994:1606:2;;;;;;;;:::i;2472:33:4:-;;;:::i;842:31::-;;;:::i;11403:463:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;11403:463:2;;;;;;;;;;;;;;;;;:::i;7394:1964::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7394:1964:2;-1:-1:-1;;;;;7394:1964:2;;:::i;216:20:4:-;;;:::i;57196:524:2:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;57196:524:2;;;;;;;;:::i;141:41:3:-;178:4;141:41;:::o;3791:70:4:-;;;;;;;;;;;;;;;;;;;;;;;;:::o;43861:162:2:-;43916:10;43930:9;43916:23;43908:70;;;;-1:-1:-1;;;43908:70:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;43988:28;:26;:28::i;:::-;43861:162::o;3186:43:4:-;;;;;;;;;;;;;:::o;55091:344:2:-;55172:5;;-1:-1:-1;;;;;55172:5:2;55158:10;:19;55150:46;;;;;-1:-1:-1;;;55150:46:2;;;;;;;;;;;;-1:-1:-1;;;55150:46:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;55231:15:2;;55207:21;55231:15;;;:7;:15;;;;;55264:14;;;;;;:22;;:14;:22;55256:51;;;;;-1:-1:-1;;;55256:51:2;;;;;;;;;;;;-1:-1:-1;;;55256:51:2;;;;;;;;;;;;;;;55318:14;;;:22;;-1:-1:-1;;55318:22:2;;;55355:34;;;-1:-1:-1;;;;;55355:34:2;;;;55335:5;55355:34;;;;;;;;;;;;;;;;;55400:28;:26;:28::i;:::-;55091:344;;:::o;43522:210::-;43601:10;-1:-1:-1;;;;;43601:16:2;;:18;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;43601:18:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;43601:18:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;43601:18:2;-1:-1:-1;;;;;43587:32:2;:10;:32;43579:70;;;;;-1:-1:-1;;;43579:70:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;43667:10;-1:-1:-1;;;;;43667:32:2;;:34;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;43667:34:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;43667:34:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;43667:34:2;:39;43659:66;;;;;-1:-1:-1;;;43659:66:2;;;;;;;;;;;;-1:-1:-1;;;43659:66:2;;;;;;;;;;;;;;;43522:210;:::o;17359:441::-;;;;;;:::o;53288:264::-;53367:5;;-1:-1:-1;;;;;53367:5:2;53353:10;:19;53345:46;;;;;-1:-1:-1;;;53345:46:2;;;;;;;;;;;;-1:-1:-1;;;53345:46:2;;;;;;;;;;;;;;;53417:9;;;53436:22;;;;53473:33;;;;;;;;;;;;;;;;;;;;;;;;;53517:28;:26;:28::i;16398:648::-;4093:14;;16564:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;16674:15:2;;;;;;:7;:15;;;;;:24;;;16669:92;;-1:-1:-1;16726:23:2;16714:36;;16669:92;16807:22;;:::i;:::-;16832:45;;;;;;;;16854:6;-1:-1:-1;;;;;16847:26:2;;:28;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;16847:28:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;16847:28:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;16847:28:2;16832:45;;16807:70;-1:-1:-1;16887:43:2;16910:6;16807:70;16887:22;:43::i;:::-;16940:61;16964:6;16972:8;16982:11;16995:5;16940:23;:61::i;:::-;17024:14;17012:27;;;4149:1;16398:648;;;;;;:::o;2401:28:4:-;;;-1:-1:-1;;;;;2401:28:4;;:::o;312:27::-;;;-1:-1:-1;;;;;312:27:4;;:::o;58826:221:2:-;58881:4;58919:5;;-1:-1:-1;;;;;58919:5:2;58905:10;:19;58897:46;;;;;-1:-1:-1;;;58897:46:2;;;;;;;;;;;;-1:-1:-1;;;58897:46:2;;;;;;;;;;;;;;;58954:14;:22;;;;;;;;-1:-1:-1;;58954:22:2;;;;;;;;;;58991:27;;;;;;;;;;;;;;;;-1:-1:-1;59035:5:2;58826:221;;;;:::o;4134:42:4:-;;;;;;;;;;;;;:::o;43098:418:2:-;43162:4;43229:5;;-1:-1:-1;;;;;43229:5:2;43215:10;:19;43211:118;;43257:61;43262:18;43282:35;43257:4;:61::i;:::-;43250:68;;;;43211:118;43361:11;;;43382:28;;;;43425:46;;;;;;;;;;;;;;;;;;;;;;;;;43494:14;43489:20;43482:27;43098:418;-1:-1:-1;;;43098:418:2:o;35600:1029::-;35672:4;35739:5;;-1:-1:-1;;;;;35739:5:2;35725:10;:19;35721:123;;35767:66;35772:18;35792:40;35767:4;:66::i;35721:123::-;35854:28;;:::i;:::-;-1:-1:-1;35885:39:2;;;;;;;;;;;;35934:19;;:::i;:::-;-1:-1:-1;35956:39:2;;;;;;;;;3417:7;35956:39;;36009:47;36028:17;35956:39;36009:18;:47::i;:::-;36005:158;;;36079:73;36084:26;36112:39;36079:4;:73::i;:::-;36072:80;;;;;;36005:158;36173:20;;:::i;:::-;-1:-1:-1;36196:39:2;;;;;;;;;3541:6;36196:39;;36249:41;36196:39;36272:17;36249:11;:41::i;:::-;36245:152;;;36313:73;36318:26;36346:39;36313:4;:73::i;:::-;36306:80;;;;;;;36245:152;36437:19;;;36466:44;;;;36525:59;;;;;;;;;;;;;;;;;;;;;;;;;36607:14;36602:20;36595:27;35600:1029;-1:-1:-1;;;;;;35600:1029:2:o;57781:133::-;57871:13;;:36;;;-1:-1:-1;;;57871:36:2;;-1:-1:-1;;;;;57871:36:2;;;;;;;;;57842:4;;;;57871:13;;;:28;;:36;;;;;;;;;;;;:13;:36;;;5:2:-1;;;;30:1;27;20:12;5:2;57871:36:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;57871:36:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;57871:36:2;;;;;;;;;-1:-1:-1;57871:36:2;-1:-1:-1;57781:133:2;;;:::o;2435:31:4:-;;;-1:-1:-1;;;2435:31:4;;;;;:::o;4358:33::-;;;;;;:::o;3604:70::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;10741:220:2:-;;;;;:::o;4506:26:4:-;;;;;;;;;:::o;55722:89:2:-;55792:12;55722:89;;:::o;53718:273::-;53809:5;;-1:-1:-1;;;;;53809:5:2;53795:10;:19;53787:46;;;;;-1:-1:-1;;;53787:46:2;;;;;;;;;;;;-1:-1:-1;;;53787:46:2;;;;;;;;;;;;;;;53849:6;53844:102;53865:7;:14;53861:1;:18;53844:102;;;53900:35;53924:7;53932:1;53924:10;;;;;;;;;;;;;;53900:23;:35::i;:::-;53881:3;;53844:102;;;;53956:28;:26;:28::i;56846:106::-;-1:-1:-1;;;;;56928:17:2;56905:4;56928:17;;;:10;:17;;;;;;;56846:106::o;57960:294::-;4093:14;;58035:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;58139:21;;;;58138:22;58130:52;;;;;-1:-1:-1;;;58130:52:2;;;;;;;;;;;;-1:-1:-1;;;58130:52:2;;;;;;;;;;;;;;;58199:13;;:48;;;-1:-1:-1;;;58199:48:2;;58221:10;58199:48;;;;;;;;;;;;-1:-1:-1;;;;;58199:13:2;;;;:21;;:48;;;;;;;;;;;;;;;:13;;:48;;;5:2:-1;;;;30:1;27;20:12;5:2;58199:48:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;58199:48:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;58199:48:2;;57960:294;-1:-1:-1;;57960:294:2:o;19988:527::-;;;;;;;:::o;989:40:4:-;;;;:::o;27076:401:2:-;27248:4;27254;27260;27277:9;27288:14;27304;27322:98;27362:7;27378:12;27393;27407;27322:39;:98::i;:::-;27276:144;;;;;;27443:3;27438:9;;;;;;;;27430:40;-1:-1:-1;27449:9:2;;-1:-1:-1;27460:9:2;-1:-1:-1;;27076:401:2;;;;;;;;;:::o;9826:592::-;4093:14;;9934:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;10038:26:2;;;;;;:18;:26;;;;;;;;10037:27;10029:54;;;;;-1:-1:-1;;;10029:54:2;;;;;;;;;;;;-1:-1:-1;;;10029:54:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;10154:15:2;;;;;;:7;:15;;;;;:24;;;10149:92;;10206:23;10201:29;10194:36;;;;10149:92;10287:30;10310:6;10287:22;:30::i;:::-;10327:46;10351:6;10359;10367:5;10327:23;:46::i;:::-;10396:14;10384:27;9826:592;-1:-1:-1;;;;9826:592:2:o;39570:1476::-;39660:4;39727:5;;-1:-1:-1;;;;;39727:5:2;39713:10;:19;39709:132;;39755:75;39760:18;39780:49;39755:4;:75::i;39709:132::-;39916:34;;:::i;:::-;-1:-1:-1;39953:48:2;;;;;;;;;;;;40011:34;;:::i;:::-;-1:-1:-1;40048:48:2;;;;;;;;;3816:6;40048:48;;40110:61;40122:23;40048:48;40110:11;:61::i;:::-;40106:190;;;40194:91;40199:35;40236:48;40194:4;:91::i;40106:190::-;40306:34;;:::i;:::-;-1:-1:-1;40343:48:2;;;;;;;;;3964:6;40343:48;;40405:61;40343:48;40442:23;40405:11;:61::i;:::-;40401:190;;;40489:91;40494:35;40531:48;40489:4;:91::i;40401:190::-;40685:28;;;40778:62;;;;40912:89;;;;;;;;;;;;;;;;;;;;;;;;;41024:14;41019:20;;13056:314;13303:17;;;;:38;;-1:-1:-1;13324:17:2;;13303:38;13295:68;;;;;-1:-1:-1;;;13295:68:2;;;;;;;;;;;;-1:-1:-1;;;13295:68:2;;;;;;;;;;;;;;2974:26:4;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2974:26:4;;-1:-1:-1;2974:26:4;:::o;34751:556:2:-;34815:4;34882:5;;-1:-1:-1;;;;;34882:5:2;34868:10;:19;34864:123;;34910:66;34915:18;34935:40;34910:4;:66::i;34864:123::-;35073:6;;;-1:-1:-1;;;;;35139:18:2;;;-1:-1:-1;;;;;;35139:18:2;;;;;;;35226:36;;;35073:6;;;;35226:36;;;;;;;;;;;;;;;;;;;;;;;35285:14;35280:20;;58660:90;58732:11;;58660:90;:::o;15599:312::-;;;;:::o;25723:264::-;25790:4;25796;25802;25819:9;25830:14;25846;25864:65;25904:7;25920:1;25924;25927;25864:39;:65::i;:::-;25818:111;;;;;;25953:3;25948:9;;;;;;;;25940:40;25959:9;;-1:-1:-1;25959:9:2;-1:-1:-1;25723:264:2;-1:-1:-1;;;25723:264:2:o;42500:592::-;42569:4;42603:5;;-1:-1:-1;;;;;42603:5:2;42589:10;:19;42585:125;;42631:68;42636:18;42656:42;42631:4;:68::i;42585:125::-;42798:13;;;-1:-1:-1;;;;;42881:32:2;;;-1:-1:-1;;;;;;42881:32:2;;;;;;;42998:49;;;42798:13;;;42998:49;;;43033:13;;;;42998:49;;;;;;;;;;;;;;;;43070:14;43065:20;;18244:1280;4093:14;;18461:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;18537:23:2;;;;;;:7;:23;;;;;:32;;;18536:33;;:72;;-1:-1:-1;;;;;;18574:25:2;;;;;;:7;:25;;;;;:34;;;18573:35;18536:72;18532:139;;;18636:23;18631:29;18624:36;;;;18532:139;18757:9;18770:14;18788:37;18816:8;18788:27;:37::i;:::-;18756:69;;-1:-1:-1;18756:69:2;;-1:-1:-1;18846:14:2;;-1:-1:-1;18839:3:2;:21;;;;;;;;;18835:68;;18888:3;18883:9;;;;;;;;18876:16;;;;;;18835:68;18916:14;18912:86;;18958:28;18953:34;;18912:86;19096:18;19124:14;-1:-1:-1;;;;;19117:42:2;;19160:8;19117:52;;;;;;;;;;;;;-1:-1:-1;;;;;19117:52:2;-1:-1:-1;;;;;19117:52:2;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19117:52:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;19117:52:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19117:52:2;19234:36;;;19117:52;19234:36;;;;;19249:19;;19234:36;;19117:52;;-1:-1:-1;19180:17:2;;;;19216:70;;19117:52;19216:17;:70::i;:::-;19179:107;;-1:-1:-1;19179:107:2;-1:-1:-1;19311:18:2;19300:7;:29;;;;;;;;;19296:89;;19357:16;19352:22;19345:29;;;;;;;;;19296:89;19412:8;19398:11;:22;19394:86;;;19448:20;19443:26;;19394:86;19502:14;19490:27;;;;;;;4149:1;18244:1280;;;;;;;:::o;3135:51::-;3178:8;3135:51;:::o;24417:334::-;24688:57;;2644:52:4;;;;;;;;;;;;;;;:::o;58301:300:2:-;4093:14;;58378:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;58482:22;;;;;;;58481:23;58473:54;;;;;-1:-1:-1;;;58473:54:2;;;;;;;;;;;;-1:-1:-1;;;58473:54:2;;;;;;;;;;;;;;;58544:13;;:50;;;-1:-1:-1;;;58544:50:2;;58567:10;58544:50;;;;;;;;;;;;-1:-1:-1;;;;;58544:13:2;;;;:22;;:50;;;;;;;;;;;;;;;:13;;:50;;;5:2:-1;;;;30:1;27;20:12;2588:50:4;;;;;;;;;;;;;;;:::o;4397:34::-;;;;;;;;;:::o;700:25::-;;;-1:-1:-1;;;;;700:25:4;;:::o;51620:207:2:-;51725:16;;;51739:1;51725:16;;;;;;;;;51698:24;;51725:16;;;;;;105:10:-1;51725:16:2;88:34:-1;136:17;;-1:-1;51725:16:2;51698:43;;51764:6;51751:7;51759:1;51751:10;;;;;;;;;;;;;:19;-1:-1:-1;;;;;51751:19:2;;;-1:-1:-1;;;;;51751:19:2;;;;;51780:40;51791:7;51800;51809:4;51815;51780:10;:40::i;3081:21:4:-;;;;:::o;2511:34::-;;;-1:-1:-1;;;2511:34:4;;;;;:::o;3937:44::-;;;;;;;;;;;;;:::o;2090:41::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;4033:43::-;;;-1:-1:-1;;;;;4033:43:4;;:::o;4800:161:2:-;-1:-1:-1;;;;;4903:24:2;;;4880:4;4903:24;;;:7;:24;;;;;;;;:51;;;;;:42;;;;:51;;;;;;4800:161;;;;;:::o;1154:21:4:-;;;;:::o;56247:414:2:-;56329:4;56396:5;;-1:-1:-1;;;;;56396:5:2;56382:10;:19;56378:124;;56424:67;56429:18;56449:41;56424:4;:67::i;56378:124::-;56545:13;;;-1:-1:-1;;;;;56568:30:2;;;-1:-1:-1;;;;;;56568:30:2;;;;;;;56613:41;;;56545:13;;;;56613:41;;;;;;;;;;;;;;;;;;;;;;;56247:414;;;;:::o;41365:653::-;41422:4;41456:5;;-1:-1:-1;;;;;41456:5:2;41442:10;:19;41438:121;;41484:64;41489:18;41509:38;41484:4;:64::i;41438:121::-;-1:-1:-1;;;;;41573:24:2;;;;;;:7;:24;;;;;:33;;;41569:139;;;41629:68;41634:27;41663:33;41629:4;:68::i;41569:139::-;41718:6;-1:-1:-1;;;;;41718:15:2;;:17;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;41718:17:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;41718:17:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;41822:69:2;;;;;;;;41840:4;41822:69;;;-1:-1:-1;41718:17:2;41822:69;;;;;;;;;;;;-1:-1:-1;;;;;41795:24:2;;;;:7;:24;;;;;;;:96;;;;;;;-1:-1:-1;;41795:96:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41902:35;41811:6;41902:18;:35::i;:::-;41953:20;;;-1:-1:-1;;;;;41953:20:2;;;;;;;;;;;;;;;41996:14;41984:27;41365:653;-1:-1:-1;;41365:653:2:o;4407:124::-;-1:-1:-1;;;;;4502:22:2;;;;;;:13;:22;;;;;;;;;4495:29;;;;;;;;;;;;;;;;;4468:15;;4495:29;;;4502:22;4495:29;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4495:29:2;;;;;;;;;;;;;;;;;;;;;;;4407:124;;;:::o;2551:31:4:-;;;-1:-1:-1;;;2551:31:4;;;;;:::o;51317:97:2:-;51377:30;51388:6;51396:10;51377:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;51377:30:2;;;;;;;;;;;;;;;;;;;;;:10;:30::i;55619:97::-;55665:15;55699:10;55692:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;55692:17:2;;;;;;;;;;;;;;;;;;;;;;;55619:97;:::o;3298:60:4:-;;;;;;;;;;;;-1:-1:-1;;;;;3298:60:4;;;-1:-1:-1;;;3298:60:4;;;;;:::o;403:40::-;;;-1:-1:-1;;;;;403:40:4;;:::o;23317:784:2:-;4093:14;;23443:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;23547:22;;-1:-1:-1;;;23547:22:2;;;;23546:23;23538:54;;;;;-1:-1:-1;;;23538:54:2;;;;;;;;;;;;-1:-1:-1;;;23538:54:2;;;;;;;;;;;;;;;23723:12;23738:50;23760:6;23768:3;23773:14;23738:21;:50::i;:::-;23723:65;-1:-1:-1;23802:31:2;;23798:76;;23856:7;-1:-1:-1;23849:14:2;;23798:76;23920:30;23943:6;23920:22;:30::i;:::-;23960:43;23984:6;23992:3;23997:5;23960:23;:43::i;:::-;24013;24037:6;24045:3;24050:5;24013:23;:43::i;4229:23:4:-;;;;:::o;55917:121:2:-;55989:42;55917:121;:::o;5220:368::-;5284:13;5309:8;5320:7;:14;5309:25;;5345:21;5380:3;5369:15;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;5369:15:2;-1:-1:-1;5345:39:2;-1:-1:-1;5399:6:2;5394:163;5415:3;5411:1;:7;5394:163;;;5439:13;5462:7;5470:1;5462:10;;;;;;;;;;;;;;5439:34;;5506:39;5526:6;5534:10;5506:19;:39::i;:::-;5501:45;;;;;;;;5488:7;5496:1;5488:10;;;;;;;;;;;;;;;;;:58;-1:-1:-1;5420:3:2;;5394:163;;;-1:-1:-1;5574:7:2;5220:368;-1:-1:-1;;;5220:368:2:o;32546:1949::-;32802:6;;;:49;;;-1:-1:-1;;;32802:49:2;;-1:-1:-1;;;;;32802:49:2;;;;;;;;;;;;32682:4;;;;;;32802:6;;;:25;;:49;;;;;;;;;;;;;;;:6;:49;;;5:2:-1;;;;30:1;27;20:12;5:2;32802:49:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32802:49:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32802:49:2;32892:6;;;:51;;;-1:-1:-1;;;32892:51:2;;-1:-1:-1;;;;;32892:51:2;;;;;;;;;;;;32802:49;;-1:-1:-1;32861:28:2;;32892:6;;;;;:25;;:51;;;;;32802:49;;32892:51;;;;;;;;:6;:51;;;5:2:-1;;;;30:1;27;20:12;5:2;32892:51:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32892:51:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32892:51:2;;-1:-1:-1;32957:26:2;;;:58;;-1:-1:-1;32987:28:2;;32957:58;32953:124;;;33044:17;33031:35;-1:-1:-1;33064:1:2;;-1:-1:-1;33031:35:2;;-1:-1:-1;;33031:35:2;32953:124;33462:25;33497:16;-1:-1:-1;;;;;33490:43:2;;:45;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33490:45:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;33490:45:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;33490:45:2;;-1:-1:-1;33571:16:2;33597:20;;:::i;:::-;33627:22;;:::i;:::-;33659:16;;:::i;:::-;33685:17;33736:59;33743:28;;33773:21;33736:6;:59::i;:::-;33713:82;-1:-1:-1;33713:82:2;-1:-1:-1;33820:18:2;33809:7;:29;;;;;;;;;33805:94;;33867:16;33862:22;33854:34;-1:-1:-1;33886:1:2;;-1:-1:-1;33854:34:2;;-1:-1:-1;;;;;;;;33854:34:2;33805:94;33934:53;33941:23;33966:20;33934:6;:53::i;:::-;33909:78;-1:-1:-1;33909:78:2;-1:-1:-1;34012:18:2;34001:7;:29;;;;;;;;;33997:94;;34059:16;34054:22;;33997:94;34120:30;34127:9;34138:11;34120:6;:30::i;:::-;34101:49;-1:-1:-1;34101:49:2;-1:-1:-1;34175:18:2;34164:7;:29;;;;;;;;;34160:94;;34222:16;34217:22;;34160:94;34289:43;34307:5;34314:17;34289;:43::i;:::-;34264:68;-1:-1:-1;34264:68:2;-1:-1:-1;34357:18:2;34346:7;:29;;;;;;;;;34342:94;;34404:16;34399:22;;34342:94;34459:14;34446:42;-1:-1:-1;34476:11:2;;-1:-1:-1;;;;;;;;32546:1949:2;;;;;;;:::o;3246:48::-;3290:4;3246:48;:::o;20968:983::-;4093:14;;21175:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;21279:19;;-1:-1:-1;;;21279:19:2;;;;21278:20;21270:48;;;;;-1:-1:-1;;;21270:48:2;;;;;;;;;;;;-1:-1:-1;;;21270:48:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;21390:25:2;;;;;;:7;:25;;;;;:34;;;21389:35;;:72;;-1:-1:-1;;;;;;21429:23:2;;;;;;:7;:23;;;;;:32;;;21428:33;21389:72;21385:139;;;21489:23;21484:29;;21385:139;21587:14;-1:-1:-1;;;;;21580:34:2;;:36;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21580:36:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21580:36:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21580:36:2;21538:38;;;-1:-1:-1;;;21538:38:2;;;;-1:-1:-1;;;;;21538:78:2;;;;:36;;;;;:38;;;;;21580:36;;21538:38;;;;;;;:36;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;21538:38:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21538:38:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21538:38:2;-1:-1:-1;;;;;21538:78:2;;21534:148;;21644:26;21639:32;;21534:148;21728:40;21751:16;21728:22;:40::i;:::-;21778:58;21802:16;21820:8;21830:5;21778:23;:58::i;:::-;21846:60;21870:16;21888:10;21900:5;21846:23;:60::i;:::-;21929:14;21917:27;20968:983;-1:-1:-1;;;;;;20968:983:2:o;52156:940::-;52276:6;;52292:798;52313:7;:14;52309:1;:18;52292:798;;;52348:13;52364:7;52372:1;52364:10;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;52396:24:2;;;;;;:7;:24;;;;;;;:33;52364:10;;-1:-1:-1;52396:33:2;;52388:63;;;;;-1:-1:-1;;;52388:63:2;;;;;;;;;;;;-1:-1:-1;;;52388:63:2;;;;;;;;;;;;;;;52482:4;52469:17;;;;52465:354;;;52506:22;;:::i;:::-;52531:37;;;;;;;;52546:6;-1:-1:-1;;;;;52546:18:2;;:20;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;52546:20:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;52546:20:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;52546:20:2;52531:37;;52506:62;-1:-1:-1;52586:52:2;52617:6;52506:62;52586:22;:52::i;:::-;52665:1;52661:5;;52656:149;52672:7;:14;52668:1;:18;52656:149;;;52715:71;52747:6;52756:7;52764:1;52756:10;;;;;;;;;;;;;;52768:11;52781:4;52715:23;:71::i;:::-;52688:3;;;;;52656:149;;;52465:354;;52849:4;52836:17;;;;52832:248;;;52873:39;52904:6;52873:22;:39::i;:::-;52939:1;52935:5;;52930:136;52946:7;:14;52942:1;:18;52930:136;;;52989:58;53021:6;53030:7;53038:1;53030:10;;;;;;;;;;;;;;53042:4;52989:23;:58::i;:::-;52962:3;;;;;52930:136;;;-1:-1:-1;52329:3:2;;52292:798;;38874:403;38934:4;39001:5;;-1:-1:-1;;;;;39001:5:2;38987:10;:19;38983:121;;39029:64;39034:18;39054:38;39029:4;:64::i;38983:121::-;39134:9;;;39153:24;;;;39192:40;;;;;;;;;;;;;;;;;;;;;;;;;39255:14;39250:20;;13802:1498;4093:14;;13916:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;14020:28:2;;;;;;:20;:28;;;;;;;;14019:29;14011:58;;;;;-1:-1:-1;;;14011:58:2;;;;;;;;;;;;-1:-1:-1;;;14011:58:2;;;;;;;;;;;;;;;-1:-1:-1;;;;;14085:15:2;;;;;;:7;:15;;;;;:24;;;14080:92;;14137:23;14132:29;;14080:92;-1:-1:-1;;;;;14187:15:2;;;;;;;:7;:15;;;;;;;;:43;;;;;:33;;;;:43;;;;;;14182:420;;14331:10;-1:-1:-1;;;;;14331:20:2;;;14323:54;;;;;-1:-1:-1;;;14323:54:2;;;;;;;;;;;;-1:-1:-1;;;14323:54:2;;;;;;;;;;;;;;;14445:9;14457:45;14484:6;14493:8;14457:19;:45::i;:::-;14445:57;-1:-1:-1;14527:14:2;14520:3;:21;;;;;;;;;14516:76;;14573:3;14568:9;;;;;;;;14561:16;;;;;14516:76;14182:420;;14616:6;;;:41;;;-1:-1:-1;;;14616:41:2;;-1:-1:-1;;;;;14616:41:2;;;;;;;;;;;;:6;;;;;:25;;:41;;;;;;;;;;;;;;;:6;:41;;;5:2:-1;;;;30:1;27;20:12;5:2;14616:41:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;14616:41:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;14616:41:2;14612:107;;14690:17;14685:23;;14612:107;14730:9;14743:14;14761:82;14801:8;14818:6;14827:1;14830:12;14761:39;:82::i;:::-;14729:114;;-1:-1:-1;14729:114:2;;-1:-1:-1;14864:14:2;;-1:-1:-1;14857:3:2;:21;;;;;;;;;14853:68;;14906:3;14901:9;;;;;;;;14894:16;;;;;;14853:68;14934:13;;14930:85;;14975:28;14970:34;;14930:85;15061:22;;:::i;:::-;15086:45;;;;;;;;15108:6;-1:-1:-1;;;;;15101:26:2;;:28;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;15101:28:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;15101:28:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;15101:28:2;15086:45;;15061:70;-1:-1:-1;15141:43:2;15164:6;15061:70;15141:22;:43::i;:::-;15194:61;15218:6;15226:8;15236:11;15249:5;15194:23;:61::i;:::-;15278:14;15266:27;13802:1498;-1:-1:-1;;;;;;;13802:1498:2:o;1277:49:4:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1277:49:4;;-1:-1:-1;1277:49:4;;-1:-1:-1;1277:49:4:o;508:47::-;;;-1:-1:-1;;;;;508:47:4;;:::o;3427:60::-;;;;;;;;;;;;-1:-1:-1;;;;;3427:60:4;;;-1:-1:-1;;;3427:60:4;;;;;:::o;36994:1606:2:-;37091:4;37158:5;;-1:-1:-1;;;;;37158:5:2;37144:10;:19;37140:128;;37186:71;37191:18;37211:45;37186:4;:71::i;:::-;37179:78;;;;37140:128;-1:-1:-1;;;;;37337:24:2;;37313:21;37337:24;;;:7;:24;;;;;37376:15;;;;37371:128;;37414:74;37419:23;37444:43;37414:4;:74::i;:::-;37407:81;;;;;37371:128;37509:33;;:::i;:::-;-1:-1:-1;37545:44:2;;;;;;;;;;;;37642:20;;:::i;:::-;-1:-1:-1;37665:44:2;;;;;;;;;3671:6;37665:44;;37723:46;37665:44;37746:22;37723:11;:46::i;:::-;37719:167;;;37792:83;37797:31;37830:44;37792:4;:83::i;:::-;37785:90;;;;;;;37719:167;37957:32;;;;;:74;;-1:-1:-1;37993:6:2;;;:33;;;-1:-1:-1;;;37993:33:2;;-1:-1:-1;;;;;37993:33:2;;;;;;;;;;;;:6;;;;;:25;;:33;;;;;;;;;;;;;;;:6;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;37993:33:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;37993:33:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;37993:33:2;:38;37957:74;37953:184;;;38054:72;38059:17;38078:47;38054:4;:72::i;37953:184::-;38269:31;;;;;38310:61;;;;38470:85;;;-1:-1:-1;;;;;38470:85:2;;;;;;;;;;;;;;;;;;;;;;;;;;;38578:14;38566:27;36994:1606;-1:-1:-1;;;;;;;36994:1606:2:o;2472:33:4:-;;;-1:-1:-1;;;2472:33:4;;;;;:::o;842:31::-;;;;:::o;11403:463:2:-;4093:14;;11517:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;11533:12;11548:53;11570:6;11578:8;11588:12;11548:21;:53::i;:::-;11533:68;-1:-1:-1;11615:31:2;;11611:76;;11669:7;-1:-1:-1;11662:14:2;;11611:76;11733:30;11756:6;11733:22;:30::i;:::-;11773:48;11797:6;11805:8;11815:5;11773:23;:48::i;:::-;11844:14;11832:27;11403:463;-1:-1:-1;;;;;11403:463:2:o;7394:1964::-;7455:4;7471:13;7494;7471:37;;7597:9;7608:15;7625;7646:6;-1:-1:-1;;;;;7646:25:2;;7672:10;7646:37;;;;;;;;;;;;;-1:-1:-1;;;;;7646:37:2;-1:-1:-1;;;;;7646:37:2;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7646:37:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7646:37:2;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;7646:37:2;;;;;;;;;;;;;-1:-1:-1;7646:37:2;;-1:-1:-1;7646:37:2;-1:-1:-1;7701:9:2;;7693:47;;;;;-1:-1:-1;;;7693:47:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;7835:15;;7831:125;;7873:72;7878:28;7908:36;7873:4;:72::i;:::-;7866:79;;;;;;;;7831:125;8046:12;8061:60;8083:13;8098:10;8110;8061:21;:60::i;:::-;8046:75;-1:-1:-1;8135:12:2;;8131:121;;8170:71;8181:15;8198:33;8233:7;8170:10;:71::i;:::-;8163:78;;;;;;;;;8131:121;-1:-1:-1;;;;;8292:24:2;;8262:27;8292:24;;;:7;:24;;;;;;;;8438:10;8407:42;;:30;;;:42;;;;;;;;;8402:101;;8477:14;8465:27;;;;;;;;;;8402:101;8604:10;8573:42;;;;:30;;;:42;;;;;;;;8566:49;;-1:-1:-1;;8566:49:2;;;8838:13;:25;;;;;8884:20;;8838:25;;8930:214;8941:3;8937:1;:7;8930:214;;;8989:6;-1:-1:-1;;;;;8969:26:2;:13;8983:1;8969:16;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;8969:16:2;:26;8965:169;;;9034:13;9054:1;9048:3;:7;9034:22;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9034:22:2;9015:13;9029:1;9015:16;;;;;;;;;;;;;;;;;:41;;-1:-1:-1;;;;;;9015:41:2;-1:-1:-1;;;;;9015:41:2;;;;;;;;;;9074:22;;;;-1:-1:-1;;9074:22:2;;;:::i;:::-;;9114:5;;8965:169;8946:3;;8930:214;;;9261:3;9257:1;:7;9250:15;;;;9281:32;;;-1:-1:-1;;;;;9281:32:2;;;;9302:10;9281:32;;;;;;;;;;;;;;;;;9336:14;9324:27;7394:1964;-1:-1:-1;;;;;;;;;;;7394:1964:2:o;216:20:4:-;;;-1:-1:-1;;;;;216:20:4;;:::o;57196:524:2:-;4093:14;;57286:4;;4093:14;;;;;:23;4085:54;;;;;-1:-1:-1;;;4085:54:2;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4085:54:2;;;;;;;;;;;;;;;57390:21;;;;57389:22;:49;;;;-1:-1:-1;57416:22:2;;;;;;;57415:23;57389:49;57381:75;;;;;-1:-1:-1;;;57381:75:2;;;;;;;;;;;;-1:-1:-1;;;57381:75:2;;;;;;;;;;;;;;;57533:13;;-1:-1:-1;;;;;57533:13:2;57511:10;:36;57507:133;;57570:59;57575:15;57592:36;57570:4;:59::i;57507:133::-;-1:-1:-1;;;;;57649:17:2;;;;;;:10;:17;;;;;:26;;;57686:27;57196:524;-1:-1:-1;;;57196:524:2:o;44029:1249::-;44086:6;;44125:282;44141:10;:17;44137:21;;44125:282;;;44188:10;44199:1;44188:13;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;44188:13:2;;-1:-1:-1;44215:22:2;;:::i;:::-;44240:37;;;;;;;;44255:6;-1:-1:-1;;;;;44255:18:2;;:20;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;44255:20:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;44255:20:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;44255:20:2;44240:37;;44215:62;-1:-1:-1;44291:39:2;44322:6;44291:22;:39::i;:::-;44344:52;44375:6;44384:11;44344:22;:52::i;:::-;-1:-1:-1;44160:3:2;;;;;44125:282;;;44417:23;;:::i;:::-;44443:18;;;;;;;;44458:1;44443:18;;;44417:44;;44471:22;44506:10;:17;;;;44496:28;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;44471:53;;44543:1;44539:5;;44534:423;44550:10;:17;44546:21;;44534:423;;;44597:10;44608:1;44597:13;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;44597:13:2;44628:24;;;:7;:24;;;;;;;:32;;;44597:13;;-1:-1:-1;44628:32:2;;44624:323;;;44680:21;;:::i;:::-;44704:50;;;;;;;;;;44719:6;;-1:-1:-1;;;44719:33:2;;;-1:-1:-1;;;;;44719:33:2;;;;;;;;;44704:50;;;;44719:6;;;:25;;:33;;;;;44704:50;44719:33;;;;;;:6;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;44719:33:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;44719:33:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;44719:33:2;44704:50;;44680:74;-1:-1:-1;44772:18:2;;:::i;:::-;44793:39;44798:10;44810:6;-1:-1:-1;;;;;44810:19:2;;:21;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;44810:21:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;44810:21:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;44810:21:2;44793:4;:39::i;:::-;44772:60;;44865:7;44850:9;44860:1;44850:12;;;;;;;;;;;;;:22;;;;44905:27;44910:12;44924:7;44905:4;:27::i;:::-;44890:42;;44624:323;;;44569:3;;;;;44534:423;;;44976:1;44972:5;;44967:305;44983:10;:17;44979:21;;44967:305;;;45030:10;45041:1;45030:13;;;;;;;;;;;;;;;;;45073:21;;-1:-1:-1;;;;;45030:13:2;;;;-1:-1:-1;45073:81:2;;45153:1;45073:81;;;45101:49;45106:9;;45117:32;45122:9;45132:1;45122:12;;;;;;;;;;;;;;45136;45117:4;:32::i;:::-;45101:4;:49::i;:::-;-1:-1:-1;;;;;45168:28:2;;;;;;:11;:28;;;;;;;;;:39;;;45226:35;;;;;;;45057:97;;-1:-1:-1;45168:28:2;;45226:35;;;;;;;;;;;-1:-1:-1;45002:3:2;;;;;44967:305;;46601:1075;-1:-1:-1;;;;;46737:24:2;;46698:36;46737:24;;;:16;:24;;;;;;;;46790:11;:19;;;;;;46737:24;;46838:16;:14;:16::i;:::-;46906:17;;46819:35;;-1:-1:-1;46864:16:2;;46883:42;;46819:35;;-1:-1:-1;;;46906:17:2;;;;46883:4;:42::i;:::-;46864:61;;46953:1;46939:11;:15;:34;;;;;46972:1;46958:11;:15;46939:34;46935:735;;;46989:17;47009:54;47021:6;-1:-1:-1;;;;;47014:27:2;;:29;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;47014:29:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;47014:29:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;47014:29:2;47045:17;47009:4;:54::i;:::-;46989:74;;47077:17;47097:30;47102:11;47115;47097:4;:30::i;:::-;47077:50;;47141:19;;:::i;:::-;47178:1;47163:12;:16;:79;;47221:21;;;;;;;;47239:1;47221:21;;;47163:79;;;47182:36;47191:12;47205;47182:8;:36::i;:::-;47141:101;;47256:19;;:::i;:::-;47283:37;;;;;;;;;47301:17;;-1:-1:-1;;;;;47301:17:2;47283:37;;47278:50;;47322:5;47278:4;:50::i;:::-;47256:72;;47369:173;;;;;;;;47411:46;47419:5;:14;;;47411:46;;;;;;;;;;;;;-1:-1:-1;;;47411:46:2;;;:7;:46::i;:::-;-1:-1:-1;;;;;47369:173:2;;;;;47482:45;47489:11;47482:45;;;;;;;;;;;;;-1:-1:-1;;;47482:45:2;;;:6;:45::i;:::-;47369:173;;;;;;;-1:-1:-1;;;;;47342:24:2;;;;;;:16;:24;;;;;;;;:200;;;;;;;;;;;;-1:-1:-1;;;47342:200:2;-1:-1:-1;;;;;47342:200:2;;;-1:-1:-1;;;;;;47342:200:2;;;;;;;;;;;;;;-1:-1:-1;46935:735:2;;-1:-1:-1;;;46935:735:2;;47563:15;;47559:111;;47614:45;47621:11;47614:45;;;;;;;;;;;;;-1:-1:-1;;;47614:45:2;;;:6;:45::i;:::-;47594:65;;;;;;;-1:-1:-1;;;47594:65:2;-1:-1:-1;;;;;47594:65:2;;;;;;46601:1075;;;;;;:::o;49315:1048::-;-1:-1:-1;;;;;49490:24:2;;49451:36;49490:24;;;:16;:24;;;;;49524:25;;:::i;:::-;-1:-1:-1;49552:37:2;;;;;;;;;49570:17;;-1:-1:-1;;;;;49570:17:2;49552:37;;49599:27;;:::i;:::-;-1:-1:-1;49629:56:2;;;;;;;;;-1:-1:-1;;;;;49647:26:2;;;-1:-1:-1;49647:26:2;;;:18;:26;;;;;:36;;;;;;;;;;;;;;49629:56;;49734:20;;49695:36;;;;;;:59;;;;49769:22;;:26;49765:592;;49811:24;;:::i;:::-;49838:32;49843:11;49856:13;49838:4;:32::i;:::-;49811:59;;49884:19;49906:69;49918:6;-1:-1:-1;;;;;49911:34:2;;49946:8;49911:44;;;;;;;;;;;;;-1:-1:-1;;;;;49911:44:2;-1:-1:-1;;;;;49911:44:2;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;49911:44:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;49911:44:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;49911:44:2;49957:17;49906:4;:69::i;:::-;49884:91;;49989:18;50010:32;50015:14;50031:10;50010:4;:32::i;:::-;-1:-1:-1;;;;;50084:22:2;;50056:20;50084:22;;;:12;:22;;;;;;49989:53;;-1:-1:-1;50056:20:2;50079:43;;49989:53;50079:4;:43::i;:::-;50056:66;;50161:79;50173:8;50183:15;50200:13;:39;;3178:8;50200:39;;;50216:1;50200:39;50161:11;:79::i;:::-;-1:-1:-1;;;;;50136:22:2;;;;;;;:12;:22;;;;;;;;;:104;;;;50325:20;;50259:87;;;;;;;;;;;50136:22;;50259:87;;;;;;;;;;;;;;;49765:592;;;;;49315:1048;;;;;;;:::o;2102:149:7:-;2163:4;2184:33;2197:3;2192:9;;;;;;;;2208:4;2203:10;;;;;;;;2184:33;;;;;;;;;;;;;2215:1;2184:33;;;;;;;;;;;;;2240:3;2235:9;;;;;;;7720:147:8;7846:14;7829:13;;:31;;;7720:147::o;7514:139::-;7632:14;7616:13;;:30;;7514:139::o;53997:920:2:-;-1:-1:-1;;;;;54089:15:2;;54065:21;54089:15;;;:7;:15;;;;;54122;;;;:23;;:15;:23;54114:62;;;;;-1:-1:-1;;;54114:62:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;54194:14;;;;;;:23;54186:62;;;;;-1:-1:-1;;;54186:62:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;54259:14;;;:21;;-1:-1:-1;;54259:21:2;54276:4;54259:21;;;;;;54295:33;;;-1:-1:-1;;;;;54295:33:2;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;54343:24:2;;;;;;:16;:24;;;;;:30;-1:-1:-1;;;;;54343:30:2;:35;:74;;;;-1:-1:-1;;;;;;54382:24:2;;;;;;:16;:24;;;;;:30;-1:-1:-1;;;54382:30:2;;;;:35;54343:74;54339:281;;;54460:149;;;;;;;;3290:4;-1:-1:-1;;;;;54460:149:2;;;;;54544:50;54551:16;:14;:16::i;:::-;54544:50;;;;;;;;;;;;;-1:-1:-1;;;54544:50:2;;;:6;:50::i;:::-;54460:149;;;;;;;-1:-1:-1;;;;;54433:24:2;;;;;;:16;:24;;;;;;;;:176;;;;;;;;;;;;-1:-1:-1;;;54433:176:2;-1:-1:-1;;;;;54433:176:2;;;-1:-1:-1;;;;;;54433:176:2;;;;;;;;;;;;;;54339:281;-1:-1:-1;;;;;54634:24:2;;;;;;:16;:24;;;;;:30;-1:-1:-1;;;;;54634:30:2;:35;:74;;;;-1:-1:-1;;;;;;54673:24:2;;;;;;:16;:24;;;;;:30;-1:-1:-1;;;54673:30:2;;;;:35;54634:74;54630:281;;;54751:149;;;;;;;;3290:4;-1:-1:-1;;;;;54751:149:2;;;;;54835:50;54842:16;:14;:16::i;54835:50::-;54751:149;;;;;;;-1:-1:-1;;;;;54724:24:2;;;;;;:16;:24;;;;;;;;:176;;;;;;;;;;;;-1:-1:-1;;;54724:176:2;-1:-1:-1;;;;;54724:176:2;;;-1:-1:-1;;;;;;54724:176:2;;;;;;;;;;;;;;53997:920;;:::o;28242:3776::-;28423:5;28430:4;28436;28453:37;;:::i;:::-;-1:-1:-1;;;;;28650:22:2;;28537:9;28650:22;;;:13;:22;;;;;;;;28625:47;;;;;;;;;;;;;;;;;28537:9;;28625:22;;:47;28650:22;28625:47;;;28650:22;28625:47;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;28625:47:2;;;;;;;;;;;;;;;;-1:-1:-1;28625:47:2;;-1:-1:-1;28687:6:2;;-1:-1:-1;;;;28682:2726:2;28703:6;:13;28699:1;:17;28682:2726;;;28737:12;28752:6;28759:1;28752:9;;;;;;;;;;;;;;28737:24;;28919:5;-1:-1:-1;;;;;28919:24:2;;28944:7;28919:33;;;;;;;;;;;;;-1:-1:-1;;;;;28919:33:2;-1:-1:-1;;;;;28919:33:2;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;28919:33:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;28919:33:2;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;28919:33:2;;;;;;;;;;;;;;;;;28890:25;;28843:109;28870:18;;;28843:109;;;;28850:18;;;28843:109;;;;28919:33;-1:-1:-1;28970:9:2;;28966:164;;-1:-1:-1;29088:20:2;;-1:-1:-1;29110:1:2;;-1:-1:-1;29110:1:2;;-1:-1:-1;29080:35:2;;-1:-1:-1;;;;;29080:35:2;28966:164;29167:65;;;;;;;;;-1:-1:-1;;;;;29182:23:2;;;-1:-1:-1;29182:23:2;;;:7;:23;;;;;:48;;;29167:65;;29143:21;;;:89;;;;29266:42;;;;;;;-1:-1:-1;;;29281:25:2;29266:42;;29246:17;;;:62;29403:6;;;:32;;-1:-1:-1;;;29403:32:2;;;;;;;;;;;:6;;;:25;;:32;;;;;29167:65;29403:32;;;;;:6;:32;;;5:2:-1;;;;30:1;27;20:12;5:2;29403:32:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;29403:32:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;29403:32:2;29376:24;;;:59;;;29449:100;;-1:-1:-1;29510:17:2;;-1:-1:-1;29529:1:2;;-1:-1:-1;29529:1:2;;-1:-1:-1;29502:32:2;;-1:-1:-1;;;;;29502:32:2;29449:100;29581:41;;;;;;;;;29596:24;;;;29581:41;;29562:16;;;:60;;;29765:21;;;;29788:17;;;;29757:67;;:7;:67::i;:::-;29735:18;;;29728:96;;-1:-1:-1;29850:18:2;29842:4;:26;;;;;;;;;29838:96;;-1:-1:-1;29896:16:2;;-1:-1:-1;29914:1:2;;-1:-1:-1;29914:1:2;;-1:-1:-1;29888:31:2;;-1:-1:-1;;;;;29888:31:2;29838:96;30039:84;30064:4;:18;;;30084:4;:18;;;30104:4;:18;;;30039:24;:84::i;:::-;30010:113;;;-1:-1:-1;30017:18:2;30141:4;:26;;;;;;;;;30137:96;;-1:-1:-1;30195:16:2;;-1:-1:-1;30213:1:2;;-1:-1:-1;30213:1:2;;-1:-1:-1;30187:31:2;;-1:-1:-1;;;;;30187:31:2;30137:96;30350:89;30375:4;:16;;;30393:4;:18;;;30413:4;:25;;;30350:24;:89::i;:::-;30321:25;;;30314:125;;-1:-1:-1;30465:18:2;30457:4;:26;;;;;;;;;30453:96;;-1:-1:-1;30511:16:2;;-1:-1:-1;30529:1:2;;-1:-1:-1;30529:1:2;;-1:-1:-1;30503:31:2;;-1:-1:-1;;;;;30503:31:2;30453:96;30642:12;-1:-1:-1;;;;;30633:21:2;:5;-1:-1:-1;;;;;30633:21:2;;30629:769;;;30815:85;30840:4;:18;;;30860:12;30874:4;:25;;;30815:24;:85::i;:::-;30786:25;;;30779:121;;-1:-1:-1;30930:18:2;30922:4;:26;;;;;;;;;30918:104;;-1:-1:-1;30980:16:2;;-1:-1:-1;30998:1:2;;-1:-1:-1;30998:1:2;;-1:-1:-1;30972:31:2;;-1:-1:-1;;;;;30972:31:2;30918:104;31179:83;31204:4;:16;;;31222:12;31236:4;:25;;;31179:24;:83::i;:::-;31150:25;;;31143:119;;-1:-1:-1;31292:18:2;31284:4;:26;;;;;;;;;31280:104;;-1:-1:-1;31342:16:2;;-1:-1:-1;31360:1:2;;-1:-1:-1;31360:1:2;;-1:-1:-1;31334:31:2;;-1:-1:-1;;;;;31334:31:2;31280:104;-1:-1:-1;28718:3:2;;28682:2726;;;;31488:55;31496:4;:25;;;31523:10;:19;31534:7;-1:-1:-1;;;;;31523:19:2;-1:-1:-1;;;;;31523:19:2;;;;;;;;;;;;;31488:7;:55::i;:::-;31459:25;;;31452:91;;-1:-1:-1;31565:18:2;31557:4;:26;;;;;;;;;31553:88;;-1:-1:-1;31607:16:2;;-1:-1:-1;31625:1:2;;-1:-1:-1;31625:1:2;;-1:-1:-1;31599:31:2;;-1:-1:-1;;;31599:31:2;31553:88;31781:25;;;;31760:18;;:46;31756:256;;;-1:-1:-1;;;31867:25:2;;;;31846:18;;31830:14;;-1:-1:-1;31846:46:2;;-1:-1:-1;31830:14:2;;-1:-1:-1;31822:74:2;;31756:256;-1:-1:-1;;31982:18:2;;31954:25;;;;;31935:14;;-1:-1:-1;31935:14:2;;-1:-1:-1;31954:46:2;;;;;-1:-1:-1;31927:74:2;;-1:-1:-1;31927:74:2;45430:1019;-1:-1:-1;;;;;45536:24:2;;45497:36;45536:24;;;:16;:24;;;;;;;;45589:11;:19;;;;;;45536:24;;45637:16;:14;:16::i;:::-;45705:17;;45618:35;;-1:-1:-1;45663:16:2;;45682:42;;45618:35;;-1:-1:-1;;;45705:17:2;;;;45682:4;:42::i;:::-;45663:61;;45752:1;45738:11;:15;:34;;;;;45771:1;45757:11;:15;45738:34;45734:709;;;45788:17;45815:6;-1:-1:-1;;;;;45808:26:2;;:28;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;45808:28:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;45808:28:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;45808:28:2;;-1:-1:-1;45850:17:2;45870:30;45875:11;45888;45870:4;:30::i;:::-;45850:50;;45914:19;;:::i;:::-;45951:1;45936:12;:16;:79;;45994:21;;;;;;;;46012:1;45994:21;;;45936:79;;;45955:36;45964:12;45978;45955:8;:36::i;:::-;45914:101;;46029:19;;:::i;:::-;46056:37;;;;;;;;;46074:17;;-1:-1:-1;;;;;46074:17:2;46056:37;;46051:50;;46095:5;46051:4;:50::i;:::-;46029:72;;46142:173;;;;;;;;46184:46;46192:5;:14;;;46184:46;;;;;;;;;;;;;-1:-1:-1;;;46184:46:2;;;:7;:46::i;:::-;-1:-1:-1;;;;;46142:173:2;;;;;46255:45;46262:11;46255:45;;;;;;;;;;;;;-1:-1:-1;;;46255:45:2;;;:6;:45::i;:::-;46142:173;;;;;;;-1:-1:-1;;;;;46115:24:2;;;;;;:16;:24;;;;;;;;:200;;;;;;;;;;;;-1:-1:-1;;;46115:200:2;-1:-1:-1;;;;;46115:200:2;;;-1:-1:-1;;;;;;46115:200:2;;;;;;;;;;;;;;-1:-1:-1;45734:709:2;;-1:-1:-1;;;45734:709:2;;46336:15;;46332:111;;46387:45;46394:11;46387:45;;;;;;;;;;;;;-1:-1:-1;;;46387:45:2;;;:6;:45::i;:::-;46367:65;;;;;;;-1:-1:-1;;;46367:65:2;-1:-1:-1;;;;;46367:65:2;;;;;;45430:1019;;;;;:::o;47923:1045::-;-1:-1:-1;;;;;48068:24:2;;48029:36;48068:24;;;:16;:24;;;;;48102:25;;:::i;:::-;-1:-1:-1;48130:37:2;;;;;;;;;48148:17;;-1:-1:-1;;;;;48148:17:2;48130:37;;48177:27;;:::i;:::-;-1:-1:-1;48207:56:2;;;;;;;;;-1:-1:-1;;;;;48225:26:2;;;-1:-1:-1;48225:26:2;;;:18;:26;;;;;:36;;;;;;;;;;;;;;48207:56;;48312:20;;48273:36;;;;;;:59;;;;48347:22;;:27;:55;;;;-1:-1:-1;48378:20:2;;:24;;48347:55;48343:128;;;3290:4;48418:42;;48343:128;48481:24;;:::i;:::-;48508:32;48513:11;48526:13;48508:4;:32::i;:::-;48481:59;;48550:19;48579:6;-1:-1:-1;;;;;48572:24:2;;48597:8;48572:34;;;;;;;;;;;;;-1:-1:-1;;;;;48572:34:2;-1:-1:-1;;;;;48572:34:2;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;48572:34:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;48572:34:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;48572:34:2;;-1:-1:-1;48616:18:2;48637:32;48572:34;48658:10;48637:4;:32::i;:::-;-1:-1:-1;;;;;48707:22:2;;48679:20;48707:22;;;:12;:22;;;;;;48616:53;;-1:-1:-1;48679:20:2;48702:43;;48616:53;48702:4;:43::i;:::-;48679:66;;48780:79;48792:8;48802:15;48819:13;:39;;3178:8;48819:39;;48780:79;-1:-1:-1;;;;;48755:22:2;;;;;;;:12;:22;;;;;;;;;:104;;;;48940:20;;48874:87;;;;;;;;;;;48755:22;;48874:87;;;;;;;;;;;;;;;47923:1045;;;;;;;;;;:::o;26266:185::-;26343:5;26350:4;26356;26379:65;26419:7;26435:1;26439;26442;26379:39;:65::i;:::-;26372:72;;;;;;26266:185;;;;;:::o;2533:306:8:-;2610:9;2621:4;2638:13;2653:18;;:::i;:::-;2675:20;2685:1;2688:6;2675:9;:20::i;:::-;2637:58;;-1:-1:-1;2637:58:8;-1:-1:-1;2716:18:8;2709:3;:25;;;;;;;;;2705:71;;-1:-1:-1;2758:3:8;-1:-1:-1;2763:1:8;;-1:-1:-1;2750:15:8;;2705:71;2794:18;2814:17;2823:7;2814:8;:17::i;:::-;2786:46;;;;;;2533:306;;;;;;:::o;42024:245:2:-;42092:6;42087:135;42108:10;:17;42104:21;;42087:135;;;42179:6;-1:-1:-1;;;;;42155:31:2;:10;42166:1;42155:13;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;42155:13:2;:31;;42147:64;;;;;-1:-1:-1;;;42147:64:2;;;;;;;;;;;;-1:-1:-1;;;42147:64:2;;;;;;;;;;;;;;;42127:4;;42087:135;;;-1:-1:-1;42231:10:2;27::-1;;39:1;23:18;;45:23;;-1:-1;42231:31:2;;;;;;;;-1:-1:-1;;;;;;42231:31:2;-1:-1:-1;;;;;42231:31:2;;;;;;;;;;42024:245::o;11872:851::-;-1:-1:-1;;;;;12000:15:2;;11979:4;12000:15;;;:7;:15;;;;;:24;;;11995:92;;12052:23;12047:29;;11995:92;-1:-1:-1;;;;;12195:15:2;;;;;;;:7;:15;;;;;;;;:43;;;;;:33;;;;:43;;;;;;12190:102;;12266:14;12261:20;;12190:102;12394:9;12407:14;12425:82;12465:8;12482:6;12491:12;12505:1;12425:39;:82::i;:::-;12393:114;;-1:-1:-1;12393:114:2;;-1:-1:-1;12528:14:2;;-1:-1:-1;12521:3:2;:21;;;;;;;;;12517:68;;12570:3;12565:9;;;;;;;12517:68;12598:13;;12594:85;;12639:28;12634:34;;5866:1144;-1:-1:-1;;;;;5993:24:2;;5946:5;5993:24;;;:7;:24;;;;;6033:21;;;;6028:132;;6126:23;6119:30;;;;;6028:132;-1:-1:-1;;;;;6174:40:2;;;;;;:30;;;:40;;;;;;;;:48;;:40;:48;6170:130;;;6275:14;6268:21;;;;;6170:130;6348:9;;-1:-1:-1;;;;;6314:23:2;;;;;;:13;:23;;;;;:30;:43;6310:140;;6418:21;6411:28;;;;;6310:140;-1:-1:-1;;;;;6831:40:2;;;;;;;:30;;;:40;;;;;;;;:47;;-1:-1:-1;;6831:47:2;6874:4;6831:47;;;;;;6888:13;:23;;;;;27:10:-1;;23:18;;;45:23;;6888:36:2;;;;;;;;;;;;;;-1:-1:-1;;;;;;6888:36:2;;;;;;;6940:31;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6989:14:2;;5866:1144;-1:-1:-1;;;5866:1144:2:o;6177:148:8:-;6232:9;6243:10;;:::i;:::-;6272:46;6279:18;;;;;;;;6294:1;6279:18;;;6299;;;;;;;;6314:1;6299:18;;;6272:6;:46::i;:::-;6265:53;;;;6177:148;;;;;:::o;6929:144::-;6996:9;7007:10;;:::i;:::-;7043;;7055;;7036:30;;7043:10;7036:6;:30::i;2369:183:7:-;2454:4;2475:43;2488:3;2483:9;;;;;;;;2499:4;2494:10;;;;;;;;2475:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;2541:3;2536:9;;;;;;;9973:131:8;10032:10;;:::i;:::-;10061:36;;;;;;;;10076:19;10081:1;:10;;;10093:1;10076:4;:19::i;:::-;10061:36;;10054:43;9973:131;-1:-1:-1;;;9973:131:8:o;8592:146::-;8657:10;;:::i;:::-;8686:45;;;;;;;;8701:28;8706:1;:10;;;8718:1;:10;;;8701:4;:28::i;11065:162::-;11130:10;;:::i;:::-;11159:61;;;;;;;;11174:44;11179:26;11184:1;:10;;;444:4;11179;:26::i;:::-;11207:10;;11174:4;:44::i;10110:119::-;10169:4;444;10192:19;10197:1;10200;:10;;;10192:4;:19::i;:::-;:30;;;;;;;10110:119;-1:-1:-1;;;10110:119:8:o;9525:118::-;9578:4;9601:35;9606:1;9609;9601:35;;;;;;;;;;;;;-1:-1:-1;;;9601:35:8;;;:4;:35::i;11370:124::-;11429:4;11452:35;11457:17;11462:1;444:4;11457;:17::i;:::-;11476:10;;11452:4;:35::i;10690:120::-;10743:4;10766:37;10771:1;10774;10766:37;;;;;;;;;;;;;;;;;:4;:37::i;12242:145::-;12299:13;;:::i;:::-;12331:49;;;;;;;;12349:29;12354:20;12359:1;482:4;12354;:20::i;:::-;12376:1;12349:4;:29::i;8260:162::-;8336:7;8375:12;-1:-1:-1;;;8363:10:8;;8355:33;;;;-1:-1:-1;;;8355:33:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;8355:33:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8413:1:8;;8260:162;-1:-1:-1;;8260:162:8:o;8428:158::-;8503:6;8540:12;-1:-1:-1;;;8529:9:8;;8521:32;;;;-1:-1:-1;;;8521:32:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;9361:158:8;9432:13;;:::i;:::-;9464:48;;;;;;;;9482:28;9487:1;:10;;;9499:1;:10;;;9482:4;:28::i;10559:125::-;10621:4;482;10644:19;10649:1;10652;:10;;;10644:4;:19::i;8908:114::-;8961:4;8984:31;8989:1;8992;8984:31;;;;;;;;;;;;;-1:-1:-1;;;8984:31:8;;;:4;:31::i;50740:439:2:-;50827:4;50862:9;50847:11;:24;;:43;;;;;50889:1;50875:11;:15;50847:43;50843:302;;;50906:7;50920:15;:13;:15::i;:::-;50970:28;;;-1:-1:-1;;;50970:28:2;;50992:4;50970:28;;;;;;50906:30;;-1:-1:-1;50950:17:2;;-1:-1:-1;;;;;50970:13:2;;;;;:28;;;;;;;;;;;;;;:13;:28;;;5:2:-1;;;;30:1;27;20:12;5:2;50970:28:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;50970:28:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;50970:28:2;;-1:-1:-1;51016:27:2;;;51012:123;;51063:3;-1:-1:-1;;;;;51063:12:2;;51076:4;51082:11;51063:31;;;;;;;;;;;;;-1:-1:-1;;;;;51063:31:2;-1:-1:-1;;;;;51063:31:2;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51063:31:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;51063:31:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;51119:1:2;;-1:-1:-1;51112:8:2;;-1:-1:-1;;;51112:8:2;51012:123;50843:302;;;-1:-1:-1;51161:11:2;;50740:439;-1:-1:-1;;50740:439:2:o;6419:278:8:-;6501:9;6512:10;;:::i;:::-;6535:13;6550;;:::i;:::-;6567:12;6574:1;6577;6567:6;:12::i;:::-;6534:45;;-1:-1:-1;6534:45:8;-1:-1:-1;6600:18:8;6593:3;:25;;;;;;;;;6589:72;;6642:3;;-1:-1:-1;6647:2:8;-1:-1:-1;6634:16:8;;6589:72;6677:13;6684:2;6688:1;6677:6;:13::i;:::-;6670:20;;;;;;6419:278;;;;;;:::o;2979:321::-;3076:9;3087:4;3104:13;3119:18;;:::i;:::-;3141:20;3151:1;3154:6;3141:9;:20::i;:::-;3103:58;;-1:-1:-1;3103:58:8;-1:-1:-1;3182:18:8;3175:3;:25;;;;;;;;;3171:71;;-1:-1:-1;3224:3:8;-1:-1:-1;3229:1:8;;-1:-1:-1;3216:15:8;;3171:71;3259:34;3267:17;3276:7;3267:8;:17::i;:::-;3286:6;1610:250:1;1666:9;;1702:5;;;1722:6;;;1718:136;;1752:18;;-1:-1:-1;1772:1:1;-1:-1:-1;1744:30:1;;1718:136;-1:-1:-1;1813:26:1;;-1:-1:-1;1841:1:1;;-1:-1:-1;1805:38:1;;2079:346:8;2148:9;2159:10;;:::i;:::-;2182:14;2198:19;2221:27;2229:1;:10;;;2241:6;2221:7;:27::i;:::-;2181:67;;-1:-1:-1;2181:67:8;-1:-1:-1;2270:18:8;2262:4;:26;;;;;;;;;2258:90;;-1:-1:-1;2318:18:8;;;;;;;;;-1:-1:-1;2318:18:8;;2312:4;;-1:-1:-1;2318:18:8;-1:-1:-1;2304:33:8;;2258:90;2386:31;;;;;;;;;;;;-1:-1:-1;;2386:31:8;;-1:-1:-1;2079:346:8;-1:-1:-1;;;;2079:346:8:o;7225:210::-;7405:12;444:4;7405:23;;;7225:210::o;4947:1116::-;5014:9;5025:10;;:::i;:::-;5049:14;5065:24;5093:31;5101:1;:10;;;5113:1;:10;;;5093:7;:31::i;:::-;5048:76;;-1:-1:-1;5048:76:8;-1:-1:-1;5146:18:8;5138:4;:26;;;;;;;;;5134:90;;-1:-1:-1;5194:18:8;;;;;;;;;-1:-1:-1;5194:18:8;;5188:4;;-1:-1:-1;5194:18:8;-1:-1:-1;5180:33:8;;5134:90;5536:14;;5593:42;521:10;5615:19;5593:7;:42::i;:::-;5535:100;;-1:-1:-1;5535:100:8;-1:-1:-1;5657:18:8;5649:4;:26;;;;;;;;;5645:90;;-1:-1:-1;5705:18:8;;;;;;;;;-1:-1:-1;5705:18:8;;5699:4;;-1:-1:-1;5705:18:8;-1:-1:-1;5691:33:8;;-1:-1:-1;;5691:33:8;5645:90;5746:14;5762:12;5778:51;5786:32;444:4;5778:7;:51::i;:::-;5745:84;;-1:-1:-1;5745:84:8;-1:-1:-1;5973:18:8;5965:4;:26;;;;;;;;;5958:34;;;;6031:24;;;;;;;;;;;;-1:-1:-1;;6031:24:8;;-1:-1:-1;4947:1116:8;-1:-1:-1;;;;;;;;4947:1116:8:o;873:503::-;934:9;945:10;;:::i;:::-;968:14;984:20;1008:22;1016:3;444:4;1008:7;:22::i;:::-;967:63;;-1:-1:-1;967:63:8;-1:-1:-1;1052:18:8;1044:4;:26;;;;;;;;;1040:90;;-1:-1:-1;1100:18:8;;;;;;;;;-1:-1:-1;1100:18:8;;1094:4;;-1:-1:-1;1100:18:8;-1:-1:-1;1086:33:8;;1040:90;1141:14;1157:13;1174:31;1182:15;1199:5;1174:7;:31::i;:::-;1140:65;;-1:-1:-1;1140:65:8;-1:-1:-1;1227:18:8;1219:4;:26;;;;;;;;;1215:90;;-1:-1:-1;1275:18:8;;;;;;;;;-1:-1:-1;1275:18:8;;1269:4;;-1:-1:-1;1275:18:8;-1:-1:-1;1261:33:8;;-1:-1:-1;;1261:33:8;1215:90;1343:25;;;;;;;;;;;;-1:-1:-1;;1343:25:8;;-1:-1:-1;873:503:8;-1:-1:-1;;;;;;873:503:8:o;11965:111::-;12018:4;12041:28;12046:1;12049;12041:28;;;;;;;;;;;;;-1:-1:-1;;;12041:28:8;;;:4;:28::i;9649:155::-;9730:4;9762:12;9754:6;;;;9746:29;;;;-1:-1:-1;;;9746:29:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;9746:29:8;-1:-1:-1;;;9792:5:8;;;9649:155::o;10816:243::-;10897:4;10917:6;;;:16;;-1:-1:-1;10927:6:8;;10917:16;10913:55;;;-1:-1:-1;10956:1:8;10949:8;;10913:55;10986:5;;;10990:1;10986;:5;:1;11009:5;;;;;:10;11021:12;11001:33;;;;;-1:-1:-1;;;11001:33:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;11001:33:8;-1:-1:-1;11051:1:8;10816:243;-1:-1:-1;;;;10816:243:8:o;9028:175::-;9109:4;9134:5;;;9165:12;9157:6;;;;9149:29;;;;-1:-1:-1;;;9149:29:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;540:331:1;596:9;;627:6;623:67;;-1:-1:-1;657:18:1;;-1:-1:-1;657:18:1;649:30;;623:67;709:5;;;713:1;709;:5;:1;729:5;;;;;:10;725:140;;-1:-1:-1;763:26:1;;-1:-1:-1;791:1:1;;-1:-1:-1;755:38:1;;725:140;832:18;;-1:-1:-1;852:1:1;-1:-1:-1;824:30:1;;961:209;1017:9;;1048:6;1044:75;;-1:-1:-1;1078:26:1;;-1:-1:-1;1106:1:1;1070:38;;1044:75;1137:18;1161:1;1157;:5;;;;;;1129:34;;;;961:209;;;;;:::o;12082:154:8:-;12163:4;12194:12;12187:5;12179:28;;;;-1:-1:-1;;;12179:28:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;12179:28:8;;12228:1;12224;:5;;;;;;;12082:154;-1:-1:-1;;;;12082:154:8:o;319:58730:2:-;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;

Swarm Source

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