All Questions
126 questions
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 ...
0
votes
1
answer
72
views
Web3.js => _data.trim() is not a function?
Trying to deploy to ganache but keeps giving this error.
Error :
TypeError: _data.trim is not a function
at ContractBuilder.deploy (C:\Users\user\Desktop\lotteryv2\node_modules\web3-eth-contract\lib\...
0
votes
0
answers
12
views
DNS using blockchain (how can i hashed my domain name ) in the code below help me to complete this code
import Web3 from "web3";
import Registry from "./contracts/Registry.json";
import Resolver from "./contracts/Resolver.json";
import Cache from "./contracts/Cache....
0
votes
1
answer
540
views
Subject: Facing "TypeError: invalid private key" during deployment
Description:
I'm encountering an issue while attempting to deploy a contract using ethers.js. The error message I'm receiving is as follows:
Error:
TypeError: invalid private key (argument="...
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
0
answers
43
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 ...
1
vote
1
answer
201
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!...
1
vote
0
answers
260
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 ...
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 ...
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
2
answers
1k
views
Exceeds block gas limit or base fee exceeds gas limit
I am learning web3, and a person is using solidity ^0.4.5, and I am adapting his code to solidity ^0.8.9, and I am facing this problem when if I have 1000 here:
factory = await new web3.eth.Contract(...
0
votes
0
answers
281
views
Access Ganache-CLI from several computers
I'm trying to create a project where Person A puts some data on a Ganache-CLI instance, and Person B is capable of retrieving it. This worked fine on one server, because Ganache-CLI was running on ...
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.
...
1
vote
1
answer
110
views
How do I make sure I have enough gas for my transaction to go through. I get a value error whenever I try to deploy a contract in brownie
I am following Patrick Alphas tutorial using brownie https://youtu.be/M576WGiDBdQ
. I have a fund_and_withdrawl script that has been compiled . With that, I am trying to deploy a fundme contract on a ...
0
votes
2
answers
1k
views
Error : contract.methods.myfunction().call() is not a function
I'm new to web 3 and I'm trying to interact with a contract deployed with ganache and I get an error here is a screenshot:
`
0
votes
1
answer
476
views
Why am I failing to interact with a smart contract I found on Etherscan.io?
I am getting the below error trying to call an existing smart contract I found on Etherscan.io function using call().
Error: Error: Returned values aren't valid, did it run Out of Gas? You
might also ...
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 ...
1
vote
0
answers
554
views
Send transaction from unlocked account using Golang in Ganache
Ganache allows unlocking accounts for sending transactions impersonating other Ethereum accounts.
Based on this answer, for an unlocked account you can send a transaction with web3.js like this:
const ...
0
votes
2
answers
20
views
Collect 2 or more contract balances in one contract
I'm trying to develop a smart contract which collect fees from other contracts.
I tried to do:
function sendFees() public {
address payable feeCollector = payable(feeCollector addredd);
...
0
votes
0
answers
890
views
Error "Returned values aren't valid, did it run Out of Gas" for simple view function
I am trying to compile, deploy and run a function for a simple Ethereum contract, but when I run the function(a simple view function that returns an int) it says that I ran out of gas:
$ npm run test
...
0
votes
2
answers
553
views
How to solve Unhandled Rejection (Error): invalid address error with web3 js
Whenever I run the code I get an error saying
"Unhandled Rejection (Error): invalid address (argument="address", value=["0xF628D397c2C1c4cB485BDF5441ac723B229f4F8f"], code=...
0
votes
1
answer
150
views
Problem approving allowance using external Metamask Account with local Ganache
I am using React, to interact with a smart contract deployed on local Ganache, I can approve allowances to accounts generated by Ganache, but I can't approve allowance with Metamask accounts which ...
0
votes
1
answer
293
views
sendSignedTransaction - (node:90923) UnhandledPromiseRejectionWarning: Error: Returned error: Invalid Signature
Hi I'm using Web3js and Ganache. I'm trying to send a serialized transaction but got the following error:
(node:90923) UnhandledPromiseRejectionWarning: Error: Returned error: Invalid Signature . I'...
1
vote
0
answers
103
views
Ganache-cli server and Webjs not connecting : Returned values aren't valid, did it run Out of Gas?
I am trying to connect web3js in the javascript section of my html to my ganache-cli nodejs server
ganache deployment script:
const ganache = require("ganache-cli");
const Web3 = require(&...
0
votes
1
answer
993
views
Truffle console showing irrelevant balance irrelevant BN{ negative: 0, words: [ 16777216, 62077800, 20718012, <1 empty item> ], length: 4, red: null }
I'm using ganache network, truffle network, web3, chai and mocha.
while using truffle console in terminal it shows:
truffle(develompment)> balance
BN {
negative: 0,
words: [ 16777216, 62077800, ...
1
vote
1
answer
752
views
Uncaught ReferenceError: global is not defined using Truffle's MetaCoin tutorial (truffle develop)
I'm using truffle develop to interact with the MetaCoin tutorial contract. I've done this before months ago on an older version of truffle and this worked fine.
But now, I'm getting the same error ...
0
votes
0
answers
177
views
How to send transaction from metamask to another metamask account using smart contract method
I have two accounts in metamask imported from ganache and well conected , when I called the function buy, web3 always used my default account in the metamask, I want to send transaction from my ...
0
votes
1
answer
172
views
issue contract instance with front end
I compile and run my contract successfuly and connect my metamask to ganache but the problem is an error shows in consol TruffleContract not defind i guess the problem is in my way to get instance in ...
0
votes
1
answer
372
views
Truffle and Ganache GUI: GUI and blockchain disconnect or some other error
For some reason, I am having a lot of weird issues with ganache at the same time and I have no idea what's causing them or even what to show to explain it.
After migration, which appears to succeed, ...
1
vote
1
answer
640
views
How do I dynamically set in my Web3.js file the deployed smart contract's ABI & address?
I'm using Truffle, Solidity, Web3.js, and Ganache. Whenever I deploy a smart contract, I have to copy and paste the new ABI & address of the contract. How can I dynamically change the value so ...
1
vote
0
answers
43
views
Create account with initial fund using web3
Is it possible to create an account with initial fund using web3?
Every time I create a new account I had to do fund transfer to add initial fund. If there is way to fund the account with minimum ETH ...
2
votes
1
answer
835
views
Cannot call function in openzepplin ERC1155 contract via web3/metamask
I am trying to call the balanceOf function in a pretty barebones openzepplin ERC1155 contract through metamask.
I am using web3 only to generate the ABI, and metamask to actually send out the call.
...
1
vote
0
answers
51
views
Interaction between 2 nodes of ganache
I am making a project on blockchain where in I am using ganache for private blockchain, meta mask to interact with the same.
Since ganache provides 10 nodes in the private blockchain, I want all the ...
1
vote
0
answers
75
views
How to store each new transaction in multiple/different blocks
How can I connect to Ganache so each time I add to the blockchain the transaction is stored in the next block. I have an issue that each time I add to the blockchain it gets added to the same block ...
1
vote
1
answer
2k
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
1
answer
142
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
0
answers
558
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 ...
17
votes
9
answers
18k
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 ...
1
vote
1
answer
785
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 ...
3
votes
0
answers
801
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
1
answer
71
views
call a contract function which creates a new contract in web3.js makes an error VM Exception while processing transaction: revert
At first I'm developing with truffle v5.1.34, Node v10.16.0, Web3 v1.2.4
To make it simple, I have a Two contracts, DApp and User
What i'm doing is call a DApp contract function which creates a new ...
0
votes
1
answer
59
views
Error when retrieving the instance of a deployed contract
I have developed a EnergyExchange DApp in the Ganache local network with React that consist of one main contract "EnergyExchange". This main contract has a function to deploy new Agent ...
0
votes
2
answers
263
views
Error when calling a get function from a deployed contract instance
I have developed a EnergyExchange DApp in the Ganache local network with React that consist of one main contract "EnergyExchange". This main contract has a function to deploy new Agent ...
0
votes
0
answers
327
views
"TxRejectedError" Using Ganache with Web3
I am having trouble sending my transaction Using Ganache. I am showing the logic that creates and sends the transaction and it says it cant be found or it is rejected don;t really know what the error ...
1
vote
1
answer
179
views
Accessing contract functions from web3 and javascript
I have deployed a contract in a private blockchain using remix and ganache. Now I want to interact with it trough web3 and the console from my browser, but I'm not managing to interact with the ...
0
votes
1
answer
1k
views
Metamask not returning the current address
I am using web3.eth.getcoinbase() function to get the address of the current account but instead, it returns null. Can someone help me with this? This is the code
web3.eth.getCoinbase(function(err, ...
0
votes
1
answer
149
views
Web3 call should return different result based on time passed
I am experiencing a weird issue. I am building a DApp where I want the new season of the game to start every 5 minutes (for testing purposes). However, web3 call returns old data, seems that it cached ...
0
votes
2
answers
1k
views
Web3 is not connecting to metamask. TypeError: Null object returned to account
I am currently following the tutorial in Dapp University YouTube channel where I am coding my own ERC-20 token https://www.youtube.com/watch?v=XdKv5uwEk5A&t=21611s. At 5:51:00 onwards you can see ...
0
votes
1
answer
398
views
Transaction response doesn't contain "receipt" value
i'm doing this send function
let result = await myContract.methods.myMethod().send({from: account});
console.log("result:", result);
using web3.js ^1.2.2 on testRPC with Ganache, hardfork Byzantium, ...
0
votes
1
answer
116
views
"VM Exception while processing transaction: invalid opcode" only with Byzantium hardfork
i'm testing my Smart Contract with Truffle and Ganache, everything works fine while using hadfork version "Petersburg", but when i switch to Byzantium i receive this error while truffle performs ...