Code to reproduce
pragma solidity ^0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol";
contract Trust {
using SafeMath for uint256;
uint256 y=10;
IERC20 public token;
function q (IERC20 _token)public{
_token.approve(msg.sender,y);
_token.transferFrom(msg.sender,address(this),y);
}
}
transact to Trust.q errored: VM error: revert. revert The transaction has been reverted to the initial state. Reason provided by the contract: “ERC20: transfer amount exceeds allowance”. Debug the transaction to get more information.