feat: compile deps
This commit is contained in:
1
examples/sample/assets/swap/spend/mainnet.addr
Normal file
1
examples/sample/assets/swap/spend/mainnet.addr
Normal file
@@ -0,0 +1 @@
|
||||
addr1w9ke4flw57jhv5tjefm8xwkfdc56et559npkcycd6u9ascc07drtu
|
||||
@@ -1 +0,0 @@
|
||||
addr1wyqlmv9mg7cc5gcrhkxsnund3640hrfmj7ynxpcpc5kux2c6u6ewl
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "PlutusScriptV2",
|
||||
"description": "Generated by Aiken",
|
||||
"cborHex": "5854585201000022253335734646466e3cdd7198009801002a40006eb8cc004c008011200022323330010014800000c888cccd5cd19b870040025742466600800866e0000d20023574400200246aae78dd50008a4c2d"
|
||||
"cborHex": "58c058be0100002225333573464646464a666ae68008400452819191919800801919b8f001375c6600c600e01490001800800911192999aab9f00114a026464a666ae68c01000852889998030030008021aba2002375c6ae84004008dd619801180199801180180224000900819b97323001375c66004600600a900011b9900149010d48656c6c6f2c20576f726c64210022323330010014800000c888cccd5cd19b870040025742466600800866e0000d20023574400200246aae78dd50008a4c2d"
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
(program
|
||||
1.0.0
|
||||
(lam
|
||||
datum
|
||||
(lam
|
||||
rdmr
|
||||
(lam
|
||||
_
|
||||
(force
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
(lam
|
||||
__constr_fields_exposer
|
||||
[
|
||||
(lam
|
||||
__constr_get_field
|
||||
[
|
||||
(lam
|
||||
x
|
||||
[
|
||||
[
|
||||
(builtin equalsByteString)
|
||||
[
|
||||
(builtin unBData)
|
||||
[
|
||||
[
|
||||
__constr_get_field
|
||||
[ __constr_fields_exposer datum ]
|
||||
]
|
||||
(con integer 0)
|
||||
]
|
||||
]
|
||||
]
|
||||
[
|
||||
(builtin unBData)
|
||||
[
|
||||
[
|
||||
__constr_get_field
|
||||
[ __constr_fields_exposer rdmr ]
|
||||
]
|
||||
(con integer 0)
|
||||
]
|
||||
]
|
||||
]
|
||||
)
|
||||
[
|
||||
[
|
||||
(builtin mkCons)
|
||||
[ (builtin bData) (con bytestring #f4) ]
|
||||
]
|
||||
[
|
||||
[ (builtin mkCons) rdmr ]
|
||||
[ [ (builtin mkCons) datum ] (con listdata []) ]
|
||||
]
|
||||
]
|
||||
]
|
||||
)
|
||||
(lam
|
||||
__constr_list
|
||||
(lam
|
||||
__arg_number
|
||||
[
|
||||
(lam
|
||||
__recurse
|
||||
[
|
||||
[ [ __recurse __recurse ] (con integer 0) ]
|
||||
__constr_list
|
||||
]
|
||||
)
|
||||
(lam
|
||||
__self_recursor
|
||||
(lam
|
||||
__current_arg_number
|
||||
(lam
|
||||
__list_of_constr_args
|
||||
[
|
||||
[
|
||||
[
|
||||
[
|
||||
(force (builtin ifThenElse))
|
||||
[
|
||||
[
|
||||
(builtin equalsInteger)
|
||||
__arg_number
|
||||
]
|
||||
__current_arg_number
|
||||
]
|
||||
]
|
||||
(force (builtin headList))
|
||||
]
|
||||
(lam
|
||||
__current_list_of_constr_args
|
||||
[
|
||||
[
|
||||
[ __self_recursor __self_recursor ]
|
||||
[
|
||||
[
|
||||
(builtin addInteger)
|
||||
__current_arg_number
|
||||
]
|
||||
(con integer 1)
|
||||
]
|
||||
]
|
||||
[
|
||||
(force (builtin tailList))
|
||||
__current_list_of_constr_args
|
||||
]
|
||||
]
|
||||
)
|
||||
]
|
||||
__list_of_constr_args
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
(lam
|
||||
__constr_var
|
||||
[
|
||||
(force (force (builtin sndPair)))
|
||||
[ (builtin unConstrData) __constr_var ]
|
||||
]
|
||||
)
|
||||
]
|
||||
]
|
||||
(delay (con unit ()))
|
||||
]
|
||||
(delay (error ))
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1
examples/sample/assets/swap/spend/script.cbor
Normal file
1
examples/sample/assets/swap/spend/script.cbor
Normal file
@@ -0,0 +1 @@
|
||||
58be0100002225333573464646464a666ae68008400452819191919800801919b8f001375c6600c600e01490001800800911192999aab9f00114a026464a666ae68c01000852889998030030008021aba2002375c6ae84004008dd619801180199801180180224000900819b97323001375c66004600600a900011b9900149010d48656c6c6f2c20576f726c64210022323330010014800000c888cccd5cd19b870040025742466600800866e0000d20023574400200246aae78dd50008a4c2d
|
||||
@@ -1 +0,0 @@
|
||||
585201000022253335734646466e3cdd7198009801002a40006eb8cc004c008011200022323330010014800000c888cccd5cd19b870040025742466600800866e0000d20023574400200246aae78dd50008a4c2d
|
||||
1
examples/sample/assets/swap/spend/testnet.addr
Normal file
1
examples/sample/assets/swap/spend/testnet.addr
Normal file
@@ -0,0 +1 @@
|
||||
addr_test1wpke4flw57jhv5tjefm8xwkfdc56et559npkcycd6u9ascc5kelye
|
||||
@@ -1 +0,0 @@
|
||||
addr_test1wqqlmv9mg7cc5gcrhkxsnund3640hrfmj7ynxpcpc5kux2cp5w9p6
|
||||
@@ -1,18 +1,24 @@
|
||||
use sample
|
||||
|
||||
// Stuff
|
||||
|
||||
/// Spend validator
|
||||
pub fn spend(datum: sample.Datum, rdmr: sample.Redeemer, _ctx: Nil) -> Bool {
|
||||
let x = #(datum, rdmr, #[244])
|
||||
|
||||
let y = [#(#[222], #[222]), #(#[233], #[52])]
|
||||
|
||||
let [z, f, ..g] = y
|
||||
|
||||
let #(a, b, _) = x
|
||||
|
||||
z == #(#[222], #[222])
|
||||
use aiken/list
|
||||
use aiken/string
|
||||
use aiken/hash.{Blake2b_224, Hash}
|
||||
use aiken/transaction.{ScriptContext}
|
||||
use aiken/transaction/credential.{VerificationKey}
|
||||
|
||||
pub type Datum {
|
||||
owner: Hash<Blake2b_224, VerificationKey>,
|
||||
}
|
||||
|
||||
pub type Redeemer {
|
||||
msg: ByteArray,
|
||||
}
|
||||
|
||||
pub fn spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool {
|
||||
let must_say_hello = string.from_bytearray(redeemer.msg) == "Hello, World!"
|
||||
let must_be_signed =
|
||||
context.transaction.extra_signatories
|
||||
|> list.any(fn(vk) { vk == datum.owner })
|
||||
|
||||
must_say_hello && must_be_signed
|
||||
}
|
||||
|
||||
test foo() {
|
||||
|
||||
Reference in New Issue
Block a user