Skip to content

Smart contracts for the CAR gasless auction and NFT token

License

Notifications You must be signed in to change notification settings

shl0ms/CAR-contracts

Repository files navigation

$CAR gasless auction and NFT contracts

Development Process

Development follows these processes outlined in development process


Project Installation, building and running

Git clone, then from the project root execute

Install

To retrieve the project dependencies and before any further tasks will run correctly

npm ci

Husky Git Commit Hooks

To enable Husky commit hooks to trigger the lint-staged behaviour of formatting and linting the staged files prior before committing, prepare your repo with prepare.

npm run prepare

Build and Test

npm run build
npm test

If you make changes that don't get picked up then add a clean into the process

npm run clean
npm run build
npm test

Hardhat

If you want to avoid using the convience scripts, then you can execute against Hardhat directly.

All tests

Target to run all the mocha tests found in the /test directory, transpiled as necessary.

npx hardhat test

Single test

Run a single test (or a regex of tests), then pass in as an argument.

 npx hardhat test .\test\sample.test.ts

Scripts

The TypeScript transpiler will automatically as needed, execute through HardHat for the instantiated environment

npx hardhat run .\scripts\sample-script.ts

Logging

Logging is performed with Bunyan

Bunyan CLI

To have the JSON logging output into a more human-readable form, pipe the stdout to the Bunyan CLI tool.

npx hardhat accounts | npx bunyan

Sequence Diagram Rendering

To create or update the renders for the Plant UML sequence diagrams

Ensure Java is installed

java -version

The output will vary depending on OS, however if it fails claiming Java is not found, then you must install before proceeding.

Generate renders for all Plant UML documents under docs/spec

npm run plant