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
Class | Description |
---|---|
Decoding | Static 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
Parameter | Type | Description |
---|---|---|
callData | string | Hex-encoded function call data (starting with "0x") |
abi | string | JSON ABI definition of the contract function |
Response
Success Response
The method returns a DecodedCallData
object with the following properties:
Property | Type | Description |
---|---|---|
IsSuccessful | bool | Indicates if decoding was successful |
FunctionName | string | Name of the decoded function |
Parameters | Dictionary<string, string> | Parameter names and their decoded values |
ErrorMessage | string | Error message if decoding failed |