Git Product home page Git Product logo

npc's Introduction

Nouns Playable Citizens (NPC)

Todo

  • [] totally free mint module for base (can we have no module and remove permissions for mint?)
  • [] time based mint
  • [] capped supply mint
  • [] update ext_contractURI for tokenMetadataExtension + metadataExtension
  • [] traits as "trait" of NPC (tokenURI details... make it so the traits owned by an NPC show up as traits of the the NPC...)
  • [] make sure equippable extension is easy to use (might need to improve equipping multiple at once, or what happens with multicall)
  • [] make it easy to mint base NFT + deploy 6551 account + possibly mint traits all in one tx? (onboarding UX)

First time local setup

1. Install geth

geth is the official implementation of an Ethereum node in Golang. Follow installation instructions here. We primarily use geth for its wallet functionality to store private keys locally to use in dapptools/foundry.

2. Create/Import Private Key

You can use geth account new to generate a new private key & public address to use for development, or you can copy a private key from one of your personal wallets and use geth account import.

Use geth account list to view your list of hosted private keys.

3. Env Variables

ETH_FROM=
ETH_KEYSTORE=
KEYSTORE_PASSWORD=
ALCHEMY_API_KEY=
SEPOLIA_RPC_URL=https://eth-goerli.alchemyapi.io/v2/$ALCHEMY_API_KEY
MAINNET_RPC_URL=https://eth-mainnet.alchemyapi.io/v2/$ALCHEMY_API_KEY

3a. Account Setup

After creating or importing a wallet, use geth account list to view the "keystore" files on your computer. Choose the wallet you'd like to use for development by saving environment variables for the public address as ETH_FROM and the keystore file path as ETH_KEYSTORE. For example: ETH_FROM=0x7ff6363cd3a4e7f9ece98d78dd3c862bace2163d and ETH_KEYSTORE=/Users/demo-user/Library/Ethereum/keystore/UTC--2021-11-16T09-41-57.123259000Z--7ff6363cd3a4e7f9ece98d78dd3c862bace2163d.

Additionally, save the local password you made for this keystore as KEYSTORE_PASSWORD.

3b. RPC Setup

Next, get an ALCHEMY_API_KEY from the Alchemy dashboard. Infura works too, but you'll have to update .env file.

4. Install Foundry

  • Foundry -> provides the forge, cast, and anvil CLIs.

Installation

  1. forge i
  2. forge c

Manual deployments steps

  1. Run through scripts 0-5 in /script to deploy (skip if already deployed)
  2. Create a 721
  3. Initialize the tba for the tokenId of the 721 (can use helper/createAccount)
  4. Mint a new trait to the tba
  5. "Equip" the trait via the 1155 (can use helper/mintAndEquipTrait for steps 4 + 5)

Extensions

Extensions extend the capabilities of a core standard. In our case, we extend ERC721 and ERC1155 with metadata rendering logic. Staking might be another example. OxRails core contracts inherit extension which offers us a way to register extensions to the contract.

Guards

Guards protect certain types of transactions. For example, we can add a tranfer guard to add extra logic to occur before or after a transfer.

Modules

Modules can be enabled with certain permissions. For example, we can have a minting module which has mint permission on a given token contract. The module has permission to mint, so we can add logic to the module such that people can mint through the module (conditional on the logic applying to them). Modules are flexible and can be added / removed. Examples of modules might be requiring a certain amount of ETH payment before minting. Or only allowing minting during a certain time frame.

npc's People

Contributors

mcgingras avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.