ETH Price: $1,957.98 (-2.49%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SubgraphNFTDescriptor

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.7.6;

import "../libraries/Base58Encoder.sol";
import "./ISubgraphNFTDescriptor.sol";

/// @title Describes subgraph NFT tokens via URI
contract SubgraphNFTDescriptor is ISubgraphNFTDescriptor {
    /// @inheritdoc ISubgraphNFTDescriptor
    function tokenURI(
        address, /* _minter */
        uint256, /* _tokenId */
        string calldata _baseURI,
        bytes32 _subgraphMetadata
    ) external pure override returns (string memory) {
        bytes memory b58 = Base58Encoder.encode(
            abi.encodePacked(Base58Encoder.sha256MultiHash, _subgraphMetadata)
        );
        if (bytes(_baseURI).length == 0) {
            return string(b58);
        }
        return string(abi.encodePacked(_baseURI, b58));
    }
}

// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;

/// @title Base58Encoder
/// @author Original author - Martin Lundfall ([email protected])
/// Based on https://github.com/MrChico/verifyIPFS
library Base58Encoder {
    bytes constant sha256MultiHash = hex"1220";
    bytes constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

    /// @dev Converts hex string to base 58
    function encode(bytes memory source) internal pure returns (bytes memory) {
        if (source.length == 0) return new bytes(0);
        uint8[] memory digits = new uint8[](64);
        digits[0] = 0;
        uint8 digitlength = 1;
        for (uint256 i = 0; i < source.length; ++i) {
            uint256 carry = uint8(source[i]);
            for (uint256 j = 0; j < digitlength; ++j) {
                carry += uint256(digits[j]) * 256;
                digits[j] = uint8(carry % 58);
                carry = carry / 58;
            }

            while (carry > 0) {
                digits[digitlength] = uint8(carry % 58);
                digitlength++;
                carry = carry / 58;
            }
        }
        return toAlphabet(reverse(truncate(digits, digitlength)));
    }

    function truncate(uint8[] memory array, uint8 length) internal pure returns (uint8[] memory) {
        uint8[] memory output = new uint8[](length);
        for (uint256 i = 0; i < length; i++) {
            output[i] = array[i];
        }
        return output;
    }

    function reverse(uint8[] memory input) internal pure returns (uint8[] memory) {
        uint8[] memory output = new uint8[](input.length);
        for (uint256 i = 0; i < input.length; i++) {
            output[i] = input[input.length - 1 - i];
        }
        return output;
    }

    function toAlphabet(uint8[] memory indices) internal pure returns (bytes memory) {
        bytes memory output = new bytes(indices.length);
        for (uint256 i = 0; i < indices.length; i++) {
            output[i] = ALPHABET[indices[i]];
        }
        return output;
    }
}

File 3 of 3 : ISubgraphNFTDescriptor.sol
// SPDX-License-Identifier: GPL-2.0-or-later

pragma solidity ^0.7.6;

/// @title Describes subgraph NFT tokens via URI
interface ISubgraphNFTDescriptor {
    /// @notice Produces the URI describing a particular token ID for a Subgraph
    /// @dev Note this URI may be data: URI with the JSON contents directly inlined
    /// @param _minter Address of the allowed minter
    /// @param _tokenId The ID of the subgraph NFT for which to produce a description, which may not be valid
    /// @param _baseURI The base URI that could be prefixed to the final URI
    /// @param _subgraphMetadata Subgraph metadata set for the subgraph
    /// @return The URI of the ERC721-compliant metadata
    function tokenURI(
        address _minter,
        uint256 _tokenId,
        string calldata _baseURI,
        bytes32 _subgraphMetadata
    ) external view returns (string memory);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"bytes32","name":"_subgraphMetadata","type":"bytes32"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b5061060b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063bacc1fc514610030575b600080fd5b6100b56004803603608081101561004657600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561007657600080fd5b82018360208201111561008857600080fd5b803590602001918460018302840111640100000000831117156100aa57600080fd5b91935091503561012a565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100ef5781810151838201526020016100d7565b50505050905090810190601f16801561011c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b606060006101b5604051806040016040528060028152602001609160f51b815250846040516020018083805190602001908083835b6020831061017e5780518252601f19909201916020918201910161015f565b51815160209384036101000a6000190180199092169116179052920193845250604080518085038152939091019052509050610244565b9050836101c357905061023b565b8484826040516020018084848082843784519201916020850191508083835b602083106102015780518252601f1990920191602091820191016101e2565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040529150505b95945050505050565b60608151600014156102655750604080516000815260208101909152610399565b6040805181815261082081018252600091602082016108008036833701905050905060008160008151811061029657fe5b60ff90921660209283029190910190910152600160005b84518110156103795760008582815181106102c457fe5b016020015160f81c905060005b8360ff16811015610332578481815181106102e857fe5b602002602001015160ff166101000282019150603a828161030557fe5b0685828151811061031257fe5b60ff90921660209283029190910190910152603a820491506001016102d1565b505b801561037057603a8106848460ff168151811061034d57fe5b60ff90921660209283029190910190910152600190920191603a81049050610334565b506001016102ad565b5061039461038f61038a848461039e565b610439565b6104d5565b925050505b919050565b606060008260ff1667ffffffffffffffff811180156103bc57600080fd5b506040519080825280602002602001820160405280156103e6578160200160208202803683370190505b50905060005b8360ff168110156104315784818151811061040357fe5b602002602001015182828151811061041757fe5b60ff909216602092830291909101909101526001016103ec565b509392505050565b60606000825167ffffffffffffffff8111801561045557600080fd5b5060405190808252806020026020018201604052801561047f578160200160208202803683370190505b50905060005b83518110156104ce578381600186510303815181106104a057fe5b60200260200101518282815181106104b457fe5b60ff90921660209283029190910190910152600101610485565b5092915050565b60606000825167ffffffffffffffff811180156104f157600080fd5b506040519080825280601f01601f19166020018201604052801561051c576020820181803683370190505b50905060005b83518110156104ce576040518060600160405280603a815260200161059c603a913984828151811061055057fe5b602002602001015160ff168151811061056557fe5b602001015160f81c60f81b82828151811061057c57fe5b60200101906001600160f81b031916908160001a90535060010161052256fe31323334353637383941424344454647484a4b4c4d4e505152535455565758595a6162636465666768696a6b6d6e6f707172737475767778797aa2646970667358221220caf7b793da7e0a41bc22ed25f39e456e5e05badf26f8cadd78da7dadc70d8c0c64736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063bacc1fc514610030575b600080fd5b6100b56004803603608081101561004657600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561007657600080fd5b82018360208201111561008857600080fd5b803590602001918460018302840111640100000000831117156100aa57600080fd5b91935091503561012a565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100ef5781810151838201526020016100d7565b50505050905090810190601f16801561011c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b606060006101b5604051806040016040528060028152602001609160f51b815250846040516020018083805190602001908083835b6020831061017e5780518252601f19909201916020918201910161015f565b51815160209384036101000a6000190180199092169116179052920193845250604080518085038152939091019052509050610244565b9050836101c357905061023b565b8484826040516020018084848082843784519201916020850191508083835b602083106102015780518252601f1990920191602091820191016101e2565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040529150505b95945050505050565b60608151600014156102655750604080516000815260208101909152610399565b6040805181815261082081018252600091602082016108008036833701905050905060008160008151811061029657fe5b60ff90921660209283029190910190910152600160005b84518110156103795760008582815181106102c457fe5b016020015160f81c905060005b8360ff16811015610332578481815181106102e857fe5b602002602001015160ff166101000282019150603a828161030557fe5b0685828151811061031257fe5b60ff90921660209283029190910190910152603a820491506001016102d1565b505b801561037057603a8106848460ff168151811061034d57fe5b60ff90921660209283029190910190910152600190920191603a81049050610334565b506001016102ad565b5061039461038f61038a848461039e565b610439565b6104d5565b925050505b919050565b606060008260ff1667ffffffffffffffff811180156103bc57600080fd5b506040519080825280602002602001820160405280156103e6578160200160208202803683370190505b50905060005b8360ff168110156104315784818151811061040357fe5b602002602001015182828151811061041757fe5b60ff909216602092830291909101909101526001016103ec565b509392505050565b60606000825167ffffffffffffffff8111801561045557600080fd5b5060405190808252806020026020018201604052801561047f578160200160208202803683370190505b50905060005b83518110156104ce578381600186510303815181106104a057fe5b60200260200101518282815181106104b457fe5b60ff90921660209283029190910190910152600101610485565b5092915050565b60606000825167ffffffffffffffff811180156104f157600080fd5b506040519080825280601f01601f19166020018201604052801561051c576020820181803683370190505b50905060005b83518110156104ce576040518060600160405280603a815260200161059c603a913984828151811061055057fe5b602002602001015160ff168151811061056557fe5b602001015160f81c60f81b82828151811061057c57fe5b60200101906001600160f81b031916908160001a90535060010161052256fe31323334353637383941424344454647484a4b4c4d4e505152535455565758595a6162636465666768696a6b6d6e6f707172737475767778797aa2646970667358221220caf7b793da7e0a41bc22ed25f39e456e5e05badf26f8cadd78da7dadc70d8c0c64736f6c63430007060033

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

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