current position:Home>I want to write a usdt collection and transfer contract. I want to call the transferform interface of usdt in this collection contract, but an error is reported when calling.

I want to write a usdt collection and transfer contract. I want to call the transferform interface of usdt in this collection contract, but an error is reported when calling.

2022-02-03 23:28:15 Q & A of Denglian community

The contract code I call is as follows :

    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);        }    }

The error message is as follows :

###### 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" }

The call is called in the normalized set. USDT The contract allowance,balanceof All interfaces are normal . I hope I can help . thank you




Take the answer 1:

hold hander Interface defined transferFrom The return value of is removed . This is because USDT Not fully following ERC20 standard






Other answers 1:


Other answers 2:


Other answers 3:


Other answers 4:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032328082621.html

Random recommended