Questions tagged [anvil]
The anvil tag has no usage guidance.
15 questions
0
votes
2
answers
69
views
Smart Contract Works in Remix and Foundry, but Fails After Deployment to Local Chain or Sepolia
I've developed a smart contract called BudgetSystem that works perfectly in the Remix IDE and has been tested on Foundry. However, after deploying the contract using Anvil on my local chain or the ...
0
votes
0
answers
18
views
Webpage not getting connected to mainnet fork
I've been trying to implement a clone of uniswap using the uniswap-v3 sdk. Now to get a quote for the exchange, I tried to get the signer object using the following code
import { ethers } from "...
0
votes
1
answer
183
views
Foundry Anvil - No signer on eth_sendTransaction with non default account
I am writing this question because of today I have been struggling with something on my dApp run locally and with the use of anvil as blockchain with a basic configuration:
anvil --host 0.0.0.0 --no-...
1
vote
1
answer
367
views
How can I add anvil token from the test token provided to my metamask account
When I run the make anvil command in terminal it provide me a bunch of accounts with test accounts. I am not able to import tokens from test account to my metamask account
0
votes
0
answers
173
views
Deploy script to anvil node foundry
Is it possible to simulate a contract deployment, using a script, to an anvil node but by specifying the localhost in the script itself instead of a flag on the CLI command?
Instead of this:
forge ...
0
votes
0
answers
47
views
Error "DeserError" while running hardhat tests on an Anvil forking node
I have a hardhat setup for both deploying and running tests of smart contracts. I wrote my unit tests using chai library and executed it using hh test --network anvil. and after a successful ...
0
votes
1
answer
330
views
queued transactions stuck on metamask on connection to anvil ( foundry )
I created and deployed a contract through foundry, setup the front end and stuff using ethers
used anvil to spin up a chain and used the private key given by anvil to import account on metamask. ...
0
votes
0
answers
271
views
Getting error "Could not fetch chain ID. Is your RPC URL correct?" in metamask while trying to add Anvil running on wsl
I was trying to add the Anvil to add on metamask, which was running in WSL.
In my VScode the Anvil is running:
What is causing the problem here ? How to fix the problem ?
1
vote
1
answer
54
views
metamask transaction successful but shows an unchanged state
I'm running a local anvil network.
This is how I added the network on metamask:
When I run a transaction like transferring ETH from Account 1 to Account 2, the transaction is successful (and on my ...
0
votes
1
answer
126
views
Foundry Anvil (local test network) database
I am using the Foundray Anvil local network to test my application. Is there an option while initiating the test network to store data of blockchain in a specific location? Similar to this --db /my/...
0
votes
1
answer
46
views
Download smartcontract's bytecode
Is there a way to download a smartcontract's bytecode with foundry and inject this bytecode into a local Anvil blockchain (at a given address) ?
Thanks
2
votes
2
answers
633
views
How to use real address in foundry anvil
I have a project that operates on Anvil. Previously, I used an account provided by Anvil, but now I wish to use the actual MetaMask address in development. Is there a method to integrate the real ...
0
votes
1
answer
518
views
trying to create contract on anvil/forge get error intrinsic gas too high
exact message:
message: intrinsic gas too high -- CallGasCostMoreThanGasLimit, data: None
generic counter contract from how to. googling around got me some old error somewhat related but not sure ...
0
votes
1
answer
125
views
UniswapV2 addLiquidityETH revert ds-math-sub-underflow
I tried this code for many contracts, and sending ETH and approving were done well, but on the addliquidityETH section, I get an error: reverted with 'ds-math-sub-underflow'. I can't understand why.
...
3
votes
1
answer
1k
views
How to work with foundry anvil custom rpc methods?
I'm running an anvil fork node on localhost:8545, and I create a provider by ethers:
const provider = new ethers.JsonRpcProvider('http://localhost:8545')
I tried some common rpc methods like: ...