`pragma solidity ^0.6.6;
contract timeBound{
uint256 timeLocked = 1589026500;
event Transfer(address _from, address _to, uint256);
mapping(address => uint256) private balance;
modifier timeChecker{
require(block.timestamp >= timeLocked, "ERC20: time locked for certain period");
_;
}
function lockCall() public timeChecker {
uint256 value = 10;
address receiver = 0xDd395D13d892Fb482e5E7392e0f58BC4F55c9d69;
require(msg.sender != address(0));
balance[receiver] = balance[receiver] + value;
emit Transfer(address(msg.sender), address(receiver), value);
}
//This balanceOf() function not returns the token balance of this contract
function balanceOf(address account) public view returns(uint256){
return balance[account];
}
}`
in the above contract timeLocked
variable is used for next 15 minutes, and require(block.timestamp >= timestamp)
is checking, when i deployed it on ropsten testnet, the receiver
gets tokens immediately before the desire time. how to counter this issue?
balanceOf
function not returns the contract token balance but the contract has tokens which will transfer in the lockCall
function to the given address.
1589026500
for a timestamp???1589026500
uinx time, next 15 minutes when i deploy contract,