chore: split example into lib and script

This commit is contained in:
rvcas
2022-10-05 21:11:42 -04:00
committed by Lucas
parent 03d4a6f1e1
commit 6b79eb0961
2 changed files with 23 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
use sample/syntax.{append, Bool}
pub type Datum {
something: String,
}
pub type Redeemer {
Buy
Sell
}
pub fn validate(datum: Datum, rdmr: Redeemer, ctx: ScriptContext) -> Bool {
when rdmr is {
Buy -> True
Sell -> datum.something == "Aiken"
}
}