-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Could not fetch bytecode for contract at 0xA48... on chain 11155111, double check that the address and chainId are correct. #83
Comments
Maybe you should check the console in the chrome and make sure there is no error ,then your project can run |
I've also facing this same issue for 4 days but no one helped me till now |
can you show me your hardhat.config file ? |
import { HardhatUserConfig } from "hardhat/config";
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.24",
};
const config: HardhatUserConfig = {
solidity: {
version: "0.8.9",
defaultNetwork: "sepolia",
networks: {
polygon: {
url: "https://rpc.ankr.com/eth_sepolia",
accounts: [`0x${process.env.PRIVATE_KEY}`],
},
},
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
};
export default config; |
Try this one instead : require("@matterlabs/hardhat-zksync-solc"); /** @type import('hardhat/config').HardhatUserConfig */ |
and just to make sure that you did replace your clientId by you actual clientId ? |
Still facing the same issue |
Hey, did you try the suggestion? Did it work? Please update this thread if anyone got it working. Thanks! |
import React from "react";
import ReactDOM from "react-dom/client";
import {BrowserRouter as Router} from "react-router-dom";
import {ThirdwebProvider} from "@thirdweb-dev/react"
import { Sepolia } from "@thirdweb-dev/chains";
import { StateContextProvider } from "./context";
import App from "./App";
import "./index.css";
import dotenv from "dotenv";
dotenv.config();
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<ThirdwebProvider activeChain={Sepolia} clientId= {process.env.CLIENT_ID}>
<Router>
<StateContextProvider>
<App/>
</StateContextProvider>
</Router>
</ThirdwebProvider>
) I had got similar error. This is my main.jsx file, it works. Make sure you choose correct activeChain field ie. the chain where you deployed the contract and get clientId field from thirdweb here: https://thirdweb.com/dashboard/settings. |
Thanks its working |
After deployment data added to the smart contract cannot be deleted. Instead you can mark it using a flag as deleted and don't consider the campaign during rendering time if the flag is set to false. |
The easiest way would just redeploy the whole contract again and update the lastest contract address in your code. Hope that helps. Sorry for bad English. |
yea this is possible but i want to implement that user who create a campaign wants to change the goal of raised amount or want to change any other specific data in the existing campaign so is it possible to edit the information |
function editCampaign(
uint256 _id,
string memory _title,
string memory _description,
uint256 _target,
string memory _image
) public {
Campaign storage campaign = campaigns[_id];
require(msg.sender == campaign.owner, "Only the campaign owner can edit the campaign.");
require(_target >= campaign.amountCollected, "New target must be greater than or equal to the amount already collected.");
campaign.title = _title;
campaign.description = _description;
campaign.target = _target;
campaign.image = _image;
}
```
something like this should work |
I've written exact code like yours on my main.jsx like this : import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter as Router } from "react-router-dom";
import { ThirdwebProvider } from "@thirdweb-dev/react";
import { Sepolia } from "@thirdweb-dev/chains";
import { StateContextProvider } from "./context";
import App from "./App";
import "./index.css";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<ThirdwebProvider activeChain={Sepolia} clientId='75d6302d3e055fc75b8fb56e3d00a115'>
<Router>
<StateContextProvider>
<App />
</StateContextProvider>
</Router>
</ThirdwebProvider>
); Does anyone have the solution for this issue? |
import { ChainId, ThirdwebProvider} from '@thirdweb-dev/react'; |
I don't think that'll fix it |
already found the solutio? |
I'm usign sepolia as test net but im getting this error.
Here my main.tsx
Someone could help ?
The text was updated successfully, but these errors were encountered: