Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x47DC8e20C15f6deAA5cBFeAe6cf9946aCC89af59
Balance 0 ETH
Nonce 1
Code Size 393 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

393 bytes
0x6080604052600436106100345760003560e01c80635c60da1b14610050578063d784d42614610086578063f851a440146100a6575b61004e6100496000546001600160a01b031690565b6100c6565b005b34801561005c57600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b34801561009257600080fd5b5061004e6100a1366004610123565b6100ea565b3480156100b257600080fd5b5060015461006a906001600160a01b031681565b3660008037600080366000845af43d6000803e8080156100e5573d6000f35b3d6000fd5b6001546001600160a01b0316331461010157600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561013557600080fd5b81356001600160a01b038116811461014c57600080fd5b939250505056fea2646970667358221220f50cd0a71c732d7b13ec0b7615a943af87d93d818a4521dbd3d6d671f0bf5f2864736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: Yes (200 runs)
Proxy.sol 81 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.7;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
contract Proxy {

    address implementation_;
    address public admin;

    constructor(address impl) {
        implementation_ = impl;
        admin = msg.sender;
    }

    function setImplementation(address newImpl) public {
        require(msg.sender == admin);
        implementation_ = newImpl;
    }
    
    function implementation() public view returns (address impl) {
        impl = implementation_;
    }

    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view returns (address) {
        return implementation_;
    }


    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _delegate(_implementation());
    }

}

Read Contract

admin 0xf851a440 → address
implementation 0x5c60da1b → address

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

setImplementation 0xd784d426
address newImpl

Recent Transactions

No transactions found for this address