Questions tagged [react]

React (also known as React.js or ReactJS) is a JavaScript library for building user interfaces. It uses a declarative paradigm and aims to be both efficient and flexible.

Filter by
Sorted by
Tagged with
0 votes
0 answers
2 views

ReactJS not displaying entire app, on localhost:3000

My app was displaying correctly yesterday, but now it is only showing parts of my app. There aren't any problems in my VScode terminal. I am developing on Brave Browser, and my web3 app is using ...
user avatar
0 votes
0 answers
19 views

Have metamask user pay minting fee, but owner sign transaction. onlyOwner and payable

I want to allow a user to mint an NFT through my React app to a payable function, but I also want to control the URI and Token ID sent to the contract because we use many different folders on IPFS. Is ...
user avatar
  • 101
0 votes
0 answers
28 views

How to convert USD to ETH?

I have created a simple CodeSandbox project to convert ETH to USD. however now I want to convert USD to ETH also. I think it seems to be there is an issue in my USD to ETH logic. It gives me the wrong ...
user avatar
0 votes
0 answers
15 views

How to write the Mint function in an ERC1155 Smart Contract and Ethers js library

Can anyone help me implement the mintPass(mintAmount) method in my next js application using ether.js library how can I write the mintPass so people can mint till 4 passes I am using ethers.js library ...
user avatar
  • 1
0 votes
0 answers
16 views

How I can make nfts fetching faster to show on frontend?

I'm creating a marketplace where at the homepage I need to show up all the nuts at once on the homepage. Is there way I can make loading faster? It takes a lot of time to fetch data from the chain. I'...
user avatar
0 votes
2 answers
30 views

How to return a struct of a specific user in solidity?

I'm working on a smart contract that allows users to pay for monthly subscriptions like Netflix, Amazon, etc... I created a function fetchMysubscription within my smart contract that allows each user ...
user avatar
  • 169
0 votes
1 answer
23 views

useContractCall in a loop from React

I have created a smart contract where users can mint several ERC721 tokens. I used the ERC721Enumerable extension from OpenZeppelin so I can easily retrieve which tokens have been minted by a specific ...
user avatar
  • 11
0 votes
1 answer
44 views

How to confirm a transaction in backend in behavior of the user?

