Contract 0xF2F88D8e974D07A2E27943310780B108f01a18b2 1

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x473e510a37ee7f928b181f1f8d3df6c922d75356dfb8ee4f4227645b2f8e7f3177555282021-05-26 21:25:2362 days 16 hrs ago0x6ebd066e2891922f3c1bfd426b2a49d5d0bc11c8 IN  0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB0.00022395
0xd439306dd9379f6899a39c243fbef4bdf7652b1701956105af6e294dff9a050c54191592021-03-05 16:29:13144 days 21 hrs ago0x6ebd066e2891922f3c1bfd426b2a49d5d0bc11c8 IN  0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB0.00022387
0xfed69bafc78ad083bedcac0ac5404d24158a6f55c4b959d44626387b5940a18d54191442021-03-05 16:28:28144 days 21 hrs agoDeFiPie Token: Deployer IN  0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB0.0004479
0xc726b8c86767f1d97c2191a756e1b684de9efe7a539f857fe1783aa02ed7063e54173352021-03-05 14:58:01144 days 22 hrs agoDeFiPie Token: Deployer IN  0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB0.00046881
0x675666ee0d2e9d11c74c557e145021dc0b2be2b091e9570517bf42cfa29a6a4e54160702021-03-05 13:54:46144 days 23 hrs agoDeFiPie Token: Deployer IN  Contract Creation0 BNB0.00365313
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x936f112325e81f6aba014ac03b7f9853d13bafa5ea43346de51d0b03e7aa4cb654554932021-03-06 22:47:24143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xd91a223f7d9407fafc44349f102cd19b64ace9e61440754efbfa1afd79ddcb9754554412021-03-06 22:44:48143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0x6aa5be834469761beb92392f039477308da3c88948088e0ab87ed31bf76045f654554032021-03-06 22:42:54143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xa67d6508bd89c14200d8261760f6df0c62e4ddbcb35aa45e86324e07ed62dabd54553652021-03-06 22:41:00143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91f4e4daa5cfd3628e3710b9aa86919797941ffb5d2ca72051a5c0ee4f854b954550672021-03-06 22:26:06143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xd91f4e4daa5cfd3628e3710b9aa86919797941ffb5d2ca72051a5c0ee4f854b954550672021-03-06 22:26:06143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91f4e4daa5cfd3628e3710b9aa86919797941ffb5d2ca72051a5c0ee4f854b954550672021-03-06 22:26:06143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
0xd91f4e4daa5cfd3628e3710b9aa86919797941ffb5d2ca72051a5c0ee4f854b954550672021-03-06 22:26:06143 days 15 hrs ago 0x854f591d24a046b0d658e5ed5b68d4ac2596eb87 0xf2f88d8e974d07a2e27943310780b108f01a18b20 BNB
0xd91f4e4daa5cfd3628e3710b9aa86919797941ffb5d2ca72051a5c0ee4f854b954550672021-03-06 22:26:06143 days 15 hrs ago 0xf2f88d8e974d07a2e27943310780b108f01a18b2 0x8a6af37a0e145c9ea771c2df689e11f2e221a5600 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RegistryProxy

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 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 2 of 4 : RegistryInterface.sol
pragma solidity ^0.7.4;

interface RegistryInterface {

    /**
     *  Returns admin address for cToken contracts
     *  @return admin address
     */
    function admin() external view returns (address payable);

    /**
     *  Returns address of actual PToken implementation contract
     *  @return Address of contract
     */
    function pTokenImplementation() external view returns (address);

    function addPToken(address underlying, address pToken) external returns(uint);
    function addPETH(address pETH_) external returns(uint);
    function addPPIE(address pPIE_) external returns(uint);
}

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

import './RegistryStorage.sol';
import "./ErrorReporter.sol";
import './RegistryInterface.sol';

