Contract 0xD204bE259F703503EF2eA03eB401Ce6E07254d96

Contract Overview

Balance:
0 Ether

Token:
Txn Hash
Method
Block
From
To
Value
0xe2ed65853c25e9f78e7ef33144d1c3ad1ffcd53a6f5b10b736eb10bebb007875Enter Markets93445642021-09-23 19:17:29284 days 4 hrs ago0xbfe67ae03ff0f5681607a024dd83b7e1e7683944 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.00010096 1
0xdb6882f8b8b846f6b62386a489f9a958cb74cec50932828722212f003344cc07Enter Markets89290172021-07-13 10:50:46356 days 12 hrs ago0x8c6f76e87d28bc8689cd76601668b99fbe35d11b IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000083861
0x36eee0866fb51b0a822861768993a25bac6af96c27102b0098eaef9d9914e500Enter Markets87525552021-06-12 19:03:10387 days 4 hrs ago0xb0c04e07a301927672a8a7a874db6930576c90b8 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0xc6481da782061774a4e28c908434c971100b70c26689c05919403fdafa0a92c9Claim Pie87122142021-06-05 18:53:40394 days 4 hrs ago0x0d7a6db093beaa689172bb3b4530ac8f4ac1a1ea IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000332812
0xc2c0d4976de73f8234ed0a97176276133fc42aa173fc543d68064906f4552513Claim Pie87121552021-06-05 18:38:55394 days 5 hrs ago0x0d7a6db093beaa689172bb3b4530ac8f4ac1a1ea IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000332812
0xf969a64debb103b406c24e779422ebc123418d808ee43e1d8898aa507193a4c5Claim Pie87121022021-06-05 18:25:40394 days 5 hrs ago0x0d7a6db093beaa689172bb3b4530ac8f4ac1a1ea IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000332812
0x6ae41106f3778903d3207c770d8830b275822f24148015d5349737ebf507d549Enter Markets87102562021-06-05 10:44:02394 days 13 hrs ago0xd2b65b9800243d9c17d988a8fd096463b4088184 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0xca47d24a39af8c707e1fe224da079bd15426d8e636aad2c47713aadf648224caEnter Markets86878542021-06-01 13:20:52398 days 10 hrs ago0x7a9f895b0bb3c7c30790d494b494005809fe7e09 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0x85a820bc7d133dc8eb7d7a8dd679860221ed9a2dd34bbc0a68649ab65afb3a21Exit Market86878392021-06-01 13:17:07398 days 10 hrs ago0x7a9f895b0bb3c7c30790d494b494005809fe7e09 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.00008441
0x23b4501ed6bef0beee64b644d550a74efb8f2b8e82168564de320c1966d8f006Exit Market86878382021-06-01 13:16:52398 days 10 hrs ago0x7a9f895b0bb3c7c30790d494b494005809fe7e09 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000155461
0x58f3ae722d26ab31d1743e41497a5928191ba8af8f91e639cacb6de5d443dfc4Exit Market86878232021-06-01 13:13:07398 days 10 hrs ago0x89cc271e62e235daa8212e9dff701df598357330 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.00026831
0x2f94bb4c67103fb62a6ecf6822de7fe121c5588a8e31b59a6780262fd119131fEnter Markets86410932021-05-24 10:27:31406 days 13 hrs ago0x7a9f895b0bb3c7c30790d494b494005809fe7e09 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000083861
0xf54b541a68932f4e7e34f2bc02767575fc332937a52c05b5fb3d1badc75250e5_set Pending Adm...86351322021-05-23 9:36:56407 days 14 hrs ago0x32b230795ab78ab51ea7b3f15a23a762aaecd3e0 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000047421
0xa0872e354a7ca9aa59fee0d75c4d102d854ada90e1268f20823e9a1e2d30753f_set Factory Con...86350332021-05-23 9:12:11407 days 14 hrs ago0x32b230795ab78ab51ea7b3f15a23a762aaecd3e0 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000034191
0x463712a6e1e1ec04906251ff45c9292d2f07e934dd3bab6d11621a14c6309e22_set Price Oracl...86350292021-05-23 9:11:11407 days 14 hrs ago0x32b230795ab78ab51ea7b3f15a23a762aaecd3e0 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000035511
0xa9208629ca01b93015a6c5fdaaa18dcd4368bcf680e30a7e7ad857f3946bde2aEnter Markets85830562021-05-14 8:31:35416 days 15 hrs ago0x7a9f895b0bb3c7c30790d494b494005809fe7e09 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0x6dc78316522190712c02628dfa6690414958a46584109a81f27b13b410807f68Enter Markets85426452021-05-07 8:02:56423 days 15 hrs ago0x5d51c0c611084c77097a9fc22e58f2acf4b0688d IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0xfcc6219249b4f09bb3ecc3a6b5d77f0916ed558840a94e53d21eca49e9452028Enter Markets85426362021-05-07 8:00:41423 days 15 hrs ago0xc76082d4924943836448fa70dd21de2b8a62bfe8 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0x732569e0c45cd6bef4d7b4f37a1bb369465efdf8226c993abc76c666fa1f7e77Enter Markets85426232021-05-07 7:57:25423 days 15 hrs ago0x8c6f76e87d28bc8689cd76601668b99fbe35d11b IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000100961
0xa2e95333b63647074bfc72dd81c73f21a753b31655a0560ee276ef4c46531a34Enter Markets84867232021-04-27 14:54:28433 days 8 hrs ago0x59eabe4ee9c3814a6bc4a50224c314438b90633c IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000083861
0xdd84d00fbbc45df8226c3e9da81ff3dbed6c42334dc66a6c35585f77a0ee6fa6Enter Markets84055182021-04-13 12:22:56447 days 11 hrs ago0x2f0e3ad9387fc8f817dd14c8820de773cbf6f637 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000083861
0xa13f51c58c14b39c64be2a871c6bdcb43f71547dd482f8fe506bee5c85acee46Exit Market84055162021-04-13 12:22:26447 days 11 hrs ago0x2f0e3ad9387fc8f817dd14c8820de773cbf6f637 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000241761
0x0adf4b9a633187052f1c6da8ca4ff0f7b0031a1271936f31b7e2288638c8a03bEnter Markets84055012021-04-13 12:18:41447 days 11 hrs ago0x2f0e3ad9387fc8f817dd14c8820de773cbf6f637 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000083861
0x67a37cebb8f23a2b4917c53b37f6987c071d9f0737cdc336b3c81d73f9ee44f0Exit Market84054952021-04-13 12:17:11447 days 11 hrs ago0x2f0e3ad9387fc8f817dd14c8820de773cbf6f637 IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000241761
0x580170015a79f2fd761f4cb8d3c31cb1a0354679fcb1f30fe9aa5c7f4aad92e2Exit Market83621772021-04-05 23:45:01455 days 4 mins ago0x54d4a26df1b02020c34a10fb7d1d9bf188dab12b IN  0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether0.000249761
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xf836f7717635a9777f865371bee2c2d40ebf0a240 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0x82aa580e4dde8e750363962d057fea6ffb138b57 0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x82aa580e4dde8e750363962d057fea6ffb138b570 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x82aa580e4dde8e750363962d057fea6ffb138b570 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x0254c2c1886d62cdb10ff8af1eb9a1e7096eb4d60 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x38d35a0ddc9ff9a526841ca3fd887f0db1f3d3b10 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x50fea718a4d400c8fc83b895edbe68fe5cbd33890 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x82aa580e4dde8e750363962d057fea6ffb138b570 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xc0a14c65582bfbc4695410230f65a97d15b33d890 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x0d9a9afcdb9cb363533132b720a43b86472f43890 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0x155ae77115de61ae5755abd2c12cfd020eb9d37e0 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xb91b6e944f7d0c8fc96f57d4d44bc9aa818b45710 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xf836f7717635a9777f865371bee2c2d40ebf0a240 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0x82aa580e4dde8e750363962d057fea6ffb138b57 0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xf836f7717635a9777f865371bee2c2d40ebf0a240 Ether
0xb6b0fbe60765be14952c25d15696bd34aebe8875a0573d4b2d13eb1b50dcc33695398562021-10-27 18:07:17250 days 5 hrs ago 0x82aa580e4dde8e750363962d057fea6ffb138b57 0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether
0xf9b90a75ae2939f98594c1988b155df3902f7986e2732d5c6fcb824b0e9eb06395398552021-10-27 18:07:02250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xf836f7717635a9777f865371bee2c2d40ebf0a240 Ether
0xf9b90a75ae2939f98594c1988b155df3902f7986e2732d5c6fcb824b0e9eb06395398552021-10-27 18:07:02250 days 5 hrs ago 0xc0a14c65582bfbc4695410230f65a97d15b33d89 0xd204be259f703503ef2ea03eb401ce6e07254d960 Ether
0xf9b90a75ae2939f98594c1988b155df3902f7986e2732d5c6fcb824b0e9eb06395398552021-10-27 18:07:02250 days 5 hrs ago 0xd204be259f703503ef2ea03eb401ce6e07254d96 0xc0a14c65582bfbc4695410230f65a97d15b33d890 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Unitroller

