The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
603 views

How to use IPFS with truffle framework [duplicate]

How to use IPFS to get the hash of the document and store it on private blockchain (using go-ethereum )? consider truffle framework and solidity as contract oriented language.
2
votes
1answer
309 views

Is it possible to get all entries of a Mapping or Array?

For debugging a smart contract, it would be helpful to see all entries of an Array or Mapping object in the smart contract. When using Truffle, I can see individual elements of a public array with ...
5
votes
1answer
4k views

Error calling a function from another contract: Member “*” not found or not visible after argument-dependent lookup in type

I'm having trouble compiling a contract that calls a function of an imported contract. SilverCoin.sol: pragma solidity ^0.4.11; contract SilverCoin { function abc() constant returns (uint) { ...
0
votes
2answers
2k views

truffle installation on ubuntu 16.04

Trying to install truffle on Ubuntu 16.04 (on window I tried and failed). First I followed the simple instruction to install "npm install -g truffle" and later on followed this link . Still not able ...
2
votes
1answer
554 views

Undeclared identifier when compiling with truffle compile

I have this contract and can't figure out where's the problem. Any ideas? (I'm a noob in solidity, just started a few days ago). HelloWorld.sol file: mapping (address => uint) balances; function ...
5
votes
2answers
5k views

passing String object with “0x..” value as bytes32 to a solidity function

I'm having trouble to pass bytes32 to a solidity function from javascript. It's converting to an incorrect bytes32 in solidity. The javascript is a test, running with truffle v3.3.1 on testRPC v3.0.5....
1
vote
1answer
419 views

solidity function not being called through web3/JS

I have the following contract (Test.sol): contract Test { bytes32 message = "This is a message."; function setMessage(bytes32 _message) { message = _message; } function getMessage() constant ...
3
votes
1answer
610 views

truffle test - not able to understand why the control jumps to different test case

I am trying to write unit test cases in truffle framework.I am able to write and execute them. However, whenever I have 2 or more test cases the control jumps from 1 test case to another. For ex: In ...
4
votes
0answers
289 views

Storing a truffle contract interface in version control

What I'm doing When I compile and deploy a contract using Truffle, I get a .json build artifact that contains information about where the contract is deployed on the network (its address). So far I ...
2
votes
1answer
850 views

Questions about interacting with contracts using truffle

I have a simple Escrow contract that I've deployed using testrpc. I'm not sure how to interact with the methods once I've created an initialized a new one. Here's the contract: pragma solidity ^0.4....
2
votes
0answers
291 views
7
votes
2answers
1k views

Which one is suitable frameworks for Dapp development(Truffle, Embark, Dapple)? [duplicate]

Right now we have major Dapp development frameworks. Truffle Framework Embark Dapple What are the pros and cons of each one. On what basis this could be chosen. And what each frameworks needs to ...
8
votes
2answers
3k views

truffle migrate Error: “Cannot find module 'truffle-expect'”

I'm following a solidity tutorial right now and I'm currently encountering an error when I run truffle migrate. Also, testrpc is running in another terminal tab, so this issue is unrelated to the ...
1
vote
3answers
426 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 ...
2
votes
1answer
891 views

Error: VM Exception while processing transaction: out of gas. error while processing transactions

MY CONTRACT : pragma solidity ^0.4.6; contract TestContract{ string coaf; string choice; string info; string isin; string recordDate; string exDate; function ...
5
votes
1answer
1k views

How to access test accounts created by TestRPC from a Solidity test with Truffle?

With Javascript tests, it is possible to access the accounts which TestRPC creates using: contract('MetaCoin', function(accounts) { // tests here can access accounts[n] to get the public keys } ...
0
votes
1answer
500 views

How to assign ether value at deployment of contract

I am trying to run this buyer seller contract in truffle using testrpc. I am unable to assign the address and value for seller at the time of deploying contract. Here is my solidity code and deploy.js ...
4
votes
1answer
2k views

truffle always says “.my_function is not a function” [duplicate]

I'm trying to do my first basic smart contract, following this popular HelloWorld tutorial. However whenever I get to the part where I run a function in the truffle console, it is always telling me "....
1
vote
1answer
1k views

Invalid JSON RPC response error when using truffle migrate + geth

I have been able to successfully deploy contracts on the ethereumjs testrpc with truffle without any issues. Now I wanted to do the same on a remote node running geth 1.6.1 but it gives me a JSON RPC ...
5
votes
1answer
5k views

Is it possible to send ether from contract address to my account address using the CloseChannel() function and what will be the Truffle command?

pragma solidity ^0.4.0; contract exchange { mapping (address => uint256) public balances; event PaymentDone(string s); function Channel( uint value) payable { balances[msg....
1
vote
1answer
1k views

Truffle Migrate with my own ethereum Network

I am developing ethereum contract. so i have setup ethereum server. i used this geth --rpc console --datadir "ethdata" --networkid xxxxx --nodiscover --rpcaddr "xx.xx.x.xxx" -rpcport 8545 --...
0
votes
1answer
581 views

How to use truffle and testrpc and simulate function call masquerading as another user?

I have setup testrpc with two accounts using this syntax basically: testrpc -h 0.0.0.0 --account=0x93e707aa1e3ada62,10000000000000000000 --account=0x47e7625a68200ea9,1000000000000000000 I can ...
0
votes
1answer
285 views

Control structure with truffle (assert and require)

When I'm trying to deploy contracts that contain assert and require using truffle I receive Error: Undeclared identifier. e.g: pragma solidity ^0.4.8; contract Owned{ address public owner = ...
2
votes
2answers
1k views

smart contract address checksum

I am going through ethereum blockchain demo's and currently trying to call other contract deployed already on a local ethereum rpc in memory blockchain. Using truffle and ethereum rpc i am testing ...
1
vote
2answers
255 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
0answers
268 views

truffle migrate command gives Error: Invalid Json Response: “”

I've cloned testrpc and have it running in a separate directory. It's set to the default localhost:8545. I've successfully installed truffle and ran truffle-init-webpack, then truffle compile. When ...
1
vote
1answer
1k views

Truffle vs Meteor [duplicate]

I have developed a dApp using Meteor. My question might sound a little dumb but here it goes: What is the difference between Truffle and Meteor? Are they exclusive from each other, is either one or ...
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 ...
2
votes
1answer
2k views

Runtime Error: out of gas when calling method on contract

I am using Truffle Framework and TestRPC. I have the following method on my contract: function sendEmr(address receiver, string universalPatientId, string firstName, string lastName, string url) ...
1
vote
1answer
374 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 ...
5
votes
1answer
6k views

How to get deployed contract address using Truffle 3.x console?

I opened truffle console and when I type my contract's name, I see a very long message on the console but not sure How do I deploy the contract and find the deployed contract address. Kindly advise.
1
vote
1answer
180 views

constant and visibility specifier in solidity

I am trying to run this code but it throws the errors . Is this possible using visibility specifier and constant once ? pragma solidity ^0.4.0; contract C { function first(uint a) private ...
1
vote
2answers
564 views

Output in truffle

I want to read the result of these code in truffle console . I used truffle v.3.2.5 and testrpc v.3.0.5 If such question return with two parameter exist then provide me a appropriate link . ...
0
votes
1answer
309 views

MetaCoin contract initializing with no value - Issue with Solidity contract constructor

I'm currently trying to get my contract Guess own another contract, MetaCoin, so that it initializes with 10k MetaCoin. Here is the MetaCoin contract: contract MetaCoin { address owner; mapping (...
1
vote
0answers
116 views

How to focus on a test in truffle

In JasmineJS and other Unit testing frameworks, there is usually a focus feature which works like this using fit: fit('Crowdsale contract - vault works correctly', function(done){ }); if I want to ...
1
vote
1answer
4k views

truffle test fails with ReferenceError: A is not defined

I am not sure what is missing. I keep getting "Reference error". Please find the details below Step 1 : Ubuntu# truffle compile Step 2: Ubuntu# truffle migrate --reset Using network 'development'....
0
votes
3answers
2k views

remove contract on ethereum blockchain using web3 [duplicate]

Is it possible to remove or update already deployed contract using web3 or truffle console or geth console?? if we know the contract details like address and ABI array, and we create a object of ...
1
vote
1answer
455 views

Problem sending MetaCoin from one account to another using unit test

In Truffle; I am trying to modify the already existing MetaCoin sample unit test in order to better understand how everything works. Below is the unit test they provide which transfers 10 coins from ...
1
vote
0answers
81 views

how to use the contract instance for multiple functions?

I am trying to test the exchange where two types of tokens are trading. I want to set those tokens in exchange and trying to trade them between two accounts, but i am unable to get the updated ...
1
vote
1answer
391 views

Truffle solidity tests are executed before end of deployment

My contract hierarchy is Token which calls function on TokenBase. The deployment is defined like so: var Token = artifacts.require("./Token.sol"); var TokenBase = artifacts.require("./TokenBase.sol");...
1
vote
1answer
527 views

Error when installing testrpc / truffle on Ubuntu Subsystem on Windows 10

Node version 7.10.0 npm installed Ubuntu Subsystem on Windows 10 I try to install testrpc and truffle. When I install truffle via sudo npm install -g truffle I always get the following error: ...
2
votes
2answers
355 views

What is the {from: account_one} third parameter in metacoin.js test example

When working through the MetaCoin sample project; within the MetaCoin.sol file we have this method: function sendCoin(address receiver, uint amount) returns(bool sufficient) { if (balances[msg....
1
vote
1answer
908 views

Unlock contract deploy address in Truffle testing using TestRPC?

I'm trying to test a function in a contract that sends ether from itself to another contract address. However in my Truffle tests I keep getting Uncaught Error: Error: could not unlock signer account. ...
7
votes
1answer
3k views

How to choose an account to deploy a contract in truffle

How do you select an account to deploy a contract using: 1)Metamask 2)Parity 3)some config file
2
votes
1answer
2k views

ReferenceError: artifacts is not defined running Truffle Test

I am trying to execute the built in until test provided in the metacoin example. I installed Mocha into my project. I then execute this command: npm test from my console. I am getting the following ...
3
votes
1answer
222 views

fallback-to-build error while installing Truffle in Ubuntu 16.10

I was installing Truffle in Ubuntu 16.10 using sudo, but I got the following error message: npm WARN wrtc@0.0.63 license should be a valid SPDX license expression npm ERR! Linux 4.4.0-59-...
1
vote
1answer
487 views

Regarding Oraclize call in smart contract

I have two functions which uses Oraclize call.I have to call these functions one after other / or simultaneously. Sample code for your reference :- pragma solidity ^0.4.0; import "./usingOraclize....
5
votes
1answer
1k views

Accessing testrpc addresses from solidity tests

I'm consulting truffle's docs on how to test contracts directly in solidity. http://truffleframework.com/docs/getting_started/solidity-tests I'd like to figure out a way to refer to existing testrpc ...
0
votes
1answer
259 views

Is there a way to programmatically withdraw money from address?

I am trying to write a test using the Truffle framework and for one of the tests I need to send the contract some ether. Is there a way that I can programmatically make a specified ether account send ...
1
vote
0answers
275 views

How does Truffle Deployer translate arguments from JavaScript to Solidity?

I have a Truffle migration that looks something like this; var MyContract = artifacts.require("./MyContract.sol"); module.exports = function(deployer) { deployer.deploy(MyContract,[ { "...