-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTransactionOutputs.cs
32 lines (28 loc) · 1.1 KB
/
TransactionOutputs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;
using Neo.SmartContract.Framework.Services.System;
using System;
using System.Numerics;
namespace TransactionOutputs
{
public class TestContract : Neo.SmartContract.Framework.SmartContract
{
public static void Main()
{
// The outputs of the transaction.
Transaction tx = (Transaction)ExecutionEngine.ScriptContainer;
TransactionOutput[] outputs = tx.GetOutputs();
// Loops though all the outputs of the transaction
// Includes assets being sent, and also unspent assets back to sender
foreach (TransactionOutput output in outputs)
{
// The asset being sent
byte[] output_asset = output.AssetId;
// The Address where the asset is being sent to
byte[] output_script_hash = output.ScriptHash;
// How much of the asset is being sent
long output_value = output.Value;
}
}
}
}