I am developing an application where the front-end does not talk directly to the blockchain. Back-end does that instead, due to some proccesses that can only be done in the back-end (file manipulation,...
user avatar
0 votes
1 answer
20 views

invalid opcode: opcode 0x4b not defined when sending a new contract

I'm trying to create a new transaction and deploy it to the blockchain, but I'm obtaining this warning when I go to inspect the transaction result on etherscan: Warning! Error encountered during ...
user avatar
  • 1
1 vote
1 answer
43 views

Is it okay to make "OpenZeppelin contracts" a dev dependency in my React app?

I am trying to reduce the bundle size of a React application. I deploy a smart contract during the project build pipeline. The contract needs to be inside the project folder of the React app so that ...
user avatar
0 votes
0 answers
15 views

How can I loop through the values in react of a tuple(solidity)

I have a function in my smart contract returns tuple and I want to return all the values to display on my react application, I used Promise.all to get back all the arrays but I got an error saying the ...
user avatar
  • 169
0 votes
0 answers
15 views

Web3 function for a submit button for transferring formdata to blockchain

I need some help for a project which I'm doing.I'm totally new to this and I am trying to learn on the go. I took some code from a github repo. The front end is React. I use Ganache and metamask. I ...
user avatar
  • 1
0 votes
0 answers
15 views

Understanding Biswap referral program

I want to create a DEX with referral program like Biswap(https://biswap.org/referral), after doing some digging I still don't understand how it works. Can someone help me? No need for indeep code ...
user avatar
0 votes
0 answers
36 views

How to safely run a contract function using stored private key in web3(react)

Since I cannot find a way to get small coin price feeds(IE Chainlink does not have them), Is there a way that I could get the price feed on the dapp(this should be easy from coinmarketcap or the like) ...
user avatar
  • 101
0 votes
0 answers
25 views

'Error: getaddrinfo' after trying to run 'truffle unbox react'

After installing truffle globally npm install -g truffle, I'll make an empty folder and try to run truffle unbox react but I end up getting an error message show below: I have the current versions of:...
user avatar
0 votes
0 answers
8 views

Allowing user to select input on mint that gets passed as a metadata value to the smart contract

I was wondering if anyone knew how/if it was possible to allow the user to choose an input on the mint page of a website, then when they hit mint it passes that value through as the value for a ...
user avatar
  • 1
0 votes
0 answers
17 views

Coinbase wallet extention not connecting on the production

I have been trying to connect to two wallets coinbase and metamask in my application. They separately get connected on the localhost but when I am uploads my web app to the server then only the ...
user avatar
0 votes
1 answer
90 views

How to get the returned data from a smart contract function using ethers.js?

I'm trying to consume a function from a smart contract using ethers.js. The function retrieve the info of a user logged before (with the help of other function). This is the function snippet. function ...
user avatar
  • 11
0 votes
1 answer
26 views

Low level function call from child contract to parent failing

I have developed an app for my hiring portfolio. I am having trouble calling a function in the parent contract from the child contract. This parent function works when called directly. In JS: buyItem =...
user avatar
1 vote
1 answer
32 views

Sending eth with write function causing problems?

I have a payable write function which accepts arguments and some ETH to perform the work. However, when calling the write function, the call is just transferring eth to the contract address without ...
user avatar
0 votes
0 answers
10 views

wallet integration with desktop dapp

which wallet integration can I do with my react or electron desktop app? How can I do that? I had tried that swapy network and muon an electron fork maintained by brave but no use.
user avatar
0 votes
1 answer
33 views

Can you query an account balance without needing metamask in browser?

I would like to use this code in order to get the account balance and display it on my react app. state = { croBalance: "", }; async componentDidMount() { const balance = await ...
user avatar
0 votes
0 answers
53 views

How to handle wrong chain error [Infura, Wagmi, React, Typescript]

When I npm run dev and my wallet is not connected to one of the chains I have specified, I get the following error This raises the question for me, how to handle the error when a user is not ...
user avatar
0 votes
0 answers
39 views

using a custom ERC20 in my minting application

I'm wondering if anyone can help me add a custom ERC20 token as a form of payment in my NFT minting application? My application is interacting with a standard ERC721 contract. pragma solidity >=0.7....
user avatar
0 votes
0 answers
15 views

How to deploy Smart Contract from RreactJS-App

To deploy my Smart Contracts to Ganache I was working with Truffle. Now I wanted to deploy the Smart Contracts via the ReactJS-app, so without typing "truffle migrate --reset" into the cmd. ...
user avatar
  • 27
0 votes
1 answer
29 views

What does curly bracket in my smart contract transaction mean?

await routerContract .addLiquidityETH( daiAddress, ethers.utils.parseEther(strDaiAmount), ethers.utils.parseEther(strDaiSlippage), ethers.utils....
user avatar
0 votes
1 answer
54 views

ethers.js await function to be run after the first function works

I am using two contracts. Contract-B has a function to receive 100 Dai tokens from users, but for that it needs to have increaseAllowance() of the Dai contract(contract-A) of that Dai Token. I then ...
user avatar
0 votes
0 answers
17 views

How do I call a script which deploys a contract to run a function? (React & Solidity)

My Issue I'm building a yield staking dapplication with React and Solidity. I built this by following a tutuorial. The dapp connects to the user's wallet and allows the user to stake their tokens for ...
user avatar
  • 1
0 votes
0 answers
35 views

Verify the contract from a contract factory directly from React

I am learning about web3 and using web3-react, ethers and hardhat. I made a contract, and I want that every user deploys their own Contract. The deployment function is this: async function ...
user avatar
0 votes
0 answers
26 views

How to properly handle network switch event in Moralis Ethereum Boilerplate

I'm using Moralis' ethereum boilerplate here. https://github.com/ethereum-boilerplate/ethereum-boilerplate It works relatively well, but whenever I switch networks, the demo throws errors in ...
user avatar
  • 115
0 votes
0 answers
13 views

How to have a URL(backed by a host provider) for a Dapp

I have created a Dapp by React, Ethers.js, and Hardhat, but I don't know how to make it available to the public? I know I must deploy it to some mainnet or testnets, instead of local servers. But the ...
user avatar
0 votes
1 answer
26 views

Contract deployment with the user interface

My smart contract constructor function accepts 2 parameters for being deployed. I have developed a user interface for this contract by Hardhat, React, and Ethers. Now I want to create an HTML form on ...
user avatar
0 votes
0 answers
33 views

estimateGas amount is absurdly high

I'm currently building a frontend, and need to send transactions. I've tested my contracts with hardhat and I'm getting a gas consumption that is not too high. But while estimating the gas consumption ...
user avatar
  • 134
0 votes
0 answers
87 views

Uniswap V3 SDK Pool.token0Price()

First of all I am only about a week into front-end programming for dApps, any patience with me would be appreciated. I am trying to get the ETH/DAI and DAI/ETH price from Uniswap Liquidity Pool and ...
user avatar
0 votes
0 answers
63 views

Cannot connect to Coinbase Extension via the @web3-react/walletlink-connector

I am trying to connect to the coinbase extension via the wallet link connector's instance, new WalletLinkConnector, but I cannot even get the extension's popup open. I am following the exact tutorial ...
user avatar
0 votes
0 answers
529 views

Connect MetaMask mobile app to React Native Dapp with DeepLinks

I'm trying to develop a React Native App that is able to connect directly to metamask(similar to OpenSea). I've figured out that i need to use a deeplink to open MetaMask, and it works, but what ...
user avatar
  • 1
2 votes
0 answers
134 views

React/Web3Modal Doesn't Work on Mobile Browsers

This is my first question that I haven't seen asked before. I am creating a DApp that allows a user to connect via Metamask or WalletConnect using the Web3Modal package in React. Everything works ...
user avatar
0 votes
0 answers
27 views

Drizzle Components in React App - can not read properties of undefined. Above statement occured in <o> component

I am trying to use Drizzle inside a React App to show the smart contract details in the front end. However stuck at this error, which says ` drizzle-react-components.js:1 Uncaught ...
user avatar
0 votes
0 answers
7 views

Prevent malicious activity on IPFS public node is a social media website

I have built a Social Media website based on Ethereum blockchain. I am saving all my content on ipfs. I am using ipfs-http-client in order to communicate with ipfs. I saw a post on ipfs discussion ...
user avatar
  • 33
0 votes
1 answer
276 views

How to call/send to a deposit function on a smart contract using ethers.js and react.js?

I am using ethers and react for my dApp. The smart contract I am using has a deposit function and a withdraw function. I got the withdraw function working from my front end, but the deposit function ...
user avatar
0 votes
0 answers
77 views

Safemint code in react web3

I have the ERC721 safemint code which looks like this in etherscan: But when I am trying to implement it in reactjs web3, I am getting an error while transaction in metamask. The code is: await ...
user avatar
  • 123
0 votes
0 answers
11 views

Undefined error come out but the value successfully printed, NextJS, Web 3 JS

So i try to call my contract with web 3 js in next js , the value is successfully printed out but undefined error came out, is there any workaround for this? Here are the functions to call the ...
user avatar
0 votes
0 answers
39 views

Not able to transfer my ETH from the Smart Contract to an User Account while using Truffle or ReactJS with Web3

My below Solidity code is working fine in the RemixIDE, where the code objective is to take some donated ETH from any Etherium account and transfer all the collected ETH to the contract owner address. ...
user avatar
0 votes
0 answers
16 views

Listing minted NFTs for a contract [duplicate]

Fairly experienced backend coder by day, blockchain/web3 dabbler by night here. I've been trying to make my first dApp this weekend, i've managed to connect to metamask, have hooked up my ERC721 ...
user avatar
  • 101
0 votes
0 answers
279 views

MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC

I am new to blockchain. I am trying to create an app using truffle react box but getting this exception when I tried to call the "increment" function. This might be a really foolish mistake ...
user avatar
1 vote
0 answers
57 views

get transaction hash web3 and ether

On my website you can pay with ETH, but I want to get the transaction hash, how can I do that? I'm using web3 and ether on my react app This is how I initialize the transaction const handleSubmit = ...
user avatar
0 votes
0 answers
41 views

How to define listener argument for provider.on(eventName, listener) for listening a smart contract event with ethers.js?

I was following this quick guide to build a Dapp. In order to build the user interface and interact with the smart contract, it uses React. There are the functions below: async function submitBid(...
user avatar
  • 11
0 votes
0 answers
40 views

Why getBalance dont work, i try useEffect on React + Web3

const [ currentBalance, setBalance ] = useState(0); Inside the login function I have get account and I want to get the balance with: const onLogin = async (provider) => { const web3 = new Web3(...
user avatar
0 votes
0 answers
33 views

hardhat tasks don't persists data to local network

I create a little NFT marketplace using solidity and hardhat. I have a JSON file with the NFT details and I wrote a hardhat task for automating the process. task("populate-market", "...
user avatar
0 votes
1 answer
16 views

token_uri starts with 'ar://" , how do fetch?

I'm using react to get nft metadata, I came across an nft 'token_uri' starting with 'ar://'. How do I unpack this? token_uri: ar://eXcwlbsV1BiRGCsGKXa60Mj0i-xDZU0k95l_ysNwv_w/1.json
user avatar

1
2 3 4 5
9