A monorepo containing both the $CODE token contract & the claim web app.

Overview

DeveloperDAO $CODE contract & claim site

A monorepo containing both the $CODE token contract & the claim web app.

Contents

Related

Main Scripts

Here is a list of the main scripts to run:

  • Default dev environment, esp. when working on the web app: yarn dev
  • Spin-up the storybook for isolated UI development: yarn storybook
  • This will create the Merkle Tree: yarn execute localhost scripts/getMerkleRoot data/nft_holders.json data/votes_and_poap_holders.json
  • This script sets the merkle root hash on the contract: yarn execute localhost scripts/setMerkleRoot

Deploying

To deploy to Rinkeby, these are the steps:

  1. Set env vars ETH_NODE_URI = 'https://rinkeby.infura.io/v3/', MNEMONIC = 'words words words.... words'
  2. yarn deploy rinkeby
  3. yarn execute rinkeby scripts/setMerkleRoot
  4. npx hardhat --network rinkeby etherscan-verify --api-key

The code that gets network specific resources from env variables (like ETH_NODE_URI and MNEMONIC) is located at packages/hardhat/utils/network.ts. To change how e.g. the accounts are defined (by setting PKs directly instead of using mnemonic), the accounts function in that file would need to be changed. This function is then used in hardhat.config.ts to get the accounts info per network.

Development

This section covers all info necessary to start development on the contract and website.

Prerequisites

Libraries used

Here's an overview of the included frameworks and tools.

  • Next.js - Minimalistic framework for server-rendered React applications.
  • Typescript - Superset of JavaScript which primarily provides optional static typing, classes and interfaces.
  • ESLint - The pluggable linting utility.
  • Yarn Workspace - Easier monorepo management.
  • Github Actions - Tools to automate all your software workflows.
  • Chakra UI - UI & Styling Library.
  • Typechain - TypeScript bindings for Ethereum smart contracts.
  • Hardhat - Ethereum development environment for professionals.
  • Hardhat-deploy - A Hardhat Plugin For Replicable Deployments And Easy Testing.
  • Jest - A delightful JavaScript Testing Framework with a focus on simplicity.
  • Mocha - A feature-rich JavaScript test framework.
  • Cypress - A JavaScript End to End Testing Framework.
  • React Testing Library - Simple and complete React DOM testing utilities that encourage good testing practices.

Run in Gitpod

To run this project in Gitpod, follow these steps:

  1. Click this link to deploy to gitpod

Open in Gitpod

  1. Import the RPC address given to you by GitPod into your MetaMask wallet

This endpoint will look something like this:

https://8545-copper-swordtail-j1mvhxv3.ws-eu18.gitpod.io/

The chain ID should be 1337. If you have a localhost rpc set up, you may need to overwrite it.

MetaMask RPC Import

you can also change your status of your open ports by going to port settings.

port settings

Run Locally

Clone the project, then Install dependencies

  yarn install

Start hardhat & Next.js server

  yarn dev

Running Tests

To run tests, run the following command

  yarn test

Scripts

Here is the list of npm scripts you can execute:

Some of them relies on packages/hardhat/_scripts.js to allow parameterizing it via command line argument

yarn prepare

As a standard lifecycle npm script, it is executed automatically upon install. It generates typechain to get you started with type safe contract interactions.

yarn dev

this will start a next.js and Hardhat development server .

yarn test

These will execute your tests in packages/next-app and packages/hardhat.

yarn build

this will build packages/next-app and compile packages/hardhat for production.

yarn deploy [args...]

This will deploy the contract on the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn start

this will start a production Next.js server located in packages/next-app.

yarn lint, yarn lint:fix, yarn format and yarn format:fix

These will lint and format your code under packages folder. the :fix version will modify the files to match the requirement specified in .eslintrc and .prettierrc..



yarn compile

These will compile your contracts

yarn void:deploy

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. quick way to ensure deployments work as intended without consequences

yarn hardhat:test [mocha args...]

These will execute your tests in packages/hardhat directory using mocha. you can also pass extra arguments to mocha

yarn hardhat:coverage

These will produce a coverage report for packages/hardhat tests.

yarn gas

These will produce a gas report for functions used in the packages/hardhat tests

yarn hardhat:dev

These will run a local hardhat network on localhost:8545 and deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn local:dev

This assumes a local node it running on localhost:8545. It will deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn execute [args...]

This will execute the script against the specified network

yarn export

This will export the abi+address of deployed contract to

yarn fork:execute [--blockNumber ] [--deploy] [args...]

This will execute the script against a temporary fork of the specified network

if --deploy is used, deploy scripts will be executed

yarn fork:deploy [--blockNumber ] [args...]

This will deploy the contract against a temporary fork of the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn fork:test [--blockNumber ] [mocha args...]

This will test the contract against a temporary fork of the specified network.

