ETH Price: $1,987.39 (-1.97%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...114658972020-12-16 18:49:171555 days ago1608144557IN
0xF3B000a6...Ea0e71430
0 ETH0.0018004440
Accept Proxy And...114467942020-12-13 20:22:351558 days ago1607890955IN
0xF3B000a6...Ea0e71430
0 ETH0.010084860
Accept Proxy And...114467912020-12-13 20:21:561558 days ago1607890916IN
0xF3B000a6...Ea0e71430
0 ETH0.0073091460
Accept Proxy And...114467872020-12-13 20:21:011558 days ago1607890861IN
0xF3B000a6...Ea0e71430
0 ETH0.0103645260
Accept Proxy And...114467822020-12-13 20:19:571558 days ago1607890797IN
0xF3B000a6...Ea0e71430
0 ETH0.007334760
Accept Proxy And...114467772020-12-13 20:18:351558 days ago1607890715IN
0xF3B000a6...Ea0e71430
0 ETH0.0087290460
Accept Proxy And...114467742020-12-13 20:18:061558 days ago1607890686IN
0xF3B000a6...Ea0e71430
0 ETH0.0045722460
Accept Proxy And...114467682020-12-13 20:16:501558 days ago1607890610IN
0xF3B000a6...Ea0e71430
0 ETH0.0071569260

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GraphProxyAdmin

Compiler Version
v0.7.4+commit.3f05b770

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : GraphProxyAdmin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "../governance/Governed.sol";

import "./IGraphProxy.sol";
import "./GraphUpgradeable.sol";

/** 
 * @title GraphProxyAdmin
 * @dev This is the owner of upgradeable proxy contracts.
 * Proxy contracts use a TransparentProxy pattern, any admin related call
 * like upgrading a contract or changing the admin needs to be send through
 * this contract.
 */
contract GraphProxyAdmin is Governed {

    /** 
     * @dev Contract constructor.
     */
    constructor() {
        Governed._initialize(msg.sender);
    }

    /**
     * @dev Returns the current implementation of a proxy.
     * This is needed because only the proxy admin can query it.
     * @return The address of the current implementation of the proxy.
     */
    function getProxyImplementation(IGraphProxy _proxy) public view returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("implementation()")) == 0x5c60da1b
        (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"5c60da1b");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Returns the pending implementation of a proxy.
     * This is needed because only the proxy admin can query it.
     * @return The address of the pending implementation of the proxy.
     */
    function getProxyPendingImplementation(IGraphProxy _proxy) public view returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("pendingImplementation()")) == 0x396f7b23
        (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"396f7b23");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Returns the admin of a proxy. Only the admin can query it.
     * @return The address of the current admin of the proxy.
     */
    function getProxyAdmin(IGraphProxy _proxy) public view returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("admin()")) == 0xf851a440
        (bool success, bytes memory returndata) = address(_proxy).staticcall(hex"f851a440");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Changes the admin of a proxy.
     * @param _proxy Proxy to change admin.
     * @param _newAdmin Address to transfer proxy administration to.
     */
    function changeProxyAdmin(IGraphProxy _proxy, address _newAdmin) public onlyGovernor {
        _proxy.setAdmin(_newAdmin);
    }

    /**
     * @dev Upgrades a proxy to the newest implementation of a contract.
     * @param _proxy Proxy to be upgraded.
     * @param _implementation the address of the Implementation.
     */
    function upgrade(IGraphProxy _proxy, address _implementation) public onlyGovernor {
        _proxy.upgradeTo(_implementation);
    }

    /**
     * @dev Accepts a proxy.
     * @param _implementation Address of the implementation accepting the proxy.
     * @param _proxy Address of the proxy being accepted.
     */
    function acceptProxy(GraphUpgradeable _implementation, IGraphProxy _proxy) public onlyGovernor {
        _implementation.acceptProxy(_proxy);
    }

    /**
     * @dev Accepts a proxy and call a function on the implementation.
     * @param _implementation Address of the implementation accepting the proxy.
     * @param _proxy Address of the proxy being accepted.
     * @param _data Encoded function to call on the implementation after accepting the proxy.
     */
    function acceptProxyAndCall(
        GraphUpgradeable _implementation,
        IGraphProxy _proxy,
        bytes calldata _data
    ) external onlyGovernor {
        _implementation.acceptProxyAndCall(_proxy, _data);
    }
}

