有偿求助,合约 转 erc20 代币,出现Gas estimation errored,账户里有代币,并授权过...
source link: https://learnblockchain.cn/question/2220
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
15 有偿求助,合约 转 erc20 代币,出现Gas estimation errored,账户里有代币,并授权过
错误:
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
The execution failed due to an exception. Reverted
kovan ,代币地址:0x7228fdb0738ad6b3fe768b53fc764eef89aea216
代码已经上传,构造需要传参数
调用代码:
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
contract TokenTransfer{
IERC20 public wowToken;
constructor() public{
wowToken = IERC20(0x7228fDb0738Ad6B3fE768B53FC764eef89aea216); //实例化一个token
}
function tokenTransfer(address _to, uint _amt) public {
wowToken.transfer(_to,_amt); //调用token的transfer方法
}
}
已解决*****************
Recommend
-
7
在网上抄的代码,在部署时提示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" }...
-
2
求助!!!geth搭建私链部署合约的时候,返回address: undefined,(已挖矿) 求助!!!geth搭建私链部署合约的时候,返回address: undefined,(已挖矿)
-
1
大神bsc nodejs 合约交互求助 大神bsc nodejs 合约交互求助 bsc...
-
4
V2EX › 程序员 #有偿求助#了解 [强化学习知识推理] [知识图谱补全] 的大佬看过来 teemocat
-
7
V2EX › Python 有偿求助, browsermobproxy+selenium 怎么连接 IP 池? doolindalton ·...
-
3
车上出现"背宝剑小人"?女子紧急求助交警!网友看后傻眼... 车上出现"背宝剑小人"?女子紧急求助交警!网友看后傻眼...
-
5
V2EX › 问与答 [求助]openclash 出现大量的上传连接,消耗了上百 G 机场流量
-
3
V2EX › 程序员 有偿求助 Mulesoft 的语法 mu...
-
4
V2EX › 程序员 有偿求助两个深度学习相关问题 y...
-
1
修改了ApplicationResource,页面出现乱码!求助! ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK