Cannot Estimate Gas #3296
Unanswered
dhwanilTrojanpy
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hello @dhwanilTrojanpy, Did Patrick deploy and use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to deploy the SimpleStorage contract from FactoryStorage Contract. In the tutorial, we are deploying it on Ethereum. As we have already deployed it on the zkSync, I am trying to deploy it on the zkSync as well. when I try to make a transaction by clicking on FactoryStorage, It gives me the below error.
Error in function invocation (message): "cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason=\"execution reverted\", method=\"estimateGas\", transaction={\"from\":\"0xac6796E373Ef3D2BC7C2E76C8a1660C0A9a38A50\",\"to\":\"0xFacD19392FB16C2acdBbc8A94c3FDa8AFd00Be56\",\"data\":\"0x1dda6541\",\"type\":0,\"accessList\":null}, error={\"code\":-32603,\"message\":\"Internal JSON-RPC error.\",\"data\":{\"code\":3,\"message\":\"execution reverted\",\"data\":\"0x3e5efef9010000a12e27ba1bd30bb4afd017e30038c36960f562edcff70bbf5ff696dfec\",\"cause\":null},\"stack\":\"{\\n \\\"code\\\": -32603,\\n \\\"message\\\": \\\"Internal JSON-RPC error.\\\",\\n \\\"data\\\": {\\n \\\"code\\\": 3,\\n \\\"message\\\": \\\"execution reverted\\\",\\n \\\"data\\\": \\\"0x3e5efef9010000a12e27ba1bd30bb4afd017e30038c36960f562edcff70bbf5ff696dfec\\\",\\n \\\"cause\\\": null\\n },\\n \\\"stack\\\": \\\"Error: Internal JSON-RPC error.\\\\n at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:653344)\\\\n at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:656577)\\\\n at Object.internal (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:657186)\\\\n at c (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:398667)\\\\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:399669\\\\n at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:648682\\\"\\n}\\n at new o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:653344)\\n at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:656577)\\n at Object.internal (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:657186)\\n at c (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:398667)\\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:399669\\n at async chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-1.js:1:648682\"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)"
As far as I understood, it tells me to define the gas limit manually. I tried to research it but couldn't find the exact solution. Please help me find the solution. I am pasting my code link below.
`// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18; // this is the version
// import { SimpleStorage } from "./SimpleStorage.sol";
contract SimpleStorage {
// bool hasFavouriteNumber = false;
// string str = "88";
// address myAddress = 0xac6796E373Ef3D2BC7C2E76C8a1660C0A9a38A50;
// bytes32 favBytes = "cat";
}
contract StorageFactory{
SimpleStorage public simpleStorage;
}`
Beta Was this translation helpful? Give feedback.
All reactions