vedant-vector / hardhat-hands-on

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hardhat - Hands-on

Submission By:- Vedant Soni [Blockchain Trainee]

Aim:- Use hardhat for developing, testing and deploying any contract of your choice. You must create hardhat tasks to deploy and verify the contract.

Contract :-

Vesting.sol

Tasks :-

  1. To Deploy Contract
    npx hardhat deploy Screenshot from 2023-04-11 13-53-12

  2. To Verify Contract
    npx hardhat verify-task Screenshot from 2023-04-11 13-59-24

Testing

Test Cases:- Test-cases for Vesting

  1. addVestingTokens Function Test Cases
    ✔ User must add some tokens
    ✔ Slice Period must be less than Vesting period
    ✔ Event emission of DepositTokens
    ✔ Balance Updation of User after token vested
    ✔ Balance Updation of Contract after token vested
  2. CalculateVestedAmount Function test cases
    ✔ All tokens must be return after vesting time ends
    ✔ No token should be vested before first interval
    ✔ No tokens should be relased after all tokens get released
    ✔ Event emission for VestedTokens
  3. Withdraw function test cases
    ✔ Non benificier can't withdraw
    ✔ Only benificiar can withdraw
    ✔ Withdrawable amount must be more than zero to withdraw
    ✔ User balance should be increse after withdraw
    ✔ Event Emission for WithdrawTokens

Screenshot

Screenshot from 2023-04-11 14-05-51

About


Languages

Language:JavaScript 78.5%Language:Solidity 21.5%