-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTransaction3.cdc
More file actions
24 lines (17 loc) · 787 Bytes
/
Transaction3.cdc
File metadata and controls
24 lines (17 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Transaction3.cdc
import ExampleNFT from 0x7303e5fa678041e4
// This transaction configures a user's account
// to use the NFT contract by creating a new empty collection,
// storing it in their account storage, and publishing a capability
transaction {
prepare(acct: AuthAccount) {
// Create a new empty collection
let collection <- ExampleNFT.createEmptyCollection()
// store the empty NFT Collection in account storage
acct.save<@ExampleNFT.Collection>(<-collection, to: /storage/NFTCollection)
log("Collection created for account 1")
// create a public capability for the Collection
acct.link<&{ExampleNFT.NFTReceiver}>(/public/NFTReceiver, target: /storage/NFTCollection)
log("Capability created")
}
}