I'm trying to write a smart contract in CameLIGO that looks like this
parameters
"Hello world"
storage
[{ text = "Blob"; voters = ["tz1TKc3zQBMv7Rez77sX4JNdqMvG33LQrURk"]}]
with the following code
type voters = address list option
type item = {
text : string;
voters : voters
}
type items_storage = item list
let add_item (new_text, items_storage : string * items_storage) : items_storage =
let new_item : item = {
text = new_text;
voters = (* Cannot get to initialize to an empty list *)
}
in
new_item :: items_storage
let main (p, s : string * items_storage) : operation list * items_storage =
(([] : operation list), add_item(p, s))
I don't know how to initialize an empty list.