Uniswap v3 NFT
Intro
Uniswap has launched LP as NFTs in v3 implementation.
"NFTs will appear as unique on-chain generated art based on the properties of your position"
base64 function
The unique feature that the Uniswap v3 NFT contract has is the token data shortener using the base64 encoding function scheme.
This function reduces the SVG data into a shorter version by encoding tokenURI data. The Base64 encoding function saves gas costs and prevents blockchain state bloat by reducing the size (characters) of token metadata (SVG URL). This contract uses the base64 encoding function to display metadata URL instead of raw URL or UTF-8 URL format.
Further reading
Contract: https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/libraries/NFTDescriptor.sol#L65
Introduction of Uniswap v3: https://uniswap.org/blog/launch-uniswap-v3/
base64 function explained: https://en.wikipedia.org/wiki/Base64
base64 text encode: https://codebeautify.org/base64-encode
Last updated