Skip to main content
Share Your Experience: Take the 2024 Developer Survey
8 votes

Impersonating accounts on a forked Ethereum main net using Hardhat

try import { network, ethers } from "hardhat"; await network.provider.request({ method: "hardhat_impersonateAccount", params: ["0x..........................."]...
zgo's user avatar
  • 81
7 votes

Impersonating accounts on a forked Ethereum main net using Hardhat

Update Oct 2022 Impersonating Accounts with Hardhat has a new, simplified API. According to their new docs, you can impersonate an account using the getImpersonatedSigner method const ...
ohhimark's user avatar
5 votes
Accepted

Request multiple random number at once on chainlink VRF

If you want to get multiple random numbers from a single VRF response, you should create an array where the randomValue is your original returned VRF number and n is the desired number of random ...
Zak Ayesh's user avatar
  • 607
5 votes
Accepted

geth mainnet fast sync appears stuck at around 100 blocks from highestBlock

That's a normal behavior, you haven't finished to sync the blockchain. Let's see the Geth documentation (https://geth.ethereum.org/docs/faq). In fast sync mode, Geth first downloads blocks without ...
clement's user avatar
  • 4,302
4 votes
Accepted

The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?

Most of the time its same. But not always. Polygon Mainnet have made its own chain, which is seperate from Ethereum chain. When we create wallet by wallet providers like metamask the wallet address of ...
aakash4dev's user avatar
3 votes

Cannot access deployed smart contract on mainnet

This maybe due to your gas configuration in hardhat.config.js. In my case I got the following error when upgrading a deployed smart contract in fuji network using hardhat-upgrades plugin. {reason: '...
Sahan Kaushalya's user avatar
3 votes

geth mainnet fast sync appears stuck at around 100 blocks from highestBlock

I finally managed to sync a mainnet node in around 15 hours using i3.2xlarge AWS EC2 instance (8 core, 61 GiB RAM, 1.9 TiB NVMe SSD). It's way larger than what is needed but the main point being that ...
Darren Jensen's user avatar
3 votes
Accepted

Deploying a simple contract to ETH Mainnet (from remix) costing $500? Am I doing this wrong?

Sorry, that's the cost of working on L1. Consider how today's average gas for all transactions was ~130 gwei or ~$150 USD: https://ycharts.com/indicators/ethereum_average_gas_price. This includes ...
ori's user avatar
  • 346
2 votes
Accepted

GasPrice: is dipendent by the moment of the call and/or the network?

Overall fee you pay for a transaction, counted in fiat currency (EUR, USD, etc), depends on the following things: Ether to fiat exchange rate (may change over time, out of your control) Gas price (...
Mikhail Vladimirov's user avatar
2 votes

How to fork current eth mainnet chain in new private blockchain from block #####

To achieve this I would start off with one node (or a couple) and sync to the main net. At block X, I would then server the connection with the mainnet The connected nodes should continue to ...
0xsegfault's user avatar
  • 1,260
2 votes

Who confirms Ropsten and Rinkeby transactions?

Ropsten transactions are confirmed by miners on that POW network. Rinkeby transactions are confirmed by specific authorized nodes run by the the Geth team. The Ethereum Foundation, Infura, AKASHA ...
import-antigravity's user avatar
2 votes

Hardhat Can't resolve 'console' on react project

I was getting the same error and what fixed it for me was changing my imports statement for ethers from import { ethers } from 'hardhat'; to import { ethers } from 'ethers';
tobel's user avatar
  • 21
2 votes

Error when deploying contract to Mainnet but not Testnet

Probably it is the mistake, but I'm not sure: You have sent extra 60 wei with your contract. that(see the picture) is no the transaction fee and it should always be 0 unless your contract expecting ...
Majd TL's user avatar
  • 3,237
2 votes

hardhat mainnet forking and impersonating an account isnt working, help!

The issues is that you are using ethers.provider which is not pointing to the localhost hardhat chain. once you get the right provider, you can then get the impersonated signer and make transactions. ...
user566245's user avatar
2 votes

hardhat mainnet forking and impersonating an account isnt working, help!

You're probably not connected to your local node fork. In hardhat tests, unless you explicitly specify --network localhost, it won't connect to your local fork and will launch a clean test env each ...
Kof's user avatar
  • 2,954
2 votes

code to activate Eth amount from Ropsten network to Main network

I received 1 Eth from someone in Africa, sent to Metamask, but he sent to Ropsten network, not to Main network. He asked me to send Dagcoins first and then he will send me a code to activate the 1 Eth ...
Richard Horrocks's user avatar
2 votes

Deploying a simple contract to ETH Mainnet (from remix) costing $500? Am I doing this wrong?

Before doing anything, I suggest first take a look at this to get familiar with contract deployment's gas calculation. After reading the aforementioned link, I suggest (if it is possible for you), ...
Rouhollah Joveini's user avatar
2 votes

The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?

It is likely that yes. Both polygon and ethereum use the same format for wallet addresses, and with the same private key you could sign transactions for both chains.
Ismael's user avatar
  • 30.6k
2 votes
Accepted

What is the current size of a copy of the entire Polygon Mainnet chain?

As of March 22, 2023, the total size of Polygon Mainnet is about 1269.05 GB. You can find this information on the Polygon snapshots website: https://snapshots.polygon.technology
Falcon Stakepool's user avatar
2 votes
Accepted

transaction would cause overdraft

This is coming from a standard check in go-ethereum. When submitting a new transaction, the node will check if the sender has other txs currently pending in the txpool. If yes, it will add up the gas ...
jj1980's user avatar
  • 151
1 vote

How do I use web3.js to read (balanceOf) an upgradable ERC20 smart contract?

To get data from an upgradeable smart contract, you should interact with the Proxy Contract Address using the ABI of the Implementation Contract. When you read data directly from the Implementation ...
João Rizk's user avatar
1 vote
Accepted

Verify contract not working (not match bytecode)

Try this Run npm init -y then npm install --save-dev hardhat after that open the folder in vsc and in the terminal run npx hradhat and choose Create an advanced sample project Install Openzepplien $ ...
Majd TL's user avatar
  • 3,237
1 vote
Accepted

"Migrations" ran out of gas after x blocks mainnet

You need your gasPrice to be much higher. 1 Gwei is 1e9, and these days 60-100 gwei are "normal" gas prices. Often even more is needed. See here for current gas prices.
Kenzo Agada's user avatar
  • 1,226
1 vote

hardhat mainnet forking and impersonating an account isnt working, help!

You run the script via the node script.js command. That creates a new temporary node that resets once you run the command again. To have a persistent effect and actually use the background node you ...
user130657's user avatar
1 vote

Ethereum network Sync up with Matic network

Once the contract is deployed in Matic network, how this get sync with Ethereum Mainnet ? It doesn't. You need to use a bridge to move tokens between two different chains, like Polygon (Matic) and ...
Mikko Ohtamaa's user avatar
1 vote
Accepted

Is there any version of AAVE protocol deployed on polygon/matic testnet?

Is seems that the documentation at https://docs.aave.com/developers/deployed-contracts/matic-polygon-market has been updated and you can find all the information you seek in the « Mumbai » which is ...
Sylvain Laurent's user avatar
1 vote

How to take advantage of the freeness of ethereum testnet and do simple ERC20 transfers on the mainnet when needed?

It is not possible to combine data from testnets and the mainnet in any meaningfully decentralized way. Furthermore, testnets may be reset at any time and weird stuff may happen there - they are not ...
Lauri Peltonen's user avatar
1 vote

How can i obtain real ether in metamask (at the same manner i obtain ether from ropsten faucet in testnet) to create real transactions in mainnet?

To obtain real Ether, you need to buy it. You buy it from a cryptocurrency exchange with fiat money (US Dollar, Euros, whatever is your national currency).
Mikko Ohtamaa's user avatar
1 vote
Accepted

How do we call the standard coin of a certain mainnet?

There is no set-in-stone rule for how to refer to ETH as a distinctive kind of coin as compared to ERC-20 tokens. The variants I heard most often are: Native cryptocurrency (as per Wikipedia) Native ...
Paul Razvan Berg's user avatar
1 vote

Is it possible to communicate between ethereum smart contract and binance smart chain contract?

No. That's not possible directly. Both blockchains are deterministic (as all blockchain are, typically). That means that the blockchain can only use data which it has inside it - it can't use data ...
Lauri Peltonen's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible