Contract 0x8ca3BD13BbF3468D48369DF508b9B614D9aa1802 1

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x2e2ce53a0a66c4e303aa16aa0cd45cc0359960b214cd792250324a93d2b9eff695411072021-07-28 6:25:347 hrs 53 mins ago0xbe99c08a503cd6f7fcc3839d98a5212d8fb27e2a IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001560575
0xc4b7b27ad1b5275f679190d046e84b2b37f37f491ffdd62c8a73944ea91d847695386772021-07-28 4:17:3110 hrs 1 min ago0x0ced2fa3ad2bd914d2738bd5f9f3541b1da0263c IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.000588285
0xb3c93876863e0fa347985d5d6b680dd3ea8373f86392d674a5fecfc745e320bb95386072021-07-28 4:13:1710 hrs 5 mins ago0x0ced2fa3ad2bd914d2738bd5f9f3541b1da0263c IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00060278
0x709c7911b859a208450b3b6af4e71f50fc0759a289fe297f3cb079766b07dbc995296852021-07-27 20:26:3117 hrs 52 mins ago0x6ebd066e2891922f3c1bfd426b2a49d5d0bc11c8 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00024834
0x070f19f1622d28ead557e1fec0152b4375ec75eb9f39b31b849f4af1dd19c54295296452021-07-27 20:24:3117 hrs 54 mins ago0x6ebd066e2891922f3c1bfd426b2a49d5d0bc11c8 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00024834
0x9f9ab4486f0c17e6ef2643b2e30d977fcd5994e6db3eae4f80f4231f95a90d8e95083872021-07-27 1:00:161 day 13 hrs ago0x64be0ba85b7ded99f7efd85c5e90002f46c20373 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.0036586
0x95c5673142c1a38322e26a3bba711faaf5c7bbf36cd4ddfd013a0859a799014a94971352021-07-26 15:24:521 day 22 hrs ago0xedaf9f1b649ac429587f309df2c4734b2ba061e2 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.000583085
0xcf1281b8063a18fed54ec18ad239a9d3116460b77082d00c8ff62ce0622b312194886122021-07-26 8:02:052 days 6 hrs ago0xf145c6eb9371ed58df672f8cacb518742bc709fe IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00065678
0xbbd61fe032a1259bfbd33fbe2d03c741d32914aafa7932204c3e56edb255437094795472021-07-26 0:23:092 days 13 hrs ago0x2b89f4548b42350d76cef1926b865cdec1d5f5b1 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001632075
0x7200cd28bca2c4041b1b7234cb1f09073071d1ef958dcc815b50341b6bf00dcc94711002021-07-25 17:19:262 days 20 hrs ago0xdc3a6d16e5d0b4ef6708fa657cc7830e7ab7430c IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001611075
0x0467e57223cd76ae3918e4bdb15679313e42f28339ca3663b8a92c7f61f50ecc94535372021-07-25 2:28:083 days 11 hrs ago0xbb9e692ef28928d85cd26cf9f306d27d1cbda2aa IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001005695
0x2dffde6bc5993da0e1bd4e8334ba34106bba2f8bd9cd557259c7dc947885972794458772021-07-24 20:04:443 days 18 hrs ago0x6ebd066e2891922f3c1bfd426b2a49d5d0bc11c8 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00024834
0x9c3aca667c5b109950f805e1006276512d982e5daf19ecfc9fffc497a0a3471594384262021-07-24 13:44:594 days 34 mins ago0x792d9ef87260723e70593d93d90c1bc64f79b8eb IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00012267
0xf616b4c92a980d0976cb43706cf8f1d5ac0efebdb7863e12ca41a1c0788dec4094360372021-07-24 11:44:194 days 2 hrs ago0xbb9e692ef28928d85cd26cf9f306d27d1cbda2aa IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001023705
0xbe077b81aeb97ba63dbc8baa039db202697a5b824cdc15f4159c1d48f554212594349482021-07-24 10:49:434 days 3 hrs ago0x467226eba0a2dbc17cd7d9c1f061b3c143a7177c IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00107419
0x8822bea19f2e11c533a341bf960295ffd20e367af9c90c9024c959fd1b03ad5694306462021-07-24 7:12:104 days 7 hrs ago0x8dc14ddd805120b17129636858e9051a51651f08 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00038833
0xc016c2bdf117bf4b12f2158ab91549191596bed17ba855539a24e7fba9c0130894306122021-07-24 7:10:284 days 7 hrs ago0x8dc14ddd805120b17129636858e9051a51651f08 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00070801
0x2db39ea57f2ca017e362d4875023c217212da65be42691fec368a424f160fe1494305592021-07-24 7:07:494 days 7 hrs ago0x8dc14ddd805120b17129636858e9051a51651f08 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.000582085
0xd5d6c06218d4de883801374d20e5f22624efc2656cdfc01b5cb58233de3084cd94303762021-07-24 6:58:354 days 7 hrs ago0x8dc14ddd805120b17129636858e9051a51651f08 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00060531
0x29388f9d8d87503d89ae3408bc8085071b1fc14c03da540ef09da05c4712ed9794149712021-07-23 18:07:104 days 20 hrs ago0x9ae81bd46113c4f4ea01c000554b5077d1042c06 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00012261
0xf6f508577088d36c5c722f338b57e68284e79081b34ce364848ceff90aa6697493831222021-07-22 15:27:095 days 22 hrs ago0xe1e210fea0c031b1a1da42292d0830a35eaf1252 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00065678
0x56b35d17d0bf0f7b3b2b9dd68630cf5f57779d9ba53d9274f80190ba255787ea93830542021-07-22 15:23:455 days 22 hrs ago0x26044c2e775d4945d19f9d13d0893903b29e9551 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00107939
0x57029582902ac180923211758264c7f2eaf396b03e08cff19c6025a4149857df93302702021-07-20 19:23:487 days 18 hrs ago0x3ec18c32dcaa7c353b27e03656ba44e53b53bd19 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.001193565
0x65ae0ab6e835012a33bc79a619cdb936beddab47e0c2e76d89f2deb1c81d912692918702021-07-19 11:21:429 days 2 hrs ago0xf6ddde80dbb7a095e08d5674ccf094c50ccc3b1e IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.00065678
0x2da6d120c329de09366e4acfb2b14007d733e48ee476bb874faf2fd8f4238cc192673272021-07-18 14:53:459 days 23 hrs ago0x64be0ba85b7ded99f7efd85c5e90002f46c20373 IN  0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB0.0032836
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xf8d429a08cb9296b3561b1ac24a9cbbe39a250680 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0x854f591d24a046b0d658e5ed5b68d4ac2596eb870 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xf8d429a08cb9296b3561b1ac24a9cbbe39a250680 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0x854f591d24a046b0d658e5ed5b68d4ac2596eb870 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xf8d429a08cb9296b3561b1ac24a9cbbe39a250680 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0x854f591d24a046b0d658e5ed5b68d4ac2596eb870 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xf8d429a08cb9296b3561b1ac24a9cbbe39a250680 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xf8d429a08cb9296b3561b1ac24a9cbbe39a250680 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0xf8d429a08cb9296b3561b1ac24a9cbbe39a25068 0x8ca3bd13bbf3468d48369df508b9b614d9aa18020 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0x8ca3bd13bbf3468d48369df508b9b614d9aa1802 0xab10ba7a07c030b65c2b340d75056d2226c13f6b0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Unitroller

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : ControllerStorage.sol
pragma solidity ^0.7.4;

