checkpoint

This commit is contained in:
Kasey White
2022-11-27 22:10:17 -05:00
committed by Lucas
parent 86ea41adc3
commit 3fb3a3240a
3 changed files with 267 additions and 55 deletions

View File

@@ -44,13 +44,15 @@ pub fn who(a: ByteArray) -> ByteArray {
}
pub type Datum {
thing: Int,
stuff: Int,
Offer { price: Int, asset_class: ByteArray }
Sell
Hold(Int)
}
pub fn spend(datum: Datum, _rdmr: Nil, _ctx: Nil) -> Bool {
when datum.thing is {
0 -> True
_ -> False
when datum is {
Offer { price, .. } -> price > 0
Hold(less) -> less < 0
Sell -> False
}
}