Compiler Version
v0.7.4+commit.3f05b770

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion, None license
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
    }

    //TODO: Add more cases
    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_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
    }

    //TODO: Add more cases
    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 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.
     */
    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()) }
        }
    }

    receive() payable external {
        require(msg.value == 0, "unitroller should not get ether");
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "remappings": [],
  "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"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610691806100326000396000f3fe60806040526004361061007f5760003560e01c8063c1e803341161004e578063c1e8033414610216578063e992a0411461022b578063e9c714f21461025e578063f851a44014610273576100f3565b806326782247146101765780638e6c0959146101a75780639788e731146101bc578063b71d1a0c146101d1576100f3565b366100f35734156100f157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f756e6974726f6c6c65722073686f756c64206e6f742067657420657468657200604482015290519081900360640190fd5b005b6002546040516000916001600160a01b031690829036908083838082843760405192019450600093509091505080830381855af49150503d8060008114610156576040519150601f19603f3d011682016040523d82523d6000602084013e61015b565b606091505b505090506040513d6000823e818015610172573d82f35b3d82fd5b34801561018257600080fd5b5061018b610288565b604080516001600160a01b039092168252519081900360200190f35b3480156101b357600080fd5b5061018b610297565b3480156101c857600080fd5b5061018b6102a6565b3480156101dd57600080fd5b50610204600480360360208110156101f457600080fd5b50356001600160a01b03166102b5565b60408051918252519081900360200190f35b34801561022257600080fd5b50610204610353565b34801561023757600080fd5b506102046004803603602081101561024e57600080fd5b50356001600160a01b031661045b565b34801561026a57600080fd5b506102046104ec565b34801561027f57600080fd5b5061018b6105df565b6001546001600160a01b031681565b6002546001600160a01b031681565b6003546001600160a01b031681565b600080546001600160a01b031633146102db576102d46001600f6105ee565b905061034e565b600180546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a160005b9150505b919050565b6003546000906001600160a01b03163314158061037957506003546001600160a01b0316155b15610390576103896001806105ee565b9050610458565b60028054600380546001600160a01b0380821673ffffffffffffffffffffffffffffffffffffffff1980861682179687905590921690925560408051938316808552949092166020840152815190927fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a92908290030190a1600354604080516001600160a01b038085168252909216602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a160005b925050505b90565b600080546001600160a01b0316331461047a576102d4600160106105ee565b600380546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19831617928390556040805192821680845293909116602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a1600061034a565b6001546000906001600160a01b031633141580610507575033155b1561051857610389600160006105ee565b60008054600180546001600160a01b0380821673ffffffffffffffffffffffffffffffffffffffff1980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600154604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a16000610453565b6000546001600160a01b031681565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa083601281111561061d57fe5b83601381111561062957fe5b604080519283526020830191909152600082820152519081900360600190a182601281111561065457fe5b939250505056fea2646970667358221220386da4339be9eb5cc39b7eda006217ed3bac70f8189ec045ad1da6ed0bb4e7c264736f6c63430007040033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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