import "./PriceOracle.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 controllerImplementation;

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

contract ControllerStorage 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 => address[]) public accountAssets;

    /// @notice isListed Whether or not this market is listed
    /**
     * @notice collateralFactorMantissa 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.
     */
    /// @notice accountMembership Per-market mapping of "accounts in this asset"
    /// @notice isPied Whether or not this market receives PIE
    struct Market {
        bool isListed;
        uint collateralFactorMantissa;
        mapping(address => bool) accountMembership;
        bool isPied;
    }

    /**
     * @notice Official mapping of pTokens -> 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;

    /// @notice index The market's last updated pieBorrowIndex or pieSupplyIndex
    /// @notice block The block number the index was last updated at
    struct PieMarketState {
        uint224 index;
        uint32 block;
    }

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

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

    /// @notice Address of the PIE token
    address public pieAddress;

    // @notice Address of the factory
    address public factory;

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

    /// @notice The PIE market supply state for each market
    mapping(address => PieMarketState) public pieSupplyState;

    /// @notice The PIE market borrow state for each market
    mapping(address => PieMarketState) public pieBorrowState;

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

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

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

File 2 of 4 : ErrorReporter.sol
pragma solidity ^0.7.4;

contract ControllerErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED,
        CONTROLLER_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,
        PRICE_UPDATE_ERROR,
        REJECTION,
        SNAPSHOT_ERROR,
        TOO_MANY_ASSETS,
        TOO_MUCH_REPAY
    }

    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_PAUSE_GUARDIAN_OWNER_CHECK,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_PENDING_IMPLEMENTATION_OWNER_CHECK,
        SET_PRICE_ORACLE_OWNER_CHECK,
        SUPPORT_MARKET_EXISTS,
        SUPPORT_MARKET_OWNER_CHECK
    }

    /**
      * @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,
        CONTROLLER_REJECTION,
        CONTROLLER_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
    }

    /*
     * 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_CONTROLLER_REJECTION,
        LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED,
        LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED,
        LIQUIDATE_COLLATERAL_FRESHNESS_CHECK,
        LIQUIDATE_CONTROLLER_REJECTION,
        LIQUIDATE_CONTROLLER_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_CONTROLLER_REJECTION,
        LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER,
        LIQUIDATE_SEIZE_TOO_MUCH,
        MINT_ACCRUE_INTEREST_FAILED,
        MINT_CONTROLLER_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_CONTROLLER_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_CONTROLLER_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_CONTROLLER_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_CONTROLLER_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,
        SET_NEW_IMPLEMENTATION
    }

    /**
      * @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 OracleErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED,
        UPDATE_PRICE
    }

    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        NO_RESERVES,
        PERIOD_NOT_ELAPSED,
        SET_NEW_ADDRESSES,
        SET_NEW_IMPLEMENTATION,
        SET_PENDING_ADMIN_OWNER_CHECK
    }

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

contract FactoryErrorReporter {
    enum Error {
        NO_ERROR,
        INVALID_POOL,
        MARKET_NOT_LISTED,
        UNAUTHORIZED
    }

    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        CREATE_PETH_POOL,
        CREATE_PPIE_POOL,
        DEFICIENCY_ETH_LIQUIDITY_IN_POOL,
        PAIR_IS_NOT_EXIST,
        SET_MIN_LIQUIDITY_OWNER_CHECK,
        SET_NEW_CONTROLLER,
        SET_NEW_DECIMALS,
        SET_NEW_EXCHANGE_RATE,
        SET_NEW_IMPLEMENTATION,
        SET_NEW_INTEREST_RATE_MODEL,
        SET_NEW_ORACLE,
        SET_NEW_RESERVE_FACTOR,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SUPPORT_MARKET_BAD_RESULT
    }

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

contract RegistryErrorReporter {
    enum Error {
        NO_ERROR,
        UNAUTHORIZED
    }

    enum FailureInfo {
        ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
        SET_NEW_IMPLEMENTATION,
        SET_PENDING_ADMIN_OWNER_CHECK,
        SET_NEW_FACTORY
    }

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

File 3 of 4 : PriceOracle.sol
pragma solidity ^0.7.4;

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

    event PriceUpdated(address asset, uint price);

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

    function updateUnderlyingPrice(address pToken) external virtual returns (uint);
}

File 4 of 4 : Unitroller.sol
pragma solidity ^0.7.4;

import "./ErrorReporter.sol";
import "./ControllerStorage.sol";
/**
 * @title ControllerCore
 * @dev Storage for the controller is at this address, while execution is delegated to the `controllerImplementation`.
 * PTokens should reference this contract as their controller.
 */
