Contract 0x993F00C98D1678371a7b261Ed0E0D4b6F42d9aEE 14

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x9c1e89a19d276f413ebec55f19f5ff5859f9ba2fe5c7614760691bc190278dd7Redeem Many1953926372024-03-29 9:34:453 hrs 21 mins ago0x9aec09debdac0dd52a5d7b15b4ae90fb20d2b6a2 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.0000059 0.01
0x8c3d9f2e20392c3dd1451eddff2e84fc423cef518a2276f5497c433456ad7e00Redeem Many1953629622024-03-29 7:31:005 hrs 25 mins ago0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000595 0.01
0x2cb637fdfb94363a8a568f57295b4a17db44afe52e94d2eeac310ca4a79bb19eRedeem Many1951576162024-03-28 17:07:2019 hrs 49 mins ago0x2963e4767f5fa21f637bb11fafa619fead21f4d1 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00023964 0.01
0x48a7c5fc191aacca8565b9143a82b36e42997861dd515695f401f62c46c22cd6Redeem Many1951362682024-03-28 15:38:1621 hrs 18 mins ago0x9aec09debdac0dd52a5d7b15b4ae90fb20d2b6a2 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00003497 0.01
0xe94ee912a87a4de985bf4a716823277be091b04f94bbf76c95fbe1a8af378ec0Redeem Many1951333662024-03-28 15:26:1221 hrs 30 mins ago0xc326fffb2afece3510ebe11c540549a6f6b302d1 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.0000336 0.01
0x531f287080a66e3d7ddef03b2138eb1c96d3864c5bc5d839bd01f9a1a7fd1a2eRedeem Many1950102812024-03-28 6:51:321 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.0000072 0.01
0x238c8ee7afb23ac52099869fb4b75c48fd9d28d1a214091add69b72228759adaRedeem Many1950101522024-03-28 6:51:021 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000831 0.01
0xe5e08aa785b6c2f6f3ba310c8abb2887c295215d0f2124235857731037a8f5bfRedeem Many1950100322024-03-28 6:50:321 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000851 0.01
0x9971f6710effa3a5f941461cfe04c67e8b4796e8d94f95685143e555a7c9f4d3Redeem Many1950099132024-03-28 6:50:021 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000828 0.01
0x5a2f0ca22a1d89393d269daaf3d120537fa7aa31df80bff1969c5f0b2a9b03e4Redeem Many1950097932024-03-28 6:49:321 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000829 0.01
0x8604fffd2259dbdf2b3e242683f5cc4ece48bd6f9b3c54e1641f46ba24d717d2Redeem Many1950096742024-03-28 6:49:021 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000822 0.01
0x2af1ca174f81c4a12d81802de389fe7c4e6772e14a11bf86dff50b94119389cfRedeem Many1950095532024-03-28 6:48:311 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000837 0.01
0x83450e757486feacccbc822060aeb7f2c462621764067ed30de2eaf384c8e9a5Redeem Many1950094352024-03-28 6:48:021 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000822 0.01
0x3922f053b3d248726b623a73e1d3d23ebcd8a370bc1d55b02759ada6798528d1Redeem Many1950093162024-03-28 6:47:321 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000831 0.01
0xb93698bc34294cf48c938fea0a8bcb9273f25988c1ff5fb9a1118e6d67913c6fRedeem Many1950091992024-03-28 6:47:031 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000841 0.01
0xd01b8b1f933fbda208099a5f1144ddeff067281a2172f2f085215e7e589d0a37Redeem Many1950090752024-03-28 6:46:321 day 6 hrs ago0x48032c6a1e521fbae6412f499126257999fe46f8 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000837 0.01
0x13f5c2bdc0b5c9172ac21392a7cc2b718b987652828839acf4c7e5ab5624820fRedeem Many1948145192024-03-27 17:12:221 day 19 hrs ago0xc56961836857210e256d71c91a62e90865075380 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00001995 0.01
0x4eb09edd08bcc5bebf9bb5a66a6332d808b6a8278d26422c77124577c1167428Redeem Many1947429932024-03-27 12:12:372 days 44 mins ago0x7a361db89c9419699def3349b5f6f1cba294267d IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000668 0.01
0xff014c91f5095806b4360cc4f880cd975dd6beba175fbde3a8bacf56c1b4cd98Redeem Many1947386292024-03-27 11:54:132 days 1 hr ago0x4ecb19a2ac49c5decfa5e65b6669c7e7fab5da9d IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000487 0.01
0x19642d948040ce67930aeda7433bb40a405fd5a9c9a91935d03c66d0fa9bee4dRedeem Many1947381672024-03-27 11:52:172 days 1 hr ago0x4ecb19a2ac49c5decfa5e65b6669c7e7fab5da9d IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000489 0.01
0xcdd6bc4abeceefc2cb09be3c934bcbbff4f8ec52865c953081abbef46f2fac69Redeem Many1947373072024-03-27 11:48:422 days 1 hr ago0x4ecb19a2ac49c5decfa5e65b6669c7e7fab5da9d IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000938 0.01
0x805a936c4a68eacfd0f50397164145e4455020d58cd433a69fb21398eb44099eRedeem Many1944993432024-03-26 19:14:492 days 17 hrs ago0xc3874c96bd6f1577df94a56e3462afb414de7d55 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000582 0.01
0x967951e42ad58170deb43ace093b9205db965fd57312b8929c16706ea7aa7703Redeem Many1944980842024-03-26 19:09:352 days 17 hrs ago0xc3874c96bd6f1577df94a56e3462afb414de7d55 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000783 0.01
0x3123568224aec0ba386ea9caeea54898b13944bc7b94ea26ab94a885e2030048Redeem Many1944887122024-03-26 18:30:292 days 18 hrs ago0x898b80b6c99f8099f7244053cc604ccdff55212e IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000539 0.01
0x7bc5b60220a4b517d3710eeab71b7b729078cfdf1d931c3b0b291d06f8b22e25Redeem Many1944848752024-03-26 18:14:292 days 18 hrs ago0x1e1f84c07e0471fc979f6f08228b0bd34cda9e54 IN  0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH0.00000555 0.01
[ Download CSV Export 
Latest 3 internal transactions
Parent Txn Hash Block From To Value
0xa05cf13d119ca79449f64a631bcc4459dcfdf7a6abcc7c16df889ca84c570147549908052023-01-23 19:51:42430 days 17 hrs ago 0x270ea4ea9e8a699f8fe54515e3bb2c418952623b 0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH
0xa05cf13d119ca79449f64a631bcc4459dcfdf7a6abcc7c16df889ca84c570147549908052023-01-23 19:51:42430 days 17 hrs ago 0x270ea4ea9e8a699f8fe54515e3bb2c418952623b 0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee0 ETH
0x09b08808c12163934278474311fa37d84714bc91521f3f2faced358b4df72089424502772022-11-30 13:43:18484 days 23 hrs ago 0x993f00c98d1678371a7b261ed0e0d4b6f42d9aee The Graph: GRT Token0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AllocationExchange

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : AllocationExchange.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/Address.sol";

import "../governance/Governed.sol";
import "../staking/IStaking.sol";
import "../token/IGraphToken.sol";

/**
 * @title Allocation Exchange
 * @dev This contract holds tokens that anyone with a voucher signed by the
 * authority can redeem. The contract validates if the voucher presented is valid
 * and then sends tokens to the Staking contract by calling the collect() function
 * passing the voucher allocationID. The contract enforces that only one voucher for
 * an allocationID can be redeemed.
 * Only governance can change the authority.
 */
contract AllocationExchange is Governed {
    // An allocation voucher represents a signed message that allows
    // redeeming an amount of funds from this contract and collect
    // them as part of an allocation
    struct AllocationVoucher {
        address allocationID;
        uint256 amount;
        bytes signature; // 65 bytes
    }

    // -- Constants --

    uint256 private constant MAX_UINT256 = 2**256 - 1;
    uint256 private constant SIGNATURE_LENGTH = 65;

    // -- State --

    IStaking private immutable staking;
    IGraphToken private immutable graphToken;
    mapping(address => bool) public authority;
    mapping(address => bool) public allocationsRedeemed;

    // -- Events

    event AuthoritySet(address indexed account, bool authorized);
    event AllocationRedeemed(address indexed allocationID, uint256 amount);
    event TokensWithdrawn(address indexed to, uint256 amount);

    // -- Functions

    /**
     * @notice Contract constructor.
     * @param _graphToken Address of the GRT token
     * @param _staking Address of the protocol Staking contract
     * @param _governor Account capable of withdrawing funds and setting the authority
     * @param _authority Account that can sign the vouchers that this contract will redeem
     */
    constructor(
        IGraphToken _graphToken,
        IStaking _staking,
        address _governor,
        address _authority
    ) {
        require(_governor != address(0), "Exchange: governor must be set");
        Governed._initialize(_governor);

        graphToken = _graphToken;
        staking = _staking;
        _setAuthority(_authority, true);
    }

    /**
     * @notice Approve the staking contract to pull any amount of tokens from this contract.
     * @dev Increased gas efficiency instead of approving on each voucher redeem
     */
    function approveAll() external {
        graphToken.approve(address(staking), MAX_UINT256);
    }

    /**
     * @notice Withdraw tokens held in the contract.
     * @dev Only the governor can withdraw
     * @param _to Destination to send the tokens
     * @param _amount Amount of tokens to withdraw
     */
    function withdraw(address _to, uint256 _amount) external onlyGovernor {
        require(_to != address(0), "Exchange: empty destination");
        require(_amount != 0, "Exchange: empty amount");
        require(graphToken.transfer(_to, _amount), "Exchange: cannot transfer");
        emit TokensWithdrawn(_to, _amount);
    }

    /**
     * @notice Set the authority allowed to sign vouchers.
     * @dev Only the governor can set the authority
     * @param _authority Address of the signing authority
     * @param _authorized True if the authority is authorized to sign vouchers, false to unset
     */
    function setAuthority(address _authority, bool _authorized) external onlyGovernor {
        _setAuthority(_authority, _authorized);
    }

    /**
     * @notice Set the authority allowed to sign vouchers.
     * @param _authority Address of the signing authority
     * @param _authorized True if the authority is authorized to sign vouchers, false to unset
     */
    function _setAuthority(address _authority, bool _authorized) private {
        require(_authority != address(0), "Exchange: empty authority");
        // This will help catch some operational errors but not all.
        // The validation will fail under the following conditions:
        // - a contract in construction
        // - an address where a contract will be created
        // - an address where a contract lived, but was destroyed
        require(!Address.isContract(_authority), "Exchange: authority must be EOA");
        authority[_authority] = _authorized;
        emit AuthoritySet(_authority, _authorized);
    }

    /**
     * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed.
     * @dev The voucher must be signed using an Ethereum signed message
     * @param _voucher Voucher data
     */
    function redeem(AllocationVoucher memory _voucher) external {
        _redeem(_voucher);
    }

    /**
     * @notice Redeem multiple vouchers.
     * @dev Each voucher must be signed using an Ethereum signed message
     * @param _vouchers An array of vouchers
     */
    function redeemMany(AllocationVoucher[] memory _vouchers) external {
        for (uint256 i = 0; i < _vouchers.length; i++) {
            _redeem(_vouchers[i]);
        }
    }

    /**
     * @notice Redeem a voucher signed by the authority. No voucher double spending is allowed.
     * @dev The voucher must be signed using an Ethereum signed message
     * @param _voucher Voucher data
     */
    function _redeem(AllocationVoucher memory _voucher) private {
        require(_voucher.amount > 0, "Exchange: zero tokens voucher");
        require(_voucher.signature.length == SIGNATURE_LENGTH, "Exchange: invalid signature");

        // Already redeemed check
        require(
            !allocationsRedeemed[_voucher.allocationID],
            "Exchange: allocation already redeemed"
        );

        // Signature check
        bytes32 messageHash = keccak256(abi.encodePacked(_voucher.allocationID, _voucher.amount));
        address voucherSigner = ECDSA.recover(messageHash, _voucher.signature);
        require(authority[voucherSigner], "Exchange: invalid signer");

        // Mark allocation as collected
        allocationsRedeemed[_voucher.allocationID] = true;

        // Make the staking contract collect funds from this contract
        // The Staking contract will validate if the allocation is valid
        staking.collect(_voucher.amount, _voucher.allocationID);

        emit AllocationRedeemed(_voucher.allocationID, _voucher.amount);
    }
}

File 2 of 8 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

File 3 of 8 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 8 : Governed.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;

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

    /// Address of the governor
    address public governor;
    /// Address of the new governor that is pending acceptance
    address public pendingGovernor;

    // -- Events --

    /// Emitted when a new owner/governor has been set, but is pending acceptance
    event NewPendingOwnership(address indexed from, address indexed to);
    /// Emitted when a new owner/governor has accepted their role
    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 for this contract
     * @param _initGovernor Address of the governor
     */
    function _initialize(address _initGovernor) internal {
        governor = _initGovernor;
    }

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

    /**
     * @notice Admin function for pending governor to accept role and update governor.
     * This function must called by the pending governor.
     */
    function acceptOwnership() external {
        address oldPendingGovernor = pendingGovernor;

        require(
            oldPendingGovernor != address(0) && msg.sender == oldPendingGovernor,
            "Caller must be pending governor"
        );

        address oldGovernor = governor;

        governor = oldPendingGovernor;
        pendingGovernor = address(0);

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

File 5 of 8 : IStaking.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity >=0.6.12 <0.8.0;
pragma abicoder v2;

import "./IStakingData.sol";

interface IStaking is IStakingData {
    // -- Allocation Data --

    /**
     * @dev Possible states an allocation can be
     * States:
     * - Null = indexer == address(0)
     * - Active = not Null && tokens > 0
     * - Closed = Active && closedAtEpoch != 0
     * - Finalized = Closed && closedAtEpoch + channelDisputeEpochs > now()
     * - Claimed = not Null && tokens == 0
     */
    enum AllocationState {
        Null,
        Active,
        Closed,
        Finalized,
        Claimed
    }

    // -- Configuration --

    function setMinimumIndexerStake(uint256 _minimumIndexerStake) external;

    function setThawingPeriod(uint32 _thawingPeriod) external;

    function setCurationPercentage(uint32 _percentage) external;

    function setProtocolPercentage(uint32 _percentage) external;

    function setChannelDisputeEpochs(uint32 _channelDisputeEpochs) external;

    function setMaxAllocationEpochs(uint32 _maxAllocationEpochs) external;

    function setRebateRatio(uint32 _alphaNumerator, uint32 _alphaDenominator) external;

    function setDelegationRatio(uint32 _delegationRatio) external;

    function setDelegationParameters(
        uint32 _indexingRewardCut,
        uint32 _queryFeeCut,
        uint32 _cooldownBlocks
    ) external;

    function setDelegationParametersCooldown(uint32 _blocks) external;

    function setDelegationUnbondingPeriod(uint32 _delegationUnbondingPeriod) external;

    function setDelegationTaxPercentage(uint32 _percentage) external;

    function setSlasher(address _slasher, bool _allowed) external;

    function setAssetHolder(address _assetHolder, bool _allowed) external;

    // -- Operation --

    function setOperator(address _operator, bool _allowed) external;

    function isOperator(address _operator, address _indexer) external view returns (bool);

    // -- Staking --

    function stake(uint256 _tokens) external;

    function stakeTo(address _indexer, uint256 _tokens) external;

    function unstake(uint256 _tokens) external;

    function slash(
        address _indexer,
        uint256 _tokens,
        uint256 _reward,
        address _beneficiary
    ) external;

    function withdraw() external;

    function setRewardsDestination(address _destination) external;

    // -- Delegation --

    function delegate(address _indexer, uint256 _tokens) external returns (uint256);

    function undelegate(address _indexer, uint256 _shares) external returns (uint256);

    function withdrawDelegated(address _indexer, address _newIndexer) external returns (uint256);

    // -- Channel management and allocations --

    function allocate(
        bytes32 _subgraphDeploymentID,
        uint256 _tokens,
        address _allocationID,
        bytes32 _metadata,
        bytes calldata _proof
    ) external;

    function allocateFrom(
        address _indexer,
        bytes32 _subgraphDeploymentID,
        uint256 _tokens,
        address _allocationID,
        bytes32 _metadata,
        bytes calldata _proof
    ) external;

    function closeAllocation(address _allocationID, bytes32 _poi) external;

    function closeAllocationMany(CloseAllocationRequest[] calldata _requests) external;

    function closeAndAllocate(
        address _oldAllocationID,
        bytes32 _poi,
        address _indexer,
        bytes32 _subgraphDeploymentID,
        uint256 _tokens,
        address _allocationID,
        bytes32 _metadata,
        bytes calldata _proof
    ) external;

    function collect(uint256 _tokens, address _allocationID) external;

    function claim(address _allocationID, bool _restake) external;

    function claimMany(address[] calldata _allocationID, bool _restake) external;

    // -- Getters and calculations --

    function hasStake(address _indexer) external view returns (bool);

    function getIndexerStakedTokens(address _indexer) external view returns (uint256);

    function getIndexerCapacity(address _indexer) external view returns (uint256);

    function getAllocation(address _allocationID) external view returns (Allocation memory);

    function getAllocationState(address _allocationID) external view returns (AllocationState);

    function isAllocation(address _allocationID) external view returns (bool);

    function getSubgraphAllocatedTokens(bytes32 _subgraphDeploymentID)
        external
        view
        returns (uint256);

    function getDelegation(address _indexer, address _delegator)
        external
        view
        returns (Delegation memory);

    function isDelegator(address _indexer, address _delegator) external view returns (bool);
}

File 6 of 8 : IGraphToken.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IGraphToken is IERC20 {
    // -- Mint and Burn --

    function burn(uint256 amount) external;

    function burnFrom(address _from, uint256 amount) external;

    function mint(address _to, uint256 _amount) external;

    // -- Mint Admin --

    function addMinter(address _account) external;

    function removeMinter(address _account) external;

    function renounceMinter() external;

    function isMinter(address _account) external view returns (bool);

    // -- Permit --

    function permit(
        address _owner,
        address _spender,
        uint256 _value,
        uint256 _deadline,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) external;

    // -- Allowance --

    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);

    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
}

File 7 of 8 : IStakingData.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity >=0.6.12 <0.8.0;

interface IStakingData {
    /**
     * @dev Allocate GRT tokens for the purpose of serving queries of a subgraph deployment
     * An allocation is created in the allocate() function and consumed in claim()
     */
    struct Allocation {
        address indexer;
        bytes32 subgraphDeploymentID;
        uint256 tokens; // Tokens allocated to a SubgraphDeployment
        uint256 createdAtEpoch; // Epoch when it was created
        uint256 closedAtEpoch; // Epoch when it was closed
        uint256 collectedFees; // Collected fees for the allocation
        uint256 effectiveAllocation; // Effective allocation when closed
        uint256 accRewardsPerAllocatedToken; // Snapshot used for reward calc
    }

    /**
     * @dev Represents a request to close an allocation with a specific proof of indexing.
     * This is passed when calling closeAllocationMany to define the closing parameters for
     * each allocation.
     */
    struct CloseAllocationRequest {
        address allocationID;
        bytes32 poi;
    }

    // -- Delegation Data --

    /**
     * @dev Delegation pool information. One per indexer.
     */
    struct DelegationPool {
        uint32 cooldownBlocks; // Blocks to wait before updating parameters
        uint32 indexingRewardCut; // in PPM
        uint32 queryFeeCut; // in PPM
        uint256 updatedAtBlock; // Block when the pool was last updated
        uint256 tokens; // Total tokens as pool reserves
        uint256 shares; // Total shares minted in the pool
        mapping(address => Delegation) delegators; // Mapping of delegator => Delegation
    }

    /**
     * @dev Individual delegation data of a delegator in a pool.
     */
    struct Delegation {
        uint256 shares; // Shares owned by a delegator in the pool
        uint256 tokensLocked; // Tokens locked for undelegation
        uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn
    }
}

File 8 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

Contract ABI

[{"inputs":[{"internalType":"contract IGraphToken","name":"_graphToken","type":"address"},{"internalType":"contract IStaking","name":"_staking","type":"address"},{"internalType":"address","name":"_governor","type":"address"},{"internalType":"address","name":"_authority","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"allocationID","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AllocationRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"authorized","type":"bool"}],"name":"AuthoritySet","type":"event"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allocationsRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approveAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authority","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"components":[{"internalType":"address","name":"allocationID","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct AllocationExchange.AllocationVoucher","name":"_voucher","type":"tuple"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"allocationID","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct AllocationExchange.AllocationVoucher[]","name":"_vouchers","type":"tuple[]"}],"name":"redeemMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_authority","type":"address"},{"internalType":"bool","name":"_authorized","type":"bool"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b50604051620013f7380380620013f7833981016040819052620000349162000196565b6001600160a01b038216620000665760405162461bcd60e51b81526004016200005d906200023f565b60405180910390fd5b6200007c82620000ad60201b620006d51760201c565b6001600160601b0319606085811b821660a05284901b16608052620000a3816001620000cf565b50505050620002c6565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216620000f85760405162461bcd60e51b81526004016200005d9062000276565b6200010e826200019060201b620006f71760201c565b156200012e5760405162461bcd60e51b81526004016200005d9062000208565b6001600160a01b03821660008181526002602052604090819020805460ff1916841515179055517f58ff942169d73f3abad652db95845088969180d650967f57f035bf5c5c9319de9062000184908490620001fd565b60405180910390a25050565b3b151590565b60008060008060808587031215620001ac578384fd5b8451620001b981620002ad565b6020860151909450620001cc81620002ad565b6040860151909350620001df81620002ad565b6060860151909250620001f281620002ad565b939692955090935050565b901515815260200190565b6020808252601f908201527f45786368616e67653a20617574686f72697479206d75737420626520454f4100604082015260600190565b6020808252601e908201527f45786368616e67653a20676f7665726e6f72206d757374206265207365740000604082015260600190565b60208082526019908201527f45786368616e67653a20656d70747920617574686f7269747900000000000000604082015260600190565b6001600160a01b0381168114620002c357600080fd5b50565b60805160601c60a05160601c6110fd620002fa600039806101b352806105eb5250806101e052806108e152506110fd6000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063b5f0d35c11610071578063b5f0d35c14610111578063cd2b1af814610124578063dfc224b414610137578063e3056a341461014a578063f2fde38b14610152578063f3fef3a314610165576100a9565b80630c340a24146100ae578063185f182d146100cc578063380d0c08146100ec5780637104dd03146100f657806379ba509714610109575b600080fd5b6100b6610178565b6040516100c39190610e03565b60405180910390f35b6100df6100da366004610c71565b610187565b6040516100c39190610e30565b6100f461019c565b005b6100df610104366004610c71565b610261565b6100f4610276565b6100f461011f366004610c92565b610384565b6100f4610132366004610cf1565b6103ea565b6100f4610145366004610da6565b61041a565b6100b6610423565b6100f4610160366004610c71565b610432565b6100f4610173366004610cc8565b610530565b6000546001600160a01b031681565b60036020526000908152604090205460ff1681565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b39061020c907f00000000000000000000000000000000000000000000000000000000000000009060001990600401610e17565b602060405180830381600087803b15801561022657600080fd5b505af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610d8a565b50565b60026020526000908152604090205460ff1681565b6001546001600160a01b031680158015906102995750336001600160a01b038216145b6102ea576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146103dc576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6103e68282610701565b5050565b60005b81518110156103e65761041282828151811061040557fe5b60200260200101516107a1565b6001016103ed565b61025e816107a1565b6001546001600160a01b031681565b6000546001600160a01b0316331461048a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0381166104dc576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b03163314610588576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0382166105b75760405162461bcd60e51b81526004016105ae90610e3b565b60405180910390fd5b806105d45760405162461bcd60e51b81526004016105ae90611001565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906106229085908590600401610e17565b602060405180830381600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190610d8a565b6106905760405162461bcd60e51b81526004016105ae90610eee565b816001600160a01b03167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106c99190611031565b60405180910390a25050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b803b15155b919050565b6001600160a01b0382166107275760405162461bcd60e51b81526004016105ae90610fca565b610730826106f7565b1561074d5760405162461bcd60e51b81526004016105ae90610e72565b6001600160a01b03821660008181526002602052604090819020805460ff1916841515179055517f58ff942169d73f3abad652db95845088969180d650967f57f035bf5c5c9319de906106c9908490610e30565b60008160200151116107c55760405162461bcd60e51b81526004016105ae90610f25565b6041816040015151146107ea5760405162461bcd60e51b81526004016105ae90610f93565b80516001600160a01b031660009081526003602052604090205460ff16156108245760405162461bcd60e51b81526004016105ae90610ea9565b600081600001518260200151604051602001610841929190610de1565b6040516020818303038152906040528051906020012090506000610869828460400151610997565b6001600160a01b03811660009081526002602052604090205490915060ff166108a45760405162461bcd60e51b81526004016105ae90610f5c565b82516001600160a01b03908116600090815260036020908152604091829020805460ff191660011790558501518551915163469e080560e11b81527f000000000000000000000000000000000000000000000000000000000000000090931692638d3c100a92610917929160040161103a565b600060405180830381600087803b15801561093157600080fd5b505af1158015610945573d6000803e3d6000fd5b5050505082600001516001600160a01b03167fe86f6a4e34293c4b00e73d2a8b6237e4ab10bb4849b1495a1a8b45d3a59d8118846020015160405161098a9190611031565b60405180910390a2505050565b600081516041146109ef576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a610a0d86828585610a17565b9695505050505050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115610a785760405162461bcd60e51b81526004018080602001828103825260228152602001806110846022913960400191505060405180910390fd5b8360ff16601b1480610a8d57508360ff16601c145b610ac85760405162461bcd60e51b81526004018080602001828103825260228152602001806110a66022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610b24573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610b8c576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80356001600160a01b03811681146106fc57600080fd5b600060608284031215610bbd578081fd5b6040516060810167ffffffffffffffff8282108183111715610bdb57fe5b81604052829350610beb85610b95565b8352602091508185013582840152604085013581811115610c0b57600080fd5b8501601f81018713610c1c57600080fd5b803582811115610c2857fe5b610c3a601f8201601f19168501611051565b92508083528784828401011115610c5057600080fd5b80848301858501376000848285010152505080604084015250505092915050565b600060208284031215610c82578081fd5b610c8b82610b95565b9392505050565b60008060408385031215610ca4578081fd5b610cad83610b95565b91506020830135610cbd81611075565b809150509250929050565b60008060408385031215610cda578182fd5b610ce383610b95565b946020939093013593505050565b60006020808385031215610d03578182fd5b823567ffffffffffffffff80821115610d1a578384fd5b818501915085601f830112610d2d578384fd5b813581811115610d3957fe5b610d468485830201611051565b8181528481019250838501865b83811015610d7c57610d6a8a888435890101610bac565b85529386019390860190600101610d53565b509098975050505050505050565b600060208284031215610d9b578081fd5b8151610c8b81611075565b600060208284031215610db7578081fd5b813567ffffffffffffffff811115610dcd578182fd5b610dd984828501610bac565b949350505050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252601b908201527f45786368616e67653a20656d7074792064657374696e6174696f6e0000000000604082015260600190565b6020808252601f908201527f45786368616e67653a20617574686f72697479206d75737420626520454f4100604082015260600190565b60208082526025908201527f45786368616e67653a20616c6c6f636174696f6e20616c72656164792072656460408201526419595b595960da1b606082015260800190565b60208082526019908201527f45786368616e67653a2063616e6e6f74207472616e7366657200000000000000604082015260600190565b6020808252601d908201527f45786368616e67653a207a65726f20746f6b656e7320766f7563686572000000604082015260600190565b60208082526018908201527f45786368616e67653a20696e76616c6964207369676e65720000000000000000604082015260600190565b6020808252601b908201527f45786368616e67653a20696e76616c6964207369676e61747572650000000000604082015260600190565b60208082526019908201527f45786368616e67653a20656d70747920617574686f7269747900000000000000604082015260600190565b602080825260169082015275115e18da185b99d94e88195b5c1d1e48185b5bdd5b9d60521b604082015260600190565b90815260200190565b9182526001600160a01b0316602082015260400190565b60405181810167ffffffffffffffff8111828210171561106d57fe5b604052919050565b801515811461025e57600080fdfe45434453413a20696e76616c6964207369676e6174757265202773272076616c756545434453413a20696e76616c6964207369676e6174757265202776272076616c7565a2646970667358221220c2b72fe4383e1d06c5363f0e5194c51b65ce7c530108fd367d83f533f2bbd72764736f6c634300070600330000000000000000000000009623063377ad1b27544c965ccd7342f7ea7e88c700000000000000000000000000669a4cf01450b64e8a2a20e9b1fcb71e61ef03000000000000000000000000270ea4ea9e8a699f8fe54515e3bb2c418952623b00000000000000000000000079f2212de27912bcb25a452fc102c85c142e3ee3

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063b5f0d35c11610071578063b5f0d35c14610111578063cd2b1af814610124578063dfc224b414610137578063e3056a341461014a578063f2fde38b14610152578063f3fef3a314610165576100a9565b80630c340a24146100ae578063185f182d146100cc578063380d0c08146100ec5780637104dd03146100f657806379ba509714610109575b600080fd5b6100b6610178565b6040516100c39190610e03565b60405180910390f35b6100df6100da366004610c71565b610187565b6040516100c39190610e30565b6100f461019c565b005b6100df610104366004610c71565b610261565b6100f4610276565b6100f461011f366004610c92565b610384565b6100f4610132366004610cf1565b6103ea565b6100f4610145366004610da6565b61041a565b6100b6610423565b6100f4610160366004610c71565b610432565b6100f4610173366004610cc8565b610530565b6000546001600160a01b031681565b60036020526000908152604090205460ff1681565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000009623063377ad1b27544c965ccd7342f7ea7e88c7169063095ea7b39061020c907f00000000000000000000000000669a4cf01450b64e8a2a20e9b1fcb71e61ef039060001990600401610e17565b602060405180830381600087803b15801561022657600080fd5b505af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610d8a565b50565b60026020526000908152604090205460ff1681565b6001546001600160a01b031680158015906102995750336001600160a01b038216145b6102ea576040805162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206d7573742062652070656e64696e6720676f7665726e6f7200604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b031980841691909117808555600180549092169091556040519282169391169183917f0ac6deed30eef60090c749850e10f2fa469e3e25fec1d1bef2853003f6e6f18f91a36001546040516001600160a01b03918216918416907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b031633146103dc576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6103e68282610701565b5050565b60005b81518110156103e65761041282828151811061040557fe5b60200260200101516107a1565b6001016103ed565b61025e816107a1565b6001546001600160a01b031681565b6000546001600160a01b0316331461048a576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0381166104dc576040805162461bcd60e51b815260206004820152601460248201527311dbdd995c9b9bdc881b5d5cdd081899481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b038381166001600160a01b03198316179283905560405191811692169082907f76563ad561b7036ae716b9b25cb521b21463240f104c97e12f25877f2235f33d90600090a35050565b6000546001600160a01b03163314610588576040805162461bcd60e51b815260206004820152601660248201527513db9b1e4811dbdd995c9b9bdc8818d85b8818d85b1b60521b604482015290519081900360640190fd5b6001600160a01b0382166105b75760405162461bcd60e51b81526004016105ae90610e3b565b60405180910390fd5b806105d45760405162461bcd60e51b81526004016105ae90611001565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000009623063377ad1b27544c965ccd7342f7ea7e88c7169063a9059cbb906106229085908590600401610e17565b602060405180830381600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190610d8a565b6106905760405162461bcd60e51b81526004016105ae90610eee565b816001600160a01b03167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106c99190611031565b60405180910390a25050565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b803b15155b919050565b6001600160a01b0382166107275760405162461bcd60e51b81526004016105ae90610fca565b610730826106f7565b1561074d5760405162461bcd60e51b81526004016105ae90610e72565b6001600160a01b03821660008181526002602052604090819020805460ff1916841515179055517f58ff942169d73f3abad652db95845088969180d650967f57f035bf5c5c9319de906106c9908490610e30565b60008160200151116107c55760405162461bcd60e51b81526004016105ae90610f25565b6041816040015151146107ea5760405162461bcd60e51b81526004016105ae90610f93565b80516001600160a01b031660009081526003602052604090205460ff16156108245760405162461bcd60e51b81526004016105ae90610ea9565b600081600001518260200151604051602001610841929190610de1565b6040516020818303038152906040528051906020012090506000610869828460400151610997565b6001600160a01b03811660009081526002602052604090205490915060ff166108a45760405162461bcd60e51b81526004016105ae90610f5c565b82516001600160a01b03908116600090815260036020908152604091829020805460ff191660011790558501518551915163469e080560e11b81527f00000000000000000000000000669a4cf01450b64e8a2a20e9b1fcb71e61ef0390931692638d3c100a92610917929160040161103a565b600060405180830381600087803b15801561093157600080fd5b505af1158015610945573d6000803e3d6000fd5b5050505082600001516001600160a01b03167fe86f6a4e34293c4b00e73d2a8b6237e4ab10bb4849b1495a1a8b45d3a59d8118846020015160405161098a9190611031565b60405180910390a2505050565b600081516041146109ef576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a610a0d86828585610a17565b9695505050505050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115610a785760405162461bcd60e51b81526004018080602001828103825260228152602001806110846022913960400191505060405180910390fd5b8360ff16601b1480610a8d57508360ff16601c145b610ac85760405162461bcd60e51b81526004018080602001828103825260228152602001806110a66022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610b24573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610b8c576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80356001600160a01b03811681146106fc57600080fd5b600060608284031215610bbd578081fd5b6040516060810167ffffffffffffffff8282108183111715610bdb57fe5b81604052829350610beb85610b95565b8352602091508185013582840152604085013581811115610c0b57600080fd5b8501601f81018713610c1c57600080fd5b803582811115610c2857fe5b610c3a601f8201601f19168501611051565b92508083528784828401011115610c5057600080fd5b80848301858501376000848285010152505080604084015250505092915050565b600060208284031215610c82578081fd5b610c8b82610b95565b9392505050565b60008060408385031215610ca4578081fd5b610cad83610b95565b91506020830135610cbd81611075565b809150509250929050565b60008060408385031215610cda578182fd5b610ce383610b95565b946020939093013593505050565b60006020808385031215610d03578182fd5b823567ffffffffffffffff80821115610d1a578384fd5b818501915085601f830112610d2d578384fd5b813581811115610d3957fe5b610d468485830201611051565b8181528481019250838501865b83811015610d7c57610d6a8a888435890101610bac565b85529386019390860190600101610d53565b509098975050505050505050565b600060208284031215610d9b578081fd5b8151610c8b81611075565b600060208284031215610db7578081fd5b813567ffffffffffffffff811115610dcd578182fd5b610dd984828501610bac565b949350505050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252601b908201527f45786368616e67653a20656d7074792064657374696e6174696f6e0000000000604082015260600190565b6020808252601f908201527f45786368616e67653a20617574686f72697479206d75737420626520454f4100604082015260600190565b60208082526025908201527f45786368616e67653a20616c6c6f636174696f6e20616c72656164792072656460408201526419595b595960da1b606082015260800190565b60208082526019908201527f45786368616e67653a2063616e6e6f74207472616e7366657200000000000000604082015260600190565b6020808252601d908201527f45786368616e67653a207a65726f20746f6b656e7320766f7563686572000000604082015260600190565b60208082526018908201527f45786368616e67653a20696e76616c6964207369676e65720000000000000000604082015260600190565b6020808252601b908201527f45786368616e67653a20696e76616c6964207369676e61747572650000000000604082015260600190565b60208082526019908201527f45786368616e67653a20656d70747920617574686f7269747900000000000000604082015260600190565b602080825260169082015275115e18da185b99d94e88195b5c1d1e48185b5bdd5b9d60521b604082015260600190565b90815260200190565b9182526001600160a01b0316602082015260400190565b60405181810167ffffffffffffffff8111828210171561106d57fe5b604052919050565b801515811461025e57600080fdfe45434453413a20696e76616c6964207369676e6174757265202773272076616c756545434453413a20696e76616c6964207369676e6174757265202776272076616c7565a2646970667358221220c2b72fe4383e1d06c5363f0e5194c51b65ce7c530108fd367d83f533f2bbd72764736f6c63430007060033

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

0000000000000000000000009623063377ad1b27544c965ccd7342f7ea7e88c700000000000000000000000000669a4cf01450b64e8a2a20e9b1fcb71e61ef03000000000000000000000000270ea4ea9e8a699f8fe54515e3bb2c418952623b00000000000000000000000079f2212de27912bcb25a452fc102c85c142e3ee3

-----Decoded View---------------
Arg [0] : _graphToken (address): 0x9623063377AD1B27544C965cCd7342f7EA7e88C7
Arg [1] : _staking (address): 0x00669A4CF01450B64E8A2A20E9b1FCB71E61eF03
Arg [2] : _governor (address): 0x270Ea4ea9e8A699f8fE54515E3Bb2c418952623b
Arg [3] : _authority (address): 0x79f2212de27912bCb25a452fC102C85c142E3eE3

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000009623063377ad1b27544c965ccd7342f7ea7e88c7
Arg [1] : 00000000000000000000000000669a4cf01450b64e8a2a20e9b1fcb71e61ef03
Arg [2] : 000000000000000000000000270ea4ea9e8a699f8fe54515e3bb2c418952623b
Arg [3] : 00000000000000000000000079f2212de27912bcb25a452fc102c85c142e3ee3


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.