TransactionSEALED
~╱*&◆■▪█╳*◇▓□*◆!%~*%!▪○╲#╱□@○^╱◆▪◇#◇&$$#█@╲▒▒@#?▫●■!□□╲◆▫!░!&■▫?
Transaction ID
Execution Error
Error Code: 1007
error caused by: 1 error occurred:
Raw Error
[Error Code: 1007] error caused by: 1 error occurred: * checking sequence number failed: [Error Code: 1007] invalid proposal key: public key 28 on account 82ed1b9cba5bb1b3 has sequence number 20336, but given 20335
Transaction Summary
TransactionScript Arguments
0amountUFix64
1.00000000
1nameString
2artistString
3artistAddressAddress
4descriptionString
5royaltyUFix64
0.00000000
6typeIDString
Cadence Script
1/// transactions/mint_v2.cdc
2
3import FungibleToken from 0xf233dcee88fe0abe
4import FungibleTokenMetadataViews from 0xf233dcee88fe0abe
5import NonFungibleToken from 0x1d7e57aa55817448
6import MetadataViews from 0x1d7e57aa55817448
7
8import JOSHIN from 0x82ed1b9cba5bb1b3
9
10
11
12
13transaction(
14 amount: UFix64,
15 name: String,
16 artist: String,
17 artistAddress: Address,
18 description: String,
19 royalty: UFix64,
20 typeID: String
21) {
22
23 /// Reference to the Token Minter Resource object
24 let tokenAdmin: &JOSHIN.Administrator
25 let tokenReceiver: &{FungibleToken.Receiver}
26
27
28 prepare(
29 minter: auth(BorrowValue) &Account,
30 receiver: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, SaveValue, UnpublishCapability) &Account
31 ) {
32
33 let vaultData = JOSHIN.resolveContractView(resourceType: nil, viewType: Type<FungibleTokenMetadataViews.FTVaultData>()) as! FungibleTokenMetadataViews.FTVaultData?
34 ?? panic("ViewResolver does not resolve FTVaultData view")
35
36 // enable receiver token
37 if receiver.storage.borrow<&JOSHIN.Vault>(from: vaultData.storagePath) == nil {
38 let vault <- JOSHIN.createEmptyVault(vaultType: Type<@JOSHIN.Vault>())
39
40 // Create a new JOSHIN Vault and put it in storage
41 receiver.storage.save(<-vault, to: vaultData.storagePath)
42
43 // Create a public capability to the Vault that exposes the Vault interfaces
44 let vaultCap = receiver.capabilities.storage.issue<&JOSHIN.Vault>(vaultData.storagePath)
45 receiver.capabilities.publish(vaultCap, at: vaultData.metadataPath)
46
47 // Create a public Capability to the Vault's Receiver functionality
48 let receiverCap = receiver.capabilities.storage.issue<&JOSHIN.Vault>(vaultData.storagePath)
49 receiver.capabilities.publish(receiverCap, at: vaultData.receiverPath)
50 }
51
52 self.tokenAdmin = minter.storage.borrow<&JOSHIN.Administrator>(from: JOSHIN.AdminStoragePath)
53 ?? panic("Signer is not the token admin")
54
55 self.tokenReceiver = getAccount(receiver.address).capabilities.borrow<&{FungibleToken.Receiver}>(vaultData.receiverPath)
56 ?? panic("Could not borrow receiver reference to the Vault")
57
58
59 }
60
61 execute {
62 if amount > UFix64(0) {
63 // Create mint tokens
64 let tokenMinter <- self.tokenAdmin.createNewMinter()
65
66 let mintedVault <- tokenMinter.mintTokens(amount: amount)
67
68 // Deposit them to the receiever
69 self.tokenReceiver.deposit(from: <-mintedVault)
70
71 destroy tokenMinter
72 }
73
74 }
75}