Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [react]

The tag has no usage guidance.

0
votes
0answers
3 views

shouldComponentUpdate() firing only when browser canvas size is changed [on hold]

I'm facing a peculiar problem in which every time in my Ethereum React DApp, a token purchase request is given by pressing a submit button. The shouldComponentUpdate() function is fired only when I ...
0
votes
1answer
20 views

How to show the time when the blockchain contract called? [duplicate]

I want to show the time when blockchain contract called. I am currently saving the time in the blockchain using a method like this function userCheckIn(uint placeid) public { userCount++; ...
0
votes
0answers
21 views

How long does a smart contract typically take to complete?

I have been developing an application using a smart contract, the application is similar to this one: https://www.ethereum.org/crowdsale I went ahead and initiated a request, below is the codebase ...
0
votes
1answer
22 views

This contract object doesn't have address set yet, please set an address first

I am in the final stages of developing an application that is similar to https://www.ethereum.org/crowdsale, however, when I click on the create button, my Metamask modal is not popping up to ask me ...
0
votes
0answers
35 views

Smart contract hanging in react

I'm trying to make a call to my smart contract and write data to my blockchain, which is successful. However, after that completes I want to make an entry in a firebase database. The code appears to ...
0
votes
0answers
16 views

web3 provider is set to null when try to access for second time

Hello i have issue with my app. I'm using truffle unbox react envoirment. I have simple component which render form and on submit i want to redirect. After i go back to form web3 is null. Here are ...
0
votes
0answers
5 views

Web3 lose state when url is chaging in react

I have a strange issue with my web3. Once when app is load my web3 is configured correct. I have a form on which I can submit some data to my contract and everything works great, but when I try to ...
0
votes
1answer
19 views

No “from” address specified in neither the specified in neither the given options nor the default options

So I already went through this query, but I still couldn't get my doubt solved. Be it any Blockchain Dapp, the same error is coming for me. I used the marriage certificate and kickstart examples. Can ...
0
votes
1answer
16 views

Request user to sign state changing transaction with metamask using Infura and web3js

Can't seem to find the right function to ask the user to sign a transaction via metamask, this is my code so far: const bet = '102500000000000010' const account = '...
0
votes
1answer
39 views

web3-core-method.umd.js:1191 Uncaught (in promise) Error: Transaction has been reverted by the EVM:

Keep getting this error and really not sure what's causing it. Smart contract: contract BasaltStore { // struct of how a document will be stored struct documentStore { // unique id of the doc ...
2
votes
1answer
45 views

Calling payable state changing function on client side with metamask in ethereum infura testnet

I can't seem to find an answer for my problem, or it's either impossible and I'm missing something, or it's trivial and I'm missing something. I have this function on client side: const bet = web3....
1
vote
1answer
19 views

Blockchain Dapp

I am trying to develop a website for verification of certificates using React and Solidity. I have reached a stage where a student can request for a certificate but I want a notification to go to the ...
0
votes
1answer
20 views

How to prompt and create Smart Contract using React

Weird question, so I have created a smart contract, verified that it works, even deployed it using Web3, Metamask and HTML/Javascript. I understand that worked. Now I am trying to integrate it into ...
0
votes
0answers
25 views

Store data on ethereum block chain using react js

I'm trying to store data on ethereum blockchain by doing this import storemetadata from "./storemetadata"; where i have the smart contract ABI in storemetadata I now add name like so storemetadata....
0
votes
0answers
15 views

Error when calling Ethereum Contract

I am using a JS library which calls Solidity functions and I been getting the following error: 0x0c444aa3066f98d5f7ee576401e7729cb1113fe288d38711a78e48836313e88c App.js:112 TypeError: createLog is ...
1
vote
0answers
15 views

Adding additional info for initial state of Drizzle

How do I add extra content to the initial state of drizzle? I want to keep some local information that is not dependant on the blockchain. Should I keep a seperate redux store for that or is there a ...
0
votes
0answers
32 views

address.replace is not a function

I'm not really sure why this web3 method is being called in my code and why it's not a function apparently. Can anyone help me understand what the issue is here? Unhandled Rejection (TypeError): ...
0
votes
0answers
21 views

Getting value for Event watch in solidity and react

I'm trying to listen for an event in my smart contract when I call another function. Smart contract event event documentAdded( uint id ); Smart contract method function sendDocument( ...
1
vote
1answer
37 views

Drizzle CacheCall always returns null

I have set up drizzle to be able to connect to my smart contract from my react-application. After some fiddling, I decided to make this function in my smart contract: /*** test ***/ uint numberFive = ...
0
votes
0answers
37 views

How to keep user's selected account and network from MetaMask updated.?

So the question is pretty straight-forward. I can setup the web3 provider no problem (currently using Metamask + local ganache), i can access the acount the user selected in the first place, and i can ...
0
votes
1answer
37 views

should I use server side rendering(Next.js) for a dapp?

Recently I have been studying a lot about dapps and now working on a little complex one. So what I wanted to ask is which is better for a dapp ? SSR or CSR ? I have read in a couple of places that we ...
1
vote
0answers
48 views

metamask and infura - Managing and signing with private keys

I am using Infura as a node for my DApp so I need to send raw transactions by signing them. These transactions can come from multiple users of an application so each user must sign and send a raw ...
2
votes
0answers
75 views

Solidity get return variable from a send method in React

I'm trying to call a method that pushes data to my Blockchain and then returns back the ID of the new struct I created. This is how I'm calling the method in my React code: const documentId = await ...
0
votes
0answers
39 views

Release / Debug build generated json-rpc calls are different

I'm trying to make simple web3 calls in React Native with web3.js, but generated json-rpc calls are different between release / debug builds - IOS/Xcode. Expected behavior const web3 = new Web3(`...
1
vote
2answers
33 views

Can I trigger the execution of a js file from a smart contract?

I'm a noob at this, so excuse me if this is a ludicrous question.. I have a ReactJS app that interacts with a smart contract via web3. At a certain point, some data gets stored to the contract, by ...
1
vote
1answer
49 views

How to detect web3 of mobile wallets?

I am working on a react application and just can't catch the web3 object of mobile wallets. Catching web3 in Metamask works like a charm. Here's my code so far: componentDidMount() { window....
1
vote
0answers
83 views

How to get the returned value of a smart contract function when it called by using cacheSend() in drizzle

I just tried to build a simple DApp using truffle, react and drizzle. My question is how to get the returned value of a smart contract function when it called by using cacheSend() in drizzle? As ...
0
votes
0answers
137 views

Web3 is injecting but stilling getting an invalid provider error

I'm injecting web3 with MetaMask, and everything works, but when I make a production build, I notice that it injects web3 alright, but when I try to call a web3 function, it throws `Please provide an ...
0
votes
1answer
81 views

Unhandled Rejection (Error): invalid string value (arg=“x”, coderType=“string”, value=5)

Using Truffle unbox react to unbox a boilerplate. received the following error from running npm run start Changes: Addition of "memory" parameters in the simpleStorage.sol Changed unit to string in ...
0
votes
0answers
22 views

How do I solve this error involving web3 and webpack in my truflle-react box based project?

The project is a truffle-react trufflebox, a bounties creating and solving application. It uses Truffle v5.0.1. This is the home page. Below is the page that displays when you click on the 'Become a ...
1
vote
1answer
199 views

Metamask transaction confirmed but “Internal JSON RPC error”

I am using getWeb3() to instantiate a contract and make calls with, the transaction says that is confirmed but when I open up developer tools there is the following error MetaMask - RPC Error: ...
0
votes
0answers
13 views

react-uport truffleBox not showing the QR for login?

After copy and paste the code given while creating an app in app-manager in uport.appmanager.me const uport = new Connect("Auction Protocol ", { clientId: "****", network: "rinkeby", signer: ...
1
vote
1answer
95 views

Getting all past events in web3JS

I have seen similar questions here, but the answers didn't help so far. I have a JS function in a React component that should parse all the past events of the contract. The function is invoked in ...
0
votes
1answer
37 views

How to send context from DrizzleContext.Provider to a Class Component / Class Container

I'm using the new Context API supported 'drizzle-react' library in my dapp. Can anyone please clarify how to receive the context sent from DrizzleContext.Provider into a "class" component? Check out ...
0
votes
1answer
387 views

Could not find “store” in either the context or props of “Connect(c)”. Either wrap the root component in a <Provider>

i'm trying to create a drizzle-react app which uses the new DrizzleContext component but running the following error in my 'localhost:3000': > Could not find "store" in either the context or ...
1
vote
1answer
202 views

React: Please pass numbers as strings or BigNumber objects to avoid precision errors

Here is my onSubmit function: onSubmitModifyAllocation = async event => { event.preventDefault(); const accounts = await web3.eth.getAccounts(); await fund.methods.modifyAllocation(this....
0
votes
1answer
375 views

JSON RPC call from javascript with axios

I would like to call a geth method via JSON RPC from within a react component. I tried this but I always get the Error: 405 (Method Not Allowed) Here is my code: try { const response = await ...
2
votes
0answers
55 views

this.contract.deployed() is not a function

I'm working on making a React frontend for my smart contract, but I'm having problems connecting it into my React code. Here are the relevant portions of my code: import TruffleContract from '...
1
vote
1answer
453 views

Truffle migrate no error but does not create build directory

I'm trying to develop a simple dapp using ReactJS.I used Charterhouse/truffle-create-react-app box suggested by truffle website. The problem is truffle compile and truffle migrate do not seem to work. ...
0
votes
0answers
30 views

solc/wrapper not working with reactjs

My compile.js code: var wrapper = require('solc/wrapper') var solc = wrapper(window.Module) const Compile = (code,name) => { return solc.compile(code, 1).contracts[':'+name]; }; export default ...
3
votes
1answer
189 views

Call a function with an address attached (Solidity React)

I'm trying to make a frontend of calling a function with an address attached: function getAvailableAllocation(address _addr) constant returns (uint ethAvailableAllocation) { return ...
1
vote
2answers
81 views

Payable function with additional value attached (web3, React)

I'm making a React frontend for an open-source blockchain protocol for tokenized hedge funds. So the question is how to provide the payable function that requires some other value attached (n this ...
2
votes
1answer
131 views

contract sendTransaction does not return transaction hash

I just started with truffle react box.. and i changed a little bit to : const tx = await instance.set.sendTransaction(999,{from : accounts[0]}); console.log("tx is on the way : ",tx); const txReceipt ...
1
vote
3answers
79 views

Why is browser taking so long to read blockchain data?

I have a dAPP and I use reactjs for the frontend. The application returns data from a smart contract (the balance) on the homepage. The main problem that I notice is that everytime I or any other ...
0
votes
1answer
599 views

The send transactions “from” field must be defined!

I am trying to call a function of a contract that has been deployed to Ganache. I am trying to call a function that makes payouts to a few addresses and can be called by owner only. When I am calling ...
1
vote
0answers
493 views

Strange error when trying to npm start react file [closed]

I get that error while npm start PS C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader> npm start > react-box@0.1.0 start C:\Users\Concierge\downloads\prod\pdf2\ipfs_image_uploader >...
0
votes
1answer
91 views

How would you generate this transaction hash?

let contract = await instance.mint( accounts, usersInput.url, usersInput.metadata[0], usersInput.metadata[1], usersInput.metadata[2], { ...
0
votes
1answer
50 views

How to sign on ethereum a pdf like on this video? [closed]

How to sign on ethereum a pdf like on this video? I'm asking specifically about what happens at 00:40 where you have a user uploading the file and then it get stored and cryptographic signature is ...
1
vote
1answer
310 views

Cannot read property 'eth' of undefined

I want to Interact with my Smart Contract via Web3 and React. But I get a error message with the following code. import React, { Component } from 'react'; import Web3 from 'web3'; let ...
2
votes
0answers
49 views

Use React Dev Tool in developing MetaMask

I am new to MetaMask, and learning how MetaMask works. I found MetaMask UI was implemented with React, so I tried to use React Dev Tool, but I am not able get it working. Please help. I started stand ...