Skip to content

Commit e7fba82

Browse files
committed
use some pubkey by default
1 parent 1b94827 commit e7fba82

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

kmir/src/kmir/kdist/mir-semantics/symbolic/spl-token.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,14 @@ module KMIR-SPL-TOKEN
313313
ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplMintKey:List)))) // Account.mint: Pubkey
314314
ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplTokenOwnerKey:List)))) // Account.owner: Pubkey
315315
ListItem(Integer(?SplAmount:Int, 64, false)) // Account.amount: u64
316-
ListItem(Aggregate(variantIdx(0), .List)) // COption<Pubkey> default None
316+
// Model COption<Pubkey> as Some(pubkey); None is not represented here.
317+
ListItem(Aggregate(variantIdx(1), ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplDelegateKey:List))))))
317318
ListItem(Integer(?SplAccountState:Int, 8, false)) // Account.state: AccountState (repr u8)
318-
ListItem(Aggregate(variantIdx(0), .List)) // COption<u64> default None
319+
// Model COption<u64> as Some(amount); None is not represented here.
320+
ListItem(Aggregate(variantIdx(1), ListItem(Integer(?SplIsNativeLamports:Int, 64, false))))
319321
ListItem(Integer(?SplDelegatedAmount:Int, 64, false)) // Account.delegated_amount: u64
320-
ListItem(Aggregate(variantIdx(0), .List)) // COption<Pubkey> default None
322+
// Model COption<Pubkey> as Some(pubkey); None is not represented here.
323+
ListItem(Aggregate(variantIdx(1), ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplCloseAuthKey:List))))))
321324
)
322325
)
323326
)
@@ -343,9 +346,9 @@ module KMIR-SPL-TOKEN
343346
andBool 0 <=Int ?SplAmount andBool ?SplAmount <Int (1 <<Int 64)
344347
andBool 0 <=Int ?SplAccountState andBool ?SplAccountState <Int 256
345348
andBool 0 <=Int ?SplDelegatedAmount andBool ?SplDelegatedAmount <Int (1 <<Int 64)
346-
andBool #isSplCOptionPubkey(Aggregate(variantIdx(0), .List))
347-
andBool #isSplCOptionPubkey(Aggregate(variantIdx(0), .List))
348-
andBool #isSplCOptionU64(Aggregate(variantIdx(0), .List))
349+
andBool #isSplPubkey(?SplDelegateKey)
350+
andBool #isSplPubkey(?SplCloseAuthKey)
351+
andBool 0 <=Int ?SplIsNativeLamports andBool ?SplIsNativeLamports <Int (1 <<Int 64)
349352
[priority(30), preserves-definedness]
350353
351354
rule [cheatcode-is-spl-mint]:
@@ -381,11 +384,13 @@ module KMIR-SPL-TOKEN
381384
),
382385
SPLDataBuffer(
383386
Aggregate(variantIdx(0),
384-
ListItem(Aggregate(variantIdx(0), .List))
387+
// Model COption<Pubkey> as Some(pubkey); None is not represented here.
388+
ListItem(Aggregate(variantIdx(1), ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplMintAuthorityKey:List))))))
385389
ListItem(Integer(?SplMintSupply:Int, 64, false))
386390
ListItem(Integer(?SplMintDecimals:Int, 8, false))
387391
ListItem(BoolVal(false))
388-
ListItem(Aggregate(variantIdx(0), .List))
392+
// Model COption<Pubkey> as Some(pubkey); None is not represented here.
393+
ListItem(Aggregate(variantIdx(1), ListItem(Aggregate(variantIdx(0), ListItem(Range(?SplMintFreezeAuthorityKey:List))))))
389394
)
390395
)
391396
)
@@ -406,10 +411,10 @@ module KMIR-SPL-TOKEN
406411
andBool #isSplPubkey(?SplMintOwnerKey)
407412
andBool 0 <=Int ?SplMintLamports andBool ?SplMintLamports <Int 18446744073709551616
408413
andBool 0 <=Int ?SplMintRentEpoch andBool ?SplMintRentEpoch <Int 18446744073709551616
409-
andBool #isSplCOptionPubkey(Aggregate(variantIdx(0), .List))
414+
andBool #isSplPubkey(?SplMintAuthorityKey)
410415
andBool 0 <=Int ?SplMintSupply andBool ?SplMintSupply <Int (1 <<Int 64)
411416
andBool 0 <=Int ?SplMintDecimals andBool ?SplMintDecimals <Int 256
412-
andBool #isSplCOptionPubkey(Aggregate(variantIdx(0), .List))
417+
andBool #isSplPubkey(?SplMintFreezeAuthorityKey)
413418
[priority(30), preserves-definedness]
414419
415420
rule [cheatcode-is-spl-rent]:

0 commit comments

Comments
 (0)