Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Truffle console is hanging on function call

I have a contract deployed to ropsten. It has a function called enter: function enter() public payable { assert(msg.value == MINIMUM); assert(OPEN == true); players.push(...
0
votes
1answer
33 views

How to deploy kyber network proxy locally and test with truffle?

I am trying to deploy a proxy from Kyber Network for local development. So far I have pulled down the workshop repo and I have successfully deployed all the contracts successfully. I have the ...
0
votes
1answer
19 views

Questions about Truffle console and Truffle develop

When I inputted truffle console, it showed the error: ➜ via-issuer-master truffle console --network interaction truffle(interaction)> var cash = aw /usr/local/lib/node_modules/truffle/build/...
1
vote
1answer
19 views

Get deployed contract dynamically in node JS

I am using Node JS and ethereum smart-contract. Every time contract gets deployed new addresses generated. Is there a way that node JS always gets an updated address of a contract? Any API so that I ...
0
votes
0answers
19 views

Ganache stuck when loading truffle project

I am not sure what can be wrong. When I try to load a truffle project (by adding the truffle-config.js file to the workspace config), ganache gets stuck at the loading icon and I get this lines at the ...
0
votes
1answer
16 views

DeclarationError: Uninitialized storage pointer. Struct error when running truffle tests

I've seen other similar questions but they don't explain why this error happens and/or they are case specific questions. So, I have this code: pragma solidity >=0.4.22 <0.7.0; contract ...
0
votes
1answer
15 views

Truffle cant deploy contract with reverting constructor

I'm developing a dapp with the truffle suite and now I'm running into a problem. Everything is working locally in the ganache instance. My contract should disallow direct payments to the contract, so ...
0
votes
1answer
21 views

Reproducing a Ganache Server across multiple computers

There are multiple developers on the team and it seems as though we all want to be working on a specific test network with specific public and private keys with a specific number of users who all have ...
0
votes
1answer
24 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
0answers
13 views

Failed to use truffle develop

When I successfully compiled and deployed contracts using Truffle and ganache-cli, I typed truffle develop to get into the truffle(develop)>, and then typed let instance = await Factory.deployed(), ...
0
votes
0answers
14 views

unable to see the first address using web3.eth.getAddress()

I tried to see all address using web3.eth.getAccounts() It's run perfectly. Next I tried to see the first address using web3.eth.getAccounts().then(function(accounts) {return accounts[0]}) It's also ...
0
votes
1answer
30 views

Transaction underpriced at 5000000 gas but overpriced at 10000000

I've been developing a smart contract for a while on the Ropsten network using the Truffle framework, quite successfully. My truffle-config.js looks like this: const path = require("path"); ...
1
vote
0answers
26 views

Is Truffle test useful?

Hi there I came across "Truffle test". As a developer I feel like it's better to test code on remix for unit testing rather than wasting time on writing truffle test in javascript. What do ...
0
votes
0answers
29 views

Testing using Truffle unbox: Assert.equal error

I ran the pet shop project. It uses "truffle unbox". The petshop project at: Petshop project using Assert.equal without any error is able to execute Assert.equal command but when I am using ...
0
votes
0answers
26 views

How to debug this metamsk error ? - Error: [ethjs-rpc] rpc error with payload:

I have a DApp integrated with metamask and ganache, front-end built on react. I am getting this error when I interact with the smart contract from front-end, contract send calls. Smart contract ...
0
votes
0answers
23 views

ERR_SSL_PROTOCOL_ERROR while connecting private blockchain

I'm working with private blockchain, and facing some issue with SSL configuration. The system has two components: The private blockchain that is configured on the VM. The web application that ...
0
votes
0answers
32 views

Problem with Assert.equal

I am compiling the code available at using "truffle test": https://michalzalecki.com/ethereum-test-driven-introduction-to-solidity/ pragma solidity 0.5.16; import "truffle/Assert.sol&...
0
votes
0answers
28 views

What does an Ethereum Client do?

I've developed Smart Contracts using Solidity, and then created a front end for them using Web3js. I used Truffle to to get them to communicate. That's how I tried out a couple of Proof of Concepts. I ...
0
votes
0answers
19 views

Compile error. Fallback function error

I use pragma 0.6.2. I am trying copile in truffle code which contain this lines: fallback() external payable{} I an getting error: The payable fallback function is defined here. fallback() external ...
0
votes
1answer
30 views

Solidity ^0.6.10 returnBalance() returns “VM Exception while processing transaction: invalid opcode”

I am using Ganache and Truffle console. I compile and migrate the following contract: // SPDX-License-Identifier: MIT pragma solidity ^0.6.10; contract EthReceiver { address payable private owner;...
0
votes
0answers
16 views

Is there a way to get revert message by my client?

I have a smart contract with this simple function: function addUser( string memory _username, string memory _nome, string memory _cognome, string memory _email) public isOwner() { require(bytes(...
0
votes
0answers
23 views

Is there a tool to add SafeMath to production code?

There are a lot of tools to prepare JavaScript/CSS code for production, e.g. to minimize, to convert ES8 code to ES5. Is there a tool to automatically apply SafeMath library to a .sol file? The ...
0
votes
1answer
34 views

Compilation Error

Hi guys I got this error when I try to compile using truffle develop. truffle(develop)> compile Compiling your contracts... Compiling ./contracts/StarNotary.sol /mnt/d/Blockchain/...
0
votes
1answer
23 views

Error: while migrating Event: invalid address (arg=“benificiaryAddress”, coderType=“address”, value=undefined) [closed]

let Event = artifacts.require("./Event.sol"); const field= { nameOfEvent : "Music", ticketCount : 100, ticketCharge :10000, durationInMinute :1200 } module....
0
votes
1answer
39 views

I am getting Error: Project ID is required deploying to ropsten in truffle

I am getting the following error: Error: PollingBlockTracker - encountered an error while attempting to update latest block: Error: project ID is required at C:\Users\myuser\Code Projects\sdfsd\...
0
votes
1answer
115 views

Swap ether to tokens on Uniswap V2 Router 02 fails

I am trying to buy DAI tokens from my smart contract using IUniswapV2Router02 contract BuyExample{ IUniswapV2Router02 usi = IUniswapV2Router02(...
0
votes
0answers
14 views

Setting up a desktop wallet with a private network on geth

Disclosures: I've never set up a wallet before, and am new to geth. I'm not worried about security right now. My goal is to set up several wallets on my private chain (if possible) in order to learn ...
1
vote
1answer
77 views

Ethereum Error: Provider does not support subscriptions: HDWalletProvider

I am making a flash loan request using web3 , truffle and keep getting the error in an event listener: The current provider doesn't support subscriptions: HDWalletProvider. I am connecting to the ...
0
votes
0answers
43 views

Convert from 0.4.17 to 0.6.2

I made a conversion from Solidity 0.4.17 to 0.6.2 of a contract that have a MINT option. The biggest problem here is that I am not sure if this function mint is okay (will return the correct id). Look:...
0
votes
1answer
35 views

Sending ETH from contract to EOA

OK, I'm baffled guys. maybe it's the amount of gas the function is using up that is causing this not to work. when I call the function: I get the following in response but no movement of Eth from my ...
0
votes
0answers
30 views

Truffle console: Exception instead of transaction

I am running the tutorial at: Medium Just Dev pragma solidity ^0.5.0; import './Victim.sol'; contract Attacker{ Victim public v; uint public count; event LogFallback(uint c, uint ...
0
votes
1answer
24 views

Truffle Migrate

What happens when there is a minor change in the smart contract and I run truffle migrate command. Example: //before contract test{ function display() public returns (string){ return "...
0
votes
0answers
15 views

Truffle test stuck when testing with geth endpoint

I tried to test the truffle suite official metacoin example using truffle test. I opened a local private chain using geth with http rpc service open at localhost:8545. My truffle-config.js file is ...
0
votes
0answers
25 views

Truffle + Infura Mainnet deploy. Transactions never get mined, timing out after 750 seconds

The contract deploys on Rinkeby without a hitch, but when it comes to mainnet it is erroring out strangely. Infura's HTTP endpoint was giving me Invalid JSON RPC RESPONSE "", so I decided to ...
0
votes
0answers
27 views

'VM Exception while processing transaction: revert\n' Error Processing transaction

I have read in various posts that this error occurs when there is a problem with executing function. So I'm asking about this error in regards to the code I have written. Please see below: contract ...
0
votes
0answers
19 views

Truffle Console: How to suppress unwanted message

I am trying to learn truffle features by going through the following tutorial. Its generating a huge message, please guide me if its wrong or not. If its not wrong please guide me how to suppress the ...
0
votes
1answer
24 views

Truffle Console error : invalid number value. Value must be an integer, while executing commands from a tutorial

I am trying to execute commands from the following tutorial: medium Dev Tutorial I am getting an integer error while executing a command: truffle(ganache)> balanceInEth = address => web3.utils....
0
votes
1answer
53 views

Error compiling OpenZeppelin 3.0 ERC20 using Truffle

I'm trying to compile this code using the Truffle command truffle compile pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract GLDToken is ERC20 { ...
0
votes
1answer
44 views

Can't unlock account while deploying contract with truffle

I am trying to set up a private blockchain with geth, using truffle to deploy a smart contract to it. My goal is to get a private blockchain running with several accounts, deploy some contracts to it ...
0
votes
0answers
22 views

Error Truffle Console: web3.fromWei is not a function

I am executing commands from a tutorial at: JustDev Tutorial on Medium I am executing the command: > truffle(ganache)> balanceInEth = address => > web3.fromWei(getBalance(address).toString(...
0
votes
0answers
12 views

Garbage Value on Truffle console while executing the commands from a tutorial

I am following the tutorial at: JustDev tutorial on medium When I execute the command: truffle(ganache)> Victim.deployed().then(contract => victim = contract) I am getting a huge output which ...
1
vote
0answers
63 views

Solidity function calls from javascript work locally but fail on ropsten,kovan etc with Error: Returned values aren't valid, did it run Out of Gas?

I have a smart contract whose function calls works fine when called locally using javascript and ganache. But when I deploy to ropsten and others, the calls to its functions fail with Error: Returned ...
1
vote
0answers
41 views

Deploy smart contract to private network

I have been having issues deploing any smart contract to my private network. I'm using geth 1.9.15. Here ALL the steps that I made to get the error: //CustomGenesis.json { "config": { &...
0
votes
1answer
30 views

My contract is deployed but instance is undefined

I have deployed a contract on the ganache blockchain successfully using truffle. In the truffle console, I can call the contract fine truffle(development)> MyCoin [Function: TruffleContract] { ...
0
votes
1answer
48 views

Invalid address

I deployed my contract in ganache. When I was started to call a function with two arguments I started getting an error. I used an address from ganache. Error: invalid address (arg="user", ...
0
votes
0answers
40 views

How to create an instance of the deployed contract in Truffle Console?

I am trying to learn Truffle tool using the tutorial at: Truffle tutorial I am writing the following command at Truffle console to create an instance of the deployed contract but I am getting the ...
0
votes
1answer
21 views

How to use truffle-assertions to verify parameters of an emit?

I have not been able to find any resources with usage instruction besides github and blog post by the author On github an example is show as such: truffleAssert.eventEmitted(result, 'TestEvent', (...
0
votes
1answer
37 views

Truffle Console: “undefined” message varaiable declaration

I am giving following commands at Truffle console but I am getting "undefined" message: > $ truffle console > > You can improve web3's peformance when running Node.js versions older > ...
0
votes
1answer
22 views

truffle migrate: Accessing 2_deploy_contracts.js of another Truffle project

I am executing “truffle migrate” command but I am getting one reference error related to ‘adoption’ variable:there is no error related to compilation 2_deploy_contracts.js ReferenceError: adoption ...
1
vote
0answers
30 views

Using privateFor in truffle test

Using truffle , I am able to deploy private smart contracts using privateFor clause. However, I am not able to use in truffle test. I get the following error. Is there a way we can use privateFor ? ...

1
2 3 4 5
44