Questions tagged [ethereum]

Ethereum is a blockchain currency (like Bitcoin) with a public ledger. Questions should relate to programming. General questions about Ethereum should be asked on https://ethereum.stackexchange.com

is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality. It provides a decentralized Turing-complete virtual machine, the Ethereum Virtual Machine (EVM), which can execute scripts using an international network of public nodes. Ethereum also provides a cryptocurrency token called , which can be transferred between accounts and used to compensate participant nodes for computations performed. Gas, an internal transaction pricing mechanism, is used to mitigate spam and allocate resources on the network.

was proposed in late 2013 by Vitalik Buterin, a cryptocurrency researcher and programmer.

The official website of is Ethereum.org

6757 questions
9
votes
1 answer

Can I create a local blockchain with Ruby on Rails or Node.js instead of Ethereum+Geth?

The Question: Does anyone know a stable framework which can be used to create a blockchain application, creating a server/node, creating a miner, a wallet, a blockchain inspector, etc? Such a framework does not have to be in Node.js nor Ruby on…
Grant Herman
  • 923
  • 2
  • 13
  • 29
9
votes
5 answers

What is the pattern for handling throw on a Solidity contract in tests

I have a function on a Solidity contract that does a throw. Eg. function do(x,y) { if ( msg.sender != owner ) throw; // ... } In the Truffle environment I have a test js something like: //.... part of a promise…
Interition
  • 381
  • 2
  • 15
8
votes
0 answers

create two nft collections from one smart contract (erc1155) in OpenSea

I want to list two collections on Opensea but instead of creating two smart contracts for that, I want to create only one (to save gas fees of uploading a contract). the only two ways I found to create a collection on OpenSea are: import an…
Ben
  • 97
  • 4
8
votes
3 answers

Call solidity function dynamically, based on its bytes4 function selector

In a smart contract, let's say I have a function which wants to invoke another function dynamically, based on some internal logic. Here it obtains the function selector as a bytes4 variable. After which it is possible to use branching logic to…
bguiz
  • 27,371
  • 47
  • 154
  • 243
8
votes
7 answers

Hardhat Config Error HH100: Network goerli doesn't exist

I am trying to deploy a contract on Goerli, but I constantly get the error Error HH100: Network goerli doesn't exist Here is my hardhat.config.ts require("dotenv").config(); import { task } from 'hardhat/config'; import…
Dominik
  • 123
  • 1
  • 1
  • 6
8
votes
5 answers

How do I accurately convert ETH to WEI when sending transaction?

I am trying to send ETH from one account to another but the conversion from ETH to WEI keeps giving me headaches. In this case, I am trying to send 0.11 ETH but in the confirmation window, I get 313.59464925 ETH instead. // This is my transaction…
cy23
  • 354
  • 1
  • 3
  • 12
8
votes
1 answer

Can I use the block height to measure the passage of a year based on the average block time in RSK and Ethereum?

I want to build a Solidity smart contract in RSK and Ethereum that pays dividends every year. Should I use the block time or can I rely on the block number, assuming a the current average inter-block time in RSK and Ethereum?
Sergio Lerner
  • 216
  • 1
  • 4
8
votes
1 answer

Is there any way to force to update metadata on Opensea?

I tried to change token base URL to display the new images of NFTs on opensea.io. But it is not updated immediately. There is a way to update by specifying force_update=true on Rikeby testnet. But I don't know how to update it on mainnet. Will it be…
Liki Crus
  • 1,901
  • 5
  • 16
  • 27
8
votes
2 answers

Rinkeby Authenticated Faucet is not working?

I need test ethereum for my pet project. I go to https://faucet.rinkeby.io/ , put a link with my tweet with my Ethereum address in MetaMask, choose 3 Ethers / 8 hours. The request was accepted, but 17 hours past and I haven't my test ethers. Did I…
Roman Matviichuk
  • 141
  • 1
  • 1
  • 7
8
votes
3 answers

transaction underpriced in BEP-20 Token transaction

I had do some transaction in Binance Smart Chain in Binance-Peg BUSD-T and it worked successfully. But after 5 transactions. I face to a problem that said Returned error: transaction underpriced ! This is my code: const web3 = new…
8
votes
1 answer

How to integrate WalletConnect in your Dapp using web3-react?

I've been trying to integrate WalletConnect by following this documentation of web3-react. The configuration that I'm using for the connector is as follows: import { WalletConnectConnector } from '@web3-react/walletconnect-connector'; export const…
Utkarsh Gupta
  • 111
  • 1
  • 2
  • 8
8
votes
2 answers

Fetch all NFTs owned by wallet address with web3.js

I am new to blockchain. I have done a little bit research and here's my steps to fetching a list of NFTs owned by certain wallet with web3.js balance = ERC721.methods.balanceOf(walletAddress).call(); objects = []; for (i = 0; i < balance; i++) { …
peter169
  • 109
  • 1
  • 1
  • 7
8
votes
3 answers

How to transfer a NFT from one account to another using ERC721?

I'm writing an NFT smart contract using the OpenZeppelin ERC721Full contract. I'm able to mint NFTs, but I want to have a button that enables them to be bought. I'm trying writing this function: function buyNFT(uint _id) public payable{ //Get…
acampana
  • 461
  • 1
  • 3
  • 17
8
votes
3 answers

Switch Metamask Network to chain 1 (Ethereum Mainnet)

This past week Metamask introduced a new function called "wallet_addEthereumChain" which allows the user to automatically add a new Etheruem RPC to their wallet when prompted. This function also allows the user to change the network they are…
Alexander Barry
  • 81
  • 1
  • 1
  • 3
8
votes
3 answers

Check that object is null in solidity mapping

I have this solidity mapping mapping (string => Ticket) public myMapping; I want to check if myMapping[key] exists or not. How can I check?
Anas Hadhri
  • 159
  • 1
  • 2
  • 9