I hosted my Lottery website on fleek.co and everything works fine while on hardhat local network. So I decided to test it on Goerli and I'm facing error after error.
At first I got the error 1 below and manually added a gas limit in the hardhat config file. After re-deploying the contract and publishing on fleek, at first, enterRaffle works fine.
When I try to enterRaffle the second time, it fails. Other times it's successful. But even then, it doesn't update the num of players like it's supposed to.
What I'm I missing?
Error 1
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"code":-32603,"message":"execution reverted","data":{"originalError":{"code":3,"data":"0x1425571c","message":"execution reverted"}}}, method="estimateGas", transaction={"from":"0x13A19933267ec307c96f3dE8Ff8A2392C39263EB","to":"0x5507C7e274B5201a98141cCd0507cF6e4416Be30","value":{"type":"BigNumber","hex":"0x2386f26fc10000"},"data":"0x2cfcc539","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.6.0)
at su.makeError (_app-3ca186e4a2557e86.js:1:1975135)
at su.throwError (_app-3ca186e4a2557e86.js:1:1975255)
at yh (_app-3ca186e4a2557e86.js:1:2115696)
at Ad.<anonymous> (_app-3ca186e4a2557e86.js:1:2123240)
at Generator.throw (<anonymous>)
at s (_app-3ca186e4a2557e86.js:1:2114235)
Then after adding gas manually like so, error 2 occurs.
goerli: {
url: GOERLI_RPC_URL,
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
// accounts: {
// mnemonic: MNEMONIC,
// },
saveDeployments: true,
chainId: 5,
gas: 6000000,
},
Error 2
_app-3ca186e4a2557e86.js:1 Uncaught (in promise) Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (transactionHash="0x1c28a6b2bfb02f23f443a854c998bec3d965a6beff525f0431480d063e5214c2", transaction={"hash":"0x1c28a6b2bfb02f23f443a854c998bec3d965a6beff525f0431480d063e5214c2","type":2,"accessList":null,"blockHash":null,"blockNumber":null,"transactionIndex":null,"confirmations":0,"from":"0x13A19933267ec307c96f3dE8Ff8A2392C39263EB","gasPrice":{"type":"BigNumber","hex":"0x6bc0e597"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x6bc0e597"},"gasLimit":{"type":"BigNumber","hex":"0x4c9e58"},"to":"0x5507C7e274B5201a98141cCd0507cF6e4416Be30","value":{"type":"BigNumber","hex":"0x2386f26fc10000"},"nonce":49,"data":"0x2cfcc539","r":"0x3869c8f2e2ecaa492c528f2065d156cdb855a6f2af9669a5472c97473f6f5d74","s":"0x1ae3086d065b24e61c4a01ea1a25a4e1109a809e8a5e8c40fba7a58d8c8e05b2","v":0,"creates":null,"chainId":0}, receipt={"to":"0x5507C7e274B5201a98141cCd0507cF6e4416Be30","from":"0x13A19933267ec307c96f3dE8Ff8A2392C39263EB","contractAddress":null,"transactionIndex":18,"gasUsed":{"type":"BigNumber","hex":"0x6448"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x4cc5aa906cc1a68ef49ade23bec8f679abeb0c2439cc2798d9f5244550bcb8a4","transactionHash":"0x1c28a6b2bfb02f23f443a854c998bec3d965a6beff525f0431480d063e5214c2","logs":[],"blockNumber":7723284,"confirmations":2,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x28a252"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x67d1c29b"},"status":0,"type":2,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.6.0)
at su.makeError (_app-3ca186e4a2557e86.js:1:1975135)
at su.throwError (_app-3ca186e4a2557e86.js:1:1975255)
at Ad.<anonymous> (_app-3ca186e4a2557e86.js:1:2091815)
at Generator.next (<anonymous>)
at a (_app-3ca186e4a2557e86.js:1:2072233)