Skip to content

Fix code review issues across contracts and transactions#266

Merged
joshuahannan merged 1 commit intomasterfrom
fix-code-review-issues
Mar 19, 2026
Merged

Fix code review issues across contracts and transactions#266
joshuahannan merged 1 commit intomasterfrom
fix-code-review-issues

Conversation

@joshuahannan
Copy link
Copy Markdown
Contributor

Summary

  • NonFungibleToken: fix typo "conficting"; convert /* ## */ block comment to /// doc comments
  • MetadataViews: replace nil-check + force-unwrap with if let in getNFTView, dictToTraits, and Edition.init; fix missing spaces around = in Media, ExternalURL, and NFTCollectionData inits; convert Trait field comments to ///; rename addTrait parameter ttrait
  • ExampleNFT: remove dead variable uriValue; var newNFTlet newNFT; replace force-unwrap on metadata["mintedTime"] with ?? panic; replace unsafe as! cast with as? ?? panic in EVMBridgedMetadata case; simplify getSupportedNFTTypes to return a dict literal; add prominent TODO comment on dummy EVM address; fix @{...}@return in doc comment
  • NFTForwarding: fix incorrect "init" in changeRecipient pre-condition error message
  • ViewResolver: convert // to /// doc comments
  • setup_account_from_nft_reference: fix double force-unwrap on NFTCollectionData; add idempotency guard (no panic on second call); publish cap at collectionData.publicPath instead of caller-supplied path; add UnpublishCapability entitlement
  • mint_nft: improve pre condition message to include actual array lengths

Test plan

  • make ci passes (all 24 Cadence tests + Go tests)

🤖 Generated with Claude Code

- NonFungibleToken: fix typo "conficting", convert block comment to ///
- MetadataViews: replace nil-check+force-unwrap with if-let in getNFTView,
  dictToTraits, and Edition.init; fix spacing in Media/ExternalURL/NFTCollectionData
  inits; convert Trait field comments to ///; rename addTrait parameter t → trait
- ExampleNFT: remove dead variable uriValue; var → let for newNFT; replace
  force-unwrap on metadata["mintedTime"] with panic; replace unsafe as! cast
  with as? ?? panic in EVMBridgedMetadata case; simplify getSupportedNFTTypes
  to return a literal; add TODO comment on dummy EVM address; fix @return tag
- NFTForwarding: fix incorrect "init" in changeRecipient error message
- ViewResolver: convert // to /// doc comments
- setup_account_from_nft_reference: fix double force-unwrap on NFTCollectionData,
  add idempotency guard, publish cap at collectionData.publicPath, add
  UnpublishCapability entitlement
- mint_nft: improve pre-condition message to include actual array lengths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@joshuahannan joshuahannan merged commit b1b07b9 into master Mar 19, 2026
2 checks passed
@joshuahannan joshuahannan deleted the fix-code-review-issues branch March 19, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants