Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
960 views

Function call returns 0

Hey can someone help me figure out why this function returns 0, when I call it? The function doesn't throw any errors when I send a transaction to it, but the Ether isn't sent and the variables aren't ...
2
votes
1answer
306 views

Upgrade to Truffle 3.0, compile error

I installed truffle V3.1.1 and whether I try truffle init or truffle init webpack, I am unable to compile the example contracts. sudo truffle compile /usr/lib/node_modules/truffle/node_modules/...
1
vote
1answer
812 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 ...
2
votes
1answer
183 views

Truffle migration error using powershell

When I write out truffle migrate, I get the following error line with a list of other directory paths. Error: Invalid JSON RPC Response: "" This is my deploy contracts file: var ConvertLib = ...
1
vote
1answer
2k views

Sending test ether on Testrpc

I'm using Truffle Version 2.1 and I'm trying to send test ether to my contract using Testrpc. I run testrpc -u 0 -u 1 And the accounts shows a balance of 99351632199997083360 wei I'm trying to send ...
29
votes
1answer
18k views

How to update a deployed smart contract? [duplicate]

I've started developing smart contracts with Truffle and when I edit a contract I always redeploy it by adding another migration script. There are two things that I wonder about: Is this the way it ...
0
votes
1answer
269 views

Function returns true for call, but variables show no change

Hey I think this may be a problem with the javascript side or Truffle, but the following function is returning true when I call it, but when I send a transaction to it, the test ether seems to ...
1
vote
1answer
442 views

How to access variables defined in struct using 'Truffle'?

