forked from mwherman2000/csharp-smart-contract-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab2_logandnotify.cs
38 lines (30 loc) · 1.11 KB
/
lab2_logandnotify.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
33
34
35
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;
namespace lab2_logandnotify
{
public class lab2_logandnotify : SmartContract
{
public static void Main()
{
// `Log()` is best to add simple strings to the NEO event log for development purposes
Runtime.Log("log 1");
Runtime.Log("log 2");
Runtime.Notify("notify 3");
// `Notify()` is best for adding variables such as lists and objects to the NEO event log
int ten = 10;
Runtime.Notify("ten", ten);
object[] results = { "a", 1, 2, "3" };
Runtime.Notify("results", results);
User e1 = new User { FirstName = "Able", LastName = "Baker" };
Runtime.Notify("e1", e1);
User e2 = new User { FirstName = "Charlie", LastName = "Delta" };
User[] userEntities = { e1, e2 };
Runtime.Notify("userEntities", userEntities);
}
public class User
{
public string FirstName;
public string LastName;
}
}
}