-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0a29d9
commit a68c4d5
Showing
8 changed files
with
95 additions
and
92 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
export const getTotalSupply = | ||
// REPLACE THIS WITH YOUR CONTRACT NAME + ADDRESS | ||
` | ||
import BuildspaceNFT from 0xb25c3b0e6ed6d79a; | ||
import BottomShot from 0x7b6adb682517f137; | ||
pub fun main(): UInt64 { | ||
return BuildspaceNFT.totalSupply; | ||
return BottomShot.totalSupply; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
import NonFungibleToken from 0x631e88ae7f1d7c20; | ||
import MetadataViews from 0x631e88ae7f1d7c20; | ||
import BuildspaceNFT from 0xb25c3b0e6ed6d79a; | ||
// REPLACE THIS WITH YOUR CONTRACT NAME + ADDRESS | ||
import BottomShot from 0x7b6adb682517f137 | ||
// This remains the same | ||
import NonFungibleToken from 0x631e88ae7f1d7c20 | ||
|
||
transaction( | ||
recipient: Address, | ||
name: String, | ||
description: String, | ||
thumbnail: String, | ||
recipient: Address, | ||
name: String, | ||
description: String, | ||
thumbnail: String, | ||
) { | ||
|
||
prepare(signer: AuthAccount) { | ||
if signer.borrow<&BuildspaceNFT.Collection>(from: BuildspaceNFT.CollectionStoragePath) != nil { | ||
return | ||
} | ||
|
||
// Create a new empty collection | ||
let collection <- BuildspaceNFT.createEmptyCollection() | ||
|
||
// save it to the account | ||
signer.save(<-collection, to: BuildspaceNFT.CollectionStoragePath) | ||
|
||
// create a public capability for the collection | ||
signer.link<&{NonFungibleToken.CollectionPublic, MetadataViews.ResolverCollection}>( | ||
BuildspaceNFT.CollectionPublicPath, | ||
target: BuildspaceNFT.CollectionStoragePath | ||
) | ||
prepare(signer: AuthAccount) { | ||
if signer.borrow<&BottomShot.Collection>(from: BottomShot.CollectionStoragePath) != nil { | ||
return | ||
} | ||
|
||
execute { | ||
// Borrow the recipient's public NFT collection reference | ||
let receiver = getAccount(recipient) | ||
.getCapability(BuildspaceNFT.CollectionPublicPath) | ||
.borrow<&{NonFungibleToken.CollectionPublic}>() | ||
?? panic("Could not get receiver reference to the NFT Collection") | ||
|
||
// Mint the NFT and deposit it to the recipient's collection | ||
BuildspaceNFT.mintNFT( | ||
recipient: receiver, | ||
name: name, | ||
description: description, | ||
thumbnail: thumbnail, | ||
) | ||
|
||
log("Minted an NFT") | ||
} | ||
// Create a new empty collection | ||
let collection <- BottomShot.createEmptyCollection() | ||
|
||
// save it to the account | ||
signer.save(<-collection, to: BottomShot.CollectionStoragePath) | ||
|
||
// create a public capability for the collection | ||
signer.link<&{NonFungibleToken.CollectionPublic}>( | ||
BottomShot.CollectionPublicPath, | ||
target: BottomShot.CollectionStoragePath | ||
) | ||
} | ||
|
||
|
||
execute { | ||
// Borrow the recipient's public NFT collection reference | ||
let receiver = getAccount(recipient) | ||
.getCapability(BottomShot.CollectionPublicPath) | ||
.borrow<&{NonFungibleToken.CollectionPublic}>() | ||
?? panic("Could not get receiver reference to the NFT Collection") | ||
|
||
// Mint the NFT and deposit it to the recipient's collection | ||
BottomShot.mintNFT( | ||
recipient: receiver, | ||
name: name, | ||
description: description, | ||
thumbnail: thumbnail, | ||
) | ||
|
||
log("Minted an NFT and stored it into the collection") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,51 @@ | ||
export const mintNFT = | ||
` | ||
import NonFungibleToken from 0x631e88ae7f1d7c20; | ||
import MetadataViews from 0x631e88ae7f1d7c20; | ||
import BuildspaceNFT from 0xb25c3b0e6ed6d79a; | ||
// REPLACE THIS WITH YOUR CONTRACT NAME + ADDRESS | ||
import BottomShot from 0x7b6adb682517f137 | ||
// This remains the same | ||
import NonFungibleToken from 0x631e88ae7f1d7c20 | ||
transaction( | ||
recipient: Address, | ||
name: String, | ||
description: String, | ||
thumbnail: String, | ||
recipient: Address, | ||
name: String, | ||
description: String, | ||
thumbnail: String, | ||
) { | ||
prepare(signer: AuthAccount) { | ||
if signer.borrow<&BuildspaceNFT.Collection>(from: BuildspaceNFT.CollectionStoragePath) != nil { | ||
return | ||
} | ||
// Create a new empty collection | ||
let collection <- BuildspaceNFT.createEmptyCollection() | ||
// save it to the account | ||
signer.save(<-collection, to: BuildspaceNFT.CollectionStoragePath) | ||
// create a public capability for the collection | ||
signer.link<&{NonFungibleToken.CollectionPublic, MetadataViews.ResolverCollection}>( | ||
BuildspaceNFT.CollectionPublicPath, | ||
target: BuildspaceNFT.CollectionStoragePath | ||
) | ||
prepare(signer: AuthAccount) { | ||
if signer.borrow<&BottomShot.Collection>(from: BottomShot.CollectionStoragePath) != nil { | ||
return | ||
} | ||
execute { | ||
// Borrow the recipient's public NFT collection reference | ||
let receiver = getAccount(recipient) | ||
.getCapability(BuildspaceNFT.CollectionPublicPath) | ||
.borrow<&{NonFungibleToken.CollectionPublic}>() | ||
?? panic("Could not get receiver reference to the NFT Collection") | ||
// Mint the NFT and deposit it to the recipient's collection | ||
BuildspaceNFT.mintNFT( | ||
recipient: receiver, | ||
name: name, | ||
description: description, | ||
thumbnail: thumbnail, | ||
) | ||
log("Minted an NFT") | ||
} | ||
// Create a new empty collection | ||
let collection <- BottomShot.createEmptyCollection() | ||
// save it to the account | ||
signer.save(<-collection, to: BottomShot.CollectionStoragePath) | ||
// create a public capability for the collection | ||
signer.link<&{NonFungibleToken.CollectionPublic}>( | ||
BottomShot.CollectionPublicPath, | ||
target: BottomShot.CollectionStoragePath | ||
) | ||
} | ||
execute { | ||
// Borrow the recipient's public NFT collection reference | ||
let receiver = getAccount(recipient) | ||
.getCapability(BottomShot.CollectionPublicPath) | ||
.borrow<&{NonFungibleToken.CollectionPublic}>() | ||
?? panic("Could not get receiver reference to the NFT Collection") | ||
// Mint the NFT and deposit it to the recipient's collection | ||
BottomShot.mintNFT( | ||
recipient: receiver, | ||
name: name, | ||
description: description, | ||
thumbnail: thumbnail, | ||
) | ||
log("Minted an NFT and stored it into the collection") | ||
} | ||
} | ||
` |