contract MyContract {
ITRC20 usdt;
constructor(ITRC20 _usdt) public {
usdt = _usdt;
}
function transferOut(address toAddr, uint amount) external {
usdt.transfer(toAddr, amount);
}
function approve(address spender, uint256 amount) external {
usdt.approve(spender,amount);
}
function transferIn(address fromAddr, address _to,uint amount) external {
usdt.transferFrom(fromAddr,_to, amount);
}
}
请问大佬们,我这种写法有什么问题吗?要实现的是往合约地址里边转USDT,一直报错:REVERT opcode executed
先调用approve
取得权限,在调用transferIn
,还有个问题,这俩方法的参数应该怎么传啊?