BlockchainContractValue

BlockchainContractValue[caddr]

gets the result obtained from a Wolfram expression contract at blockchain address caddr.

BlockchainContractValue[caddr,prop]

gets the property prop of the result obtained from a Wolfram expression contract with address caddr.

BlockchainContractValue[caddr,func]

calls the function func of a contract with address caddr.

BlockchainContractValue[caddr,assoc]

calls a contract with address caddr with the properties defined in Association assoc.

Details and Options

  • BlockchainContractValue has option BlockchainBase with default value $BlockchainBase.
  • BlockchainContractValue extracts a contract from a blockchain, then runs the specified function in it. It cannot write data to a blockchain; this requires BlockchainTransactionSubmit.
  • BlockchainContractValue[caddr] returns an Association <|"Result"result,"Evaluated"evaluated|>, with the following properties:
  • "Result"output of the evaluation of a Wolfram expression contract
    "Evaluated"specifies whether a contract has been evaluated
  • BlockchainContractValue[caddr, func] calls a non-Wolfram expression contract where func must be a Typed expression defining the name of the function and the output data type.
  • BlockchainContractValue[caddr, assoc] calls a non-Wolfram expression contract with additional parameters where association assoc must have the following property:
  • "Function"Typed expression defining the function to call
  • Additionally, the association assoc can also have the following properties:
  • "Inputs"input parameters of the function to call
    "Sender"address of the sender that is calling the contract
  • If a particular function does not successfully evaluate in the contract at a given address, BlockchainContractValue returns Missing["NoResult"].

Examples

Basic Examples  (3)

Verify the total supply of OmiseGo tokens using its address:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Check the balance of OMG tokens of a certain holder:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Check the auction of CryptoKitty with Token ID 883551:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2019
(12.0)