/ test / contracts / sophia_2 / events.aes
events.aes
 1  contract Events =
 2    type alias_int = int
 3    type alias_address = address
 4    type alias_string = string
 5  
 6    datatype event =
 7        Event1(indexed alias_int, indexed int, string)
 8      | Event2(alias_string, indexed alias_address)
 9      // | BadEvent1(indexed string, string)
10      // | BadEvent2(indexed int, int)
11  
12    function f1(x : int, y : string) =
13      Chain.event(Event1(x, x+1, y))
14  
15    function f2(s : string) =
16      Chain.event(Event2(s, Call.caller))
17  
18    function f3(x : int) =
19      Chain.event(Event1(x, x + 2, Int.to_str(x + 7)))
20