Biders need to send 0.001 ether to participate in the lottery by calling placeBid
.
If 3 blocks has been passed without someone bidding, whoever call the placeBid
latest will be regarded as winner and staked amount would become claimable balance of him. Winners can widraw their rewards by calling claimTreasure
.
npx hardhat compile
npx hardhat test
npx hardhat compile
npx hardhat run scripts/deploy.ts --network=<network>
To check more details for harthat CLI, check here
PlaceBid should work
success testPlaceBid should not work
failure testclaimTreasure should work
success test