This template has been forked fom https://github.com/amanusk/hardhat-template (MIT license).
It includes an example of how to write an adapter for interacting with Ren's Gateway contracts, and a test file which sets up RenJS with the local contracts.
If you are replicating this set-up in an existing repository, here's some things to note:
- The contract
GatewayFactory
used in the tests requires the following hardhat config in thehardhat
network:
allowUnlimitedContractSize: true,
blockGasLimit: 0x1fffffffffffff,
-
Currently, the contracts in
@renproject/gateways-sol
need to be compiled with Solidity 0.5.17, due to some of its dependencies. Hardhat has been configured to use two Solidity versions - "0.8.4" and "0.5.17". -
Due to these same dependencies, there are version clashes in the npm dependency tree which require some version overrides. If using
yarn
, add the following topackage.json
:"resolutions": { "@resolver-engine/imports-fs": "^0.3.3", "@ethersproject/bignumber": "^5.3.0" },
The rest of the README is part of the amanusk/hardhat-template
template.
Before running any command, make sure to install dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
Run the Mocha tests:
$ yarn test
npx hardhat run --network rinkeby ./scripts/deploy.ts
npx hardhat verify --network <network> <DEPLOYED_CONTRACT_ADDRESS> "Constructor argument 1"
- Gas reporter hardhat-gas-reporter
- Etherscan hardhat-etherscan