I have erc20 tokens. Now I want to send these tokens to the current contract. How can I send it?
function bid(uint256 tokens) public {
require(block.timestamp < time,"time exceeded");
require(token.balanceOf(msg.sender) >= tokens,"less balance");
balance[counter][msg.sender] += tokens;
token.approve(msg.sender, tokens);
token.transferFrom(msg.sender, address(this), tokens);
}
This is what I did but function is not excuting.