Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

273 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
1k views

How to Catch Connection Issues to Web3 Provider using Web3.js

My node.js script is able to successfully connect to the Web3 provider when both the private key (using truffle-privatekey-provider) and the provider host URL are correct. let privateKey = ..., ...
Nyxynyx's user avatar
  • 1,167
6 votes
0 answers
556 views

Truffle test of two transactions during the same block

I'm trying to test a solidity function that only allows it to be called once per block. E.g. (my desired functionality): Tx1 calls Fn during block #100, and when successful sets a boolean flag for ...
jonnyg's user avatar
  • 61
5 votes
0 answers
571 views

`eth_getTransactionReceipt` returns the transaction hash not the receipt

I use sol-coverage in a truffle project. Ganache is my development blockchain. I have a lot of tests which end up doing more than a few thousand JSON RPC calls. Due to unbeknownst reasons, the ...
Paul Razvan Berg's user avatar
5 votes
1 answer
825 views

Can't debug transactions that fail during the Web3.js estimateGas() call? No Tx Hash

NOTE: I am doing my work with the Ganache v1.2.2 GUI client on a Linux Ubuntu 18.04 station. There are many revert errors that happen during the estimateGas() call that precedes the actual Web3.js ...
Robert Oschler's user avatar
4 votes
0 answers
509 views

Ganache Error/Bug?: Incompatible EIP155-based V 0 and chain id 1

I'm trying to mainnet-fork using the Ganache UI (instead of ganache-cli which seems to work fine.) The error mentions the chain id. I've used all sorts of chain ids. Mostly 1377 and 1. I'm not really ...
JDOaktown's user avatar
  • 169
4 votes
0 answers
201 views

Does 'estimateGas' behave the same on Ganache and on mainnet?

I noticed that estimateGas behavior in Ganache has changed: In version 6.4.1, it throws an exception if exceeding the gas-limit. In version 6.5.1, it returns the estimation even if exceeding the gas-...
goodvibration's user avatar
4 votes
1 answer
883 views

Remix + Ganache - Cannot call one contract from another

I have an innocent looking contracts that work painlessly in Remix. Test contract can easily call Another if I use JavaScript VM in Remix. I also have ganache-cli running on port 7454. If I connect ...
Amarsh's user avatar
  • 209
4 votes
0 answers
467 views

Difference between execution costs on remix an Ganache?

I created a contract on remix and then deployed it. when I call any function there is an execution cost in gas. I also deployed the same contract on Ganache for testing. I find the execution cost in ...
Mohamed's user avatar
  • 491
3 votes
0 answers
882 views

Uniswap addLiquidity Error: "revert TransferHelper: TRANSFER_FROM_FAILED"

I'm having issues with the addLiquidity() call failing due to what likely seems to be an approval issue and producing the following error code: Internal JSON-RPC error. { "message": "VM ...
T-Man-Stan's user avatar
3 votes
1 answer
661 views

Uniswap GUI on forked mainnet

I have created a forked mainnet in Ganache which is working well using the CLI. However I would like to have access to the UNISWAP GUI. If I open Uniswap and change my metamask settings to localhost, ...
blockbyblock's user avatar
3 votes
0 answers
757 views

How can I handle the UniswapV2: LOCKED revert reason when calling swapETHForExactTokens on the Uniswap router2 contract

I have forked the eth mainnet onto my local machine using ganache cli and am trying to call the UNISWAP router2's SwapETHForExactTokens to swap eth for MEME tokens. I call the function from truffle ...
user63854's user avatar
3 votes
1 answer
1k views

Error Ganache: Run out of gas - Works in Remix/Not from dApp

I am working on an application that stores and retrieves personal data on/from the ethereum blockchain. Just working on this to improve my Solidity and SC expertise and get comfortable with the ...
Valentijn van den Hout's user avatar
3 votes
0 answers
849 views

Mnemonic and HD Path in Ganache and ethereumjs-tx gives different private key and address

I am having difficulty reproducing the private key and address using the mnemonic and HD path provided by Ganache. Mnemonic weird farm vast surge upper truth answer end radar impact mind jeans HD ...
Nyxynyx's user avatar
  • 1,167
3 votes
0 answers
1k views

web3.personal.newAccount() successfully created but not listed in ganache accounts.why?

I am using truffle framework for Dapp development and I am new in Blockchain.I used the command web3.personal.newAccount() to create a new account. But i cannot view this account when i take ...
jeswin cyriac's user avatar
3 votes
2 answers
677 views

Check your gas amount error ERC721

I am trying to deploy contracts to Ganache for testing using Truffle, but no matter what I set gas price / gas limit / gas to both in truffle.js and Ganache itself, it always get check gas amount on ...
Forrest Colyer's user avatar
2 votes
0 answers
66 views

Truffle hit a require or revert statement in simple ERC777 constructor

I have incredibly simple code, taking straight from openzeppelin's ERC777 contract. When I run truffle migrate, however, I receive Replacing 'Implementation' -------------------------- *** ...
chriscrutt's user avatar
2 votes
0 answers
141 views

