我寫了一個簡單的拍賣合約檔案,它的大小是 9.49KB(磁盤上 12KB),當我使用 運行這個合約時npx hardhat test
,我得到這個錯誤:
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="Transaction reverted: trying to deploy a contract whose code is too large", method="estimateGas", transaction={"from":"0xf39Fd6e...
我認為當合約檔案超過 24,576 位元組(即 24KB)時會發生此錯誤。但是我的檔案只超過了 10Kbs,我不能再縮小我的代碼了。我應該怎么辦?
uj5u.com熱心網友回復:
它可能與您的進口量相加。嘗試使用allowUnlimitedContractSize
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/504758.html
上一篇:如何使用Typescript、Jest和Axios在同一個單元測驗中模擬兩個不同的請求?
下一篇:在C#單元測驗中使用2位元組陣列