omnia_decodeTransaction

Returns the Transaction.data field of an Ethereum transaction.

Parameters

  1. DATA, 20 bytes - contract_address. The address of the smart contract called.

  2. DATA, variable length- data. Transaction.data field to be decoded. REQUIRED

  3. DATA, 20 bytes - signer. Address corresponding to the signer of the transaction.

Note: contract_address and signer parameters are not required, but providing them might help to recover more details about the decoded input.

Returns

Object with following details:

ParameterDescriptionNotice

method

It describes the method name in ABI, for example, "transfer".

type

It describes the parameter type in ABI, for example, "address", "uint256", and "bool".

name

It describes the parameter name in ABI, for example "_from", "_to", "_value".

input

It describes the input data in ABI.

address_info

It describes the info about the address as a parameter. The info includes: (1) "is_contract" describes whether the address is a contract. "1" means true; "0" means false. (2) "contract_name" describes the contract name if the address is a contract. (3) "standard" describes the standard type of the contract. Example:"erc20". (4) "symbol" describes the token symbol if the address is an ERC20 contract. (5) "name" describes the token name if the address is an ERC20 contract. (6) "malicious_address" describes whether the address is a suspected malicious contract. "1" means true; "0" means that we have not found malicious behavior of this address.

When the address is not a contract ("is_contract"=0), "contract_name", "standard", "symbol", and "name" will return "null". When the address is a contract but not an erc20 contract, "standard", "symbol", and "name" will return "null".

contract_name

The name of the contract that the user is interacting with.

contract_description

Description of the contract.

malicious_contract

It tells if the contract that the user is interacting with is a malicious contract.

signature_detail

It explains the function of the method.

risky_signature

It tells if the transaction that users are signing contains risk.

Even non-malicious, commonly used, well-known contracts can be highly risky if not used properly.

risk

It explains why the transaction that users are signing contains risk.

Even non-malicious, commonly used, well-known contracts can be highly risky if not used properly.

Example

Request

curl --request POST \
     --url https://endpoints.omniatech.io/v1/RPC_ENDPOINT \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "omnia_decodeTransaction",
    "params": [
        {
            "contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
            "data": "0x095ea7b30000000000000000000000009901bac880caecad999e292811db9c1db3e86f8a000000000000000000000000000000000000000000000000000000000001951b",
            "signer": "0x822FC93407C81BA1401838Cb2991130D2bE36a94"
        }
    ]
}
'

Response

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "method": "approve",
        "risk": null,
        "params": [
            {
                "type": "address",
                "name": "spender",
                "input": "0x9901bac880caecad999e292811db9c1db3e86f8a",
                "struct": null,
                "tuple": null,
                "address_info": {
                    "standard": "OTHER",
                    "symbol": null,
                    "name": null,
                    "contract_name": null,
                    "malicious_address": 0,
                    "is_contract": 1
                }
            },
            {
                "type": "uint256",
                "name": "amount",
                "input": "103707",
                "struct": null,
                "tuple": null,
                "address_info": null
            }
        ],
        "contract_name": null,
        "contract_description": null,
        "malicious_contract": null,
        "signature_detail": null,
        "risky_signature": null
    }
}

Last updated