我想写一个合约,该合约可以转移波场shasta的usdt,以下是我代码 1。我用的是波场shasta测试网 2.我使用了官方的代码模板 https://github.com/TRON-Developer-Hub/TRC20-Contract-Template 3。transferuuu的usdt地址是TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs,也就是contractaddress参数值,我执行地址是有usdt的
问题: 我用TRON-IDE部署后,执行transferuuu函数,amount如果是0可以正常执行,但是大于1时,从外部执行,提示错误信息:REVERT opcode executed。请问怎么回事
以下是我TRON-IDE截图
` pragma solidity ^0.5.0;
import "./ITRC20.sol"; import "./SafeMath.sol";
contract TRC20 is ITRC20 {
ITRC20 private _uuuu;
function transfer(address recipient, uint256 amount) public returns (bool) {
emit Transfer(msg.sender, recipient, amount);
// _transfer(msg.sender, recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "TRC20: transfer from the zero address");
require(recipient != address(0), "TRC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function transferuuu(address contractaddress,address recipient, uint256 amount) public returns (bool) {
_uuuu = ITRC20(contractaddress);
_uuuu.transfer(recipient,amount);
// return true;
}
}`