Examples
The following examples demonstrate how to use the ScriptBuilder class to create various transaction scripts for the Phantasma blockchain.
Example 1: Transfer Tokens
Example 2: Transfer NFT
Example 3: Call Smart Contract
Example 4: Call NFT Contract
These examples show how to create transaction scripts using the ScriptBuilder class and its methods. Each script begins with the AllowGas method to allocate gas for the transaction, followed by the specific operation to be executed, and ends with the SpendGas method to pay for the gas used during the execution. Finally, the EndScript()
method is called to generate the byte array representation of the transaction script.
Last updated