Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
455 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 =...
7
votes
3answers
8k views

What is the correct way to access public variable from contract in Truffle: then or standard callback?

There are some similar posts to this but none seem to be able to solve my problem. I have a contract deployed with Truffle running with testrpc. I want to access the value of a public uint variable ...
3
votes
1answer
1k views

How would you integrate an Angular 2 CLI frontend project with a Truffle 2 project?

I'm using Angular 2, with TypeScript, Webpack and all that on my main projects, so every time I have to go back to a Truffle project using AngularJS 1.x, a kitten dies and my head hurts a little. How ...
21
votes
2answers
5k views

Oracle (oraclize.it) with Truffle and Testrpc

As I understood in the blockchain, it is "not" possible to interact with webservices outside the blockchain. This must be done over oracles in order to verfiy that the request is secure, and the state ...
6
votes
2answers
2k views

Cannot read property 'call' of undefined

I am running HelloWorld contract. pragma solidity ^0.4.2; contract HelloWorld { uint public balance; function Helloworld(){ balance = 1000; } } After truffle compile and truffle ...
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
167 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 ...
4
votes
1answer
432 views

Watching events defined in libraries

Is it possible to watch for event triggers when the actual event and trigger is defined in a library? I get no console output with the following code library ObjectHistoryLib { event ...
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
470 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) { ...
5
votes
1answer
2k views

Getting new BigNumber() not a number: [object, object] error

I am getting a BigNumber() error from the standard token function balanceOf(). The function returns uint256, but it seems like it's returning an array of objects. Here is my javascript testing in ...
5
votes
2answers
3k views

Constructor initializing another contract

I have a contract which is creating an instance of another contract. I am confused about deploying the contracts in Truffle. Does the constructor get initialized when deployed?
1
vote
0answers
336 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
106 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; ...
1
vote
1answer
431 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 { ...
11
votes
2answers
4k views

How to pass constructor parameters to a contract using Truffle?

I am using testrpc and truffle for deploying contracts.I want to pass constructor parameters while deploying. contract User { string public userName; function User(string ...
2
votes
0answers
648 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....
6
votes
1answer
684 views

Problem with start() in web3-provider-engine

While trying to connect to a provider(infura) I get the above error below is the full stack trace: bundle.js:54318 Uncaught TypeError: this.provider.sendAsync is not a function at Web3Subprovider....
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,...
3
votes
3answers
468 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 ...
5
votes
2answers
2k views

Accessing struct fields in Web3 returned by a promise in Truffle

I'm using web3js (via Truffle) to make a call to a contract, to access a struct in a mapping. mapping (bytes32 => entry) public entries; struct entry { Mode status; Deed deed; uint ...
4
votes
1answer
594 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 (...
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....
2
votes
1answer
292 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 ...
5
votes
2answers
672 views

Events being fired twice

Given a function and a event in a contract: event OtherCreated(address other, address addr1, address addr2); function doSomething(address addr1, address addr2){ if(aBool == true){ ...
1
vote
1answer
117 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
254 views

Truffle project encounters “Error: Cannot find deployed address”

I am a beginner and was trying to run a truffle project but encountered an error which I am unfamiliar with. I based it off Testing contracts with truffle To explain this is my folder structure. ...
1
vote
2answers
817 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 ...
1
vote
1answer
208 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 ...
13
votes
2answers
5k views

Truffle Migrations Account Locked Error with --network command

I have started a private blockchain using the command, geth --networkid 1337 --datadir ~/home/xyz/testnet --ipcpath /home/xyz/.ethereum/geth.ipc --rpc --rpcapi eth,web3 --rpcport 8545 --rpcaddr ...
3
votes
1answer
237 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
250 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 ...
2
votes
0answers
325 views

Using Truffle with Ethercamp Ethereum Studio

I'm trying to use the Truffle development environment inside of EtherCamp Ethereum Studio. My main reference is this issue in the Truffle issue tracker. It suggests using eth-lightwallet and hooked-...
1
vote
0answers
757 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 ...
8
votes
1answer
573 views

What is the most correct way to test modifiers?

As per the title, which testing method is most correct for modifiers? Something like testing via inheritance and creating a function specifically designed to test modifiers or testing via a framework ...
3
votes
1answer
148 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 ...
8
votes
1answer
524 views

Configure Truffle Compiler: Default Import Folder

I want to use an external library. I guess it is good to load the library in production from a CDN because this requires less space and should be faster. import "github.com/Arachnid/solidity-...
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: ...
6
votes
3answers
3k views

Return value of low-level calls not used

I'm attempting to use the function send() in Solidity I've got this error when i try to compile my contract with truffle : Warning: Return value of low-level calls not used. any idea about it? ...
26
votes
10answers
10k views

How can you handle an expected throw in a contract test using truffle and ethereum-testRPC?

Is it possible to write a test using truffle that attempts to confirm that a throw occurs in a contract? For example, if I had a contract with function... contract TestContract { function testThrow(...
3
votes
1answer
430 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 ...
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 ...
5
votes
4answers
2k views

How to use Truffle with Solidity 0.4

I just tried to set up a truffle project and tried to compile a contract I have already written. When I do so I get the following error message: /usr/lib/node_modules/truffle/node_modules/solidity-...
2
votes
3answers
1k views

Why does truffle console work fine with testrpc but truffle serve isn't finding accounts?

I'm running testrpc on the default port 8545. I run truffle console and test with: web3.eth.sign(web3.eth.accounts[0], web3.sha3("123")) This works fine. According to docs the sign method only works ...
3
votes
1answer
1k views

Setting up gasPrice in testrpc doesn't influence the transaction cost

Testing this function: function withdrawAll () public stopInEmergency () { if (!msg.sender.send(12 finney)) { throw; } } My truffle test: it("Should let correct payouts and ...
3
votes
1answer
620 views

Assigning a 2D byte array and accessing via Web3

So I'm trying to work with two-dimensional byte arrays and am experiencing some results that I don't quite understand. I am using Truffle v2.0.4 for compiling/deploying my contracts with ethereumjs-...
8
votes
1answer
564 views

Filtering on events of the entire blockchain not possible in testrpc via truffle

A contract I wrote has an event in its constructor. Since I want to find it back in the logs it doesn't seem possible to start listening to the latest block. Because the event is already 'fired' ...
27
votes
3answers
9k views

What are truffle migrations?

As written in Truffle docs: Migrations are Javascript files that help you deploy contracts to the Ethereum network. These files are responsible for staging your deployment tasks, and they're ...