Interface
The smart contract is developed with the Archetype language.
Storage
The contract defines an admin address that only can call the add
and clear_expired
entry points:
variable admin : address = @tz1h4CiqWxNe4UxSpkwXy617RM6DaK6NU76P
The contract defines a collection of miles:
asset mile identified by id {
id : string;
amount : nat;
expiration : date
}
The contract defines a collection of owners and defines which owner owns which miles:
asset owner identified by addr {
addr : address;
miles : partition<mile> = []
}
Entry points
add
entry add (
ow : address,
newmile_id : string,
newmile_amount : nat,
newmile_expiration : date) {
called by admin
effect { ... }
}
consume
entry consume (quantity : nat) {
...
}
clear expired
entry clear_expired () {
called by admin
effect {
...
}
}