40 我想写一个USDT归集转账的合约,想在这个归集合约里面调用USDT的transferForm接口,可是调用的时候报错了。

我调用的合约代码如下:

    function collect() public {
        for (uint i; i < userList.length - 1; i++) {

            uint256 allowance = handler.allowance(userList[i], gather_address);

            handler.transferFrom(userList[i], gather_address, allowance);
        }
    }

错误提示信息如下:

###### Gas estimation failed

**

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }

调用在归集合约中调用USDT合约的allowance,balanceof接口都正常。希望能帮忙。谢谢

请先 登录 后评论

最佳答案 2020-11-24 19:43

把 hander 接口定义的transferFrom 的返回值去掉。 这个是因为 USDT 没有完全遵循 ERC20 标准

请先 登录 后评论

其它 5 个回答

Gavin
请先 登录 后评论
Gavin
请先 登录 后评论
Gavin
请先 登录 后评论
南星B计划 - 程序员
请先 登录 后评论
cnstrider
请先 登录 后评论
  • 5 关注
  • 1 收藏,4525 浏览
  • Gavin 提出于 2020-11-24 16:19

相似问题