The contracts are developed with the Foundry toolkit. The project was initialized with the Foundry Template.
The development of the project requires functional installations of:
$ npm install$ forge build$ forge clean$ forge test$ npm run test:coverage$ npm run test:coverage:report$ npm run lintFormatting Solidity code with Forge:
$ forge fmtFormatting JavaScript code with Prettier:
$ npm run prettier:writeStart anvil in one terminal:
$ anvilDeploy the contracts from another terminal:
$ ./main.sh deploy --localIf 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-artifactsThe artifacts will be copied to the ../wellness-frontend/public/foundry-artifacts directory.
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 --testnetThis will deploy the contracts to the Base Sepolia network and verify them on BaseScan. The artifacts will be copied to
the ../testnet-artifacts directory.
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-analyzerAn to run the static analysis on the whole project just run:
$ slither .