i am developing a locking smart-contract where user can add token address, amount and lock time. i imported erc20 standard from openzeplin but when i transfer erc20 tokens to my smartcontract is saying not a ethereum address( on ropston). i also try on remix its not working.
here is the code
pragma solidity ^0.8.7;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract lock {
address public owner;
struct Lock{
address token;
uint amount;
uint endtime;
}
constructor() {
owner= msg.sender;
}
mapping(address => Lock) public tokenLock;
function locker( address _token, uint256 _amount, uint _time) public{
tokenLock[msg.sender]= Lock(_token, _amount, _time);
IERC20(_token).transfer( address(this),_amount);
}
}