26 lines
699 B
Plaintext
26 lines
699 B
Plaintext
contract Events =
|
|
type alias_int = int
|
|
type alias_address = address
|
|
type alias_string = string
|
|
|
|
datatype event =
|
|
Event1(indexed alias_int, indexed int, string)
|
|
| Event2(alias_string, indexed alias_address)
|
|
| BadEvent1(indexed string, string)
|
|
| BadEvent2(indexed int, int)
|
|
| BadEvent3(indexed alias_string, string)
|
|
| BadEvent4(indexed int, alias_address)
|
|
|
|
function f1(x : int, y : string) =
|
|
Chain.event(Event1(x, x+1, y))
|
|
|
|
function f2(s : string) =
|
|
Chain.event(Event2(s, Call.caller))
|
|
|
|
function f3(x : int) =
|
|
Chain.event(Event1(x, x + 2, Int.to_str(x + 7)))
|
|
|
|
function i2s(i : int) = Int.to_str(i)
|
|
function a2s(a : address) = Address.to_str(a)
|
|
|