File 2 of 4 : Governed.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @title Graph Governance contract
 * @dev All contracts that will be owned by a Governor entity should extend this contract.
 */
contract Governed {
    // -- State --

    address public governor;
    address public pendingGovernor;

    // -- Events --

    event NewPendingOwnership(address indexed from, address indexed to);
    event NewOwnership(address indexed from, address indexed to);

    /**
     * @dev Check if the caller is the governor.
     */
    modifier onlyGovernor {
        require(msg.sender == governor, "Only Governor can call");
        _;
    }

    /**
     * @dev Initialize the governor to the contract caller.
     */
    function _initialize(address _initGovernor) internal {
        governor = _initGovernor;
    }

    /**
     * @dev Admin function to begin change of governor. The `_newGovernor` must call
     * `acceptOwnership` to finalize the transfer.
     * @param _newGovernor Address of new `governor`
     */
    function transferOwnership(address _newGovernor) external onlyGovernor {
        require(_newGovernor != address(0), "Governor must be set");

        address oldPendingGovernor = pendingGovernor;
        pendingGovernor = _newGovernor;

        emit NewPendingOwnership(oldPendingGovernor, pendingGovernor);
    }

    /**
     * @dev Admin function for pending governor to accept role and update governor.
     * This function must called by the pending governor.
     */
    function acceptOwnership() external {
        require(
            pendingGovernor != address(0) && msg.sender == pendingGovernor,
            "Caller must be pending governor"
        );

        address oldGovernor = governor;
        address oldPendingGovernor = pendingGovernor;

        governor = pendingGovernor;
        pendingGovernor = address(0);

        emit NewOwnership(oldGovernor, governor);
        emit NewPendingOwnership(oldPendingGovernor, pendingGovernor);
    }
}

File 3 of 4 : IGraphProxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

interface IGraphProxy {
    function admin() external returns (address);

    function setAdmin(address _newAdmin) external;

    function implementation() external returns (address);

    function pendingImplementation() external returns (address);

    function upgradeTo(address _newImplementation) external;

    function acceptUpgrade() external;

    function acceptUpgradeAndCall(bytes calldata data) external;
}

File 4 of 4 : GraphUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./IGraphProxy.sol";

/**
 * @title Graph Upgradeable
 * @dev This contract is intended to be inherited from upgradeable contracts.
 */
