BlockchainTransaction (for Ethereum)
$BlockchainBase = "Ethereum"
BlockchainTransaction[assoc]
represents an Ethereum blockchain transaction built from the components in the association assoc.
Details
- Gives a symbolic representation of an Ethereum blockchain transaction; it does not submit the transaction, and the transaction is not signed.
- BlockchainTransaction[…][prop] gives the value of the property prop for the transaction.
- The following elements must be given:
-
"TransactionCount" number of transactions associated with the account "GasPrice" price per gas unit in wei - Additionally, the "GasLimit" element can be given. By default, it is computed internally:
-
"GasLimit" maximum amount of gas for execution - When doing a transfer, the following elements must be given:
-
"Address" address to send the transfer "Amount" amount of wei to transfer - When deploying a contract, the following element must be given:
-
"Contract" contract to deploy in the transaction - When using plain Solidity code, the contract must be a string containing the code, as in "Contract""code".
- When using plain Solidity code with multiple contracts, "Contract" must be specified as an association <"SourceCode""code","Main""name" >, where "Main" is the name of the contract to be deployed.
- When providing a file containing Solidity code, the contract must be a File, as in "Contract"->File[…].
- When providing a file containing Solidity code with multiple contracts, "Contract" must be specified as an association <"Source"File[…],"Main""name" >, where "Main" is the name of the contract to be deployed.
- When providing multiple files containing Solidity code, "Contract" must be specified as an association <"Source"{file1,file2,…},"Main""name" >, where {file1,file2,…} is a list of File expressions from which file1 will be compiled, and "Main" is the name of the contract to be deployed.
- When using compiled Solidity code, "Contract" must be specified as an association of the form <"ByteCode""hexstring","ABI""spec" >, where "ABI" is the Application Binary Interface.
- Additionally, when providing an association for "Contract", an extra "Parameters" property can be given to define the initialization parameters of the contract to be deployed.
- When deploying an automatically executed Wolfram Language expression in an Ethereum transaction, the following elements can be given:
-
"WolframExpression" a expression to evaluate when harvested "WolframExpressionReference" a reference to an expression to be retrieved and evaluated - Ethereum transactions containing Wolfram Language expressions can only be deployed to the Ethereum testnet.
- When calling a contract, the following elements must be given:
-
"Address" address of the contract "FunctionCall" function call to make in the contract - The "FunctionCall" element can be an Association or a Typed expression.
- In case "FunctionCall" is a Typed expression, it must define the function name.
- In case "FunctionCall" is an Association expression, the following property must be given:
-
"Function" Typed expression defining the function to call - The following additional properties can also be given to the "FunctionCall" association:
-
"Inputs" input parameters of the function to call "Sender" address of the sender that is calling the contract - The following additional properties can also be requested from a BlockchainTransaction object:
-
"Signed" whether the transaction has been digitally signed "MessageHash" hash of the unsigned transaction "RawTransaction" serialized transaction "TransactionID" transaction ID - BlockchainTransaction can represent Ethereum mainnet (default) and testnet (Sepolia) transactions. To specify these networks, use the "BlockchainBase" value inside the required association or the BlockchainBase option.
Examples
open allclose allBasic Examples (2)
Scope (7)
Plain-Text Solidity Contract (2)
Solidity Contract File (1)
Compiled Solidity Contract (1)
Wolfram Language Expression (2)
Options (2)
Applications (1)
Create an Ethereum BlockchainTransaction:
Wolfram Research (2019), BlockchainTransaction, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Ethereum.html.
Text
Wolfram Research (2019), BlockchainTransaction, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Ethereum.html.
CMS
Wolfram Language. 2019. "BlockchainTransaction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Ethereum.html.
APA
Wolfram Language. (2019). BlockchainTransaction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Ethereum.html