Skip to content

Onchain NFT collection using raw bytecode contracts for SVG data

Notifications You must be signed in to change notification settings

Raggaer/faceless-bytecode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faceless Bytecode

NFT collection that uses custom bytecode generated contracts for storing SVG data on-chain. The contracts that hold the SVG data contain hexadecimal strings as their own deployed bytecode.

Since the contract bytecode does not contain all the normal clutter the gas used for deployment is reduced. This method allows to deploy almost 24 (12, since hex uses 2 bytes every byte) KB full SVG strings using less gas than storing the SVG data on an immutable variable.

bytecode

Simple bytecode generator used for the SVG data. The contract deployment apart from the hex string only contains between 13 to 15 bytes of bytecode clutter.

Gas deployment differences

As seen on the hardhat/scripts/deploy-svg-compare.js script; For a 650 B SVG (1.27 KB when hex encoded) the results are the following (Ganache local node):

Gas for raw bytecode 190286
Gas for contract with data 654925 (344%)

About

Onchain NFT collection using raw bytecode contracts for SVG data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published