contract Unitroller is UnitrollerAdminStorage, ControllerErrorReporter {

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

    /**
      * @notice Emitted when pendingControllerImplementation is accepted, which means controller 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() {
        // 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 = pendingControllerImplementation;

        pendingControllerImplementation = newPendingImplementation;

        emit NewPendingImplementation(oldPendingImplementation, pendingControllerImplementation);

        return uint(Error.NO_ERROR);
    }

    /**
    * @notice Accepts new implementation of controller. 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 != pendingControllerImplementation || pendingControllerImplementation == address(0)) {
            return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK);
        }

        // Save current values for inclusion in log
        address oldImplementation = controllerImplementation;
        address oldPendingImplementation = pendingControllerImplementation;

        controllerImplementation = pendingControllerImplementation;

        pendingControllerImplementation = address(0);

        emit NewImplementation(oldImplementation, controllerImplementation);
        emit NewPendingImplementation(oldPendingImplementation, pendingControllerImplementation);

        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
        if (msg.sender != pendingAdmin) {
            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.
     */
    fallback() payable external {
        // delegate all other functions to current implementation
        (bool success, ) = controllerImplementation.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()) }
        }
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"NewPendingImplementation","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"_acceptAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_acceptImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"_setPendingImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controllerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingControllerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b031916331790556105da806100326000396000f3fe60806040526004361061007b5760003560e01c8063c1e803341161004e578063c1e803341461019e578063e992a041146101b3578063e9c714f2146101e6578063f851a440146101fb5761007b565b806326782247146100fe5780638e6c09591461012f5780639788e73114610144578063b71d1a0c14610159575b6002546040516000916001600160a01b031690829036908083838082843760405192019450600093509091505080830381855af49150503d80600081146100de576040519150601f19603f3d011682016040523d82523d6000602084013e6100e3565b606091505b505090506040513d6000823e8180156100fa573d82f35b3d82fd5b34801561010a57600080fd5b50610113610210565b604080516001600160a01b039092168252519081900360200190f35b34801561013b57600080fd5b5061011361021f565b34801561015057600080fd5b5061011361022e565b34801561016557600080fd5b5061018c6004803603602081101561017c57600080fd5b50356001600160a01b031661023d565b60408051918252519081900360200190f35b3480156101aa57600080fd5b5061018c6102ce565b3480156101bf57600080fd5b5061018c600480360360208110156101d657600080fd5b50356001600160a01b03166103c9565b3480156101f257600080fd5b5061018c61044d565b34801561020757600080fd5b50610113610528565b6001546001600160a01b031681565b6002546001600160a01b031681565b6003546001600160a01b031681565b600080546001600160a01b031633146102635761025c6001600f610537565b90506102c9565b600180546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a160005b9150505b919050565b6003546000906001600160a01b0316331415806102f457506003546001600160a01b0316155b1561030b57610304600180610537565b90506103c6565b60028054600380546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a92908290030190a1600354604080516001600160a01b038085168252909216602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a160005b925050505b90565b600080546001600160a01b031633146103e85761025c60016010610537565b600380546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a160006102c5565b6001546000906001600160a01b0316331461046e5761030460016000610537565b60008054600180546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600154604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a160006103c1565b6000546001600160a01b031681565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa083601281111561056657fe5b83601381111561057257fe5b604080519283526020830191909152600082820152519081900360600190a182601281111561059d57fe5b939250505056fea2646970667358221220de714685213e2afbfb436525a9118a87861f3617354c211d473f50f38d61cde864736f6c63430007060033

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.