windingtree / videre-contracts

Videre Protocol smart contracts 📃
GNU General Public License v3.0
0 stars 2 forks source link

author: mfw78 mfw78@protonmail.com

Videre Engine Smart Contract

Overview

Videre is a collection of contracts that allows for implementation of real-world service marketplaces. Components of the contracts include:

For more information, please see the docs.

Usage

First configure a .env file. You can copy .env.template to .env and change the defaults. You MUST specify a MNEMONIC.

To compile and run a hardhat test node with the contract deployment:

yarn #installs packages
yarn hardhat node

Tests

Test contracts are located in contracts/test, with unit tests being written in Typescript. The unit tests are found within test and make extensive use of fixtures from hardhat-deploy.

Deployment

The deployment in videre-contracts is handled by hardhat-deploy which handles deployment in the following scenarios:

  1. Local unit testing - deploy to hardhat local chain.
  2. Staging - deploys to live testnet (ie. sokol, goerli, ropsten, etc).
  3. Production (forking) - deploy to hardhat local chain forked from production archive node.
  4. Production - deploy to live environment.

CI/CD

All PR are linted and subjected to local unit tests. Once a PR is pushed to the main branch, upon successful completion of linting and local unit tests, the contracts are pushed automatically to the nominated staging testnet (eg. sokol).

All staging releases are deployed using transparent proxy contracts, allowing for in-place upgrading in the development cycle.

WARNING: When a smart contract is modified such that it's storage layout changes, this is grounds for nominating a breaking change in the commit message, at which time the entire staging environment should be redeployed with new addresses published to the in the release notes.

Sokol (staging)

All contracts have source code verified via sourcify, with this being accessible via blockscout.

Developers: In order to get whitelisted / receive test tokens, please kindly ask for help in our discord.

How to use

Unit testing:

yarn test

Coverage analysis:

yarn hardhat coverage

Run deploy scripts and deploy to sokol:

yarn hardhat deploy --network sokol

Now verify the contracts on Sourcify:

yarn hardhat sourcify --network sokol

NOTE: Substitute gnosis above for the applicable target network.