You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm trying to deploy my contract on ethereum sepolia network but encountered this error:
Error: sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.7.0)
i have added const signer = provider.getSigner(); according to this answer on stackoverflow but the error is still there, here's my App.js code:
...
constloadBlockchainData=async()=>{try{constprovider=newethers.providers.Web3Provider(window.ethereum)setProvider(provider)constsigner=provider.getSigner();constnetwork=awaitprovider.getNetwork()constchainId=network.chainId;constcontractAddresses=config[chainId];if(!contractAddresses){thrownewError(`No contract deployed to chain with id ${chainId}`);}constcarbonCredit=newethers.Contract(config[network.chainId].carbonCredit.address,CarbonCredit,provider)consttotalSupply=awaitcarbonCredit.totalSupply()constcredits=[]for(vari=1;i<=totalSupply;i++){consturi=awaitcarbonCredit.tokenURI(i)constresponse=awaitfetch(uri)constmetadata=awaitresponse.json()credits.push(metadata)}setCredits(credits)constescrow=newethers.Contract(config[network.chainId].escrow.address,Escrow,provider)setEscrow(escrow)window.ethereum.on('accountsChanged',async()=>{constaccounts=awaitwindow.ethereum.request({method: 'eth_requestAccounts'});constaccount=ethers.utils.getAddress(accounts[0])setAccount(account);})}catch(error){console.error("Error loading blockchain data",error);}}useEffect(()=>{loadBlockchainData()},[])...
can anyone help me with this? i'm more than happy to provide more related code if you ask, any help would be awesome
The text was updated successfully, but these errors were encountered:
i'm trying to deploy my contract on ethereum sepolia network but encountered this error:
Error: sending a transaction requires a signer (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=contracts/5.7.0)
i have added
const signer = provider.getSigner();
according to this answer on stackoverflow but the error is still there, here's my App.js code:can anyone help me with this? i'm more than happy to provide more related code if you ask, any help would be awesome
The text was updated successfully, but these errors were encountered: