Code Monkey home page Code Monkey logo

nft-contracts's Introduction

NFT Contracts by Buildship

Hardhat Tests

Donate on Gitcoin if you like this repo ❤️‍🔥

This is a collection of smart-contracts that help you to launch your own 10k-avatar collection like CryptoPunks, Bored Ape Yacht Club or Pudgy Penguins.

Made by https://buildship.xyz. If you can't code, use our simple web-app to deploy!

USE AT YOUR OWN RISK. Most of the features are in production already, however this doesn't guarantee any security. Unreleased and speculative code is located in contracts/experiments directory.

Features include:

ERC721CommunityImplementation.sol

  • Limited supply
  • Mint N tokens in one transaction
  • Generative art
  • Lazy Mint – buyers pays for mint
  • Manually start/stop sale
  • Reserve X tokens for team or community
  • Deployed by Factory using Clones
  • Supports NFTExtension to upgrade mint and tokenURI functions

ERC721CommunityBase.sol

  • Same features as ERC721CommunityImplementation
  • Import and inherit in your own projects
contract MyPFPNFT is ERC721CommunityBase {

    constructor() ERC721CommunityBase(
        0.1 ether, // public mint price, you can change later
        10000, // total supply
        100, // reserved
        20, // max mint per transaction
        0, // royalty fee
        "ipfs://Qm/", // baseURI
        "Bored Ape Yacht Club", 
        "BAYC",
        false // should start at 1 or at 0?
    ) {}

}

ERC721CommunityImplementation_

A copy of ERC721CommunityImplementation without any mention of Buildship. It's used as a base interface for Buildship Fuelpass subscribers (https://buildship.xyz/fuelpass).

colordiff contracts/ERC721CommunityImplementation_.sol contracts/ERC721CommunityImplementation.sol

NFTExtension

  • Can be added to main NFT using addExtension
  • Support changing mint and tokenURI functions

How to use:

Init

npm i
touch .mnemonic
node scripts/generate_mnemonic.mjs
vim .mnemonic # input generated mnemonic

cp .env.example .env
vim .env # input your keys

Development

When you change something, run:

npx hardhat compile

Then, to test your code:

npx hardhat test

Checking different versions of ERC721CommunityImplementation:

colordiff contracts/ERC721CommunityBase.sol contracts/ERC721CommunityImplementation.sol --context=1
colordiff contracts/ERC721CommunityBase_ERC1155.sol contracts/ERC721CommunityBase.sol --context=1

Deploy to production

You can deploy using Hardhat. Refer to Hardhat scripts and console guides for deployment. https://hardhat.org/guides/deploying.html

However, we also support deploying with your Metamask:

Upload to IPFS for Frontend Deploy

Instead of deploying from your local machine, you can compile and send it for deployment from the Buildship web app.

hh upload contracts/Greeter.sol --args '"hello","bar"'

It needs network selection to run, but it doesn't matter which you use. You can run with development network.

In the end, you get IPFS hash to the uploaded bytecode. Use in on https://gate-rinkeby.buildship.xyz/deploy/bafkreid4l4ru7sngq6fcvpizljo7hpm6dmcwjory4kcrbpbkde2xih75au?args=[]

Thanks

Thanks to Gitbook.com for providing free access to their platform to host our docs! https://learn.buildship.xyz/

ERC721A for their mint-optimized ERC721 https://erc721a.org/

Our contributors

Buildship users who have given us their trust and used our code on mainnet, already processing >5M$ in total volume and >35,000 NFT minted! https://dune.xyz/caffeinum/buildship_xyz

nft-contracts's People

Contributors

bbshark99 avatar bigdaddyarrow avatar caffeinum avatar mikelun avatar theshadowagent 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nft-contracts's Issues

ERC721Community: can't burn() via Extension with reducing maxSupply

ERC721Community contract is based on ERC721A which supports burning only by transferring to 0xdead address (0x000000000000000000000000000000000000dEaD). Such burns don't reduce the number of items on OpenSea, because the contract needs to be updated as well

Writing a BurnExtension with reducing maxSupply is currently not possible because reduceMaxSupply is onlyOwner and doesn't allow burning less than totalMinted() amount

Add onchain storage for generative art

Create contract OnchainArtStorageExtension.sol, inherit NFTExtension and Renderer.

Contract should override tokenURI and render methods, returning html page stored in contract memory

Security Vulnerability

Contract have centralization danger, developer can withdraw all money which is raised by minting NFT deployed using buildShip. This is no good.

Stuck on contract

Hi there, If I want to set this up for a donation process, what kind of contract do I need? I want a pre-stated amount of eth for a donation, lets say 0.005 ETH, and let the people choose if they want to donate it 1 time, 2 times or 3 times (so the current application is perfect).

Some help would be awesome, thanks a lot!!

Floating Pragmas

Not a problem, but a lousy solidity's code practice, Every contract has a floating pragma which is not recommended. It should be fixed.

Fix the Pragmas

Additional context:
Check this: https://t.co/PsMruMmE6t

Thanks,
AB Dee

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.