Explorer

Decode Smart Contract Call Data

Learn how to decode encoded smart contract function calls using the Okto SDK in Unity.

Overview

The Okto SDK provides decoding function that allow you to interpret encoded smart contract function calls.

Decoding is the reverse process of encoding - it takes hex-encoded call data and converts it back into readable function names and parameters using the contract's ABI.

Example

Class Overview

ClassDescription
DecodingStatic class providing methods to decode smart contract call data

Decode Call Data

DecodeCallDataDirectWrapper(string callData, string abi) decodes hex-encoded smart contract call data using the provided ABI.

Parameters

ParameterTypeDescription
callDatastringHex-encoded function call data (starting with "0x")
abistringJSON ABI definition of the contract function

Response

Success Response

The method returns a DecodedCallData object with the following properties:

PropertyTypeDescription
IsSuccessfulboolIndicates if decoding was successful
FunctionNamestringName of the decoded function
ParametersDictionary<string, string>Parameter names and their decoded values
ErrorMessagestringError message if decoding failed