Get Smart Contract
curl --request GET \
--url https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}import requests
url = "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"verified_twin_address_hash": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"is_verified": true,
"is_changed_bytecode": true,
"is_partially_verified": true,
"is_fully_verified": true,
"is_verified_via_sourcify": true,
"is_verified_via_eth_bytecode_db": true,
"is_self_destructed": true,
"can_be_visualized_via_sol2uml": true,
"minimal_proxy_address_hash": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"sourcify_repo_url": "https://sourcify.repo.com/100/link_to_a_contract_at_sourcify",
"name": "Cryptostamp3L2",
"optimization_enabled": false,
"optimizations_runs": 200,
"compiler_version": "v0.8.4+commit.c7e474f2",
"evm_version": "default",
"verified_at": "2021-06-02T17:54:17.116055Z",
"abi": "[{\"type\":\"constructor\",\"stateMutability\":\"nonpayable\",\"inputs\":[{\"type\":\"address\",\"name\":\"_bridgeDataAddress\",\"internalType\":\"address\"},{\"type\":\"uint256\",\"name\":\"_finalSupply\",\"internalType\":\"uint256\"},{\"type\":\"uint256[5]\",\"name\":\"_totalColorSupply\",\"internalType\":\"uint256[5]\"}]}]",
"source_code": "contract A {}",
"file_path": "contract.sol",
"compiler_settings": {
"compilationTarget": {
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": "ERC1967Proxy"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"constructor_args": "0x01",
"additional_sources": [
{
"file_path": "contracts/erc-20.sol",
"source_code": "pragma solidity ^0.8.0; \\n contract A {}"
}
],
"decoded_constructor_args": [
[
"0x2a3885b3f0c98f3e36334d4fa7beda53cb0ae095",
{
"internalType": "address",
"name": "_logic",
"type": "address"
}
]
],
"deployed_bytecode": "0x01",
"creation_bytecode": "0x02",
"external_libraries": [
{
"name": "MathLib",
"address_hash": "0xF61f5c4a3664501F499A9289AaEe76a709CE536e"
}
],
"language": "solidity | vyper | yul",
"status": "selfdestructed | failed | success"
}blockscout
Get Smart Contract
GET
/
blockscout
/
smart-contracts
/
{address_hash}
Get Smart Contract
curl --request GET \
--url https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}import requests
url = "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.b3.fun/blockscout/smart-contracts/{address_hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"verified_twin_address_hash": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"is_verified": true,
"is_changed_bytecode": true,
"is_partially_verified": true,
"is_fully_verified": true,
"is_verified_via_sourcify": true,
"is_verified_via_eth_bytecode_db": true,
"is_self_destructed": true,
"can_be_visualized_via_sol2uml": true,
"minimal_proxy_address_hash": "0x394c399dbA25B99Ab7708EdB505d755B3aa29997",
"sourcify_repo_url": "https://sourcify.repo.com/100/link_to_a_contract_at_sourcify",
"name": "Cryptostamp3L2",
"optimization_enabled": false,
"optimizations_runs": 200,
"compiler_version": "v0.8.4+commit.c7e474f2",
"evm_version": "default",
"verified_at": "2021-06-02T17:54:17.116055Z",
"abi": "[{\"type\":\"constructor\",\"stateMutability\":\"nonpayable\",\"inputs\":[{\"type\":\"address\",\"name\":\"_bridgeDataAddress\",\"internalType\":\"address\"},{\"type\":\"uint256\",\"name\":\"_finalSupply\",\"internalType\":\"uint256\"},{\"type\":\"uint256[5]\",\"name\":\"_totalColorSupply\",\"internalType\":\"uint256[5]\"}]}]",
"source_code": "contract A {}",
"file_path": "contract.sol",
"compiler_settings": {
"compilationTarget": {
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": "ERC1967Proxy"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
},
"constructor_args": "0x01",
"additional_sources": [
{
"file_path": "contracts/erc-20.sol",
"source_code": "pragma solidity ^0.8.0; \\n contract A {}"
}
],
"decoded_constructor_args": [
[
"0x2a3885b3f0c98f3e36334d4fa7beda53cb0ae095",
{
"internalType": "address",
"name": "_logic",
"type": "address"
}
]
],
"deployed_bytecode": "0x01",
"creation_bytecode": "0x02",
"external_libraries": [
{
"name": "MathLib",
"address_hash": "0xF61f5c4a3664501F499A9289AaEe76a709CE536e"
}
],
"language": "solidity | vyper | yul",
"status": "selfdestructed | failed | success"
}Path Parameters
Address hash
Pattern:
^0x([A-Fa-f0-9]{40})$Response
Smart Contract
Example:
"0x394c399dbA25B99Ab7708EdB505d755B3aa29997"
Example:
"0x394c399dbA25B99Ab7708EdB505d755B3aa29997"
Example:
"https://sourcify.repo.com/100/link_to_a_contract_at_sourcify"
Example:
"Cryptostamp3L2"
Example:
false
Example:
200
Example:
"v0.8.4+commit.c7e474f2"
Example:
"default"
Example:
"2021-06-02T17:54:17.116055Z"
Example:
"[{\"type\":\"constructor\",\"stateMutability\":\"nonpayable\",\"inputs\":[{\"type\":\"address\",\"name\":\"_bridgeDataAddress\",\"internalType\":\"address\"},{\"type\":\"uint256\",\"name\":\"_finalSupply\",\"internalType\":\"uint256\"},{\"type\":\"uint256[5]\",\"name\":\"_totalColorSupply\",\"internalType\":\"uint256[5]\"}]}]"
Example:
"contract A {}"
Example:
"contract.sol"
Example:
{ "compilationTarget": { "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": "ERC1967Proxy" }, "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs" }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [] }
Example:
"0x01"
Show child attributes
Show child attributes
Example:
"0x01"
Example:
"0x02"
Show child attributes
Show child attributes
Example:
"solidity | vyper | yul"
Example:
"selfdestructed | failed | success"
HypeDuel