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的結果