Get the opcode traces for a historical transaction on the network with the given transaction ID or hash
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodesimport requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes', 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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes",
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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes"
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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes")
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{
"address": "<string>",
"contract_id": "0.0.2",
"failed": true,
"gas": 123,
"opcodes": [
{
"depth": 123,
"gas": 123,
"gas_cost": 123,
"memory": [
"<string>"
],
"op": "<string>",
"pc": 123,
"stack": [
"<string>"
],
"storage": {},
"reason": "<string>"
}
],
"return_value": "<string>"
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}Contracts
Get the opcode traces for a historical transaction on the network with the given transaction ID or hash
Re-executes a transaction and returns a result containing detailed information for the execution,
including all values from the {@code stack}, {@code memory} and {@code storage}
and the entire trace of opcodes that were executed during the replay.
Note that to provide the output, the transaction needs to be re-executed on the EVM,
which may take a significant amount of time to complete if stack and memory information is requested.
GET
/
api
/
v1
/
contracts
/
results
/
{transactionIdOrHash}
/
opcodes
Get the opcode traces for a historical transaction on the network with the given transaction ID or hash
curl --request GET \
--url https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodesimport requests
url = "https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes', 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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes",
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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes"
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://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.mirrornode.hedera.com/api/v1/contracts/results/{transactionIdOrHash}/opcodes")
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{
"address": "<string>",
"contract_id": "0.0.2",
"failed": true,
"gas": 123,
"opcodes": [
{
"depth": 123,
"gas": 123,
"gas_cost": 123,
"memory": [
"<string>"
],
"op": "<string>",
"pc": 123,
"stack": [
"<string>"
],
"storage": {},
"reason": "<string>"
}
],
"return_value": "<string>"
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}{
"_status": {
"messages": [
{
"data": "0x3000",
"detail": "Generic detailed error message",
"message": "Generic error message"
}
]
}
}Path Parameters
Transaction Id or a 32 byte hash with optional 0x prefix
Pattern:
^(0x)?[A-Fa-f0-9]{64}|(\d{1,10})\.(\d{1,10})\.(\d{1,10})-(\d{1,19})-(\d{1,9})$Query Parameters
If provided and set to false, stack information will not be included in the response
If provided and set to true, memory information will be included in the response
If provided and set to true, storage information will be included in the response
Response
OK
The address of the transaction recipient in hex. Zero address is set for transactions without a recipient (e.g., contract create)
Network entity ID in the format of shard.realm.num
Pattern:
^\d{1,10}\.\d{1,10}\.\d{1,10}$Example:
"0.0.2"
Whether the transaction failed to be completely processed.
The gas used in tinybars
The logs produced by the opcode logger
Show child attributes
Show child attributes
The returned data from the transaction in hex
Was this page helpful?