On-chain components of the Umbra protocol.
This dev toolchain is based on @PaulRBerg's hardhat-template repo and includes:
- Hardhat: compile and run the smart contracts on a local development network
- TypeChain: generate TypeScript types for smart contracts
- Ethers: renowned Ethereum library and wallet implementation
- Waffle: tooling for writing comprehensive smart contract tests
- Solhint: linter
- Prettier Plugin Solidity: code formatter
Before running any command, make sure to install dependencies:
$ yarn installCompile the smart contracts with Hardhat and generate the TypeChain bindings in typechain/:
$ yarn buildRun Solhint, ESLint, and the Prettier check:
$ yarn lintApply available fixes and formatting, then rerun the checks:
$ yarn lint:fixTo run a single linter, use yarn lint:sol for Solhint or yarn lint:ts for ESLint.
Format the code with Prettier:
$ yarn prettierRun the Mocha tests:
$ yarn testRun the tests with a gas report:
$ yarn test:gasDeploy the Umbra and StealthKeyRegistry contracts to a network defined in hardhat.config.ts, using the account derived from MNEMONIC in .env. Deployment records are saved to deploy-history/:
$ yarn deploy --network <network>To deploy only the StealthKeyRegistry:
$ yarn deploy:registry --network <network>Delete the smart contract artifacts, the TypeChain bindings and the Hardhat cache:
$ yarn clean