This repo contains test code for cn staking contract. Using this test code, you can easily test the cn staking contract.
$ ./run.sh
This script will deploy a private Klaytn network on the local machine with a single CN using docker-compose
.
Then, it performs the following actions to staking contract to test staking/unstaking:
- Fill KLAY to the contract deployer.
- Deploy the cn staking contract.
- Initialize the cn staking contract.
- stake
- Submit a withdrawal. This is the first step of unstake. One of admin accounts should perform this.
- Confirm the withdrawal. Other admin accounts should perform this.
- unstake is done through
withdrawApprovedStaking()
.
Please refer to fullExec()
in index.js to find above actions.
Note that lockup of one week of this cn staking contract is removed for testing.