Skip to content

Commit

Permalink
Clean up warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantumplation committed Dec 5, 2023
1 parent ca701fa commit 218f679
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions validators/settings.ak
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use aiken/list
use aiken/transaction.{InlineDatum, Spend, Mint, ScriptContext, OutputReference}
use aiken/transaction/credential.{ScriptCredential}
use aiken/transaction/value
use sundae/multisig
use types/settings.{SettingsDatum, SettingsMintRedeemer, SettingsRedeemer, SettingsAdminUpdate, TreasuryAdminUpdate, settings_nft_name}
Expand All @@ -11,19 +10,14 @@ validator(protocol_boot_utxo: OutputReference) {
expect Some(own_input) = ctx.transaction.inputs
|> transaction.find_input(own_utxo_ref)
let own_address = own_input.output.address
expect ScriptCredential(own_script_hash) = own_address.payment_credential
// Assume the first output is the settings output
// This is safe because we check that the value is unchanged, so if the outputs
// are in a different order, that check will fail
expect Some(own_output) = list.head(ctx.transaction.outputs)
expect own_output.address == own_address
expect InlineDatum(output_datum) = own_output.datum
expect output_datum: SettingsDatum = output_datum

let token_present_in_output =
value.quantity_of(
own_output.value,
own_script_hash,
settings_nft_name) == 1

let value_not_changed =
own_output.value == own_input.output.value

Expand Down

0 comments on commit 218f679

Please sign in to comment.