Is it possible to get the raw transaction hex of the entire transaction in Brownie?

I am creating unit tests for a smart contract that I am working on using Brownie and pytest. In one of the functions, I need to pass the raw transaction hex of an entire Ethereum transaction (not just ...
Jdawg287's user avatar
2 votes
1 answer
678 views

Deploy smart contract with metamask ethers.js and ganache

I want to deploy smart contracts on front-end with metamask address as deployer. To do that, I first compile the smart contract with Remix and put the json output on my React project (I use Ganache to ...
Silta's user avatar
  • 31
2 votes
1 answer
581 views

"contract x" ran out of gas. Something in the constructor (ex: infinite loop) caused gas estimation to fail ganache

i'm trying to deploy contracts on private network ganache using ganache application. but it threw an error because of its big size: "contract x" ran out of gas. Something in the constructor (...
Seif Khédija's user avatar
2 votes
0 answers
85 views

Eth-gas-reporter typeError

I am trying to understand how the eth-gas-reporter works but I keep getting TypeError: invalid reporter 'eth-gas-reporter' when I ran truffle test. Specifically the output is: Using network '...
null_user's user avatar
2 votes
2 answers
1k views

ERC20 Token deployed to Ganache not seen on Metamask

I connected my truffle project to the ganache network. Also I added ganache network into the metamask. After deploying erc20 contract to ganache, I can see my account's token balance on truffle ...
Salih Cemil Cetin's user avatar
2 votes
0 answers
236 views

Using Eth-Brownie to fork mainnet from specific blockheight?

Can I use eth-brownie to fork mainnet from a specific blockheight? I have an archive node if that helps. I want to see what would have happened, instead of what will happen Can another service do this?...
CQM's user avatar
  • 167
2 votes
0 answers
3k views

Alternative to ganache

can someone please tell me an alternative to Ganache? Tried installing ganache on my laptop and it's not supported. Ganache works on 64 bit computers and mine is 32bit. Is there a way I can go round ...
Adeolu Adewole's user avatar
2 votes
2 answers
443 views

How to deploy blockchain app in heroku

I want to deploy my blockchain app in heroku and i just want to use ganache as my blockchain network. is that possible?
Martin Angeles's user avatar
2 votes
0 answers
166 views

An error occurred while running C:\Users\path marketplace1\marketplace1\truffle-config.js! Did you forget to `npm install` your project?

I am getting this error when I try to add the truffle-config file to my project in ganache. What to do?
Crypto's user avatar
  • 105
2 votes
0 answers
320 views

Android Studio And Ethereum?

how i can connect android studio application with Ganache? i'm trying to build an application on android (that is my Front end) with a Smart contract (Back end) on my private Blockchain (Ganache). it'...
Riccardo Perelli's user avatar
2 votes
0 answers
32 views

When does 'truffle deploy' yield a different output every time?

truffle deploy (aka truffle migrate) is documented here. I'm doing the following sequence: Starting a local Ganache node Running truffle deploy I'd expect this sequence to yield the exact same ...
goodvibration's user avatar
2 votes
0 answers
227 views

Using OpenZeppelin's increaseTime.js

I'm writing a test for a time-dependent solidity function. I'd like to use the increaseTime.js helper from v1.12.0 of OpenZeppelin's library. When I try to call this helper inside my test, I get an ...
Ann Kilzer's user avatar
2 votes
0 answers
561 views

evm_revert to snapshot#1 in ganache-cli automatically

I am using evm_increaseTime in my tests to move block time but in ganache-cli it shows that it is reverting to snapshot #1. I have not used evm_revert or evm_snapshot. Is it normal? what is the ...
rohit_sethi's user avatar
2 votes
0 answers
248 views

Mist on Ganache asks for a password on creating transaction

I cannot send funds to another my account with Mist, it asks for password. I'm using Ganache testnet, and didn't created any password in it. I tried to use ganache-cli -d -u "...
Dr.X's user avatar
  • 131
2 votes
0 answers
409 views

What does ganache mean by eth_getTransactionReceipt?

I'm transitioning our testing suite from using the parity client to using (a fork of) testrpc/ganache (so we can run code coverage). Our parity client has a lot of configuration, and I don't know how ...
Alex Altair's user avatar
2 votes
0 answers
388 views

Signature generated through web3.eth.sign not leading to same address after fromRpcSig

I am trying to write sign a challenge using web3.eth.sign, web3 uses ganache.provider(), But when i do fromRpcSig(signature) ecrecover(challenge) which results in different address. But when i sign ...
Pram's user avatar
  • 121
2 votes
1 answer
593 views

Exceeds block gas limit error to call view functions

With solidity view function, you can specific the amount of gas to use. My understand is since it is not a state changing transaction, all the gas cost is not charged for, and the client should be ...
tao chen's user avatar
2 votes
0 answers
410 views

Truffle deployment with metamask to ganache leads private key error

I'm using Truffle, web3js and Metamask to build a webapp. I'm using ganache for local testing. I'm trying to deploy a contract with import TruffleDeployer from 'truffle-deployer'; import ...
Paymahn Moghadasian's user avatar
2 votes
0 answers
231 views

Couldn't estimate the gas when running Mist against ganache-cli

I am running ganache-cli locally, then connecting Mist with /Applications/Mist.app/Contents/MacOS/Mist --rpc http://localhost:8545 Then, when I try to send from one test acccount to another in the ...
Ann Kilzer's user avatar
2 votes
0 answers
164 views

Import contracts, compiling and deployment

quick question. I have a set of contracts A,B,C. A contains import 'B' and import 'C'. Should I just compile A and then deploy it on the blockchain for the functions in B and C to be implemented ...
mikegross's user avatar
  • 135
2 votes
1 answer
403 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
GabCas's user avatar
  • 121
2 votes
1 answer
273 views

Branch a Truffle test into various Ganache blockchain states

I am currently testing a contract that can evolve in different ways, depending on the interaction between parties. But all these possible scenarios share the same initialization. So, the question I ...
Augusto T.'s user avatar
2 votes
3 answers
751 views

Windows Ganache GUI not taking updates from Truffle running on WSL2

I have added truffle workspace to Ganache as usual. But now when I do a simple truffle develop followed by migrate inside the truffle shell, Ganache picks up that the contracts are deployed, but it ...
Somjit's user avatar
  • 265
1 vote
0 answers
27 views

Missing Revert Data (Hardhat/Ganache)

shortMessage: 'missing revert data', info: { error: { message: 'VM Exception while processing transaction: invalid opcode', stack: 'RuntimeError: VM Exception while processing ...
Kishor Kumar Paroi's user avatar
1 vote
0 answers
27 views

Accessing a String[ ][ ] type array from a Solidity Backend to a React Frontend

Greetings to the one reading this issue. My project uses: Ganache - Deployment Solidity - Smart Contract React - Frontend Metamask - Wallet Here is the screenshot of the problem. I am unable to ...
Siddhant Khare's user avatar
1 vote
0 answers
13 views

Why are my exceptions rendered differently after versions update?

I don't remember the previous versions I was using but I remember upgrading because I hoped to have a local test network (via Ganache) supporting EIP-1559. My versions are: Truffle v5.11.5 (core: 5.11....
Luis Masuelli's user avatar
1 vote
0 answers
28 views

Truffle migration of an ownable contract

Initially, I deploy everything using REMIX IDE, currently I would like to try to deploy a contract that is ownable into local ganache blockchain using truffle migration: pragma solidity ^0.8.18; ...
tony's user avatar
  • 13
1 vote
0 answers
32 views

How to fix `Invalid callback object specfied` error when deploying a smart contract?

My smart contract: // SPDX-License-Identifier: MIT pragma solidity 0.8.19; contract Inbox { string public message; constructor (string memory initiialMessage) { message = ...
Jyobala's user avatar
  • 11
1 vote
0 answers
17 views

Mainnet fork deployment - Error: *** Deployment Failed *** "Migrations" hit an invalid opcode while deploying

I am trying to deploy contracts on a mainnet fork. I have my fork running with the command ganache --fork https://mainnet.infura.io/v3/$INFURA_API_KEY --wallet.unlockedAccounts=$MY_ACCOUNT --chain....
justinsacco's user avatar
1 vote
1 answer
171 views

How do I fix Error: Deployment Failed on ganache?

I am encountering this error while deploying my smart contract on the Ganache blockchain, can anyone help me fix it? Error: *** Deployment Failed *** "Coffee" hit an invalid opcode while ...
kaustubh sharma's user avatar
1 vote
0 answers
99 views

Importing ERC20 token on Ganache silently fails

I have deployed an ERC20 contract on my local Ganache network, I am trying to add it to Metamask. It seems to find it, but then fails to display it in my token list after import: First I add the token ...
S..'s user avatar
  • 81
1 vote
0 answers
32 views

React dapp using same previous account(from ganache) even though changed in metamask

I have tried to interact and call functions from ethereum contract deployed at local blockchain ganache in my react dapp. And I am using metamask. But even though I change the account in metamask the ...
K7000's user avatar
  • 11
1 vote
0 answers
195 views

How to implement a custom consensus mechanism in Ganache

As a beginner in the Ethereum world, I have developed a blockchain network in Ethereum using Truffle, Ganache and Web3.js. I can deploy smart contract to Ganache network and transactions are included ...
Tripoli's user avatar
  • 11
1 vote
1 answer
975 views

Unhandled Exception: Connection refused - Truffle Ganache Connection with Flutter

I am getting this error when trying to link a smart contract deployed on a Ganache local blockchain with Flutter web3dart package. Note: Testing on android (both emulator and physical device give the ...
Tomas Ward's user avatar

1
2 3 4 5 6