@venusprotocol/guardian
v1.0.0
Published
Safe module to pause Venus markets
Keywords
Readme
Development
Prerequisites
NodeJS >=18.0.0
Solc v0.8.25 (https://github.com/ethereum/solidity/releases/tag/v0.8.25)
Installing
yarn install
Linting and code formatting
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:
$ yarn lintLinting command can be run with the fix flag to fix eligible errors automatically
$ yarn lint:sol --fix
$ yarn lint:ts --fixTo pretty all files run:
$ yarn prettierRun Tests
npx hardhat test- To run fork tests add FORK=true, FORKED_NETWORK and one ARCHIVE_NODE var in the .env file.
Compilation
The project supports compilation for both regular Ethereum networks and ZKSync networks.
Regular Compilation
npx hardhat compileZKSync Compilation
npx hardhat compile --config hardhat.config.zksync.tsFull Compilation (Both Configurations)
yarn compileThis command compiles contracts for both regular and ZKSync configurations.
Releases and Versioning
Releases are automatically managed using semantic-release and commit messages.
Deployment
npx hardhat deploy- This command will execute all the deployment scripts in
./deploydirectory - The default network will be
hardhat - Deployment to another network:
- Make sure the desired network is configured in
hardhat.config.ts - Add
DEPLOYER_PRIVATE_KEYvariable in.envfile - Execute deploy command by adding
--network <network_name>in the deploy command above, e.g.npx hardhat deploy --network bsctestnet
- Make sure the desired network is configured in
ZKSync Deployment
For ZKSync networks, use the ZKSync configuration:
npx hardhat deploy --config hardhat.config.zksync.ts --network zksyncsepoliaAvailable ZKSync networks:
zksyncsepolia- ZKSync Sepolia testnetzksyncmainnet- ZKSync mainnetExecution of single or custom set of scripts is possible, if:
- In the deployment scripts you have added
tagsfor example: -func.tags = ["MockTokens"]; - Once this is done, adding
--tags "<tag_name>,<tag_name>..."to the deployment command will execute only the scripts containing the tags.
- In the deployment scripts you have added
Verify Contracts
npx hardhat etherscan-verify --network <network-name>Hardhat Commands
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
Documentation is autogenerated using solidity-docgen.
They can be generated by running yarn docgen
