Skip to content

Smart contract of Wellness Project

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

bbs-paris/wellness-smart-contracts

Repository files navigation

Wellness Reward Smart Contracts

The contracts are developed with the Foundry toolkit. The project was initialized with the Foundry Template.

Installation

The development of the project requires functional installations of:

Essential Commands

Install Node.js dependencies

$ npm install

Build smart contracts

$ forge build

Clean

$ forge clean

Tests execution

$ forge test

Tests execution with coverage report

$ npm run test:coverage

Tests execution with coverage report in HTML

$ npm run test:coverage:report

Linting

$ npm run lint

Formatting code

Formatting Solidity code with Forge:

$ forge fmt

Formatting JavaScript code with Prettier:

$ npm run prettier:write

Deploying the contracts

On anvil local network

Start anvil in one terminal:

$ anvil

Deploy the contracts from another terminal:

$ ./main.sh deploy --local

If the frontend project is located in the same directory as the contracts, i.e. ../wellness-frontend, you can enable the copy of the artifacts to the frontend project after the deployment with:

$ ./main.sh deploy --local --copy-artifacts

The artifacts will be copied to the ../wellness-frontend/public/foundry-artifacts directory.

On Base Sepolia network

First, export the required variables:

$ export API_KEY_BASESCAN=<your-api-key>
$ export PRIVATE_KEY=<your-private-key>
$ export PUBLIC_KEY=<your-account-address>

PRIVATE_KEY and PUBLIC_KEY are the private and public keys of the account you want to use to deploy the contracts.

API_KEY_BASESCAN is your BaseScan API key, required to verify the contracts on BaseScan. You can get an API key by creating an account on BaseScan.

Then, deploy the contracts:

$ ./main.sh deploy --testnet

This will deploy the contracts to the Base Sepolia network and verify them on BaseScan. The artifacts will be copied to the ../testnet-artifacts directory.

Static Analysis

Slither is used to improve the quality of the code. There is a dedicated job on the CI pipeline to run the static analysis.

But you can also run it locally. For that you will need to install slither. If you have a functionnal python environment, you can install Slither as follow:

$ pip install slither-analyzer

An to run the static analysis on the whole project just run:

$ slither .

About

Smart contract of Wellness Project

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published