0.0.15 • Published 2 years ago
hardhat-forktools v0.0.15
hardhat-forktools
Overview
Adds some tools for use during testing in hardhat forks, like:
- getWrappedTokenAddress(){
- wrapNative
- swapExactETHForTokens
- addLiquidity
- setBalance
- setStorageAt
- impersonate
- advanceBlock
- advanceBlocks
- logEvents
Currently supports the following networks:
- Ethereum mainnet
- BSC
- Polygon
How to install
Install with npm or yarn by doing yarn add hardhat-forktools
Then in hardhat.config.ts
add
import "hardhat-forktools";
How to use
Forktools are injected in the HardhatRuntimeEnvironment, so you can just do hre.forktools.wrapNative(5000, mySigner)
to convert native to wrapped.
Known issues
- Only 3 networks are supported
- ?