-
Notifications
You must be signed in to change notification settings - Fork 382
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
Changing to Sepolia Testnet #65
base: master
Are you sure you want to change the base?
Conversation
Made all these changes but getting this error: contract call failure TypeError: Cannot read properties of undefined (reading 'call') How to fix it?
|
@DharaneeswaranR share your repo. |
@@ -0,0 +1,2 @@ | |||
PRIVATE_KEY='YOUR KEY' | |||
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/pOXRE5q4Mu5BJj-3sw4DaIOErWcnsI1Q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did you get this rpc url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create your own RPC node on Alchemy or use the publicly available nodes. Your choice.
accounts: [`0x${process.env.PRIVATE_KEY}`] | ||
} | ||
sepolia: { | ||
url: "https://sepolia.rpc.thirdweb.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this line be replaced with ,
url: process.env.SEPOLIA_RPC_URL, ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily. Either should be ok.
Hello, this my main.jsx import { StateContextProvider } from "./context"; const root = ReactDOM.createRoot(document.getElementById('root')); root.render(
//this is my index.jsx import { useAddress, useContract, useMetamask, useContractWrite } from '@thirdweb-dev/react'; const StateContext = createContext(); export const StateContextProvider = ({ children }) => { const address = useAddress(); const publishCampaign = async (form) => {
} const getCampaigns = async () => {
} const getUserCampaigns = async () => {
} const donate = async (pId, amount) => {
} const getDonations = async (pId) => {
} return ( export const useStateContext = () => useContext(StateContext); |
Hello @shivam5643 Secondly, I had handled this issue before. Check out this answer and upvote if helpful. |
Sorry for my inconvenience for not well formatted.
I had seen that answer previously on stack overflow and I do the same..but
couldn't resolve my bug. Please help me.
…On Fri, 8 Sept, 2023, 4:29 pm Frankline Kihiu, ***@***.***> wrote:
Hello @shivam5643 <https://github.com/shivam5643>
First, you need to make sure your question is well formatted.
Secondly, I had handled this issue before. Check out this answer and
upvote if helpful.
https://stackoverflow.com/a/76622874
—
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXW2H24TVB7J3IYNWSIJLRDXZL3CLANCNFSM6AAAAAA3IFHKHM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is my hardhat.config.js
|
index.jsx
mains.jsx
|
when i am trying to create any campaign then after that it shows me this error. contract call failure TypeError: Cannot read properties of undefined (reading 'call') what to do i am not getting that? |
@shivam5643 This time, it's because you need to polyfill the Node globals and modules to enable the web3 import to run in the browser. First, Install the package as a dev dependency.
then, Change your import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), nodePolyfills()],
define: {
"process.env": {},
},
}); |
Is my hardhat.config.js, main.jsx and index.jsx are fine?
…On Fri, 8 Sept, 2023, 7:28 pm Frankline Kihiu, ***@***.***> wrote:
@shivam5643 <https://github.com/shivam5643>
The current error is different from the one above.
This time, it's because you need to polyfill the Node globals and modules
to enable the web3 import to run in the browser.
First, Install the package as a dev dependency.
npm install --save-dev vite-plugin-node-polyfills
then,
Change your vite.config.js to look something like;
import react from ***@***.***/plugin-react";import { defineConfig } from "vite";import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vitejs.dev/config/export default defineConfig({
plugins: [react(), nodePolyfills()],
define: {
"process.env": {},
},});
—
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXW2H22OXSLF5YWCGEXKBDTXZMQARANCNFSM6AAAAAA3IFHKHM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Did it work? |
@kihiuFrank |
Firstly.. contract call failure TypeError: Cannot read properties of undefined (reading 'call') |
Drop your repo |
This is my repo link.
<https://github.com/shivam5643/Blockchain_crowdfunding>
… Message ID: ***@***.***
com>
|
Does you get any solution?
…On Fri, 8 Sept, 2023, 9:19 pm shivam kumar, ***@***.***> wrote:
This is my repo link.
<https://github.com/shivam5643/Blockchain_crowdfunding>
> Message ID: ***@***.***
> .com>
>
|
Will look at it today |
Had you seen that??🤔
…On Mon, 11 Sept, 2023, 1:28 pm Frankline Kihiu, ***@***.***> wrote:
Will look at it today
—
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXW2H2Y3AAYMHTN5JS74O5LXZ3AEDANCNFSM6AAAAAA3IFHKHM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Had you get any solution for this..?
I'm stuck at this point.
On Tue, 12 Sept, 2023, 11:15 pm shivam kumar, ***@***.***>
wrote:
… Had you seen that??🤔
On Mon, 11 Sept, 2023, 1:28 pm Frankline Kihiu, ***@***.***>
wrote:
> Will look at it today
>
> —
> Reply to this email directly, view it on GitHub
> <#65 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AXW2H2Y3AAYMHTN5JS74O5LXZ3AEDANCNFSM6AAAAAA3IFHKHM>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
Hello @shivam5643 |
Or, you can test this for yourself. It's quite easy. Get the contract abi (available on the dashboard/contracts/the contract /sources). Also I have created a pull request on your project. Check it out. |
@shivam5643 |
I will start with changing the network from Goerli to sepolia testnet as Goerli now requires you to have real ETH to use it.
Steps for changing to Sepolia Testnet
npx thirdweb deploy
client/context/index.js
main.jsx
.See more on how to set-up here