Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 views

Assertion Error

Solidity file pragma solidity ^0.5.0; contract Todo { struct User { uint id; string name; } User[] public users; uint public nextId = 1; function create(string memory name) public ...
0
votes
0answers
12 views

Is there an ethereum simulator that does things like price swings and congestion?

Is there an Ethereum network simulator that does things like gas price swings, many other transactions submitted, etc? I'm aware of running things like geth or ganache but as far as I can tell they ...
1
vote
1answer
35 views

how to call a function of a smart contract from a c program using JSON-RPC

Indeed, i installed ganache where i deployed a smart contract. I wanted to write a c program that would allow me to call the functions of my smart contract and read the messages. This program would ...
0
votes
0answers
9 views

How to use promises with drizzle/vue-plugin

I'm trying to implement a blockchain based app. I'm using Drizzle Vue plugin to interact with the methods in smart contracts. However, I stumbled across the following issue. After executing the ...
1
vote
0answers
18 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, ...
0
votes
0answers
18 views

VM Exception when accessing mapping

I created a contract with a User struct than contains an age, a first name, and a last name. The function getUser() should return this information for an inputted address. But when I call my getUser() ...
1
vote
1answer
53 views

Ganache Invalid JSON RPC response: “”

Trying to connect Ganache GUI running on port 7545 to web3.js. Getting the below error whenever trying to call any of the functions of web3 - > web3.eth.getBalance("...
0
votes
1answer
39 views

Explorer for Private Blockchain with Ganache

I set up a private blockchain with ganache in the server. Now I want to view the transactions like in the public blockchain explorer. Locally I use Ganache GUI where I can actually track down ...
0
votes
1answer
20 views

How can a Smart Contract ask informations to a node?

I need to code something quite complex compared to my experience. Just for academic purpose, I'm supposed to have a lightweight blockchain that connects a group of nodes; in this blockchain every node ...
0
votes
1answer
26 views

Main Net RPC IP

I am trying to fork Ethereum Main Net via Ganache. In order to do this, I need The URL of the existing chain's RPC server. Nevertheless, I can't find such URL anywhere. Can anybody suggest such URL?
0
votes
0answers
16 views

Ganache does not update account balance after contract deploying

I work with Ganache and nodeJS. Whenever i effort to deploy my contract with JavaScript the related block is mined, that demonstrate the given contract is deployed, but the balance of the sender ...
0
votes
0answers
12 views

Truffle does not inject web3 into the test.js files

I get the following error while executing my truffle js files. despite trying to use web3 = new Web3(); or web3Provider = new web3.providers.HttpProvider('http://127.0.0.1:7545'); web3 = new Web3(...
0
votes
0answers
15 views

ganache forked mainnet always revert even on success transaction in mainnet

I am trying to impersonate an account using forked mainnet what I did was unluck the unknown account, approve the erc-20 token and copy then send the transaction of that address. Everytime the address ...
0
votes
1answer
44 views

Not able to interact with Ganache-cli: “-bash: ganache-cli: command not found”

I've already installed ganache-cli with sudo npm install -g ganache-cli on my MacOS but I am not able to interact with it through my terminal. I always get the error: -bash: ganache-cli: command not ...
0
votes
0answers
19 views

Ganache forked mainnet impersonate account transaction error

I am trying to impersonate my contract using forked mainnet on ganache whenever the account send a transaction I dryrun the transaction first on forked mainnet but it always give me Error: Returned ...
0
votes
0answers
14 views

What are the transaction ordering options in ganache?

I saw this got Geth and Parity but I am just wondering if the are transaction ordering options in ganache too? I yes what are these, what is the default one and how to enable them?
1
vote
0answers
28 views

Debugging contracts on a mainnet fork with Remix

I'm developing a contract that relies on some states of other contracts currently deployed on mainnet. I'm after a way to test and debug my contract without having to deploy to mainnet first. I'm ...
0
votes
0answers
24 views

Checking transactions in ganache-cli

Is there a command to enter into the terminal to check past transactions on the locally deployed ganache-cli blockchain? With ganache gui one gets the transactions button. Is there some similar ...
0
votes
0answers
23 views

Forked Mainnet `INSUFFICIENT_OUTPUT_AMOUNT` on a transaction

I am currently using ganache and forked mainnet to test if a transaction in advance will fail or not. I get error INSUFFICIENT_INPUT_AMOUNT on ganache while the tx success on mainnet and observed that ...
0
votes
2answers
14 views

Issue deploying a contract successfully with Truffle and ganache

Long story short my contract is not passing the deployment test using truffle, mocha, and chai. I ran the code individually in the truffle console and it was returning an address just fine but it won'...
0
votes
1answer
38 views

My metamask extension is not getting connected to ganache local block chain

This is my Html code : <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> ...
0
votes
1answer
28 views

Truffle test deploys everytime a new contract with .deployed()

I want to test some contracts^^ And now Im wondering because like I understand .deployed() should take the contracts from the migration in truffle and dont deploy new ones? My test.js: const one = ...
1
vote
2answers
15 views

Question about Ganache

After I updated my Ganache the account addresses and the Mnemonic change everytime I start Ganache. The option "Autogenerate HD Mnemonic" is disabled. Do you know a way to keep the same ...
5
votes
1answer
2k views

Setup Ganache with Metamask. What and where is a Chain ID?

I am following these instructions. The problem is that the above instructions don't mention Chain ID and it appears Chain ID is required to even make it work. Thus, I'm stuck. What is the Chain ID? ...
0
votes
0answers
38 views

Exception errors and contract calls

Noob here. I've set up a test blockchain using Ganache and have successfully deployed a sample contract to one of the addresses in my environment (using Remix). However, when I try to run my python ...
0
votes
1answer
68 views

Connect Ganache to Ropsten

I want to connect Ganache to Ropsten such that i can see Ropsten's ledger with Ganache. Is this possible? if yes, what settings do I need to do on Ganache?
0
votes
1answer
32 views

JS Testing: A contract calling a function in another contract which creates a contract

I want to test three contracts in total: Main.sol, Factory.sol, PCE.sol Here's the flow I want: accounts[0] calls factoryStart in Main.sol Main.sol should call a function in Factory.sol, passing the ...
0
votes
0answers
49 views

Always getting “Gas Estimation failed” in Remix when testing 1inch swap function

I am trying to test 1inch swap function from the contract deployed via Remix on a Ganache fork of the Ethereum Mainnet. When calling this function I always get the "Gas estimation failed" ...
4
votes
4answers
1k views

The endpoint returned a different chain ID: 0x539 (Ganache)

I am trying to connect Metamask to ganache by creating a custom RPC with the following details: New RPC URL: HTTP://127.0.0.1:7545 Chain Id: 5777 But I keep getting the error message The endpoint ...
0
votes
1answer
31 views

Contract calling a function in another contract : TypeError

I have three contracts Ignition.sol , Factory.sol, Cookie.sol , Ignition should call the function 'factoryStart()' in the Factory contract. newCookie() creates new Cookie.sol contracts depending on ...
1
vote
1answer
31 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 ...
0
votes
0answers
29 views

Can I use a separate pc to run a full eth node and connect to it?

Since running a light node doesn't work (no peers connecting) and running a full node on my pc takes up basically all the RAM while syncing I've decided to run a full node on my old laptop instead. ...
1
vote
1answer
99 views

Truffle ganache fork

Suppose I have access to a full archive Node and I want to fork from a specific block using Ganache. Using ganache-cli, I can specify where to fork using the --fork parameter by passing it the Node ...
0
votes
1answer
32 views

Ganache: How to see block data in every node?

I'm using ganache to simulate and a local blockchain network, and web3.py to interact with it. One aspect of blockchain is transparency: all transactions, once mined, are written into the ledgers of ...
0
votes
0answers
40 views

Truffle returns no code at address after contract update

etherjs (5.0) is used to deployed a smart contract Hello.sol. Here is the js code (truffle 5.1.52/ganache CLI 6.12.1): import { ContractFactory, ethers } from "ethers"; let privateKey = ...
1
vote
1answer
24 views

Web3py didn't throw error(in Remix it did)

The contracts I used: EtherDelta(DEX) Freedomcoin(Token) Here is my logic: I use userA who deployed the two contracts to transfer 100Ether to userB, then userB invoke depositToken, however, as there ...
0
votes
1answer
86 views

Truffle doesn't see the smart contract deployed on ganache

etherjs (5.0) is used to deployed a smart contract Hello.sol. Here is the js code (truffle 5.1.52/ganache CLI 6.12.1): import { ContractFactory, ethers } from "ethers"; let privateKey = ...
0
votes
1answer
69 views

Web3.py with Ganache - Error “from not found”, 'code': -32000

I have opened an instance of ganache at localhost port 9545 where I can connect with web3.py. However when I am trying to perform a transact using the below code: w3 = Web3(Web3.HTTPProvider('http://...
0
votes
1answer
396 views

Uniswap on Ganache

So im trying to write a smart contract that involves using Uniswap. I would like to test my smart contract and was looking into setting up uniswap on my local ganache server, but as I am new, a few ...
0
votes
0answers
23 views

Empty Address when using Truffle Debug

I currently have a local chain with Ganache. Say I have two contracts written in Solidity: Foo_v0_0_1.sol Bar_v0_0_1.sol In the code for my smart contract Foo_v0_0_1, I have the following: import &...
0
votes
1answer
153 views

Deployed contract address in Truffle does not match Ganache

I have truffle set up with Ganache. I am running tests on my solidity contract that involve sending ether to the contract and withdrawing it from the contract. Funny thing is my tests are PASSING, but ...
0
votes
1answer
1k views

ReferenceError: cannot access 'CONTRACT' before initialization

I'm trying to test a single smart contract (PCE_Contract.sol) with (PCE_Contract_test.js) using Truffle. When I run Truffle test, console output is : ReferenceError: Cannot access 'PCE_Contract' ...
0
votes
0answers
17 views

Ganache launch unexpected token in JSON: Syntax Error

After launching Ganache on my Windows 10 laptop. Ganache was working fine but one day, while running Ganache, my laptop shut down because of some problem with the battery. After opening the laptop ...
1
vote
1answer
20 views

Running test with multiple contract address on a local Ganache blockchain

I'm developing with Truffle and Ganache I have an standard ERC20 ABI that I import in my test file. it only has 3 optionals functions name, symbol and decimals. const Token = artifacts.require('./...
1
vote
0answers
183 views

UniswapV2 addLiquidityETH() reverting when trying to deploy to ganache locally

I'm trying to locally deploy a contract similar to sushiswap, but I keep getting a revert from addLiquidityETH(), no message other than VM Exception while processing transaction: revert //module....
1
vote
1answer
64 views

How to test your smart contract against currently existing ones on mainnet locally using Truffle?

Background I am fairly new to smart contracts and am currently experimenting using Ganache and Truffle to test on my local machine. My goal would be to have the smart contract interacting with other ...
1
vote
0answers
194 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 ...
0
votes
1answer
24 views

Need Some Basic Information related Ethereum [closed]

I'm newbie to block chaining and need help related truffle and related tools.... Q. Whats difference between truffle and ganache? Q1. Is truffle/Ganache(Don't know difference) is server side EVM, I ...
1
vote
1answer
39 views

How to find value of non-public state variable

I understand that public state variables automatically creates a getter function when deployed, its value can be accessed via the getter function. However, if a state variable is not public, how can ...
0
votes
1answer
162 views

Why is truffle migration failing to deploy contracts? “cannot read options of undefined”

I am trying to deploy a local version of SushiSwap on a local test Ethereum chain. I am using Ganache and Truffle to deploy the smart contracts locally. When I run truffle migrate and attempt to ...

1
2 3 4 5
9