contract RegistryProxy is RegistryStorage, RegistryErrorReporter {
    /*** 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 Emitted when implementation is changed
      */
    event NewImplementation(address oldImplementation, address newImplementation);

    constructor(address _implementation, address pTokenImplementation) {
        admin = msg.sender;
        implementation = _implementation;

        delegateTo(implementation, abi.encodeWithSignature("initialize(address)", pTokenImplementation));
    }

    function setImplementation(address newImplementation) external returns(uint) {
        if (msg.sender != admin) {
            return fail(Error.UNAUTHORIZED, FailureInfo.SET_NEW_IMPLEMENTATION);
        }

        address oldImplementation = implementation;
        implementation = newImplementation;

        emit NewImplementation(oldImplementation, implementation);

        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 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
        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);
    }

    /**
     * @notice Internal method to delegate execution to another contract
     * @dev It returns to the external caller whatever the implementation returns or forwards reverts
     * @param callee The contract to delegatecall
     * @param data The raw data to delegatecall
     * @return The returned bytes from the delegatecall
     */
    function delegateTo(address callee, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returnData) = callee.delegatecall(data);
        assembly {
            if eq(success, 0) {
                revert(add(returnData, 0x20), returndatasize())
            }
        }
        return returnData;
    }

    function delegateAndReturn() internal returns (bytes memory) {
        (bool success, ) = implementation.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()) }
        }
    }

    /**
     * @notice Delegates execution to an implementation contract
     * @dev It returns to the external caller whatever the implementation returns or forwards reverts
     */
    fallback() external {
        // delegate all other functions to current implementation
        delegateAndReturn();
    }
}

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

contract RegistryStorage {
    address public implementation;
    address public admin;
    address public pendingAdmin;
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"pTokenImplementation","type":"address"}],"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"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"_acceptAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","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":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"setImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516105eb3803806105eb8339818101604052604081101561003357600080fd5b508051602091820151600180546001600160a01b03199081163317909155600080546001600160a01b038086169190931617908190556040805183851660248083019190915282518083039091018152604490910190915294850180516001600160e01b0390811663189acdbd60e31b17909152939492936100ba9391909216916100c216565b505050610183565b6060600080846001600160a01b0316846040518082805190602001908083835b602083106101015780518252601f1990920191602091820191016100e2565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610161576040519150601f19603f3d011682016040523d82523d6000602084013e610166565b606091505b5091509150600082141561017b573d60208201fd5b949350505050565b610459806101926000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063267822471461006d5780635c60da1b14610091578063b71d1a0c14610099578063d784d426146100d1578063e9c714f2146100f7578063f851a440146100ff575b61006a610107565b50005b61007561018c565b604080516001600160a01b039092168252519081900360200190f35b61007561019b565b6100bf600480360360208110156100af57600080fd5b50356001600160a01b03166101aa565b60408051918252519081900360200190f35b6100bf600480360360208110156100e757600080fd5b50356001600160a01b031661023d565b6100bf6102c2565b6100756103a7565b60008054604051606092916001600160a01b031690829036908083838082843760405192019450600093509091505080830381855af49150503d806000811461016c576040519150601f19603f3d011682016040523d82523d6000602084013e610171565b606091505b505090506040513d6000823e818015610188573d82f35b3d82fd5b6002546001600160a01b031681565b6000546001600160a01b031681565b6001546000906001600160a01b031633146101d2576101cb600160026103b6565b9050610238565b600280546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a160005b9150505b919050565b6001546000906001600160a01b0316331461025d576101cb6001806103b6565b600080546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a16000610234565b6002546000906001600160a01b031633146102ea576102e3600160006103b6565b90506103a4565b60018054600280546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600254604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a16000925050505b90565b6001546001600160a01b031681565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa08360018111156103e557fe5b8360038111156103f157fe5b604080519283526020830191909152600082820152519081900360600190a182600181111561041c57fe5b939250505056fea264697066735822122021041b4bb64f96f4bc37953d9f58e3dad960ff95df7a51de6a54cad2d395e69564736f6c634300070600330000000000000000000000008a6af37a0e145c9ea771c2df689e11f2e221a560000000000000000000000000d7cd60574929925cdfde8df121df6cbb6a3d87b2

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

0000000000000000000000008a6af37a0e145c9ea771c2df689e11f2e221a560000000000000000000000000d7cd60574929925cdfde8df121df6cbb6a3d87b2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008a6af37a0e145c9ea771c2df689e11f2e221a560
Arg [1] : 000000000000000000000000d7cd60574929925cdfde8df121df6cbb6a3d87b2


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.