aeso_aci
Module
aeso_aci
Description
contract Answers =
record state = { a : answers }
type answers() = map(string, int)
stateful function init() = { a = {} }
private function the_answer() = 42
function new_answer(q : string, a : int) : answers() = { [q] = a }{
"contract": {
"functions": [
{
"arguments": [],
"name": "init",
"returns": "Answers.state",
"stateful": true
},
{
"arguments": [
{
"name": "q",
"type": "string"
},
{
"name": "a",
"type": "int"
}
],
"name": "new_answer",
"returns": {
"map": [
"string",
"int"
]
},
"stateful": false
}
],
"name": "Answers",
"state": {
"record": [
{
"name": "a",
"type": "Answers.answers"
}
]
},
"typedefs": [
{
"name": "answers",
"typedef": {
"map": [
"string",
"int"
]
},
"vars": []
}
]
}
}Types
Exports
contract_interface(aci_type(), string()) -> {ok, json() | string()} | {error, term()}
render_aci_json(json() | json_text()) -> string().
Example run
Last updated
Was this helpful?