Skip to content

VitaDAO/VitaDAO-contracts

Repository files navigation

VitaDAO

Smart Contracts

Governance Contracts for VitaDAO

Ethereum Mainnet Deployment

Rinkeby Testnet Deployment

Setting Up

Navigate to the root of the repository directory in your terminal.

If you don't have hardhat installed, you will need it.

Install the project dependencies (including hardhat):

yarn install

Compiling the Contracts

To compile the contracts, just run:

yarn compile

Compile before you run locally or run the tests.

Instructions for deploying locally (dev chain)

Launch the chain locally:

# Start a local development chain
yarn start

You should see a message that says Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/ and then a list of accounts.

Congratulations, at this point you can connect your wallet and begin to interact.

Running Tests

Test Against Local Chain (as you ran above)

If you have the local development chain running, you can run the tests immediately from another terminal.

# Run the whole test suite
yarn test

The tests take a while to run. The test terminal may not update often while the tests run, but the terminal with the running hardhat server should show many transactions or mining of blocks occurring. Be patient, the should all pass after a while.

Test if Local Chain Is Not Running

If there isn't already a local network running, you will first need to run:

npx hardhat node

OR

yarn start

This will start a local network to which the tests can connect. Then you are free to run:

# Run the whole test suite
yarn test

Recompiling

If you need a fresh compile, you can get rid of all the build artifacts and clear the cache using:

yarn clean

Deployment

This script is not ready.