• 官网
  • 中文
  • English
  • Russian
  • More language
Show / Hide Table of Contents
  • Home
  • Getting Started
  • NEO Node
    • Introduction
    • Installation
    • Graphical User Interface
    • Test Network
    • CLI Reference
    • Private Chain
    • API Reference
      • dumpprivkey
      • getaccountstate
      • getassetstate
      • getbalance
      • getbestblockhash
      • getblock
      • getblock
      • getblockcount
      • getblockhash
      • getblocksysfee
      • getconnectioncount
      • getcontractstate
      • getnewaddress
      • getrawmempool
      • getrawtransaction
      • getstorage
      • gettxout
      • getpeers
      • getversion
      • invoke
      • invokefunction
      • invokescript
      • sendrawtransaction
      • sendtoaddress
      • sendmany
      • validateaddress
    • Network Protocol
    • Consensus
      • Consensus Whitepaper
      • Consensus Diagram
  • Smart Contract
    • Introduction
    • Getting Started (C#)
    • Getting Started (Java)
    • Getting Started (Python)
      • Using Prompt
      • Settings and Logging
      • Interacting with Smart Contracts
      • Tests
      • Python Compiler
    • Tutorial
      • Basics
      • Hello World
      • Lock Contract
      • Domain (Domain Name System)
      • Smart Contract Parameters and Return Values
      • Contract Authentication Tutorial
      • Deploying a Lock Contract
      • Contract Call
      • Deploying and Invoking
    • Test
    • Whitepaper
    • API Reference
      • NEO
      • System
    • Framework
      • .NET framework
        • NEO
          • Account
          • Asset
          • Block
          • Blockchain
          • Enrollment
          • Header
          • Storage
          • StorageContext
          • Transaction
          • TransactionAttribute
          • TransactionInput
          • TransactionOutput
        • System
          • ExecutionEngine
    • System Fees
  • Document for Exchange Developers
  • Contributors

Metodo invokefunction

Restituisce il risultato dopo la chiamata a uno smart contract in scripthash con le date operazioni e parametri.

[!Nota]

Questo metodo è per testare il tuo script della macchina virtuale (VM) come se fosse stato eseguito sulla blockchain in quel momento. Questa chiamata RPC, non ha in alcun modo effetto sulla blockchain.

Descrizione del parametro

scripthash: Smart contract scripthash

operation: Il nome dell'operazione (string)

params: I parametri da passare nell'operazione dello smart contract

Esempio

Corpo della richiesta:

{
  "jsonrpc": "2.0",
  "method": "invokefunction",
  "params": [
    "ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",
    "balanceOf",
    [
      {
        "type": "Hash160",
        "value": "bfc469dd56932409677278f6b7422f3e1f34481d"
      }
    ]
  ],
  "id": 3
}

Corpo della risposta:

{
    "jsonrpc": "2.0",
    "id": 3,
    "result": {
        "state": "HALT, BREAK",
        "gas_consumed": "0.338",
        "stack": [
            {
                "type": "ByteArray",
                "value": "00e1f505"
            }
        ]
    }
}
  • Improve this Doc
Back to top Copyright © 2014-2018 NEO