Skip to content

Commit

Permalink
start on spend from account action
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Dec 23, 2023
1 parent b2ed4e2 commit 9b0c7a9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion validators/account.ak
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ type Intention {
condition: IntentionCondition,
value_leaving: List<(PolicyId, AssetName, Int)>,
nonce: OutputReference,
/// User to track ordering number. Useful for dexes to ensure
/// your order is applied in a specific order
order: Int,
}

type DataEnvelope {
Expand Down Expand Up @@ -194,6 +197,22 @@ validator {
expect rdr: ValidateRedeemer = rdr

when rdr is {
SpendFromAccount(data_envelopes) -> {
let split_intentions =
fn(ref_input: Input, acc) {
let Input { output: Output { address, value, datum, .. }, .. } =
ref_input

if address.payment_credential == pc {
todo
} else {
acc
}
}

todo
}

OwnerSpend(control_index) ->
validate_account_spend(
control_index,
Expand All @@ -204,7 +223,8 @@ validator {
NonceState,
)

SpendFromAccount(data_envelope) -> todo
// This allows for the account to support vaults of unspendable assets
// and only the VaultSpend action can move these assets
VaultSpend(control_index) ->
validate_account_spend(
control_index,
Expand Down

0 comments on commit 9b0c7a9

Please sign in to comment.