Environment
I'm using REMIX Online IDE.
Details
I'm trying to transfer tokens from a LINK erc20 wallet (Connected via Metamask) to my contracts address.
The approveTransfer functions goes in without an issue, however when i call the transferToken function i keep running into "reverted" error.
I did verify that i have enough balance in my link token address before trying to send.
At this point i'm not sure what i did wrong.
Would appreciate all the help i can get <3 regards Dan.
Code to reproduce
address linkAdr = 0x84b9B910527Ad5C03A9Ca831909E21e236EA7b06; IERC20 link = IERC20(linkAdr); uint256 public userlinkbalance = 0; address public msgSender = _msgSender(); uint256 public approvedAmount = 0; function transferToken(uint256 amount) external returns(string memory){ uint256 linkAmt = amount * 10**18; link.transferFrom(_msgSender(), address(this), linkAmt); } function approveTransfer(uint256 amount) external returns(string memory) { uint256 approveAmt = amount * 10**18; userlinkbalance = link.balanceOf(_msgSender()); link.approve(address(this),approveAmt); approvedAmount = approveAmt; } function getLinkBalance() public view returns(uint256){ return link.balanceOf(address(this)); }