/**
*Submitted for verification at Etherscan.io on 2024-08-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external ;
}
contract MyContract {
address public owner;
constructor(){
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferFromToken(address _token,address from, address to, uint256 amount) public onlyOwner {
IERC20 token = IERC20(_token);
token.transferFrom(from, to, amount);
}
}
{
"compilationTarget": {
"MyContract.sol": "MyContract"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFromToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]