The tests with this configuration makes "a copy" of the external blockchain from the RPC_URL provided. This lets you play with the current state in your tests.
Create a .env.local
file from the .env.example
. You need these to run the tests
RPC_URL
: unquoted URL to the RPC with basic authenticationNOK_ADDRESS
: address to the NOK(CBToken) contractME_ADDRESS
: Your address or anyone else. (user to fetch balanceOf of the address)WHALE_ADDRESS
: Address of someone you categorize as a "Whale" in the NOK contract. Used to transfer NOK to you if you want more đź’°
./contracts
contains CBContract.sol
which is the actual contract for NOK token.
Run the test for NOK (which is deployed already) and TokenLock which we deploy automatically before tests are run
yarn test
This is a useful tool if you want to impersonate another address on the network. We do this CBToken.spec.ts
and TokenLock.spec.ts
Let's say you want to transfer tokens from someone or call functions on contracts that are only callable by certain addresses
For deploying contracts, building typescript interfaces to the network please read more in the Hardhat documentation