Back to All Episodes
Season 2Episode 56

Onchain SVG Smart Contracts

February 25, 2023
38m

Listen Now

About This Episode

In this episode of DevNTell, Narb welcomes Nicholas to discuss onchain SVG smart contracts he has built for Juicebox. Nicholas provides an overview of Juicebox, an onchain treasury protocol, and explains how Juicebox projects are represented by NFTs. He demonstrates how he developed a token URI resolver to provide onchain metadata for Juicebox projects, using SVG and base64-encoded fonts. Nicholas walks through the design process, including mockups and the final SVG implementation, and dives into the smart contract code, highlighting functions for data retrieval and layout padding. The session concludes with Nicholas sharing resources for those interested in exploring onchain SVGs.

Key Takeaways

1

Juicebox is an onchain treasury protocol where projects are represented by NFTs, allowing for composable project management.

2

Onchain SVGs can provide real-time, dynamic metadata for NFTs directly from the blockchain, eliminating dependence on external servers.

3

Custom token URI resolvers can be used to generate and update metadata for a whole protocol or individual projects within it.

4

Implementing onchain SVGs involves challenges such as layout padding for variable data and ensuring cross-browser rendering compatibility.

5

Base64 encoding allows for embedding complex assets like fonts directly into onchain SVG contracts.

Listen On

Share This Episode

Share on X

Watch Episodes Live!

Subscribe to our event calendar and never miss a live episode.

View Event Calendar