Questions tagged [truffle]

Questions regarding the implementation and use of the Truffle development and testing environment.

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

npm ERR! code ENOENT npm ERR! syscall spawn git

I use the command npx truffle unbox react to develop a dapp but I get these errors below in my console. Can anybody help me? I really don't know how can I solve them.
1
vote
1answer
17 views

truffle unbox pet-shop gives DownloadingError: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27)

Ubuntu 18.04. Truffle v5.1.2 (core: 5.1.2) Solidity v0.5.12 (solc-js) Node v13.2.0 Web3.js v1.2.2 When I execute truffle unbox pet-shop on terminal, I get error ✔ Preparing to download ⠼ ...
0
votes
1answer
19 views

Truffle js test. Test not really testing

I have this tests that supposedly pass (in the terminal, I can see the checks). But they never actually run the code: it("should add an exam to the exams list", () => { let hash_test = "...
0
votes
1answer
26 views

Error Installing Truffle [closed]

OS: Ubuntu 18.04 I am following this guide (https://www.codeooze.com/blockchain/ethereum-dev-environment-2019/) to install Ganache, npm, and then Truffle. Everything is fine till I execute sudo ...
0
votes
1answer
24 views

RPC error when interacting with contract using Ganache GUI, but it works fine when using Ganache CLI

I have a truffle project, if I migrate it onto ganache-cli and then interact with my contract (via Metamask) it works great. But if I try and do the exact same thing using ganahe-gui the contract ...
0
votes
1answer
10 views

Deploy smart contract on Ropsten, Kovan

When I deploy my truffle smart contract on test networks like Ropsten and Kovan, can I interact with it using multiple PCs at once simultaneously? And will the data updated from one PC be visible on ...
0
votes
0answers
12 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?
0
votes
0answers
8 views

Any idea how to add new contracts into drizzle react app using the address?

I have a react app which creates new contracts. lets say A creates B. I have the addresses of the newly created contracts of B. How do i add the newly created contracts of B using its address to ...
1
vote
1answer
55 views

Issue with selfdestruct() getting an error

main contract function which calls my secondary contract function gameOver(uint _matchId)public payable onlyOwner returns(bool) { Match my_match = Match(matchTracker[_matchId]); bool success ...
0
votes
1answer
20 views

Truffle js test a call with arguments

I am trying to testa a smart contract function that receives an arg. I'm using truffle javascript tests, this is the smart contract function, very simple: function addExam(string memory hash) public ...
0
votes
1answer
17 views

How can fix in smart contract written in solidity?

TypeError: Invalid type for argument in function call. Invalid implicit conversion from address to address payable requested. selfdestruct(admin); pragma solidity >=0.4.21 <0.6.0; ...
0
votes
1answer
20 views

Uncaught (in promise) Error: Invalid JSON RPC response: “”

How to solve this error that show in the picture of chrome browser below? Bundle.js var contractABI = []; var contractAddress = '0x9B69fA769D70728d14a70A4F10E7078032FF1632'; var web3 = new Web3('...
0
votes
1answer
24 views

Truffle. Test .call() args . Error: invalid string value (…) at PromiEvent

I have a js truffle test: it("should add an exam to the exams list", async () => { // This should test the complete functionality let hash_test = "fB03aA5E2E71De1470ae2"; let instance =...
0
votes
1answer
16 views

Solidity. Truffle test not passing “expected { _events: {},…” to equal

I can't get a test to pass, for me it is very clear but I am missing something obvious: This is the smart contract: function getContractOwner() public pure returns (string memory ...
0
votes
0answers
14 views

Truffle test passing when it should not

I have this test, it clearly shouldn't pass: contract("Exams", function(accounts) { it("should keep the contract owner", function() { // var expectedValue = "...
0
votes
1answer
14 views

Nothing happens whe I run truffle test

I am new to solidity. Maybe I am missing something obvious in the setup. But when I run truffle test, I get nothing, the terminal just stays there forever. $ truffle test ... and I don't know why, ...
0
votes
1answer
11 views

How can I add new contracts generated from a factory to my drizzle-react app?

I have a Factory contract which creates new contracts. How do I get the new contract into my drizzle-react web app? I am using to send the transaction to create a new contract but I don't know how ...
0
votes
0answers
19 views

How can MetaMask alert about transaction errors before they are caused?

The MetaMask extension has this feature to warn about transaction errors before a transaction is being made: ALERT: Transaction Error. Exception thrown in contract code. How is this done? A dry ...
0
votes
0answers
18 views

How to fix transfer in etherum

$ truffle test Using network 'development'. Compiling your contracts... =========================== > Compiling ./contracts/DappToken.sol > compilation warnings encountered: /home/geet/...
0
votes
0answers
27 views

How to correctly send Ether between contracts in vyper?

I have a user, Contract A, and Contract B. I want user to call a function A of Contract A, that function executes function B from Contract B, which sends ether from Contract B to Contract A. Here is ...
0
votes
1answer
26 views

How to call external payable contract function from app.js (DApp)?

The contract has a function: function purchaseTokens() external payable { require(msg.value>0); ...etceteras... } What I need is an app.js part, something that would look like this (lets ...
0
votes
1answer
15 views

Truffle Contract Abstraction Contract.at() not returning logs when methods are called

In my test file I have this set up: let acc = await Account.deployed() Then when I call a method, I can get the logs in the receipt: let deposit = await acc.deposit() console.log(deposit.receipt....
1
vote
1answer
27 views

What is the best way to deploy and test smart contracts on multiple machines?

I have recently started developement on Ethereum and the concepts are pretty much new to me. I need to test event emitting/listening on multiple machines for my contract. For the same, I have tried ...
0
votes
0answers
20 views

Can't include web3 & truffle in chrome extension

I'm trying to include web3 & truffle in my chrome extension. In npm, I'm doing it this way: const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); ...
1
vote
3answers
43 views

Basic question I guess but is “web3” a client in the sense that I want to use a very simple client to interact with the network?

Long story short I need a way to send programmatically a raw transaction without any bounds checkings or any checks...now I am not trying to abuse or flood the network - my goal is to attempt to send ...
1
vote
1answer
21 views

Is there an equivalent of truffle's deployer.link() functionality without using truffle?

I'm trying to migrate a project away from using Truffle, and in the migration script, it currently uses truffle's link() function. Is there some sort of equivalent library, perhaps implemented by web3 ...
1
vote
1answer
55 views

Pass arrays to solidity's function from truffle

I am getting ALERT: Transaction Error. Exception thrown in contract code in metamask when calling addBet function from truffle. The function works without any errors when called from remix. The ...
0
votes
1answer
61 views

Getting “gas required exceeds allowance (93846700840810) or always failing transaction” on private network. How to access geth client via nodejs?

I have recently started using Ethereum. I am trying to test my contract using multiple machines. Only solution I found was to setup a private network using Geth and add peers. Following is the genesis ...
0
votes
1answer
42 views

Payable external function call not updating state variables

I'm trying to get buyToken() to update the balance of the caller. I'm using Truffle and Ganache, running tests, but the testBuyToken() function keeps failing, apparently the BALANCES variable isn't ...
0
votes
1answer
28 views

Metamask TestRPC shows 0 Ether while connecting to Ganache- CLI

I've gone through various Q/A(s) of the problem of ganache-cli and metamask not linking but after trying all the solutions, still doesn't work for me. As soon as I type ganache-cli in windows cmd ...
0
votes
2answers
99 views

Truffle - Get ETH Balance with Web3JS - two different errors

Using "web3": "1.0.0-beta.46" because doing a tutorial, and they recommended using all his versions to make sure everything works together. Using Gnache and Truffle unit tests, I have tried two ...
0
votes
1answer
19 views

Truffle returning balances from a function

This maybe just a simple Javascript issue, but it's in the context of running under Truffle. I can't seem to access my object variables coming back from my function; thus the tests are failing with ...
0
votes
2answers
38 views

Not able to successfully send Transactions via MetaMask on Firefox Browser

Does anybody help me figuring out why I am getting failed transaction here?What does this error means? Few days back,with the same line of code,I was able to successfully send transactions. An update:...
0
votes
0answers
16 views

Is there any example of a drizzle-react dapp implementation that uses render props?

Render props were added after React 16.3 and the github readme for drizzle-react suggests to use them. The problem for is that there is no updated documentation (other then the small example in the ...
0
votes
1answer
17 views

Are there any virtual IoT simulators that facilitate the connection with Ethereum Blockchain?

I already built a smart contract for Ethereum Blockchain by using truffle; Now, I'm looking to connect my smart contract with the IoT environment. So are there any IoT simulators (platform, framework,...
0
votes
0answers
48 views

What is the networkid and chain id of truffle cli?

I am using truffle console to deploy contracts and using Nodejs/web3js to interract with it. I wanted to use ethereumjs-tx for signing transaction, here is the reference link. I am not sure ,how can ...
0
votes
1answer
27 views

rpc error with payload and exception thrown in contract code

This is the problem I get when trying to run my contract! And then when I go ahead and run it, this pops up This is my js code: import React, { Component } from 'react'; import Web3 from 'web3'; ...
0
votes
1answer
31 views

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error?

what is 'UnimplementedFeatureError: Not yet implemented - FixedPointType' error in solidity while compiling through truffle ? How to fix it ? Using solidity compiler version - 0.5.9
0
votes
1answer
27 views

Why do I always get “Returned values are not valid, did it run Out of Gas”?

I'm new on Ethereum blockchain and I'm working on deploy and using smart contract using truffle on my private blockchain. I have followed exactly this guide https://www.trufflesuite.com/docs/...
0
votes
0answers
28 views

Error: invalid number/address values

Having trouble with the submitOracleResponse inside the callback below: flightSuretyApp.events.OracleRequest({ fromBlock: 0 }, function (error, event) { if (error) console.log(error); ...
0
votes
0answers
36 views

Unable to deposit ether from External Account to Contract

This is my first question on StackOverflow. I am having trouble sending Ether from an account to the contract. The DApp I am creating is separated into a Data & App contract, where the Data ...
0
votes
1answer
28 views

Adding a payee to a donation contract. Error: Transaction reverted

Disclaimer: I'm a noob when it comes to programming altogether let alone smart contracts. I refactored this code that was written like three years ago so it could work with solidity 0.5.0. I deployed ...
0
votes
0answers
32 views

Truffle test including mainnet contract - Error: Cannot create instance of Whitelist; no code at address

Problem with the error Error: Cannot create instance of Whitelist; no code at address 0x6198149b79AFE8114dc07b46A01d94a6af304ED9 How do I have to setup truffle so that I can run a test which includes ...
0
votes
0answers
17 views

Can't migrate, ropsten randomly throws out of gas

I have the following migration files with 50 contracts' deployment and their setup (calling each other functions like privileges, access and so on): On the development network everything works fine. ...
0
votes
1answer
32 views

Emited Solidity Events not being watched at frontend truffle contract instance

So, I have been reading through A LOT of pages about events in Solidity and how to interact with them on frontend but I am still pretty new to this and it seems like there have been multiple changes, ...
0
votes
0answers
33 views

Truffle how to test with reference to mainnet smart contract - Error: while migrating VM Exception while processing transaction: revert

I would like to run a truffle test on a smart contract that includes a smart contract address deployed on mainnet. However, this results in the following error Error: Error: Error: while migrating ...
0
votes
1answer
38 views

How to solve the error “”before all“ hook: prepare suite:” [closed]

When I tested my contract, I got this error ""before all" hook: prepare suite:" Does anyone know how to solve this error? This is my dependencies. "truffle": "5.0.7", "web3": "1.0.0-beta.46"
0
votes
1answer
17 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
3
votes
0answers
41 views

What's the point of Truffle Migrations?

I've been reading a few articles and StackExchange posts (e.g. What are truffle migrations?) about Truffle Migrations, but I still don't get it: why do we need them? It seems they do only one thing (...
0
votes
0answers
21 views

Developing a dapp using Truffle. Metamask will sometime throw this error when interacting with a simple contract

Trying to setup my development environment to start a personal dapp project. I am starting off the project with the React truffle box. 1) I start by running truffle develop which launches a local ...