Neo Express Contract Invocation File

July 3, 2026 ยท View on GitHub

Overview

Neo Express uses a JSON file containing contract invocation information, which can be passed by path to the contract invoke neo-express command.

This document describes the contract invoke file format used by Neo Express.

There are several advantages of using an invoke file instead of the command line:

  • invoke files can be checked into source control
  • invoke files can handle complex and nested contract parameters
  • invoke files can be generated by tools such as Visual DevTracker

Invocation File Format

A neo-invoke file is a serialized JSON object, or an array of JSON objects, that contains the information needed to invoke Neo smart contracts. The file can have any extension, though it typically uses .neo-invoke.json to both indicate its usage and enable JSON syntax highlighting in tools.

A neo-invoke JSON object has three properties: contract, operation and args.

contract Property

The contract property identifies the deployed contract to invoke. It is a JSON string, not an object. Neo Express resolves the value as a deployed contract name first, then as a script hash. A leading # is also accepted and is ignored for contract lookup.

Examples:

{
  "contract": "token",
  "operation": "symbol",
  "args": []
}
{
  "contract": "0x558a35116215a65a03eeb156704f34a07404ee96",
  "operation": "symbol",
  "args": []
}

Use neoxp contract list to list deployed contract names and hashes. Use neoxp contract hash when you need to calculate the deployment hash for a compiled contract and deployment account before deployment. contract invoke does not resolve a contract from a .nef path; deploy the contract first, then invoke it by name or hash.

operation Property

For invoking N3 contracts, the operation must be specified by name in the invocation file.

args Property

The args property contains an array of contract parameters to be passed to the contract via the invoke script. Neo Express generates the invoke script for the contract specified via the contract and operation property.

The following JSON types are treated as the corresponding Contract parameter type:

  • Boolean
  • Integer
    • Note, non-integer JSON numbers are not valid contract parameters. Additionally, only integers that fall between Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER can be encoded in this manner. Integers that fall outside that range should be encoded using the type/value approach detailed above.
  • String
  • Array

Additionally, direct encoded strings can use special prefixes to indicate other contract parameter types:

  • Direct encoded strings with a '@' prefix are treated as a wallet address. Available inputs are:

    • @+wallet name - the default address in the wallet will be read and converted to Uint160 as the contract parameter
    • @+address - the Base58 encoded address will be converted to Uint160 as the contract parameter

    For example:

    @genesis

    @node1

    @NZg1gGbZ4VrAFnjmxLxWn2MHbsBXM2s8hY

  • Direct encoded strings with a '#' prefix are treated as a contract hash. Available inputs are:

    • #+script hash - the script hash will be converted into Uint160 as the contract parameter
    • #+transaction hash - the transaction hash will be converted into Uint256 as the contract parameter
    • #+block hash - the block hash will be converted into Uint256 as the contract parameter
    • #+contract name - the corresponding contract will be queried and related contract hash will be converted into Uint160 as the contract parameter

    For example:

    #0x558a35116215a65a03eeb156704f34a07404ee96

    #0xc401a47c96711a6cf99cc2cbc185c249a935dab0df43bf6886093eacec2010b2

    #neo

    #test-contract

Example

Following is an example of invocation file:

[
    {
        "contract": "token",
        "operation": "transfer",
        "args": [
            "@dev",
            "@genesis",
            1000,
            []
        ]
    },
    {
        "contract": "token",
        "operation": "transfer",
        "args": [
            "@dev",
            "#NFT",
            1000,
            []
        ]
    }
]