GithubHelp home page GithubHelp logo

bound-layerable's Introduction

BoundLayerable

BoundLayerable is a set of smart contracts for minting and then composing layerable NFTs on-chain.

The BoundLayerable flow:

  • A user mints a set of N "layers" efficiently using ERC721A
    • The first is a "base" or "bindable" layer
  • Layers are revealed on-chain
  • Users can burn a layer to "bind" it to their base layer
  • Users can update the base layer's metadata on-chain to show/hide and reorder layers

Technical specs

  • Secure on-chain randomness using ChainLink VRF
  • 8 types of layers
    • Up to 32 unique layers per "type" elements, except the 8th type, which supports 31 unique layers
    • 255 total unique layers
    • 16-bit granularity (~0.0015%) for trait rarity
  • Up to 32 "Active" layers at once
  • Traits and metadata stored on-chain
  • Updateable metadata contract

bound-layerable's People

Contributors

emo-eth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pynchmeister

bound-layerable's Issues

Add PREVRANDAO alternative to Chainlink VRF on Ethereum

Post-merge, PREVRANDAO is an acceptable source of randomness, and would simplify the randomness process.

Constructor of a PREVRANDAO-based source of randomness should revert if chain associated with block.chainid does not have the PREVRANDAO opcode (ie, is not 1)

Reproduce in local?

Thank you for the wonderful repo!
Layered NFTs feel so unexplored yet soooo interesting, this is crazy. Appreciate sharing your knowledge - I tried reproducing it on my local computer with hot-chain-svg, it didn't produce an output.

Feel free to destroy this if repo is wip

Explore packing layerId into ERC721A _extraData

We should always store layerId for base tokens upon binding, since they may be re-bound or rearranged, and the extra 100-200 gas to read the extraData from warm ownership slot is going to be cheaper than the layer seed calculation + lookup.

Since layer tokens are burned upon being bound, they should not store their layerId during the binding process.

It may be worth looking into calculating+storing the layerId for any token when transferring. The ownership/extraData storage slot will already be warm, but calculating will add at least 5000 gas on first transfer after reveal in worst cases (max 2 SLOADs for packed distributions, plus all comparison and calculation overhead - unsure on specific gas usage).

Minimizing gas usage during binding+arranging for end-user experience may be worth the added gas overhead during transfer - but a better gas analysis should be done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.