ethersjs运行时出现的问题

1.在运行部署在ganache1.1.0上的合约中的某个函数时,出现了这样的问题,之前部署在geth上时并没有这样的问题

userdeMacBook-Pro:test-ethers user$ node test-index.js 
CreateAndBuyToken error :Error: Transaction hash mismatch from Provider.sendTransaction. (expectedHash="0x211f260dbb90994afc634271d596bde5ddc17da85c24abca30691c1193f39f1b", returnedHash="0x8e0223f1a8627ed6b9677e0fb09bd02cda5f1cea0e19edebda44c771803bc697", version=4.0.13)

发现这好像是ganache版本的问题:

I experienced the same issue with ganache-cli@6.2.1 paired with ethers@4.0.12. Downgrading to ganache-cli@6.1.8 fixed the issue.

所以后面打算还是使用geth

 

2.

 Error: gas required exceeds allowance or always failing transaction

在运行合约函数时加上{gasLimit : 500000}即可,因为eth_estimateGas得出了infinite的结果

 

转载于:https://www.cnblogs.com/wanghui-garcia/p/10109179.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值