Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
349 views

Truffle/Web3: myContract.method.estimateGas causes BigNumber error

I get the following error when running truffle test: { BigNumber Error: new BigNumber() not a number: [object Object] at raise (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/...
2
votes
1answer
694 views

Truffle and contract with an Address type constructor parameter

When I add new contract (testrpc) with truffle with parameter of type "address" the reading value of this property seems wrong (always 0x0000000000000000000000000000000000000000), I do not find the ...
0
votes
1answer
160 views

Contract not being initialized

Having issues with a contract creating another contract using Truffle dev environment. Here are my steps - truffle console var node = Node.deployed() node.then(function(instance){node=instance}) var ...
3
votes
1answer
315 views

What are the differences between callback and OAR address

I am using Oraclize with testrpc and truffle and I have confused in some points Now when I choose an address account when run the bridge, why and what is the purpose of the choice. node bridge -a 1 ...
1
vote
1answer
149 views

RPC access to a Private Blockchain Error (-32600)

I am building a private blockchain for testing. I have a droplet at digital ocean and I installed the latest geth. The blockchain has mining but only headers and there is no data for content. I am ...
1
vote
1answer
215 views

Question regarding Testrpc evm_increaseTime and oraclise

After creating my contract at t1, which is supposed to be called back from oraclise using Ethereum-bridge at t2. I did a time jump to t2 on testrpc using evm_increaseTime and evm_mine. Yet the ...
3
votes
1answer
2k views

Truffle.js and Kovan/Ropsten

I am trying to use truffle.js and the testnet. I want to test using Kovan an Ropsten. Here is the doc from truffle - networks: { "live": { network_id: 1, // Ethereum public network // optional ...
3
votes
1answer
2k views

Truffle error: Cannot read property 'call' of undefined [duplicate]

I am trying to run the following contract in truffle, which is pretty much the same HelloWorld but I kept the name MetaCoin from the truffle example. I have read this, this, and this posts related to ...
9
votes
1answer
2k views

how can I run a truffle test in a debugger? [duplicate]

as a developer I want to run my javascript test in a debugger so as to be able to step through tests and inspect the values of variables. The goal is to run it in a Mocha debug mode
8
votes
1answer
4k views

How to pass arbitrary bytes to a function (2016)

I'm trying to implement a contract which will store bytes blob, a dynamic bytes array. For example I have following struct: Sign { address signer; bytes16 signType; bytes sign; } plus ...
0
votes
2answers
910 views

TestRPC Accounts Locked

I'm having difficulty getting going with truffle and testrpc. The steps I've taken are: Create a blank project and initialise with truffle init Start testrpc with testrpc Trying truffle migrate or ...
3
votes
2answers
864 views

Unit Testing Date Time Values

I have a function that makes use of the current time (now). The Contract as a whole is a Crowdfunding token and the cost of tokens differ depending on the date and time that tokens are purchased. ...
2
votes
0answers
163 views

Truffle test resources

I'm looking for some guide that drive me into solidity + truffle unit test (best practice, etc...). The only doc that I have found is the official doc.
1
vote
1answer
246 views

Cannot access variables in contract

This is my contract- pragma solidity ^0.4.0; contract helloworld { uint public balance; function helloworld(){ balance = 1000; } function getBalance() returns(uint) { ...
16
votes
2answers
10k views

Problem with Truffle Console: Cannot read property 'call' of undefined

I´m having problem with the basic HelloWorld example coded in Solidity and managed with truffle with testrpc. pragma solidity ^0.4.2; contract HelloWorld { uint public balance; ...
2
votes
1answer
545 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
4answers
1k views

Contract Method not returning value

I have a contract : pragma solidity ^0.4.2; import "Owned.sol"; contract SGBFactory is Owned { event SGBUpdate(uint sbgID, bool isCreated, string message); // isCreated = true means created, ...
1
vote
1answer
394 views

Design principles for a file sharing contract

I'm building a file sharing solution, which can benefit from the public ledger. I picture, that each file would have its own contract with an owner, and list of Addresses and their permissions on the ...
5
votes
3answers
4k views

Build an application with Truffle + React + Redux

I'm looking for some examples about how to build a Dapp with Truffle + React + Redux. I'm able to only find this old tutorial https://www.youtube.com/watch?v=GPP6uAq15d8. Does anyone have some other ...
3
votes
1answer
1k views

Parity mining on --chain dev for truffle migrate

I am using Parity to create a custom app and so I am using it locally on --dev. "$ truffle migrate" fails, I think because there is no balance in the account. It says: Error: Insufficient funds. ...
1
vote
2answers
506 views

Truffle console + javascript

I have a question for you guys. I have 2 contracts: contract House { uint public idHouse; ... } contract ArrayHouse { House[] public arrayHouse; function getHouse(uint n) returns(House){ ...
1
vote
1answer
530 views

Call a function from an account

Knowing that account0 = 0x2ac971cfceb478a3db5a43598e098839007cec34 account1 = 0x55990a8c443a0eb296cff4bece4c54350185b019 I started testrpc. After that, I called a function buyItem(moneyPaid,{from:...
9
votes
1answer
6k views

Could somebody please explain in detail what this Ethereum contract is doing?

I am new to ethereum & blockchain technology and trying to understand somethings(Etheruem, Truffle, DApps etc.) here and there from the internet. From Ethereum official website, Create a ...
1
vote
1answer
564 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
2k views

how to parse the value returned by truffle ?

I need the value of string. Also, what is the significance of s , e , c . truffle(development)> x.then(function(result) { console.log(result[4]);});}}); undefined truffle(...
2
votes
2answers
5k views

How to send some amount to a Contract in truffle

My contracts were tested in both Browser Solidity and Mist Wallet and it works fine. I am trying to use testrpc and trying to depoy Below is the javascript I am using it on truffle console ...
2
votes
0answers
280 views

How to ensure correct ordering when using a for loop in truffle test

I am using truffle (javascript) to test my solidity contracts and want to automatically run my contract functions a large number of times. I can't figure out how to make a for loop work with promises ...
5
votes
2answers
2k 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?
3
votes
1answer
501 views

Can Truffle deployer send ether on construction?

If a contract has a payable constructor and needs to be filled on construction, is this possible with the truffle migration workflow?
0
votes
1answer
951 views

truffle - how to invoke functions based on the address elements

// 1) I am invoking a function and getting the entire project list - SUCCESS truffle(development)> hub.then(function(instance){return instance.getProjAddr.call();}) [ '...
4
votes
1answer
3k views

truffle console - return (array of addresses) issue

This problem happens only when I place contracts A and contract B in seperate file. When placed in same file, I get the array elements perfectly Please find the contract below. I was able to ...
3
votes
1answer
2k views

Ether transfer to another account

-I am trying to transfer ether from one account to another using smart contract which is deployed on azure. -when I call receiverAddress.send(amount) in the function in my contract it returns the ...
6
votes
1answer
3k views

How to set a sender address when deploying a contract with Truffle?

I don't seem to find the answer to what looks like a really basic question. How does one specify a sender address when deploying a new contract using Truffle ? My contract is owned. So most of my ...
1
vote
1answer
1k views

What is the truffle command to send token and check balance of token?

pragma solidity ^0.4.8; contract Token { string public name; string public symbol; uint8 public decimals; // address public owner; mapping (address => uint) balances; event ...
2
votes
1answer
519 views

Error in dapp developed using 'Truffle' framework - Issue in fetching the result from Oraclize-Query

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

Is it possible to interact with multiple contracts in the same .sol file using Truffle?

Instead of separating each contract into it's own file, I'm wondering if/how I can interact with each individual contract one in a single .sol file through truffle console. Thanks.
1
vote
1answer
2k views

truffle test - TypeError : myFunction is not a function

I'm using truffle and testrpc to check whether my addMember function works or not. And here is my contract code. /*make Stakeholder*/ function addMember(bytes32 _name, uint256 _threshold, uint256 ...
3
votes
2answers
807 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
296 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
796 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
176 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 ...
25
votes
1answer
15k 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
251 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
425 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
522 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
515 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
447 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
218 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
298 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 ...