Please help. How do I go bout this?
fail with error when interacting with the contract means a condition in a method that we call doesn't meet the requirement.
i didn't go through the whole logic of the contract, but it seems the method you call was withdraw()
function and the first requirement we need to pass to have a successful txn is:
require( (user.checkpoint + TIME_STEP) < block.timestamp ,"only once a day" );
it means when you made a txn, (user.checkpoint + TIME_STEP) at that particular state is bigger than the block.timestamp. when it happened, the txn is reverted (we still need to pay some gas) and return the error message: "only once a day".
here's a good article to understand require
function in solidity:
hope it helps.