TransactionSEALED
▫*■╳╲█■▪%██○*%&$&▪~%▒╲◆^*▒&■●▓?╲◇&◇&╲▪*■%╲▓*◇$%╲◇░╳%!?&~╳~~○█╱╱@
Transaction ID
Execution Fee
0.00000849 FLOWScript Arguments
Copy:
0amountUFix64
1000.00000000
Cadence Script
1import FungibleToken from 0xf233dcee88fe0abe
2import BaitCoin from 0xed2202de80195438
3
4// Admin transaction to burn BAIT tokens from admin's own vault
5transaction(amount: UFix64) {
6
7 prepare(signer: auth(BorrowValue, Storage) &Account) {
8 log("Admin burning ".concat(amount.toString()).concat(" BAIT from own vault"))
9
10 // Verify the signer is the admin
11 assert(signer.address == 0xed2202de80195438, message: "Signer must be the admin")
12
13 // Borrow the admin resource from the signer's storage
14 let adminResource = signer.storage.borrow<&BaitCoin.Admin>(from: /storage/baitCoinAdmin)
15 ?? panic("Could not borrow admin resource. Admin must have the admin resource.")
16
17 // Get the admin's own BAIT vault to burn from
18 let adminVault = signer.storage.borrow<auth(FungibleToken.Withdraw) &BaitCoin.Vault>(from: /storage/baitCoinVault)
19 ?? panic("Could not borrow admin's BAIT vault. Admin must have a BAIT vault.")
20
21 // Withdraw tokens from admin's vault
22 let tokensToBurn <- adminVault.withdraw(amount: amount)
23
24 // Burn the tokens (destroy them and reduce total supply)
25 BaitCoin.burnTokens(amount: amount)
26 destroy tokensToBurn
27
28 log("Successfully burned ".concat(amount.toString()).concat(" BAIT from admin vault"))
29 }
30
31}