Skip to content

diginex/CryptoCarz

Repository files navigation

CryptoCarz smart contracts

Contracts

Please see the contracts/ directory.

Develop

Contracts are written in Solidity and tested using Truffle and ganache-cli.

Dependencies

# Install local node dependencies
$ npm install

Test

# Compile all smart contracts
$ npm run build

# Run all tests
$ npm test

# Run test coverage analysis
$ npm run coverage

Docker

A Docker image to run containerized testing is provided. Requires [Docker Compose][docker compose].

# Build the container and run all tests
$ make build test

# Run a test for a single contract
$ docker-compose run --rm truffle npm test test/CryptoCarzToken.test.js

Web3.js examples

Examples are provided on how to call a function of the smart contract from Node.js and how to deploy the smart contract in an Ethereum blockchain (e.g. mainnet, testnet, etc.)

# Run the example scripts
$ ts-node src/examples.ts

# Transpile to Javascript and run
$ tsc && dist/examples.js