Questions tagged [ganache]
For questions about using the Ganache personal blockchain testing environment.
626
questions
0
votes
0
answers
19
views
When sending a transaction using web3 I recive EIP1559FeeMarketTransaction.fillFromResult error
I am using a ganache local blockchain and truffle to test my smart contracts, this problem started to occur all of a sudden, since before I wasn't running into this problem.
So when I call the ...
1
vote
1
answer
8
views
brownie test results in ValueError: sender account not recognized
I am trying to run curve finance's multi-rewards test suite with brownie test, however, the tests fail with the following error:
accounts = <brownie.network.account.Accounts object at 0x103e0caf0&...
1
vote
0
answers
7
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....
0
votes
1
answer
42
views
Got `invalid opcode` when deploying a contract to Ganache test network from Truffle
I have launched Ganache 2.7.1 in Mac and using truffle 5.11.3. I tried to deploy below contract to Ganache but filed:
helloworld.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;
...
0
votes
0
answers
21
views
Error when Importing Web3 in React: Module not found for './formats' and
I'm encountering an issue while trying to import the Web3 library in a React project. The error message I'm receiving is:
Module not found: Error: Can't resolve './formats' in '/Users/kaustubhsharma/...
1
vote
0
answers
37
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 ...
0
votes
0
answers
19
views
Can I add an NFT image to MetaMask on the Ganache test network?
Here is my code:
const addImageToMetaMask = async (_tokenAddress, _tokenName, _tokenSymbol, _urlImage, _tokenId) => {
try {
if (typeof window.ethereum !== 'undefined') {
const provider =...
-1
votes
1
answer
28
views
how can i deploy my Dapp?
what if I have deployed my smart contract on truffle and used ganache to deploy the same and i havn't used any test network, so if I go to deploy it on netlify to demonstrate the same will it work??
1
vote
0
answers
70
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 ...
0
votes
2
answers
23
views
TypeError: Member "add" not found or not visible after argument-dependent lookup in struct Chainlink.Request memory
I encounter this error when trying to compile and migrate to my blockchain EVM.The smart contract supposed to trigger a job from Chainlink from Ganache EVM. This is the code to it
pragma solidity >=...
0
votes
1
answer
27
views
Chainlink says my EVM node is unreachable to localhost ganache
I have followed the instructions from chainlink doc here. In the instruction, instead of sepolia, I renamed to ganache because it will be linking with my ganache EVM.
As everything is setup, my ...
0
votes
0
answers
24
views
AttributeError: 'Eth' object has no attribute 'abi'
I am building a web application using django to register phone battery details and it interacts with a smart contract. I am trying to use the decode_log method but I keep getting this error:
...
0
votes
2
answers
156
views
CALL_EXCEPTION in estimateGas with local ganache
I am trying to deploy a contract to a local ganache network using Nodejs v20. Nodejs is able to connect with local Ganache but the deploy() method is giving following error:
Error: missing revert ...
0
votes
0
answers
19
views
Are accounts on Ganache Blockchain considered Nodes?
I wanted to ask a question: the accounts on Ganache are nodes, for example
I mean, if I am in the project, I let the account send the transaction to another account
This process considers that you are ...
0
votes
0
answers
23
views
Too much time to upload a file to ganache-cli blockchain
I am trying to upload a 1.6 Mb file to a state variable of type bytes in a smart contract I deployed in ganache blockchain, so I started it using this command to avoid the out of gas error in python ...
1
vote
1
answer
51
views
web3.js how to call receive() external payable?
firstly, I have a code in a contract as below:
receive() external payable {
// function enter() external payable {
require(msg.value > 0.1 ether, "require minimum 0.1 ether!...
0
votes
0
answers
38
views
write failed transactions to ganache
i'm trying to debug a complex transaction in ganache (using mainnet fork). it reverts and i want to debug why exactly.
i cannot use truffle debugger because it wants transaction hash, but i don't have ...
0
votes
1
answer
129
views
Invalid opcode error in ganache 2.7.1
I have created a smart contract and deployed it using web3.py by connecting to the ganache 2.7.0 version and deployed the smart contract in it but suddenly there was a update in ganache which I did ...
0
votes
1
answer
180
views
Error: Returned error: sender account not recognized
this contract for Deploys instances of other smart contracts and i'm using ganache
contract Contracts_Factory {
// Common Section
uint256 SIZE = 10;
uint index = 0;
string[] accounts = ...
0
votes
2
answers
236
views
How to configure custom ethereum node in foundry project?
Hardhat allows users to configure a custom network in the networks configuration object. This allows developers to run their JS/TS test suites against another local node such as Ganache or even a live ...
1
vote
0
answers
27
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 ...
0
votes
0
answers
62
views
Unhandled Rejection (Error): Internal JSON-RPC error
I keep getting this error:
Unhandled Rejection (Error): Internal JSON-RPC error.
{
"message": "VM Exception while processing transaction: revert",
"stack": "...
1
vote
0
answers
107
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 ...
0
votes
0
answers
24
views
How to measure time taken (computation) for each task in Ganache/Truffle?
If we have deployed a Dapp and using Ganache, how to measure the time taken for each step/task? or the total time taken for the entire application or the time taken for the creation of each block in ...
1
vote
1
answer
715
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 ...
3
votes
4
answers
1k
views
contract.deployTransaction.wait(1) not working in ethers version 6
To be specific I am using ethers version 6.2.3
Error is in this line
const deploymentReceipt = await contract.deployTransaction.wait(1);
Entire code I am using to deploy contract and wait
const { ...
1
vote
1
answer
45
views
Reentrancy attack: Safe Remote Purchase
Hello everyone i am new to solidity coding, and i want to improve my security skill regarding smart contracts and evm.
In order to accomplish this goal i tried a reentrancy attack on a simple contract....
0
votes
1
answer
51
views
Problem with brownie
when deploying the contract
it gives me
<function deploy_simple_storage at 0x0000021D6E255670>
What does that mean?
Deploy.py
from brownie import accounts,config,SimpleStorage
def ...
0
votes
0
answers
33
views
Sending a transaction timeout on Ganache without any error logged
Sending this transaction on a fresh Ganache 8.19.3 server causes a timeout.
{
"from": "0xaf854bcb87f01ad2914142eaea751157fcc9152a",
"to": "...
2
votes
0
answers
50
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'
--------------------------
*** ...
0
votes
0
answers
23
views
Prompt user to mint nft using data input
constructor(
string memory name,
string memory symbol
) ERC721(name, symbol) {}
function mintNFT(string memory tokenURI)
public onlyOwner
returns (uint256)
{
_tokenIds.increment();...
0
votes
0
answers
23
views
Following code is taking forever to deploy. Please help
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
const provider = new ethers.providers.JsonRpcProvider(
"http://172.20.96.1:...
0
votes
0
answers
29
views
Where can I get the password(s) of locked accounts of Ganache from?
I created a workspace in Ganache so that I've enabled Lock Accounts feature (You can see that in the below photo) in the workspace set up process. So, What is the password to unlock accounts? Where is ...
1
vote
1
answer
196
views
How to expose Ganache to local network?
I have a .appx installation of Ganache for Windows. I've made a blockchain on it & deployed a smart contract. Now I want to test it on Android Metamask. But Ganache address is only listening to my ...
1
vote
1
answer
56
views
web3py sendTransaction without private key
I am trying to make a transaction, but failing.
I have ganache-cli with 1000 ETHs in each wallet. I am running some python scripts to make transaction.
Using this link, I am not able to do so. This ...
0
votes
3
answers
160
views
Brownie private keys
Brownie under the hood use Ganache. Ones we start brownie console accounts are generate automatically (10 by default) for further use.
Question: is there a way to discover private key from account[0] ...
0
votes
1
answer
43
views
Web3j fails to deploy simple Vyper Contract to Ganache
I have a simple hello world contract, compiled with Vyper. I use Web3j CLI to make a Java wrapper class from the contract's abi and bin files. When I deploy it, I get a stack underflow error.
I know ...
0
votes
1
answer
61
views
Get 'revert ds-math-sub-underflow' with removeLiquidity func
I deployed Uniswap contracts locally on Ganache. I was able to addLiquidity, process different swaps, but I can't now remove that liquidity. I just get 'VM Exception while processing transaction: ...
0
votes
0
answers
194
views
How to get VSCode REMIX plugin debugger to step through the Solidity Source
I am new to Solidity development. The environment I have running at the moment is VSCode (ver 1.75.0) under WIN 10 Pro with the Ethereum Remix plugin (ver 0.0.12) connected to Ganache (ver 2.5.4) ...
1
vote
2
answers
58
views
Why does deploying a contract causes two transactions?
I am new to Ethereum, learning about smart contracts.
I have a simple hello world contract.
# @version ^0.3.7
@external
@pure
def hola() -> String[5]:
return "hola!"
Currently, I'm ...
1
vote
0
answers
23
views
Uncaught (in promise) TypeError: ProposalsRegistrationEndedEvent.watch is not a function
I was following an old Ethereum dapp tutorial to make a voting dapp. It uses truffle contract, web3js and ganache and when i access the pages via localhost i get the following error in the console: ...
1
vote
0
answers
112
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 ...
0
votes
1
answer
220
views
Ganache-UI fails to link with Truffle project
Created Truffle project with truffle init. The project has two simple contracts written in Vyper. I configure the project's truffle-config.js to point at Ganache-UI.
Using truffle test, my contracts ...
0
votes
1
answer
726
views
Getting "Runtime error: code size to deposit exceeds maximum code size" when deploying contract with web3 on ganache
I'm new to blockchain. I'm trying to deploying a contract through web3 on ganache (the npm version) for testing purpose with mocha.
During the deployment attempt, ganache returns with the following ...
1
vote
0
answers
45
views
org.web3j.protocol.exceptions.TransactionException: {"stack":"TXRejectedError: Exceeds block gas limit
I'm trying to communicate with my deployed contract using web3j. First I should let you know that I have 0 experience in web3j, I'm using it for the first time.
Goal: I wanted to simply call that ...
0
votes
1
answer
45
views
solidity contract creation factory contract method is being called, but new contract is not getting created
I have two seperate contracts:
SuperAdmin.sol
User.sol
And they look like this:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./User.sol";
contract SuperAdmin {
...
0
votes
0
answers
48
views
Locally testing Chainlink VRFV2 Direct Funding Method
I needed to generate a random number in order to pick a random winner in my solidity smart contract. That's why I used Chainlink VRFV2 direct funding method.
I tested everything on Remix, now I want ...
0
votes
0
answers
125
views
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)
const fs = require("fs-extra");
async function main() {
//http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const ...
0
votes
0
answers
118
views
How ganache unlocks account that doesn't belong to me?
In ganache mainnet fork, I can unlock any account and make transactions on behalf of that account:
npx ganache-cli -p 8545 -f https://mainnet.infura.io/v3/$WEB3_INFURA_PROJECT_ID --unlock $...
0
votes
1
answer
98
views
Cannot deploy contracts on local ganache instance
Don't know why, but getting this error. I tried account from ganache that has 100 ETHs. The compilation was successfully done but when I try to deploy the error arises. Pls help...!