Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
195 views

How do I go from truffle testrpc to mainnet?

I've been teaching myself ethereum via the stack solidity/truffle/truffle-contract/testrpc/metamask. I built a small dApp that runs on testrpc with proper unit tests which work great. I've written a ...
1
vote
2answers
3k views

HelloWorld contract using truffle v3.2.1

I made my first very simple HelloWorld smart contract : pragma solidity ^0.4.4; contract HelloWorld { uint public balance; function sayHi() returns (bool success) { balance = 1000; ...
1
vote
0answers
55 views

TestRPC crashing

When I run my Truffle test suite locally with testrpc, testrpc sporadically fails with this error: eth_call /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:61262 db.get(key, { ...
1
vote
1answer
633 views

MetaMask transaction not completed

I'm making a simple dApp that sends funds from one account to another using Truffle + MetaMask on testrpc. In my app.js, I have a pay() function that calls web3.eth.sendTransaction({from: account1, ...
1
vote
1answer
658 views

Truffle Compile on Windows “Could not find a suitable configuration file” [duplicate]

I am trying to do a simple Truffle Compile on window 10 using git bash but i keep getting "Could not find a suitable configuration file" I have tried "Truffle Compile" after running truffle init. I ...
2
votes
2answers
2k views

How to access a token instance created by another smart contract constructor

I am using a smart contract which creates a token instance in its constructor: contract Exemple{ Token public myToken function Exemple(){ myToken=Token(this); } }...
14
votes
1answer
3k views

How do I control compiler settings with truffle?

I'm using truffle development environment for prototype contract development and I need to change compiler setting (e.g. turn optimization on and off). The documentation for the development ...
3
votes
1answer
453 views

Solidity Browser and Truffle giving different bytecodes

I am compiling in solidity browser and then compiling the same exact code in truffle. The code is the following: pragma solidity ^0.4.11; contract double{function d(int256 a)constant returns(int256){...
7
votes
1answer
8k views

Truffle gas price and gas limit on demand instead of using fixed amount

I use truffle. When I deploy contracts, sometimes I encounter gas related errors. I always set fixed value of gas price in truffle.js. I want to change it. I think we can use web3.eth.estimateGas and ...
6
votes
3answers
3k views

Truffle + INFURA for deployment

I've recently started to use Truffle to automate/speed up my development. As I'm still getting the grasp of it I've come up with a barrier when trying to use INFURA for migrations. INFURA nodes don'...
7
votes
2answers
3k views

Ethers in testrpc

I am new to Ethereum. I have some questions concerning the use of ethers(in stead of MetaCoins) with truffle and testrpc. 1. By default, do the accounts of testrpc contain the currency in ethers? If ...
0
votes
1answer
867 views

solidity how to test a crowdsale contract in truffle and testrpc by sending 1 ether

my solidity MyContract running on testrpc with truffle i am trying to write a test using solidity to test the crowdsale contract i want to test when an address send 1 eth to the contract address the ...
2
votes
1answer
392 views

Errors Trying to Install Zeppelin

I'm trying to install Zeppelin to use in conjunction with Truffle. I've been trying to figure out this error for hours with no success. When installing I get the following output: Zachs-MBP:oz-...
1
vote
1answer
145 views

Truffle. Type index error (Error: Error: VM Exception while executing eth_call: invalid opcode)

I have got error if i try call method getArrayData() contract ManagerDb { struct ManagerStruct { bytes32 firstname; bytes32 lastname; bytes32 email; uint index; ...
0
votes
2answers
145 views

A contract that seems to work fine isn't doing anything

I'm having a problem with a smart contract I have deployed on a local testrpc network. I'm using truffle, nodejs and web3js. I am running that testrpc network on Ubuntu 16.04, and into it there's is ...
1
vote
2answers
784 views

How to build a web interface that allows users to carry out transactions on a private blockchain?

I'm just getting started with Ethereum. To understand the platform better, I intend to build a web interface for a voting contract. User should be able to make authenticated transactions to vote on a ...
1
vote
0answers
282 views

Trying to Deploy a contract Factory on Truffle

I am trying to deploy a contract factory that creates multiple other contracts. The problem is they are both in the same solidity file. When migrating and deploying I can only access the Factory ...
0
votes
1answer
388 views

Testing contract interactions with Truffle

I have 2 contracts, User and Registry, interacting and I want to test their interactions with Truffle. Currently my test(s) for User are contract('User', function(accounts) { // many tests here ...
1
vote
1answer
265 views

switching signer off when using parity as development network

I successfully created a private network with some accounts with lots of ETH following the instructions on parity's github but when I try to create a transaction the signer wants me to validate each ...
1
vote
2answers
246 views

Calling values from Solidity contract

I'm trying to create a contract where I can save and then call a person's 'first name', 'last name' and 'age' within the truffle console. I'm able to save using the addPerson method, but every time I ...
1
vote
1answer
884 views

Truffle - can deploy to ropsten but not mainnet

I am trying to deploy a contract to the mainnet. My truffle.js looks like this: require('babel-register') module.exports = { networks: { "live": { network_id: 1, host: 'localhost', ...
1
vote
0answers
201 views

evm_mine in parity dev chain. Fast forward time in Development Chain

Everybody loves testrpc, except me. So, I like to write unit test against real parity dev chain node. The question is how to fast forward timestamp(create new blocks) ? function advanceBlock() { ...
0
votes
1answer
2k views

How to connect to contract via javascript deployed using truffle

I have deployed a contract using truffle on the testrpc network. I need to write a Javascript code that can connect to the contract and run the functions of the contract but I can't figure out how to ...
5
votes
2answers
250 views

Sending ethers with mocha.js and truffle might result in larger sums than intended

Good day, I have a contract General and a library GenLib. library GenLib{ event MoneyIn (address _from, uint256 _amount); function moneyIn() { MoneyIn(msg.sender, msg.value); <- ...
0
votes
1answer
788 views

Basic testing with Truffle (not changing contract's state)

I'm just starting to use Truffle to test this contract pragma solidity ^0.4.11; contract Basic { bytes32 value; function Basic() { value = "mcansado"; } function getValue() ...
0
votes
1answer
117 views

VM Exception: Contract from within a contract

I am following this example to experiment with contract from within a contract (using testrpc). contract Product { bytes32 public Name; function Product (bytes32 _Name) { Name = ...
6
votes
1answer
5k views

Truffle and Node JS

The dApp I'm building requires a traditonal backend and as a result I need to use Node.js and MongoDB alongside Truffle. Does anybody know how to set Node to work with Truffle? Thanks!
5
votes
2answers
4k views

How would you integrate Ethereum smart contracts into an existing node/react project?

I have an existing node/graphql/mongodb/react/redux project that is in beta and I would like to integrate Ethereum smart contracts to be able to save transaction information into the block chain. Is ...
4
votes
1answer
608 views

Solidity, Ethereum ICO, Truffle and my head exploding

I am trying to somehow end up with a solidity code (for an Ethereum token and a Crowdsale contract), that I can paste in the source code bar in Ethereum Wallet and deploy the Token and the Crowdsale ...
2
votes
2answers
268 views

Difference of behavior between Metamask and direct connection to testrpc

I’m guessing there is an obvious answer to this question but I’m just completely missing the point. I have a very simple contract with 2 functions: a setter that changes a bunch of fields, and a ...
8
votes
2answers
7k views

How do you get the balance of an account using truffle/ether-pudding?

Is there an ether-pudding way to get the balance of a contract/account, or should I just use web3.eth.getBalance(account)?
0
votes
1answer
503 views

Can't access smart contract published with truffle in testrpc from javascript

I'm trying to develop a simple smart contract that sends Ether from one address to another and I can't make it work. I'm using Ubuntu 16.04, truffle 3.4.7, node 7.10.1 and solidity 0.4.13. The ...
2
votes
0answers
286 views

Truffle Contract transaction doesn't wait to be mined

I have a thing that has been annoying me when using truffle-contract, ever since updating from Truffle 2 to Truffle 3. I am no longer able to run transactions synchronously - even though it is stated ...
6
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-...
12
votes
1answer
4k views

Truffle migrate fails

I am using testrpc. While running truffle migrate I get the following error: /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:671 throw new Error(this....
7
votes
2answers
2k views

What are the best practices to keep your ethereum smart contract code from being copied and reused?

I'm new to smart contract development. I have built a couple of sample projects and deployed those to my private network. So now I am doing some research on best practices in regards to smart contract ...
4
votes
1answer
672 views

Error: invalid address during truffle migration process in Rinkeby network

I can't deploy my contract to Rinkeby network through truffle migrate --reset --network rinkeby. My truffle.js file looks like this: { networks: { rinkeby: { { ...
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 ...
8
votes
1answer
723 views

Migrating solidity program testrpc+truffle - Error: Invalid JSON RPC response: “” at Object.InvalidResponse

I am trying to make a truffle application. truffle compile : working fine making a 'build' folder with .json files in it. truffle migrate : Gives the following error I am running testrpc in ...
0
votes
1answer
212 views

Why does Truffle create contract when tests contains no transactions?

I tried running tests that were not sending any transactions and ran into two errors that to me make no sens : an authentification error and, when the account has been unlocked, a block gas limit ...
2
votes
1answer
606 views

Problems with UINT values when testing with mocha/chai

I am testing at the moment some smart contracts with truffle(mocha/chai/chai-as-promised) and have the following problem: I have a getter, and this getter delivers an UINT value, then when I try to ...
1
vote
1answer
262 views

Contract won't deploy (Truffle, React + Redux Box)

I am trying to develop a smart contract that would allow for multisig actions. So if I, for example, want to add admin to AdminStorage I will need consent of a number of admins. It's exactly like ...
3
votes
0answers
133 views

Not able to successfully do transactions of default MetaCoins(from Truffle) on local testnet on MetaMask

I have installed truffle and ran the default contract provided by truffle. I successfully compiled,migrate and put the default dapp on local testnet http://localhost:8080/.I am able to see the dapp ...
2
votes
0answers
202 views

How can I get my dapp interface to work on Mist? I'm using truffle framework and it works with Metamask

I can't get my interface to work on Mist using truffle contract abstraction. After building and testing successfully with Metamask I thought I'd test it on Mist as well and, surprise, it doesn't work. ...
4
votes
1answer
565 views

Truffle: How to detect test environment while running smart contract test cases?

I'm trying to run some test cases in Travis CI using truffle but I want some of them not to run if the test environment(localhost:8545) is running via "testrpc" because some of my test cases only ...
2
votes
0answers
624 views

How to connect frontend with contract backend using truffle?

Right now I'm having some trouble understanding how it all fits together if I want to make a Dapp. I did create a contract and the frontend using truffle. Then I compiled it and deployed it to ...
2
votes
1answer
557 views

Solidity Truffle React TestRPC: Invalid address error while creating transactions through React app

I am writing a simple contract which is basically a registry. I am using testRPC for my ethereum testing. Following is my contract on Truffle: notary.sol pragma solidity ^0.4.11; contract notary { ...
3
votes
0answers
342 views

Unit testing with chai-as-promised: how to test for two possible errors with rejectedWith()?

I am new to asking questions here and I am sorry if my question is not correctly asked! I am currently testing some smart contracts with truffle and have some problems with testing for exceptions. ...
6
votes
2answers
664 views

Can a solidity contract count how many times it has been instantiated?

After the deployment of the contract, let's say MyContract, can we literally count how many times MyContract has been instantiated? Here's the code of MyContract: contract MyContract { uint ...
1
vote
2answers
1k views

Truffle Build doesn't work

module.exports = { build: { //"index.html":"index.html", //"app.js": [ //"javascripts/app.js" //], //"app.css": [ //"stylesheets/app.css" //], //"images/": "images/" }, networks: { development: ...