This is the sample contract given :- contract User { string public userName; mapping(address => Service) public services; struct Service { ...
2
votes
1answer
622 views

How to test a contract on Truffle with multiple nodes?

I am a Truffle user. I would like to create one contract and test this. When testing, I'd like to setup three nodes, link them, access the contract and test it. Is this possible? Or am I doing strange ...
2
votes
1answer
521 views

Error running Truffle migrate

Does anyone know why the below occur. Command: truffle migrate --reset Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: VM Exception while ...
5
votes
1answer
457 views

Oraclize + Testrpc + Truffle. Results aren't updating in contract

In my contract I am just doing a basic query to WolframAlpha function testOracle(){ oraclize_query("WolframAlpha", "random number between 0 and 100");} I also have the __callback function: ...
2
votes
0answers
235 views

Error in dapp developed using 'Truffle' framework -Smart contract function call won't get executed

I am developing a dapp using 'testrpc' and 'truffle'.I have also used ethereum-bridge for Oraclize.I have written a smart contract function which calls a url using 'OraclizeQuery'. The following is ...
0
votes
1answer
320 views

Smartcontract function call won't get executed in dapp developed using 'Truffle' framework

I am developing a dapp using 'testrpc' and 'truffle'.I have also used ethereum-bridge for Oraclize.I have written a smart contract function which calls a url using 'OraclizeQuery'.I have added the ...
1
vote
1answer
319 views

How to fetch specific data based on user input from url using Oraclize?

I am using 'testrpc' and 'truffle' for development. The following is the contract code used. pragma solidity ^0.4.0; import "./usingOraclize.sol"; contract WeatherApiCall is usingOraclize { ...
4
votes
1answer
5k views

Account is locked, after running Truffle migrate command [duplicate]

I am new to this technology and I am trying to Deploy the contract to Ropsten test network. I have my geth running in one terminal. In my truffle console I have an account with some ether. I unlock it,...
1
vote
2answers
715 views

Compile errors on sample project in Truffle 3.0.2

I tried to compile some smart contracts in truffle 3.0.2 (which works without problems in browser solidity and even older versions of truffle) and got compile errors. So I created a sample truffle ...
2
votes
1answer
446 views

How to display the result returned from Oraclize's _callback function in dapp frontend?

I am using testrpc as client and truffle as development framework.And also using ethereum-bridge for Oraclize. This is the contract code.I have downloaded the 'Oraclize API' (oraclizeAPI_0.4.sol)from ...
1
vote
1answer
1k views

I want to use crypto-js module in truffle / app.js

I want to use npm module "crypto-js" in app.js of truffle_project. But I can't use it. app.js: var CryptoJS = require("crypto-js"); // ... I build app, then I open build/index.html by browser, I ...
1
vote
1answer
676 views

How to run contracts with 'Oraclize' using truffle?

This is the contract code.I have downloaded the 'Oraclize API' (oraclizeAPI_0.4.sol)from the Oraclize github repo.I have added this file to the truffle contracts folder, and rename the file to ...
0
votes
1answer
566 views

A promise was created in a handler but was not returned from it

Hey I'm new to javascript promises. I am getting several errors stating a promise is created but not returned. How do you return from a promise?
1
vote
1answer
604 views

Function calling constructor of another contract seems to silently fail

Ok so I am trying to initialize a new contract. From what I understand, creating this contract will only return a transaction hash. So I'm trying to access the new contract from data structures in the ...
6
votes
2answers
3k views

Creating contracts via new doesn't work

According to the official doc, a contract can create a new contract using the new keyword. But it does not work when I test the code from this post. My dev environment is truffle 2.1.1 and testrpc (or ...
1
vote
0answers
358 views

Truffle overwrite MetaMask web3 wrong msg.sender address

Considering this contract : pragma solidity ^0.4.7; contract Test { function Test() { // constructor } function getMsgSender() constant returns (address account) { ...
1
vote
1answer
476 views

Truffle serve not finding css and javascript files

the directory is getting served wrong in truffle and I can't figure out where to change it.... The terminal response is... Couldn't find file at .//app/app.js. My build file....... module.exports =...
6
votes
1answer
1k views

invalid JUMP after upgrading truffle & testrpc

I have a contract with a method add() where I read the value msg.value and change the contract informations. before upgrading, I was calling this method in my test with return contract.add({from: ...
3
votes
1answer
1k views

Preset testRPC account balances not showing up in Solidity contract mapping, during truffle console session

I notice that preset balances in testrpc, like this: unix$ testrpc --account="privKey1,balance1" --account="privKey2,balance2" ... don't get passed to this Solidity data structure: mapping(address =...
1
vote
1answer
176 views

Ethereum Contract Issue

I have written a contract Transfer and the functions defined in the contract Transfer is used in another contract SecondTransfer.I have defined a constructor in the contract Transfer and initialized ...
3
votes
1answer
3k views

How to find out the value using call() method in truffle and testrpc?

pragma solidity ^0.4.2; contract Transfer { address public owner; mapping (address => uint) balances; // constructor ...
2
votes
2answers
489 views

Where does web3 come from?

I used Truffle to setup a basic example dapp, which includes a frontend javascript file in which I see the following lines: window.onload = function() { web3.eth.getAccounts(function(err, accs) { ...
21
votes
1answer
5k views

What is truffle?

What is the truffle framework? Who can use it, who should use it? And what are the benefits?
2
votes
0answers
377 views

How to send message to an address using solidity contract + truffle

Here is the link to my code: https://github.com/nandinicbit1981/hello-truffle The problem with this is: If I am sending a message: Hello World, I am getting the input field in the mined transaction ...
3
votes
0answers
110 views

Ethereum pudding transaction hash

Is it possible to get the transaction hash of a function call in Ethereum Pudding/ Truffle?. It seems that it works straight forward with web3 but Pudding is hiding it?
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; ...
3
votes
3answers
480 views

Contract inheritance? Need some help to understand certain things

I'm using testrpc, and truffle. I created a simple token as seen in many tutorials which shall be used to buy or enable certain actions when clicking a button on an UI. contract MyToken { mapping ...
2
votes
0answers
659 views

reference a deployed contract in truffle or node.js

I have a previously deployed contract on my PRIVATE-NET which I know its address. Now I am using truffle. How do I reference this contract in truffle console using its address? I looked through web3....
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,...
5
votes
1answer
600 views

Out of gas exception: error when using GUI/JS but not within truffle

I'm trying something with Ethereum and my current testing environment is Truffle. In the smart contract I have a struct with 5 fields (bytes32, bytes32, bytes32, address, bool). If a call a function (...
2
votes
1answer
303 views

Using eth-lightwallet and truffle

I've tested with accounts created and unlocked in geth and my sample app works fine. I'm now going distributed with my accounts and have added eth-lightwallet and HookedWeb3Provider to put the account ...
1
vote
1answer
1k views

How to send Metacoins to other accounts with truffle console and testrpc local blockchain?

Playing around with the default project provided by truffle. I compiled the contracts with truffle compile.Then deployed with truffle migrate and after that switched to the console via truffle console....
1
vote
1answer
223 views

Error : BlockGasLimitReached: <Transaction(45f6)>: 'gaslimit' actual:4712388 target:3141592

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. I even tried to manually set the gas_limit variable in tester.py to ...
1
vote
1answer
123 views

testrpc throwing error “This has not yet been implemented”

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. Could you please help me. Thanks, ERROR:jsonrpc.manager:API Exception: {'...
1
vote
2answers
847 views

truffle account lock

I was trying to deploy the default truffle project following this guide: https://steemit.com/ethereum/@brennanhm/ethereum-smart-contract-testing-installing-truffle-and-testrpc I am running the sample ...
3
votes
1answer
251 views

TestRPC - Pythereum - No handlers could be found for logger “jsonrpc.manager”

I am trying to get the standard init tests to work but I am getting the subject error. could you please help me to resolve this. Thanks, TestRPC/0.8.7/linux2/python2.7.12 Available Accounts ...
2
votes
1answer
262 views

In javascript, what does the line var meta = MetaCoin.deployed(); mean and what does it return?

I am following the official Truffle docs to create a Dapp and am reviewing the code. I am repeatedly seeing the line var meta = MetaCoin.deployed(); What is the deployed function? What does it ...
1
vote
0answers
800 views

Web3 sending transaction fails, works in truffle console

Developing an application which relies on a blockchain. Have test chain running with help of testrpc and I'm using truffle to compile and deploy contracts. This way I've created some contracts and ...
2
votes
0answers
111 views

Minimal contract testing setup using truffle

This question is a follow up onto this one. I have tried following the suggestion in the answer of adding a done() method that fires when an error occurs (an exception is raised) but it doesn't when I ...
4
votes
1answer
2k views

Error: VM Exception while executing transaction: out of gas

I'm new to smart contracts, so please be gentle ;) I'm having trouble deploying a contract to testrpc using truffle. $ truffle deploy Error deploying LFC: Error: VM Exception while ...
3
votes
1answer
153 views

Different return value Truffle & online compiler

Using the online solidity compiler startGame() returns false, but using truffle this function returns a long hex string: 0xf697bd4ff4f5574f3cf73cd46a18087a5a0cf1aa1580fd4992ab20f574a808fe function ...
3
votes
1answer
445 views

Problem with `truffle init`

I can't start truffle, this is the Error: truffle init /usr/local/lib/node_modules/truffle/node_modules/ether-pudding/index.js:182 for (var file of files) { ^^ SyntaxError: ...
3
votes
2answers
2k views

Truffle test - Timeout during out-of-the-box metacoin.js test

Been trying to get the standard init tests to work for a couple of hours, but no joy. Would be grateful for any assistance. Steps taken so far truffle init Fine. So far, so good. truffle ...