Skip to content

marco-jardim/merkle-verifier

Repository files navigation

merkle-verifier

Proof of inclusion sample contract.

Proof of Inclusion CI

🔧 Setting up local development

Requirements

Local Setup Steps

# Clone the repository
git clone https://github.com/marco-jardim/merkle-verifier.git

# Install dependencies
npm install

# Set up environment variables (keys)
cp .env.example .env # (linux)
copy .env.example .env # (windows)

### Hardhat usage:
## Just Compile: 
npx hardhat compile

## Deploy locally: 
# Dry deployment: 
npx hardhat deploy

# With node running:
npx hardhat node

# Connect with console:
npx hardhat console --network localhost

## Compile and Deploy to Rinkeby:
npx hardhat deploy --network rinkeby

## Test: 
npx hardhat test

# Generate typescript files
npx hardhat typechain

# Clean artifacts (doesn't need to be versioned):
npx hardhat clean

Notes for localhost

  • The deployments/localhost directory is included in the git repository, so that the contract addresses remain constant. Otherwise, the frontend's constants.ts file would need to be updated.
  • Avoid committing changes to the deployments/localhost files (unless you are sure), as this will alter the state of the hardhat node when deployed in tests.

📖 Guides

  • Check out ./test/test.ts for a full example of how to interact with the contract.

Contracts