All Questions
203 questions
0
votes
0
answers
20
views
i have an error to bulid web app react by blockchain solidity, truffle, ganache, metamask:the solution for frequency error please give me the solutio
import React, { useState, useEffect } from 'react';
import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import Web3 from 'web3';
import HomePage from './HomePage';
import ...
0
votes
0
answers
54
views
when using call function in web3.py im getting error
Error: Could not transact with/call contract function, is contract deployed correctly and chain synced?
import streamlit as st
from web3 import Web3
import hashlib
import json
# Connect to local ...
0
votes
1
answer
18
views
Truffle Test Error: UnhandledRejections detected VM Exception while processing transaction: revert code: -32000
I am still learning solidity and using Ganache.
Below is the contract I am trying to execute:
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
contract FundMe {
address payable public ...
0
votes
1
answer
23
views
Copying of type struct ECommerceMarketplace.OrderItem memory[] memory to storage not yet supported
I am working on creating an E-Commerce Smart Contract. But when I run the migrate command, I'm getting this error:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract ...
1
vote
0
answers
94
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 ...
1
vote
0
answers
36
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 ...
0
votes
0
answers
11
views
Contract is not deploying
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
const provider = new ethers.providers.JsonRpcProvider("http://172.27.128.1:7545&...
1
vote
0
answers
41
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 = ...
0
votes
1
answer
388
views
Error when deploying my contract and interact with him
Here is the error message :
Deploying, please wait...
BaseContract {
target: '0x80f4D1df2Da11Ca9437A01519d3972d07E54A43E',
interface: Interface {
fragments: [
[ConstructorFragment],
...
0
votes
2
answers
1k
views
Error: missing revert data when deploying Solidity contract with ethers.js and Ganache
I'm having an issue deploying a Solidity smart contract using ethers.js and Ganache. I have a simple contract called SimpleStorage.sol:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
...
0
votes
0
answers
245
views
Web3.py exception contract logic error; execution reverted: VM exception
I would like to contract the transactions to solidity compiler and got the following error;
raise ContractLogicError(f"execution reverted: {message}", data=data)
web3.exceptions....
0
votes
1
answer
45
views
Whenever I add the truffle config file to ganache, all the account balances become 0.00 ETH, any solutions?
The truffle compile and migrate work fine, but when I add the config file to the ganache, it makes all the account balances as 0.00 ETH.
I am following this repo https://github.com/SuyashMore/...
0
votes
1
answer
118
views
Perplexing issue: Ownable: caller is not the owner'
i am a new developer and i am struggling with an issue since two weeks now and can't get to the bottom of it.
Here is some context: I have two smart contracts, one minting an NFT and the other issuing ...
1
vote
1
answer
2k
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;
...
1
vote
1
answer
317
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 ...
-1
votes
1
answer
121
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??
0
votes
1
answer
664
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 = ...
1
vote
1
answer
1k
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 ...
6
votes
5
answers
3k
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
78
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....
2
votes
0
answers
71
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'
--------------------------
*** ...
1
vote
0
answers
26
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
71
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
55
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
474
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
76
views
Issues deploying large contracts with Web3.JS , but with Remix contract deploys perfectly
I am using solc npm package as compiler. It seems to compile fine. Maybe it's not a gas issue, but a problem with how I'm deploying multipart contracts in Web3 JS.
//initial.js
var output = JSON.parse(...
0
votes
1
answer
173
views
Change ganache Owner Account in WEB3J from account[0] to account[1]or account[2]
I'm looking for a way to change owner of the smart contracts in java web3j as we do in web3 javascript using from:
//using account for transaction in javascript
await contract.function(param1, param2, ...
0
votes
1
answer
163
views
Ran out of gas while using the browser
When I call the function through Remix IDE I have no problem.
But when I try to call it through the browser, I get the error:
Error: Returned error: VM Exception while processing transaction: out of ...
0
votes
1
answer
591
views
Why is require condition with or ( || )operator always false?
I have an internal function which is called from an external function. At the 2 require(msg.sender == ContractOwner ... ) the result of the compare is always false, or at least it is ignored and the ...
1
vote
1
answer
159
views
My function does not return a value when I use the Ganache provider
When I deploy the smart contract in the Remix VM my function returns a random number but when I use the Ganache provider my function returns nothing.
// Initializing the state variable
uint ...
1
vote
1
answer
691
views
How do I get the addresses from the Ganache?
I am trying to implement a virtual Smart Voting in Remix IDE.
I want to get the remaining 99 addresses from the Ganache to create an iteration and have them register at polling stations and then vote.
...
1
vote
1
answer
42
views
Where created contract address come from?
when i creat smart contract
i found to address in ganache
first sender address,the address which deploy the contract in remix
second the created contract address, where come from , what diffirent ...
1
vote
0
answers
280
views
Ganache Invalid Remainer error
I am currently using ganache, i am getting the following error when i execute w3.eth.send_raw_transaction(signed_txn.rawTransaction)
Transaction Object:
{'from': '...
0
votes
1
answer
296
views
Error: Cannot create instance of <the-contract>; no code at address 0x
I'm using truffle and I want to use USDC token contract to send token to a address but it shows me this error when I run npx truffle migrate
Error: Cannot create instance of ERC20Mock; no code at ...
0
votes
0
answers
264
views
I can't listen events with web3.py on ganache provider
I wanted to use the same provider for the Remix IDE and web3.py. So that, I can use the debug features of the remix IDE. I installed ganache and started the provider. I connected the Remix and ...
3
votes
1
answer
4k
views
Error: chainId address mismatch
i'm trying to deploy a simple smart contract with node-js on a ganache-GUI but i keep getting this Error: chainId address mismatch;
may chainId is the same as the networkId in the ganache app witch is ...
2
votes
2
answers
2k
views
How to get reverted error name with ethers in javascript?
I write a solidty code and also a custom error like this:
error TestObject__IndexNotFound();
function getProductChain(uint256 index) public view returns(SupplyChain memory){
if (index > (...
0
votes
1
answer
496
views
how to call a rest api into smart caontract
My scenario is as follows:
I use a private Ethereum network such as ganache.
In a smart contract function, I need to call a web service and then continue processing based on it.
I don't have any idea.
...
0
votes
1
answer
116
views
Avoid "out of gas" when calling a view function using truffle
I have a rather computationally expensive view function on my smart contract, which works with no problem on rinkeby (calling it from etherscan).
However, deploying the contract into a local chain (on ...
0
votes
0
answers
86
views
Problem with funds and incrementing counter
I am writing this app using Truffle and Ganache suite and I am having trouble with a certain transaction. Solidity ver is 0.8.3.
I am using metamask to connect the wallet and importing contacts from ...
1
vote
0
answers
204
views
Can not deploy my contract on ganache-cli using ETH mainnet fork
I used ganache-cli in combination with my Infura key to fork ETH mainnet so I could use the Uniswap router in my development environment:
ganache-cli --fork https://mainnet.infura.io/v3/<mykeyhere&...
0
votes
1
answer
329
views
Error Installing Truffle in VS Code?
I'm trying to install truffle on VS Code(in window 10) after installing node.js, npm and ganache.
All the above three have been installed and worked but When I tried to install truffle in VS Code in ...
0
votes
1
answer
33
views
I have written a smart contract in solidity using remix ide. the contract is deployed but while interacting the contract it is showing error
pragma solidity ^0.6.0;
contract MyContract {
//taking data
int [] private PV1 = [ 0,0,0,0,0,0,704000,1280000,2560000,3840000,5504000,6400000,6400000,6400000,5312000,3584000,2048000,1472000,0,...
0
votes
1
answer
31
views
Hi,I had written the code for voting purpose.Can you guys help me out to write a truffle testing code for this?
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract voting{
address private onlyowner;
uint private Virat =0;
uint private Rohit =0;
constructor(){
onlyowner = msg.sender;
}
...
0
votes
0
answers
66
views
Truffle with weird behavior dealing with uint type of variables
I´ve spent a couple weeks try to understanding what was heppening. The same solidity code worked great in REMIX but not in Truffle/Ganache. Let´s me explain. I wrote a code bases on Openzeppelin, but ...
0
votes
0
answers
15
views
my transaction triplicates and all of them fail
I am new to creating smart contracts, I followed this video in order to create a simple to-do list. I needed to update some code in order to make it work since the video is more than 2 years old. This ...
0
votes
3
answers
100
views
How to show the data stored in the blockchain to the client side app
I wrote this contract for an 'Online Birth and Death Registration System' that stores data to the blockchain and now I'd like to know how i can retrieve the data I store so I can display it on another ...
0
votes
1
answer
507
views
Windows Ganache install Errors [closed]
I'm attempting to install ganache via npm install ganache from my windows machine using PowerShell.
Upon execution, a list of errors is populated.
One asked me to install python which I thought was ...
0
votes
2
answers
547
views
How to write data to the blockchain using an html form
I am currently working an Online Birth Certificate Registration System using blockchain for my final year project in Uni. I have incorporated Moralis in my project to handle the users and linked it to ...
1
vote
1
answer
122
views
truffle with ganache uses "UNKNOWN" network instead of "development"
When I run truffle migrate --reset and then truffle networks I see that the contracts were deployed to a network named UNKNOWN.
I have this configuration:
development: {
host: "127.0.0.1&...