Skip to content

CabinDAO/Passports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Passports XYZ [DEPRECATED]

This project is no longer actively maintained

Quick Links

Background: Why NFTs for Membership?

Every community in the Web3 space has it's own way of implementing membership. Social DAOs like FWB use a fungible token (ERC-20) to token-gate their community while NFT projects like Bored Ape Yacht Club do so with their ERC-721, non-fungible token. As we outlined in our article, Unbundling social token economics, governance, and access, we believe that every DAO and Web 3 community needs to decide how fungible their membership is and make the appropriate technical decision to implement it as an ERC-20 or an ERC-721.

There are plenty of tools for implementing membership and token-gating based on an ERC-20, but very few (if any) for doing so with an ERC-721. The goal of Passports.xyz is to provide a tool for easily minting NFTs that can be used for this kind of token-gating.

Contributing

CabinDAO operates under a Bounty system for its products, including Passports. Each Bounty is specced as a task in Clarity, which you could view the full board of tasks here. On each task, you could comment to ask questions to gain more context on what needs to be done. Once you understand a task well enough and are interested, you could begin tackling the task.

  1. Assign yourself to the task on Clarity and mark the task as "In Progress".
  2. Make changes locally to a new branch
  3. Push and create a pull request against the main repo
  4. Tag the relevant maintainers for review
  5. Once approved, merge your pull request and delete the branch

In the ethos Web3, this project operates on permissionless contribution. Please read through this README to get setup and start contributing. If only after reading through this documentation that you are hitting roadblocks, feel free to DM @dvargas92495 on Discord.

Environments

The setup below outlines how to connect to the local network. You can additionally use Passports on any of the following test networks:

  • Kovan
  • Ropsten
  • Rinkeby
  • Goerli

You could access the live app at https://passports.creatorcabins.com. Everytime you open a pull request against the main repository, a branch specific environment is also deployed to test your live changes before merging with main.

Setup

The project is mostly located in the /packages directory. Within that directory, there are two packages that are under active development:

  1. /app - This hosts the source code for the user-facing web app
  2. /contracts - This hosts the smart contract source code for passports, published as an NPM package

You will also need some secret environment variable values in order to access our development instances in other services. Please DM @dvargas92495 you email on lastpass so that he could share the secrets with you.

Web App Setup

Please follow the steps below to set up the web app locally:

  1. Fork the repo to your account
  2. Clone the repo from your github to your local machine
  3. Navigate to the App's directory with cd packages/app
  4. Install dependencies with npm install
  5. Run the app with npm run dev

This should open the app in your browser pointed to localhost:3000. You could connect to whichever live Ethereum network through your wallet, and the user interface should respond accordingly.

Contracts Setup

If you are looking to make changes to the smart contracts, it helps to run a local network for the app to interact with.

  1. Navigate to the Contracts directory with cd packages/contracts
  2. Install dependencies with npm install
  3. Run a local blockchain with npm run dev
  4. Notice that a bunch of accounts with addresses were printed. Copy the private key of one of them.
  5. Create a local packages/contracts/.env file and add PRIVATE_KEY=0x12341234 to the top of the file. Replace 0x12341234 with the private key that you copied.
  6. Open another terminal tab and build the contracts with npm run build
  7. Deploy the newly build contracts to your local network with npm run migrate:local.
  8. Navigate to the packages/app directory.
  9. Create another .env file at packages/app/.env. Add all of the environment variables that were shared with you on lastpass.
  10. Run the webapp locally by running npm run dev from the packages/app directory.
  11. Once on the browser, add the new network to your wallet. In Metamask, you could do this by going to Settings > Networks > Add Network and fill out the following data:
  12. You can now connect to and interact with your local network.

Wallet Setup

  1. Open up MetaMask, click the accounts circle in the top right and click "import account".
  2. Paste the private key from step 3 and click import. (Each of the accounts created in step 3 are pre-populated with 10,000 ETH)
  3. If you don't see the ETH balance after importing, switch off of the "Localhost" network you created to another network, then go back to "Localhost". You should then see the balance.

Note that every time you change the smart contracts, you will need to rebuild and redeploy it to your local network in order to see the changes. Most of the times this will copying the new contract address to your packages/app/.env file for you. You will then need to reboot the frontend.

The contract artifacts are deployed as an npm package called @cabindao/nft-passport-contracts, which is one of the web app's dependencies. The contract artifacts are deployed to the test networks listed above and their contract addresses are also included in the package. To see your changes in production version of the app, we will need to first publish the artifacts to npm, then install the latest version of the package to the web app. Locally, you can have Next resolve the npm package to your local contracts directory by adding USE_LOCAL_CONTRACTS=true to your .env file.

Cabin

Cabin is a digitally-native organization (often called a DAO) building a decentralized city by creators, for creators. You can learn more about us by visiting our website or joining our Discord server. Please consult our Brand Guidelines on how to work within our visual identity.