Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
4
votes
3answers
891 views

Truffle v5 runs out of gas but Truffle v4 deploys the contract

Truffle v4 used to deploy the contract successfully, but Truffle v5 truffle migrate command fails. My process to deploy: 1) delete buidl/ folder 2) truffle compile 3) truffle migrate Truffle v5 ...
4
votes
2answers
1k views

truffle deploy to geth failing, generating “receipt not found” repeatedly from geth

I've just installed truffle on an ubuntu virtualbox, and it is failing to deploy to a geth dev setup. Geth gives me a never-ending receipt not found for transaction ...
4
votes
2answers
3k views

Deploying contracts in Ropsten with Truffle

I have another n00b question... sorry about that :( I'm trying to deploy a smart contract to Ropsten. I have synched the Ropsten network with geth --testnet --fast --rpc --rpcapi eth,net,web3,...
3
votes
1answer
8k views

how to know the contract address which truffle is deploying with

I am using truffle migrate --reset --compile-all to deploy the contract to local network but in order to use new web3.eth.Contract(jsonInterface[, address][, options]), i should be able to know ...
3
votes
2answers
434 views

simple dapp with React “issues with solidity”

i am trying to build a simple app (will improve once i get the simple one to work)I created a new Reactapp, added both the contracts and migrations directories and i use ganache and metamaks. I have ...
3
votes
1answer
647 views

Truffle 3.0 upgrade changes, migration and javascript errors

Hey I'm trying to upgrade to Truffle 3 and it's a complete mess. The migrations wont work as there are two errors: Error encountered, bailing. Network state unknown. Review successful transactions ...
2
votes
3answers
2k views

Unable to install Truffle - Command Not Found

I am unable to install Truflle on my Windows 10. I am running latest versions of npm and node. I have tried uninstalling and then reinstalling but it still doesn't work. I have installed Truffle ...
2
votes
1answer
563 views

Can I execute functions within a contract (transact) from multiple accounts?

I have a contract that is deployed on the local test blockchain. I am using testrpc and truffle for testing my contract. However, I wish to execute functions of the contract from multiple accounts (2 ...
2
votes
1answer
2k views

Deploying to testnet using Truffle and Metamask

Is it possible to deploy a smart contract developed using truffle to testnet using just Metamask (without a local eth client instance running)? I tried importing the private key of metamask wallet to ...
2
votes
1answer
873 views

Is it possible to divide my crowdsale contract into multiple files in order to solve gas issue?

I'm trying to deploy a crowdsale contract, which is using open zeppelin, on ropsten network but I got gas related error. The error says "please check your gas amount". How can I solve it? I think this ...
1
vote
1answer
202 views

No output when writing data to IPFS and storing its hash through Solidity

So I am using truffle. Following from Creating a form in IPFS for users to enter data [check the code in answer], doing some changes: Contract name - IpfsContract.sol test.js uses the following JSON ...
1
vote
1answer
299 views

Why the balance that I see in the Ropsten isn't reflected in Truffle console?

This is my account #1: http://ropsten.etherscan.io/address/0x6bc701e7c3b642fc12a3a6f7d1144b8200a26401 and I sent some ETH to account #2: https://ropsten.etherscan.io/address/...
1
vote
1answer
1k views

Cannot run truffle behind proxy? [duplicate]

I've installed truffle and related software on my office PC. I've set the proxy server for node.js. The truffle init got the following error. Is it proxy issue? H:\work\eth> truffle.cmd init ...
1
vote
1answer
556 views

failure to verify truffle compiled contract on ropsten.etherscan.io

Recently just pushed my first smart contract from truffle to the ropsten testnet. As you can see from my terminal output below it compiles and was migrated with no problem: Was broadcast to the ...
1
vote
1answer
1k views

How to migrate a contract that has a constructor parameter of address type via truffle

as the official simple of solidity contract SimpleAuction { … function SimpleAuction(uint _biddingTime, address _beneficiary) { beneficiary = _beneficiary; auctionStart = now; ...
1
vote
3answers
1k views

“Truffle test” fails in petshop tutorial

I don't know what this error means or how to fix it. I try to follow the tutorial located here and when I get to the point where I have to run "truffle test" I get the following error. with ...
1
vote
2answers
833 views

How to Compare Two Arrays in Solidity

How can I compare two arrays in Solidity (with Truffle test framework)? MyContract.sol -- pragma solidity 0.4.19; contract MyContract { uint[] public myArr; MyContract(uint[] _initArr) ...
1
vote
1answer
35 views

Truffle Javascript tests won't change Contract State (Contract State won't Change)

I reviewed a similar answer but it didn't work. Right now I'm starting with an Example trying truffle, I did a small Echo project based on the Pet Store Box from Truffle. And i'm having some problems: ...
1
vote
0answers
394 views

Truffle v3.2.5 migration error: contract code couldn't be stored

I'm using Truffle 3.2.5 and Parity to try and migrate a project to Ropsten. I've tried changing the gas amount per the error's advice. I'm running a full Parity node on the same machine, so my truffle ...
1
vote
1answer
399 views

Truffle Tutorial pet-shop with test-rpc adopt button doesn't work

I have followed the tutorial exactly like they showed in their page: http://truffleframework.com/tutorials/pet-shop except the following changes because they use "ganache" (currently bugged and ...
1
vote
1answer
1k views

Setting up private network w Geth, can't unlock account and deploy contracts

I have set up a private network with Geth with the following command: geth --datadir="PathToDatadir" --mine -minerthreads 2 -verbosity 3 -maxpeers 5 --ipcapi "admin,debug,eth,miner,net,personal,shh,...
1
vote
1answer
359 views

Setting up a truffle project

I'm reading truffles's docs and am trying to build a custom project with a contract and a few test cases (written in a js file). I need to do this because testrpc is (considerably) faster than geth. ...
1
vote
1answer
1k views

The send transactions “from” field must be defined!

I am trying to call a function of a contract that has been deployed to Ganache. I am trying to call a function that makes payouts to a few addresses and can be called by owner only. When I am calling ...
1
vote
1answer
576 views

Undefined in truffle-contract initialization

why I always have undefined from contract(_contract).setProvider(this.web3Provided); Component: import React, {Component, PropTypes} from 'react'; import { default as Web3 } from 'web3'; import { ...
1
vote
1answer
353 views

Transaction not found after 50 blocks on mainnet

I updated geth & truffle today. Now I'm getting "Transaction not found after 50 blocks" when trying to deploy to mainnet. I tried setting my gas higher than anything on http://ethgasstation.info/...
1
vote
1answer
502 views

Error: The contract code couldn't be stored, please check your gas amount or exceed gas limit

I keep getting the error please check your gas amount or exceed gas limit. The truffle config file module.exports = { networks: { development: { host: 'localhost', ...
1
vote
2answers
1k views

Identifier not found or Not Unique testing contract truffle

Created a simple HelloEthereum.sol contract: pragma solidity ^0.4.17; contract HelloEth { string message; function HelloEth() public{ message = "Hello Ethereum!"; } ...
1
vote
0answers
66 views

error in WebSocket connection

error : browser-sync-client.js?v=2.26.3:15 WebSocket connection to 'ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=mW3 please i need help on this. i was getting ...
1
vote
3answers
425 views

When creating a new contract I receive a “contract code couldn't be stored” error but the contract is still created

Sale.new({ from: state.account, value: value, gas: 4000000 }).then((instance) => { // do something with instance }).catch((err) => { alert(err) }) When the above code runs I sometimes ...
1
vote
1answer
366 views

Accessing/Modifying Options Parameters in Contract

I'm using truffle and metamask to deploy a very simple contract that enables the transfer of ether from one test account to another. How do I use my JavaScript file to access the options parameters ...
1
vote
1answer
800 views

HelloWorld.deployed().balance.call() is not working

I entered the command correctly but I am still getting this error: TypeError: Cannot read property 'call' of undefined at evalmachine.:1:19 at ContextifyScript.Script.runInContext (vm.js:35:29) at ...
1
vote
2answers
368 views

TypeError: Name has to refer to a struct, enum or contract when compiling a contract

I'm getting a weird error while compiling a contract in Solidity, I think it's because I'm using Solidity v0.5.0 and it was written with a previous version. Here's the code: pragma solidity ^0.4.2; ...
1
vote
1answer
397 views

Truffle V3.1.9, error running migrations

Hey I'm updating my truffle project from V2 to V3, and I am getting this error after migrating: sudo truffle migrate --network development Using network 'development'. Running migration: ...
1
vote
1answer
335 views

Account balance does not decrease after send ether

For example here is my example function in smart contract: function adoptCreeptomas(uint256 beastQuantity, address referrer ) public payable whenNotPaused { msg.sender.transfer(50); } And then I ...
1
vote
1answer
436 views

Truffle Drizzle ContractData call keccak256 error

I started with truffle unbox drizzle then made use of my contract. I can make use of the ContactForm without error in App.js: <ContractForm contract="TheContract" method="addData" labels={["...
1
vote
1answer
210 views

Unit test in truffle fails

pragma solidity ^0.4.23; contract adding{ uint256 public total; function add(uint256 val1,uint256 val2) public returns(uint256){ total = val1+val2; return total; } } The above code ...
0
votes
2answers
715 views

truffle/web3 event listeners returns nothing

We have an event being triggered in a contract and our listeners on the client cant receive the return value. https://gist.github.com/stupeters187/9529b54fe0d48ee606ad06ced6b16031 Update: metamask ...
0
votes
0answers
58 views

command line brings up code instead of running commands [duplicate]

I am trying to run truffle commands on commandline but it brings up the code file instead like this
0
votes
1answer
29 views

truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert

I am a beginner. I can deploy to a private network but I can not deploy to a public network. I need a Deploy to the kovan test network. please help me. >truffle init >npm install truffle-...
0
votes
1answer
125 views

truffle-contract: cannot test method before real consume ether method

I am using truffle-contract for connecting between frontend and smart contract. Currently, I can call method on smart contract and can consume ether successfully. const result = await instance....
0
votes
1answer
550 views

Cannot connect to testrpc

I have a testrpc running on a virtual machine (Ubuntu 16.04) and it works properly when I interact with it using the truffle console. My only goal is to call a smart contract that simply sends ether ...
0
votes
1answer
334 views

Upgrading to solidity version 0.5.0 getting deployment failed error with same smartcontract perfectly deployed on 0.4.24

The same smart contract is running smoothly in solidity version 0.4.24 but now when I update the solidity version and solving a lot of bugs inside my smart contract I intended to deploy that in ...
0
votes
1answer
592 views

Error: VM Exception while processing transaction: out of gas - Truffle

I'm facing some issue with test cases, I wrote some simple function in my smart contract as following: function Create ( bytes32 _a, address _b, string _c, address[] _d, uint256[]...
0
votes
2answers
519 views

using abi generated by truffle in DApp

I use truffle to deploy contract to ganache network. I like to use the json file generated by the truffle in the DApp rather writing messy ABI into it. I tried the below piece of code and it gives ...
0
votes
0answers
43 views

Web3 & Solidity - Automatically read ABI and Create Contract

Is there a way to automatically create a new Solidity Contract - from within a web3 JS file using the .json file created in a project's build folder after each compile? I have already figured out how ...
0
votes
1answer
350 views

“instance.at(addr) is not a function” in truffle console (access to non-migrated contracts)

I have a setup with one contract that is a singleton and is migrated to e.g. a testnet through the truffle console. This contract "creates" new contracts, which I want to access in the truffle console....
0
votes
1answer
257 views

Export a JS package from Truffle?

Truffle has this whole build process for deploying fronted code that is kinda mediocre. Does anyone know if I can just have Truffle output a single javascript file that will work in a web3 enabled ...
0
votes
1answer
205 views

Solidity test file reaches gas limit due to imports

I have a sol contract X.sol and a sol test file TestX.sol. X.sol is large: ~4m Gas after optimisation TextX.sol compiles, migrates and executes tests fine when just executing a single test - testY, ...
0
votes
1answer
379 views

Truffle Exec Gets Stuck [closed]

I want to exec a script in the truffle console. script const artifacts = require('./build/contracts/Message.json') const contract = require('truffle-contract') const Message = contract(artifacts); ...
0
votes
0answers
184 views

Truffle Drizzle: Passing String address results in Invalid Number of Parameters

I have a view function in my contract that takes an address as a parameter and returns a uint: function getNumber(address _address) public view returns (uint) { require(_address != 0x0); ...