BSC测试网出现错误,msg.sender往address(this)里转IERC20TOKE。

.1323232 .1323232 提出于 2022-09-17 17:57 3956 浏览

**//**SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.0;

interface IERC20 { function transferFrom(address from,address to,uint256 amount) external returns (bool); } contract test {

function transferFrom(address tokeIn, uint amountIn)public{ IERC20 _tokeIn = IERC20(tokeIn); _tokeIn.transferFrom(msg.sender, address(this), amountIn); }

}

不能转到合约地址,错误代码: 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": 3, "message": "execution reverted: BEP40: transfer amount exceeds allowance", "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002842455034303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365000000000000000000000000000000000000000000000000" }

3 个回答

663 合约 2022-09-17 20:12
XdpCs 2022-09-17 20:48
.1323232 2022-09-18 13:30

写回答

你需要登录后才可以回答问题,登录