Open Luan4560 opened 8 months ago
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
Maybe you should check the console in the chrome and make sure there is no error ,then your project can run
can you show me your hardhat.config file ?
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 /
module.exports = {
solidity: {
version: "0.8.17",
defaultNetwork: "sepolia",
networks: {
hardhat: {},
sepolia: {
url: "https://11155111.rpc.thirdweb.com",
accounts: [0x${process.env.PRIVATE_KEY}
]
}
},
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
};
and just to make sure that you did replace your clientId by you actual clientId ?
Still facing the same issue
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;
Hey, did you try the suggestion? Did it work? Please update this thread if anyone got it working. Thanks!
Maybe you should check the console in the chrome and make sure there is no error ,then your project can run
I am facing the same issue and have not been able to configure it for the last 2 days! I am using Polygonamoy testnet . Please help me regarding 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";
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.
I too had the same issue but after trying so many solutions it somehow got fixed. I don't know how it got fixed and the current code is somewhat similar to the code it started with when facing the problem but now it got fixed. This is my current code hope this helps
How do you fix the issue with connect wallet as useMetamask is deprecated.
How do you fix the issue with connect wallet as useMetamask is deprecated.
you can use useConnect('metamask')
or useMetamask()
. Even though useMetamask()
is deprecated it still functions. Hope this helps.
Thanks its working and tell me how i delete a particular campaign that i created
Thanks its working
and tell me how i delete a particular campaign that i created
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.
Thanks its working
and tell me how i delete a particular campaign that i created
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
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.
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>
);
But I still got this error :
Does anyone have the solution for this issue?
import { ChainId, ThirdwebProvider} from '@thirdweb-dev/react'; try this
import { ChainId, ThirdwebProvider} from '@thirdweb-dev/react'; try this
I don't think that'll fix it
I'm usign sepolia as test net but im getting this error.
Here my main.tsx
Someone could help ?