npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

erc721psi

v0.7.0

Published

[![Node.js CI](https://github.com/estarriolvetch/ERC721Psi/actions/workflows/node.js.yml/badge.svg)](https://github.com/estarriolvetch/ERC721Psi/actions/workflows/node.js.yml) [![Publish Package to npmjs](https://github.com/estarriolvetch/ERC721Psi/action

Downloads

70

Readme

ERC721Psi

Node.js CI Publish Package to npmjs Build Documentation npm version

ERC721Psi is releasd under MIT opensource licence and free to use. If you need commercial support/service regarding ERC721Psi, feel free to contact ctor.xyz

ERC721Psi is an ERC721 compilant implementation designed for scalable and gas-efficient on-chain application with built-in randomized metadata generation. Inspired by AzukiZen's awesome ERC721A, ERC721Psi also provides batch minting at a fixed gas cost. However, ERC721Psi manages to solve the scaling issue of token transfer through the mathematical power of the de Bruijn sequence.

Powered by Chainlink's VRF V2, ERC721Psi comes with an extension that can batch mint multiple tokens with tamper-proof on-chain random attributes while retaining the fixed minting gas cost.

Litepaper: https://mirror.xyz/ctor.xyz/zy3TUWuJFSeWyMWAucTRP45o-sVToKTrtDsUIiD_m48

Slides: https://www.slideshare.net/EstarriolVetch/erc721psi

Docs: https://estarriolvetch.github.io/ERC721Psi/

Installaion

npm

npm install --save-dev erc721psi

yarn

yarn add --dev erc721psi

Usage

pragma solidity ^0.8.0;

import "erc721psi/contracts/ERC721Psi.sol";

contract Adventurer is ERC721Psi {

    constructor() 
        ERC721Psi ("Adventurer", "ADVENTURER"){
    }

    function mint(uint256 quantity) external payable {
        // _safeMint's second argument now takes in a quantity, not a tokenId. (same as ERC721A)
        _safeMint(msg.sender, quantity);
    }

}

Random Seed Extension

The random seed extensions provide an easy way for NFT projects to create on-chain randomized metata at the individual token level. The random seed extensions uses Chainlink's VRF V2 as its source of randomness. Each token comes with its own unique seed that can be used to derived its attributes.

interface IERC721RandomSeed {
    function seed(uint256 tokenId) external view returns (uint256);
}

There are two types of random seed extensions with different schemes of requesting randomness.

  • ERC721PsiRandomSeed: The randomness is requested during minting. There is no extra actions required for the project owner to reveal the token. The random seeds of the tokens will be revealed when the randomness request is fulfilled by the Chainlink nodes.
  • ERC721PsiRandomSeedReveal: The randomness is requested when the _reveal() function is called. This function is usually called by the project owner to reveal the tokens. Everytime _reveal() is called, it will reveal the random seeds of all the tokens minted since the last reveal.

Considerations

It is important to realize that balanceOf, totalSupply, tokenByIndex, and tokenOfOwnerByIndex in ERC721Psi are not designed to be gas efficient since they are mostly used by front end only. By doing so, we are able to reduce the storage usage and thus minimize the gas consumption for the rest of the functions.

If tracking balanceOf on-chain is important for your application, please use the ERC721PsiAddressData extension.

Road Map

  • Implement more extensions.
  • Add more test cases.
  • Build an contract wizard (like this) for generating the contract skelton.

Contributors

PRs on documentations, test cases, and any contract improvemetns are welcomed!!

Projects using ERC721Psi

If your projects use ERC721Psi, we'd like know more about it! Feel free to DM 0xEstarriol to share your project.