Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions contracts/ExampleNFT.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ access(all) contract ExampleNFT: NonFungibleToken {
/// withdraw removes an NFT from the collection and moves it to the caller
access(NonFungibleToken.Withdraw) fun withdraw(withdrawID: UInt64): @{NonFungibleToken.NFT} {
let token <- self.ownedNFTs.remove(key: withdrawID)
?? panic("ExampleNFT.Collection.withdraw: Could not withdraw an NFT with ID "
.concat(withdrawID.toString())
.concat(". Check the submitted ID to make sure it is one that this collection owns."))
?? panic("ExampleNFT.Collection.withdraw: Could not withdraw an NFT with ID \(withdrawID). Check the submitted ID to make sure it is one that this collection owns.")

return <-token
}
Expand Down Expand Up @@ -290,9 +288,7 @@ access(all) contract ExampleNFT: NonFungibleToken {
/// and returns it to the caller so that they can own NFTs
access(all) fun createEmptyCollection(nftType: Type): @{NonFungibleToken.Collection} {
if nftType != Type<@ExampleNFT.NFT>() {
panic("ExampleNFT.createEmptyCollection: The requested nftType <"
.concat(nftType.identifier)
.concat("> is not supported by this contract. Only ExampleNFT.NFT tokens are supported."))
panic("ExampleNFT.createEmptyCollection: The requested nftType <\(nftType.identifier)> is not supported by this contract. Only ExampleNFT.NFT tokens are supported.")
}
return <- create Collection()
}
Expand Down
3 changes: 1 addition & 2 deletions contracts/MetadataViews.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,7 @@ access(all) contract MetadataViews {

view init(score: UFix64?, max: UFix64?, description: String?) {
if score == nil && description == nil {
panic("MetadataViews.Rarity.init: Cannot initialize the Rarity Metadata View! "
.concat("The provided score and description are both `nil`. A Rarity needs to set score, description, or both"))
panic("MetadataViews.Rarity.init: Cannot initialize the Rarity Metadata View! The provided score and description are both nil. A Rarity needs to set score, description, or both")
}

self.score = score
Expand Down
11 changes: 4 additions & 7 deletions contracts/utility/NFTForwarding.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ access(all) contract NFTForwarding {
/// getSupportedNFTTypes returns a list of NFT types that this receiver accepts
access(all) view fun getSupportedNFTTypes(): {Type: Bool} {
let recipientRef = self.borrowRecipientCollection()
?? panic("NFTForwarding.NFTForwarder.getSupportedNFTTypes: "
.concat("Could not borrow a reference to the recipient's NFT Collection!"))
?? panic("NFTForwarding.NFTForwarder.getSupportedNFTTypes: Could not borrow a reference to the recipient's NFT Collection!")
return recipientRef.getSupportedNFTTypes()
}

Expand All @@ -57,14 +56,12 @@ access(all) contract NFTForwarding {
///
access(all) fun deposit(token: @{NonFungibleToken.NFT}) {
post {
recipientRef.getIDs().contains(id):
"NFTForwarding.NFTForwarder.deposit: Could not forward deposited NFT! "
.concat("The recipient's collection did not contain the transferred NFT with ID ")
.concat(id.toString()).concat(" after function execution.")
recipientRef.getIDs().contains(id):
"NFTForwarding.NFTForwarder.deposit: Could not forward deposited NFT! The recipient's collection did not contain the transferred NFT with ID \(id) after function execution."
}

let recipientRef = self.borrowRecipientCollection()
?? panic("Could not borrow reference to recipient's Collection!")
?? panic("NFTForwarding.NFTForwarder.deposit: Could not borrow reference to recipient's Collection!")
let id = token.id
let uuid = token.uuid

Expand Down
18 changes: 9 additions & 9 deletions lib/go/contracts/internal/assets/assets.go

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions lib/go/templates/internal/assets/assets.go

Large diffs are not rendered by default.

61 changes: 30 additions & 31 deletions lib/go/test/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/onflow/flow-nft/lib/go/test

go 1.25.0
go 1.25.1

require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/onflow/cadence v1.8.3
github.com/onflow/flow-emulator v1.13.0
github.com/onflow/flow-go-sdk v1.9.2
github.com/onflow/cadence v1.9.10
github.com/onflow/flow-emulator v1.18.0
github.com/onflow/flow-go-sdk v1.9.16
github.com/onflow/flow-nft/lib/go/contracts v1.3.0
github.com/onflow/flow-nft/lib/go/templates v1.3.0
github.com/rs/zerolog v1.34.0
Expand All @@ -21,7 +21,7 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.13.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.24.0 // indirect
github.com/bits-and-blooms/bitset v1.24.4 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
Expand Down Expand Up @@ -55,7 +55,7 @@ require (
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.8.1-0.20250402194037-6f932b086829 // indirect
github.com/fxamacker/cbor/v2 v2.9.1-0.20251019205732-39888e6be013 // indirect
github.com/fxamacker/circlehash v0.3.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
Expand Down Expand Up @@ -94,7 +94,7 @@ require (
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jordanschalm/lockctx v0.0.0-20250412215529-226f85c10956 // indirect
github.com/jordanschalm/lockctx v0.1.0 // indirect
github.com/k0kubun/pp/v3 v3.5.0 // indirect
github.com/kevinburke/go-bindata v3.24.0+incompatible // indirect
github.com/klauspost/compress v1.18.0 // indirect
Expand Down Expand Up @@ -125,18 +125,18 @@ require (
github.com/multiformats/go-multistream v0.6.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.11.0 // indirect
github.com/onflow/crypto v0.25.3 // indirect
github.com/onflow/atree v0.12.1 // indirect
github.com/onflow/crypto v0.25.4 // indirect
github.com/onflow/fixed-point v0.1.1 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.2 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.2 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.3 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.3 // indirect
github.com/onflow/flow-evm-bridge v0.1.0 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251117184523-ab0655178589 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.18 // indirect
github.com/onflow/flow-go v0.47.0-ledger-service.1.0.20260318224013-f6e2e8f41961 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.20 // indirect
github.com/onflow/go-ethereum v1.15.10 // indirect
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
Expand Down Expand Up @@ -167,7 +167,7 @@ require (
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.10.1 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/spf13/viper v1.15.0 // indirect
Expand All @@ -185,41 +185,40 @@ require (
github.com/x448/float16 v0.8.4 // indirect
github.com/zeebo/blake3 v0.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel v1.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.42.0 // indirect
go.opentelemetry.io/otel/sdk v1.42.0 // indirect
go.opentelemetry.io/otel/trace v1.42.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/telemetry v0.0.0-20251112162317-03ef243c208a // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gonum.org/v1/gonum v0.16.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect
google.golang.org/grpc v1.79.3 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.4.1 // indirect
modernc.org/libc v1.66.10 // indirect
modernc.org/libc v1.67.6 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.40.0 // indirect
modernc.org/sqlite v1.46.1 // indirect
)

replace github.com/onflow/flow-nft/lib/go/contracts => ../contracts
Expand Down
Loading
Loading