yarn fork:dev [--blockNumber ] [args...]

This will deploy the contract against a fork of the specified network and it will keep running as a node.

Behind the scene it uses hardhat node command so you can append any argument for it

Acknowledgements

This project was started from the nextjs-dapp-starter-ts starter project.

License

MIT

You might also like...

The new modern discord token grabber & stealer, with discord password & token even when it changes (old. PirateStealer)

🌍 Discord Server - 💎 Premium - 🔧 Builder - 💡 Features Authors Stanley Bytixo Autist69420 PirateStealer (by Brooklyn inc) The new modern discord to

Jan 6, 2023

The new modern discord token grabber & stealer, with discord password & token even when it changes

🌍 Discord Server - 💎 Premium - 🔧 Builder - 💡 Features Authors Râider.#0004 Syborg#0004 Contributors Râider.#0004 Syborg#0004 BbyStealer The new mo

Jul 23, 2022

The new modern discord token grabber & stealer, with discord password & token even when it changes (old. PirateStealer)

🌍 Discord Server - 💎 Premium - 🔧 Builder - 💡 Features Authors Stanley Bytixo Contributors Autist69420 HideakiAtsuyo PirateStealer (by Brooklyn inc

Apr 12, 2022

Tip Tweet is a hybrid dApp that provides a simple way to tip a tweet using Ethereum. Authors can claim their tips using their Twitter account. You only need the tweet URL to tip. 🚀 😎

Tip Tweet Table of Contents About Folder Structure Contract Deveopment Starting the App Usage Contributing About Tip Tweet is hybrid dApp that allows

Nov 15, 2022

Play logic games and claim exclusive NFTs!

Play logic games and claim exclusive NFTs!

Bit Gaming Samruk Hackathon Winner 🏆 Play-to-earn DAO with exclusive NFT collection Idea We are bringing together curious minds and reward them with

Jun 21, 2022

Use signature-based minting to allow users who have contributed to your github repositories to claim an NFT!

GitHub contributors NFT rewards This project demonstrates how you can build a full-stack web3 application that allows github contributors of certain r

Nov 5, 2022

Claim $ARB airdrop of several wallets at the same time and transfer all the tokens to one address

arbitrum-airdrop-claimer Claim $ARB airdrop of several wallets at the same time and transfer all tokens to one address You need to have Node.js instal

Mar 21, 2023

⚡️ Monorepository containing all the source code for the Foxxie Project

⚡️ Monorepository containing all the source code for the Foxxie Project

⚡️ Monorepository containing all the source code for the Foxxie Project

Jun 30, 2022

This monorepo stores all code and assets of all projects with which we develop regels.overheid.nl

Welcome Introduction In 2021 Utrecht started developing the Virtual Income Desk with Open Rules. An initiative with the aim for citizens to always and

Dec 8, 2022
The new modern discord token grabber & token stealer, with discord password & token even when it changes

The new modern discord token grabber & token stealer, with discord password & token even when it changes

Stanley 143 Jan 6, 2023
Angular JWT refresh token with Interceptor, handle token expiration in Angular 14 - Refresh token before expiration example

Angular 14 JWT Refresh Token example with Http Interceptor Implementing Angular 14 Refresh Token before Expiration with Http Interceptor and JWT. You

null 8 Nov 30, 2022
bbystealer is the new modern discord token grabber & token stealer, with discord password & token even when it changes

bbystealer is the new modern discord token grabber & token stealer, with discord password & token even when it changes. Terms Educational purpose only. Reselling is forbidden. You can use the source code if you keep credits (in embed + in markdown), it has to be open-source. We are NOT responsible of anything you do with our software.

null 10 Dec 31, 2022
Unified-myst is a monorepo containing packages for using MyST

unified-myst (IN-DEVELOPMENT) unified-myst is a monorepo containing packages for using MyST (Markedly Structured Text), within the unified ecosystem.

Executable Books 5 Apr 14, 2022
Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Supabase auth, frontend + backend - example with Next.js Learn how to set up Supabase auth for both the frontend and backend of your application using

YK 7 Nov 20, 2022
Pim 4 Jun 21, 2022
A web application that allows the user to connect through Unstoppable Domains and claim a small block of the site

FRAGMENTED Summary A web application that allows the user to connect through Unstoppable Domains and claim a small block of the site. Each user will b

null 2 Jan 24, 2022
Use thirdweb's token, edition drop, and a custom contract using thirdweb deploy to build a Play-to-Earn game!

thirdweb Play-to-Earn Example This example project is a simple Play-to-Earn (P2E) game! The Idea The game is a "mining" game, where your character min

thirdweb templates 28 Jan 2, 2023
Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

null 2 Jan 5, 2022
Ethernaut.5.token - Exercice 5 (Token) on Ethernaut

Advanced Sample Hardhat Project This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the

Shoto 1 Jan 3, 2022