contract GraphUpgradeable {
    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32
        internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Check if the caller is the proxy admin.
     */
    modifier onlyProxyAdmin(IGraphProxy _proxy) {
        require(msg.sender == _proxy.admin(), "Caller must be the proxy admin");
        _;
    }

    /**
     * @dev Check if the caller is the implementation.
     */
    modifier onlyImpl {
        require(msg.sender == _implementation(), "Caller must be the implementation");
        _;
    }

    /**
     * @dev Returns the current implementation.
     * @return impl Address of the current implementation
     */
    function _implementation() internal view returns (address impl) {
        bytes32 slot = IMPLEMENTATION_SLOT;
        assembly {
            impl := sload(slot)
        }
    }

    /**
     * @dev Accept to be an implementation of proxy.
     */
    function acceptProxy(IGraphProxy _proxy) external onlyProxyAdmin(_proxy) {
        _proxy.acceptUpgrade();
    }

    /**
     * @dev Accept to be an implementation of proxy and then call a function from the new
     * implementation as specified by `_data`, which should be an encoded function call. This is
     * useful to initialize new storage variables in the proxied contract.
     */
    function acceptProxyAndCall(IGraphProxy _proxy, bytes calldata _data)
        external
        onlyProxyAdmin(_proxy)
    {
        _proxy.acceptUpgradeAndCall(_data);
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"NewOwnership","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"NewPendingOwnership","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract GraphUpgradeable","name":"_implementation","type":"address"},{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"}],"name":"acceptProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract GraphUpgradeable","name":"_implementation","type":"address"},{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"acceptProxyAndCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"},{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"changeProxyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"}],"name":"getProxyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"}],"name":"getProxyImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"}],"name":"getProxyPendingImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IGraphProxy","name":"_proxy","type":"address"},{"internalType":"address","name":"_implementation","type":"address"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506100243361002960201b6109141760201c565b61004b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b61096c8061005a6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637eff275e116100715780637eff275e146101b157806399a88ec4146101df578063e3056a341461020d578063eb451a0214610215578063f2fde38b14610243578063f3b7dead14610269576100a9565b806307ebde0e146100ae5780630c340a2414610139578063204e1c7a1461015d5780635bf410eb1461018357806379ba5097146101a9575b600080fd5b610137600480360360608110156100c457600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156100f857600080fd5b82018360208201111561010a57600080fd5b8035906020019184600183028401116401000000008311171561012c57600080fd5b50909250905061028f565b005b610141610388565b604080516001600160a01b039092168252519081900360200190f35b6101416004803603602081101561017357600080fd5b50356001600160a01b0316610397565b6101416004803603602081101561019957600080fd5b50356001600160a01b0316610429565b610137610488565b610137600480360360408110156101c757600080fd5b506001600160a01b0381358116916020013516610597565b610137600480360360408110156101f557600080fd5b506001600160a01b038135811691602001351661065a565b610141610701565b6101376004803603604081101561022b57600080fd5b506001600160a01b0381358116916020013516610710565b6101376004803603602081101561025957600080fd5b50356001600160a01b03166107b7565b6101416004803603602081101561027f57600080fd5b50356001600160a01b03166108b5565b6000546001600160a01b031633146102e7576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b836001600160a01b0316639ce7abe58484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031681565b6000806060836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b50915091508161040a57600080fd5b80806020019051602081101561041f57600080fd5b5051949350505050565b6000806060836001600160a01b0316604051808063396f7b2360e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b6001546001600160a01b0316158015906104ac57506001546001600160a01b031633145b6104fd576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b60008054600180546001600160a01b038082166001600160a01b03198086168217808855931690935560405193811694929391169184917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f9190a36001546040516001600160a01b03918216918316907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146105ef576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663704b6c02826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146106b2576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b6001546001600160a01b031681565b6000546001600160a01b03163314610768576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663a2594d82826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b6000546001600160a01b0316331461080f576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610861576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000806060836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b600080546001600160a01b0319166001600160a01b039290921691909117905556fea2646970667358221220d0a752d67488c5c0799af193673aab9badf0cec9e2eda86dbe5a2706346ec04264736f6c63430007040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637eff275e116100715780637eff275e146101b157806399a88ec4146101df578063e3056a341461020d578063eb451a0214610215578063f2fde38b14610243578063f3b7dead14610269576100a9565b806307ebde0e146100ae5780630c340a2414610139578063204e1c7a1461015d5780635bf410eb1461018357806379ba5097146101a9575b600080fd5b610137600480360360608110156100c457600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156100f857600080fd5b82018360208201111561010a57600080fd5b8035906020019184600183028401116401000000008311171561012c57600080fd5b50909250905061028f565b005b610141610388565b604080516001600160a01b039092168252519081900360200190f35b6101416004803603602081101561017357600080fd5b50356001600160a01b0316610397565b6101416004803603602081101561019957600080fd5b50356001600160a01b0316610429565b610137610488565b610137600480360360408110156101c757600080fd5b506001600160a01b0381358116916020013516610597565b610137600480360360408110156101f557600080fd5b506001600160a01b038135811691602001351661065a565b610141610701565b6101376004803603604081101561022b57600080fd5b506001600160a01b0381358116916020013516610710565b6101376004803603602081101561025957600080fd5b50356001600160a01b03166107b7565b6101416004803603602081101561027f57600080fd5b50356001600160a01b03166108b5565b6000546001600160a01b031633146102e7576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b836001600160a01b0316639ce7abe58484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031681565b6000806060836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b50915091508161040a57600080fd5b80806020019051602081101561041f57600080fd5b5051949350505050565b6000806060836001600160a01b0316604051808063396f7b2360e01b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b6001546001600160a01b0316158015906104ac57506001546001600160a01b031633145b6104fd576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b60008054600180546001600160a01b038082166001600160a01b03198086168217808855931690935560405193811694929391169184917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f9190a36001546040516001600160a01b03918216918316907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146105ef576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663704b6c02826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146106b2576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b6001546001600160a01b031681565b6000546001600160a01b03163314610768576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b816001600160a01b031663a2594d82826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561063e57600080fd5b6000546001600160a01b0316331461080f576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b038116610861576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000806060836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b600080546001600160a01b0319166001600160a01b039290921691909117905556fea2646970667358221220d0a752d67488c5c0799af193673aab9badf0cec9e2eda86dbe5a2706346ec04264736f6c63430007040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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.