Solidity code used by other Venus projects
npm install @venusprotocol/solidity-utilities 
- NodeJS - 18.x
- Solc - v0.8.13 (https://github.com/ethereum/solidity/releases/tag/v0.8.13)
``
yarn install
`
Linting is done using eslint for typescript and solhint for solidity. Prettier is used to format solidity and typescript files.
To check linting and formatting on all files run:
`sh`
$ yarn lint
Linting command can be run with the fix flag to fix eligible errors automatically
`sh`
$ yarn lint:sol --fix
$ yarn lint:ts --fix
To pretty all files run:
`sh`
$ yarn prettier
`
npx hardhat test
`
- To run fork tests add FORK_MAINNET=true PRIVATE_KEY and QUICK_NODE_KEY in the .env file.
Releases are automatically managed using semantic-release and commit messages.
`
npx hardhat deploy
`
- This command will execute all the deployment scripts in ./deploy directoryhardhat
- The default network will be hardhat.config.ts
- Deployment to another network: - Make sure the desired network is configured in - Add PRIVATE_KEY variable in .env file - Execute deploy command by adding --network in the deploy command above - E.g. npx hardhat deploy --network bsctestnettags
- Execution of single or custom set of scripts is possible, if:
- In the deployment scripts you have added for example: - func.tags = ["MockTokens"];--tags "
- Once this is done, adding to the deployment command will execute only the scripts containing the tags.
``
npx hardhat etherscan-verify --network
`
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
npx hardhat help
REPORT_GAS=true npx hardhat test
npx hardhat coverage
TS_NODE_FILES=true npx ts-node scripts/deploy.ts
npx eslint '*/.{js,ts}'
npx eslint '*/.{js,ts}' --fix
npx prettier '*/.{json,sol,md}' --check
npx prettier '*/.{json,sol,md}' --write
npx solhint 'contracts/*/.sol'
npx solhint 'contracts/*/.sol' --fix
`
Documentation is autogenerated using solidity-docgen.
They can be generated by running yarn docgen`