Test env. commands

Using the Hardhat framework, interacting with a contract deployed in the local environment is implemented as a CLI. All commands can be called with yarn hardhat <command>. The implementation is under the tasks/ folder, so please refer to the task.

When testing on the local environment, first run yarn hardhat:deploy to open the local environment.

// example: get pool info
$ yarn hardhat pool:info 0xe7de38237a4ED33fbf30f5aaD683F99Bc6c15817


┌────────────────────────────────────────────┬────────┬────────┬─────────┬────────────┬───────────────────────────┬───────────────────────────┬────────────────────┐
 pool Address                                token0  token1  swapFee  priceRatio  reserve0                   reserve1                   totalValueLock ($) │
├────────────────────────────────────────────┼────────┼────────┼─────────┼────────────┼───────────────────────────┼───────────────────────────┼────────────────────┤
 0xe7de38237a4ED33fbf30f5aaD683F99Bc6c15817  KDAI    WKLAY   0.002    0.92336     1052510019943583677983227  1000189271702431420936569  2142716            
└────────────────────────────────────────────┴────────┴────────┴─────────┴────────────┴───────────────────────────┴───────────────────────────┴────────────────────┘

tasks

accounts

Returns accounts list of local test environment

yarn hardhat accounts

┌───────────────┬────────────────────────────────────────────┬───────────────────────────────┐
 name           address                                     balance                       
├───────────────┼────────────────────────────────────────────┼───────────────────────────────┤
 deployer       0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266  9999999329713343500000000000  
├───────────────┼────────────────────────────────────────────┼───────────────────────────────┤
 dev            0x70997970C51812dc3A010C7d01b50e0d17dc79C8  10000000000000000000000000000 
├───────────────┼────────────────────────────────────────────┼───────────────────────────────┤
 user100        0x90F79bf6EB2c4f870365E785982E1f101E93b906  9998999998657649250000000000  
├───────────────┼────────────────────────────────────────────┼───────────────────────────────┤

addresses

Returns Pangea contracts list of local test environment

dashboard:tokens

Returns token info in local test environment

  • caution : token prices are set randomly

dashboard:pools

Returns every pools' info in local test environment

dashboard:positions

Returns every positions' info in local test environment

pool:create

Creates a new pool

position:mint

Mints a new position

position:addLiquidity

Adds liquidity to existing position

position:burn

Burns existing position

(If the amount is larger than existing liquidity, NFT will be burn after claiming liquidity+fees)

position:collect

Claims fee from position

swap:exactInputSingle

Swaps token in pool (Based on Input amount)

swap:exactOutputSingle

Swaps token in pool (Based on Output amount)

erc20:balanceOf

Returns balance of user

erc20:faucet

Gets token for test

Last updated