feat: on-chain SVG NFT recipe with Chainlink price feeds#39
Merged
Conversation
EVM-only recipe covering base64 tokenURI decoding, on-chain SVG rendering in sandboxed iframes, Chainlink price feed integration, and dynamic NFT minting. Includes educational deep-dive on on-chain vs off-chain storage, SVG security, and gas considerations. Refs #19
- Replace redundant svgContent state with useMemo derived from metadata - Guard handleMint on address being defined (prevent minting to zero address) - Wrap handleMint BigInt conversion in try/catch - Add res.ok check on off-chain metadata fetch - Add enabled guard on Chainlink useReadContract - Fix unconditional ellipsis on short URIs - Disable mint button when wallet not connected
Remove the bare example/evm/page.tsx and replace with a full showcase app built on the recipe-shell template. Includes: - w3-kit design system (tokens, dark mode, Geist font) - w3-kit NFTCard and PriceTicker components - Live Loot NFT + Chainlink price feed on mainnet - Deploy & Mint flow on Sepolia with pre-compiled contract - RecipeLayout with wallet connect and theme toggle
…d deploy status - Change evm.tsx default Chainlink address from Sepolia to mainnet - Remove unused useWriteContract/useWaitForTransactionReceipt for deploy - Replace error-as-status with dedicated deployStatus state - Add mountedRef to prevent state updates after unmount in deploy polling
Contributor
Author
ReviewReviewed recipe content, showcase example, and code quality. Recipe files (evm.tsx, learn.md, README, meta.json):
Showcase example (TanStack Start + w3-kit components):
Review fixes applied:
LGTM — ready to merge. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
safeMint.learn.md(~2500 words) covering on-chain storage, SVG encoding pipeline, Chainlink oracles, rendering security, and gas considerationsWhy EVM only
On-chain SVG generation via
abi.encodePackedinsidetokenURI()is an EVM-specific pattern. Solana NFTs use Metaplex which stores URIs pointing off-chain. Chainlink is also EVM-native.Files
Sources referenced in learn.md
Test plan
npm run format:checkpassesCloses #19