2022 Developer Survey is open! Take survey.

Questions tagged [frontend]

The user-facing part of an application. In a desktop application this would include the windowing framework and the forms the user interacts with; in a command line program it would be the available commands and arguments; and in a web app it would refer to the HTML and JavaScript.

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

Getting An Invalid BigNumber error code when attemping to return a uint256

function requestVotes(uint256 _id) public onlyOwner { proposalIdURL = proposalContract.Proposals(_id); string memory voteURL = string(abi.encodePacked("https://hub.snapshot.org/...
user avatar
1 vote
0 answers
13 views

IPFS: Add file in frontend through public gateway, pin file in backend by its CID

This is more of a generic question. I want to give people the chance to upload their file through my front-end using "ipfs-http-client": var ipfs = ipfsHttpClient.create('https://ipfs.infura....
user avatar
  • 27
0 votes
1 answer
25 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
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
  • 149
0 votes
0 answers
91 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
1 answer
30 views

Forking mainnet and modifying its state on frontend

I would like to simulate a contract interaction in a frontend application but in order to do so I need to impersonate an address and mint a certain amount of ERC20 to that address. This is fairly ...
user avatar
0 votes
0 answers
42 views

How do I create a front-end for a brownie project?

For my college assignment, I have made a brownie project that runs entirely using inputs given through the console. It is a simple brownie project that just manipulates some variables in a smart ...
user avatar
0 votes
0 answers
44 views

How to prepare a transaction from the server and sign it in the front-end?

Is there a way to prepare a transaction from the server, then wait for the user to sign the transaction from the frontend with Metamask, before running other functions from the server (e.g., update a ...
user avatar
  • 1
0 votes
0 answers
19 views

Basic beginner questions concerning smart contracts and dApp front-end code organization

To help getting started easier I am looking into some boilerplate starter kits such as https://github.com/paulrberg/solidity-template, https://github.com/scaffold-eth/scaffold-eth, etc. Basic question,...
user avatar
0 votes
0 answers
187 views

Why am I getting an Internal JSON-RPC error for calling one state variable from my contract but not on another very similar variable?

I am using ethers.js in Svelte to communicate with my Vyper contract currently deployed to the Avalanche FUJI testnet for a basic social networking app. When I call this state variable from my ...
user avatar
0 votes
1 answer
89 views

Calling a solidity function without a wallet using ethers.getDefaultProvider

I am trying to call a function from my solidity contract which shows how many nfts have been minted so far, I want the front end user to be able to see the number even if they don't have a wallet in ...
user avatar
  • 3
1 vote
2 answers
135 views

If you pull numerical data from the Ethereum blockchain, what format is it in and why?

I got this question in an interview and I am really not sure if I am correct. Numbers are encoded in hex format and they are big numbers. But what is the reason behind that? I tried to google a lot ...
user avatar
0 votes
0 answers
85 views

Deposit 1 ETH to the contract

this is my contract code: function deposit() public payable { require (msg.value == 1 ether); emit Deposit(msg.sender,msg.value); } and this is my vanilla javascript code ...
user avatar
0 votes
0 answers
105 views

How to make static React site and put it to IPFS

I am using site build with Create React App and it all works fine when I run it on server. What I would like is to put it to IPFS and for that it needs to be a "generated static website" (no ...
user avatar
  • 210
0 votes
0 answers
157 views

Is a dapp really decentralized if the frontend is hosted on a centralized server?

If we need to access to the Dapp from a website (which requires a central DNS, a central hosting, a central team developing the front etc), does not that mean the app is not decentralized? Can we ...
user avatar
  • 105
0 votes
2 answers
47 views

Backend for DApp

I'm developing a DApp, and I need some logic to handle events. This shouldn't be done in the Frontend of the application, right? So what would a good approach look like. I thought about a Java-Backend ...
user avatar
  • 27
0 votes
1 answer
108 views

How do I connect a smart contract to the frontend?

I know this question has been asked so many times and i know its a stupid question. But I am just unable to figure out how do i show information from the smart contract abi on the front end of the ...
user avatar
0 votes
0 answers
70 views

Sending Polygon via Metamask

I'm converting my DAPP to Polygon from Ethereum. And currently we have a frontend system that lets users pay us for our services. We are doing this using the Metamask RPC API. But because we are no ...
user avatar
  • 126
1 vote
3 answers
287 views

Best way to automatically update balances displayed in front end

Im trying to figure out the best way to automatically update balances in front end upon receiving and sending tokens. Ive tried creating an instance of a token in my react app, then creating an event ...
user avatar
0 votes
1 answer
257 views

Dealing with "Uncaught (in promise) Error: Provided address [object Promise] is invalid, the capitalization checksum test failed"

I'm, trying to connect a front-end to my smart contract but whenever I call the function from the UI I get this error: Uncaught (in promise) Error: Provided address [object Promise] is invalid, the ...
user avatar
0 votes
1 answer
210 views

Web3 - handling separation between read-only calls and send requests?

I want to create a simple front-end for my DApp. The DApp fetches values about the smart contract to display on the site. If the reader wants to interact (eg. buy) with the smart contract, I have a '...
user avatar
0 votes
0 answers
75 views

Crowdsale smart contract frontend creation

I wanted to make a front end webpage for buyflamecoin function in my crowdsale smart contract. Crowd sale contract link : https://bscscan.com/address/0x959a4c2980ee9541b7359a1ab67b3b963c33ab93 Can ...
user avatar
1 vote
1 answer
3k views

How to create a dapp that verifies NFT ownership?

I'm trying to create a simple react app that will allow the user to enter a token ID and Ethereum address, then it will confirm if that address has it. Do I need Solidity to do this? I'm aware of ...
user avatar
0 votes
1 answer
98 views

Can't call a external view function with web3

I need to call a getter function from my contract, but I'm getting the following error: Error Error: Internal JSON-RPC error. { "message": "VM Exception while processing transaction: ...
user avatar
  • 309
1 vote
2 answers
1k views

Can't get info with web3: web3.eth.getAccounts returns undefined

I'm trying to connect to the blockchain via web3 and metamask and the web3.eth.getAccounts() method is returning undefined, however window.ethereum.request({ method: 'eth_requestAccounts' }) returns ...
user avatar
  • 309
0 votes
0 answers
44 views

Interaction between my webapp and smart contract

I am experimenting for the first time with smart contracts and NFT stuff. So I am at the point where I have a react webapp with metamask integration. The user can connect his wallet. I want to ...
user avatar
2 votes
1 answer
4k views

How to set msg.value in function call using ethers.js?

I've got a function in my smart contract and i want it to take an argument that sets the msg.value and then pays it into the contract: function deposit(uint256 amount) public payable { msg.value = ...
user avatar
0 votes
0 answers
486 views

Error, returned values aren't valid, did it run out of gas? on a view function

im trying to call a view function from my frontend but cant seem to do so. This is my code: import { AbiItem } from 'web3-utils' import cakeABI from 'config/abi/cake.json' import { getCakeAddress } ...
user avatar
0 votes
1 answer
427 views

How to connect Yield farm frontend to Matic/Polygon

The idea I am following is to create yield farm like https://polyvertex.finance/. Backend with contracts is clear to some extent thanks to tutorials. Problems come with frontend for which I barely can ...
user avatar
0 votes
0 answers
2k views

Uncaught TypeError: Cannot read property 'contract' of undefined

I'm getting this error. Can someone please help me Uncaught TypeError: Cannot read property 'contract' of undefined at add_details ((index):140) line:140--> var myContract = new Web3.eth.Contract(...
user avatar
  • 1
0 votes
1 answer
225 views

Unhandled Rejection (TypeError): SimpleContract.methods.set is not a function

I'm trying to build a Student Management System Dapp,where data of students are taken from frontend and stored in smart contract. Why I'm getting this error,while I try to set value(name) to the field-...
user avatar
  • 1
0 votes
1 answer
3k views

How to convert number to BN with web3

I am trying to get the balance of eth from Metamask account, but I get the following error in the browser console: Uncaught Error: [number-to-bn] while converting number "0.322778986" to BN....
user avatar
  • 5
0 votes
1 answer
204 views

Dapp with frontend

I made a login page with metamask for my Dapp, but now I need to link my login button to the profile page which will have student details like name, phonenumber, certificates (pdf) etc. where these ...
user avatar
  • 1
2 votes
0 answers
59 views

Is it conventional to host your dapp on a subdomain (e.g. app.uniswap.org), and why?

I've noticed the design pattern of having an enter app button from the home/landing page which opens the dapp in a new tab is quite common. This is something that I don't see in Web2 design. Is there ...
user avatar
2 votes
1 answer
83 views

How to get historical value of a state variable?

I am unsure of the best way to do this. I have a pool contract with a state variable of the total balance of the pool. I want to show a line chart on my dApp that shows how the balance of the pool has ...
user avatar
0 votes
1 answer
115 views

Connect local frontend with smart contract on ropsten

I'm new to DApp programming an I'm struggling with this problem since two days now. Cloned this github example: https://github.com/dappuniversity/election I deployed the smart contract to ropsten with ...
user avatar
0 votes
1 answer
54 views

full stack dapp clone example elastic supply algorithmic stablecoin

I'm new to vyper (but have some python experience), I would like to clone a very simple dapp to have a look at the full stack of an ethereum dapp from back end (write compile and deploy a simple ...
user avatar
1 vote
1 answer
596 views

Invoke Metamask with a pure JS/HTML set up

I am new to front end Web3 and I am trying to have a simple SIGN button that will invoke metamask to sign a "Message". I can't seem to get it working. I am using pure HTML/JS without any ...
user avatar
1 vote
1 answer
807 views

using only html page for frontend with web3 or ethers.js

I was just wondering, since we are able to write js scripts inside html docs, would we be able to create a dapp with fully functional html front end for our smart contracts? Or would we need to use ...
user avatar
  • 97
2 votes
0 answers
212 views

How to capture error reason of "ALERT: Transaction Error. Exception thrown in contract code." from Metamask in the front-end

Let's say we have a smart contract test with a function foo() and a modifier so that only the contract owner can call this function. Now we have a front-end with a user that is not the contract owner ...
user avatar
1 vote
0 answers
562 views

Cannot read property 'methods' of null

My teammate has deployed ERC 20 token to rinkeby test network using the truffle openzeppelin code. Now I wanted to interact with that token by using ABI and the contract address of that token using ...
user avatar
0 votes
1 answer
440 views

Is it possible to create a frontend web app that connect to an Ethereum contract for read only without users having to have metamask? [closed]

I would like to create a web front end with as less friction as possible for new users. The app would be a kind of explorer with all calls to blockchain as read only to getter functions. So is there a ...
user avatar
  • 183
0 votes
1 answer
416 views

Alternatives to MEW for advanced users

I am looking for an alternative to MyEtherWallet. I am facing some issues with MEW, thus I am looking for alternative, preferably with more advanced functions - like for example allow me to "...
user avatar
1 vote
2 answers
1k views

Trying to connect front-end application with smart contract

I am creating a simple registration and login forms in React.js and connecting it with smart contract in order to use it to store the data from the front and to the blockchain is there any method or ...
user avatar
3 votes
1 answer
1k views

How to import the Contract type from the web3.js library?

Here's how I can do that in ethers@4.0.47: import { Contract, ethers } from "ethers"; const contractInstance: Contract = new ethers.Contract(address, abi); But in web3.js@1.2.8 none of the ...
user avatar
1 vote
0 answers
119 views

Possibilities of ERC721 image generation [closed]

What image generation techniques could you suggest for a DApp game that utilizes ERC721? I know that CrypoKitties has a unique DNA sequence and different pieces of the sequence correspond to the ...
user avatar
  • 217
0 votes
1 answer
297 views

How can i make a simple chartjs chart with ethereum contract address

i would like to have a chart on my site that prints the last price of a certain erc20 token i have seen a widget from ethplorer but i rather build my own chart but i cant find any documentation for ...
user avatar
0 votes
1 answer
161 views

Query each struct of a Mapping vs looping getter function for front-end?

I have a mapping of structs and a counter variable to keep track of how many structs are stored in the mapping. For front-end development would you recommend to query each struct using the auto-...
user avatar
  • 183
0 votes
1 answer
246 views

Emited Solidity Events not being watched at frontend truffle contract instance

So, I have been reading through A LOT of pages about events in Solidity and how to interact with them on frontend but I am still pretty new to this and it seems like there have been multiple changes, ...
user avatar
  • 1
0 votes
1 answer
182 views

Windows: command "npm install drizzle" give me an ERR!

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ `tar.gz module has been deprecated and your application is ...
user avatar