Skip to content

Fully onchain generated nft project, deployed on eth chain

Notifications You must be signed in to change notification settings

MichiMich/OnChainAsciiApes

Repository files navigation

OnChainAscii Apes

Fully onchain generated nft project, deployed on the eth chain. OnChainAsciiApes

Project properties:

  • 204 Apes in total, 9 special apes
  • onchain svg generation during mint
  • "random" nft assigment during mint
  • "random" nft name assigment during mint

The "random" factor is created by combining the wallet address of the minter with the last block number, the timestamp and the previous generated "random" number. In addition, the created "random" number for the nft generation is the index at an unorganized array. This array carries the nft properties like left and right eye and will be removed after mint to secure a once only occuring nft generation (every nft combination is unique).

This is not a truly random generated number, which could be archieved by using chainlink vrf for example. This servers as an approach of various, not incremental assignments during mint, which is sufficient.

Additional contracts

The main contract "OnChainAsciiApes" is linked to 2 additional contracts

ApeGenerator

The ApeGenerator contract holds all nft generation specific values like generel svg data, mint combinations, hex unicode data for the ape eyes, ape eye colors and general ape color. It is used for creating and registering an ape by storing the data in a nft attributes - tokenId mapping. Furthermore it holds all data for querying the tokenURI of a given tokenId.

AccessUnitControl

Basically the function of the AccessUnitControl contract could be found here.

In this case the AccessUnitcontrol contract is used to secure the last 3 nfts (which are special apes) for certain wallet addresses only.

The wallet addresses allowed for minting them are given by the top 3 donators at the donation contract. (At this state the wallet addresses and number of allowed nfts are written manually after the snapshot is announced)

NFT attributes

Nft attributes

  • Apecolor (value in hex color)
  • Bananascore (value between 60-100)
  • Eyecolor left (value in hex color)
  • Eyecolor right (value in hex color)
  • Eye left (in unicode hex character)
  • Eye right (in unicode hex character)
  • Facesymmetry (left and right eye dependend)
  • Name (generated during mint, combined with tokenId)

Fetch NFT data

Fetch nft data

Fully onchain generated means no secondary services/providers like ipfs needed. The nft data can be fetched by going to the etherscan address of the contract and query the tokenURI of your nft.

Prerequisites

  • Nodejs and npm You'll know you've installed nodejs right if you can run:
    node --version
    

    and get an ouput like: vx.x.x

  • hardhat You'll know you've installed hardhat right if you can run:
    npx hardhat --version
    

    and get an ouput like: 2.9.3

Yarn instead of npm. You'll know you've installed yarn right if you can run:

yarn --version And get an output like x.x.x

You might need to install it with npm

    A webbrowser, since you can read this here I should not have to mention it^^
    Basic understand of js, hardhat and solidity. If you want to get basic understanding up to expert I highly recommend the man, the myth, the legend: Patrick Collins
    Some rinkeby eth if you deploying to rinkeby testnet, you could grap some here

clone repository

fire up the git clone command:

git clone https://github.com/MichiMich/OnChainAsciiApes

cd into it

cd OnChainAsciiApes

install dependencies

yarn

deploy contracts on local hardhat chain

npx hardhat run /scripts/deploy.js --network localhost

If you wan tot deploy on other networks, create a secrets.json file and paste in the values like given in the secrets-example.json

Important never push your private keys on github

About

Fully onchain generated nft project, deployed on eth chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published