TransactionSEALED
▓▫■▪@~▫^%■◆□#◆▫●░$○▒$◇○!▒▓░□#*╲▒%╳*▒~▫$░▒^█#○▒◆@░&╱█╳╱!?◇◆▫@^◆●▒
Transaction ID
Execution Error
Error Code: 1007
checking sequence number failed: [Error Code: 1007] invalid proposal key: public key 2 on account 82ed1b9cba5bb1b3 has sequence number 594780, but given 594779
Raw Error
[Error Code: 1007] error caused by: 1 error occurred: * checking sequence number failed: [Error Code: 1007] invalid proposal key: public key 2 on account 82ed1b9cba5bb1b3 has sequence number 594780, but given 594779
Transaction Summary
Transaction
Script Arguments
Copy:
0amountUFix64
50.00000000
1nameString
オルビスザ クレンジングオイル
2artistString
AIICO
3artistAddressAddress
4descriptionString
5royaltyUFix64
0.00000000
6typeIDString
PsSAaWOSEN1IoLMNyvWd
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 AIICOSMPLG from 0x82ed1b9cba5bb1b3
9
10import KARAT1N5PFSBT from 0x82ed1b9cba5bb1b3
11
12
13
14transaction(
15 amount: UFix64,
16 name: String,
17 artist: String,
18 artistAddress: Address,
19 description: String,
20 royalty: UFix64,
21 typeID: String
22) {
23
24 /// Reference to the Token Minter Resource object
25 let tokenAdmin: &AIICOSMPLG.Administrator
26 let tokenReceiver: &{FungibleToken.Receiver}
27
28 let nftMinter: &KARAT1N5PFSBT.NFTMinter
29 let receiverRecipientCollectionRef: &{NonFungibleToken.Receiver}
30
31 prepare(
32 minter: auth(BorrowValue) &Account,
33 receiver: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, SaveValue, UnpublishCapability) &Account
34 ) {
35
36 let vaultData = AIICOSMPLG.resolveContractView(resourceType: nil, viewType: Type<FungibleTokenMetadataViews.FTVaultData>()) as! FungibleTokenMetadataViews.FTVaultData?
37 ?? panic("ViewResolver does not resolve FTVaultData view")
38
39 // enable receiver token
40 if receiver.storage.borrow<&AIICOSMPLG.Vault>(from: vaultData.storagePath) == nil {
41 let vault <- AIICOSMPLG.createEmptyVault(vaultType: Type<@AIICOSMPLG.Vault>())
42
43 // Create a new AIICOSMPLG Vault and put it in storage
44 receiver.storage.save(<-vault, to: vaultData.storagePath)
45
46 // Create a public capability to the Vault that exposes the Vault interfaces
47 let vaultCap = receiver.capabilities.storage.issue<&AIICOSMPLG.Vault>(vaultData.storagePath)
48 receiver.capabilities.publish(vaultCap, at: vaultData.metadataPath)
49
50 // Create a public Capability to the Vault's Receiver functionality
51 let receiverCap = receiver.capabilities.storage.issue<&AIICOSMPLG.Vault>(vaultData.storagePath)
52 receiver.capabilities.publish(receiverCap, at: vaultData.receiverPath)
53 }
54
55 self.tokenAdmin = minter.storage.borrow<&AIICOSMPLG.Administrator>(from: AIICOSMPLG.AdminStoragePath)
56 ?? panic("Signer is not the token admin")
57
58 self.tokenReceiver = getAccount(receiver.address).capabilities.borrow<&{FungibleToken.Receiver}>(vaultData.receiverPath)
59 ?? panic("Could not borrow receiver reference to the Vault")
60
61
62 let collectionData = KARAT1N5PFSBT.resolveContractView(resourceType: nil, viewType: Type<MetadataViews.NFTCollectionData>()) as! MetadataViews.NFTCollectionData?
63 ?? panic("ViewResolver does not resolve NFTCollectionData view")
64
65 // enable account collection
66 if receiver.storage.borrow<&KARAT1N5PFSBT.Collection>(from: collectionData.storagePath) == nil {
67 // Create a new empty collection
68 let collection <- KARAT1N5PFSBT.createEmptyCollection(nftType: Type<@KARAT1N5PFSBT.NFT>())
69
70 // save it to the account
71 receiver.storage.save(<-collection, to: collectionData.storagePath)
72
73 // create a public capability for the collection
74 receiver.capabilities.unpublish(collectionData.publicPath)
75 let collectionCap = receiver.capabilities.storage.issue<&KARAT1N5PFSBT.Collection>(collectionData.storagePath)
76 receiver.capabilities.publish(collectionCap, at: collectionData.publicPath)
77 }
78
79 // Borrow the recipient's public NFT collection reference
80 self.receiverRecipientCollectionRef = getAccount(receiver.address).capabilities.borrow<&{NonFungibleToken.Receiver}>(collectionData.publicPath)
81 ?? panic("Could not get receiver reference to the receiver's NFT Collection")
82
83 // borrow a reference to the NFTMinter resource in storage
84 self.nftMinter = minter.storage.borrow<&KARAT1N5PFSBT.NFTMinter>(from: KARAT1N5PFSBT.AdminStoragePath)
85 ?? panic("Account does not store an object at the specified path")
86 }
87
88 execute {
89 if amount > UFix64(0) {
90 // Create mint tokens
91 let tokenMinter <- self.tokenAdmin.createNewMinter()
92
93 let mintedVault <- tokenMinter.mintTokens(amount: amount)
94
95 // Deposit them to the receiever
96 self.tokenReceiver.deposit(from: <-mintedVault)
97
98 destroy tokenMinter
99 }
100
101 if typeID != "" {
102 let metadata=KARAT1N5PFSBT.Metadata(name: name, artist: artist, artistAddress: artistAddress, description: description, type: typeID, serialId: 1, royalty: royalty)
103 // Mint the NFT and deposit it to the recipient's collection
104 self.nftMinter.mintNFT(recipient: self.receiverRecipientCollectionRef, metadata: metadata)
105 }
106 }
107}