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
284 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
0answers
260 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
3answers
376 views

Deploy Ethereum SmartContract on Azure

I am using truffle to write smart contracts , my code and deployments work well on local ethereum rpc. Now i added another environment in "truffle.js" file with url to my azure "Ethereum Consortium ...
1
vote
0answers
392 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 ...
5
votes
1answer
345 views

Getter function on solidity

what mistake did I make? pragma solidity ^0.4.0; contract Getter_check { uint public data = 50; function f() constant returns (uint r) { r = data; } } pragma solidity ^0.4.0; ...
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) ...
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
170 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 ...
0
votes
1answer
306 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 (...
10
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....
0
votes
2answers
1k views

truffle migrate fails: intrinsic gas too low

I'm trying to follow the tutorial on using Truffle framework for Ethereum development at https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-2-30b3d335aa1f. ...
1
vote
2answers
544 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 . ...
1
vote
0answers
114 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
362 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 ...
3
votes
1answer
1k views

Unable to migrate contracts to Kovan using truffle.js (testrpc and dev chain works though)

I'm having problems deploying contracts to kovan. I'm able to deploy to testrpc, as well as the parity dev chain, but the exact same process fails on kovan. The contract hangs at: Running migration: ...
6
votes
5answers
7k views

How do I find the exact solidity compiler version used by truffle?

I'm trying to verify a contract I have compiled and deployed onto the network using Etherscan. The contract was compiled using truffle. How do I work out exactly which version of the solidity compiler ...
1
vote
3answers
1k views

Out of Gas error on TesRPC

Hey so I have been just messing around with truffle and I keep getting an out of gas error when I test out the commands after a certain point. Even if I uninstall and reinstall testrpc, the problem ...
1
vote
2answers
789 views

Using Truffle, Metamask and Ropsten to simulate two users

I'm trying to create an environment where I can test that access to a contract is restricted to a given wallet address, so I'm trying to simulate two users... 1) I'm running geth pointing to Ropsten ...
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
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 ...
0
votes
3answers
586 views

How can I let TestRpc reveil the public key of a generated account

I suffer a steep learning curve at the beginning. My current goal is to set up a testing environment with TestRpc, Truffle and Web3j (wow). Web3j worked as expected and generated a Java wrapper for ...
1
vote
1answer
385 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
452 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
1answer
520 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
341 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....
23
votes
4answers
4k views

what does `deploy.link` exactly do in `truffle`

Please explain use cases for deploy.link() function in migrations in truffle framework. How would you use it and for what.
25
votes
12answers
21k views

How to upgrade solidity compiler in truffle

I couldn't find a way to upgrade a version of truffle solidity compiler. Also curious how to see that information for deployed contracts in truffle console
7
votes
1answer
2k 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 ...
1
vote
1answer
896 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. ...
5
votes
1answer
2k views

How to deploy truffle contracts to Rinkebey?

What are the parameters that I have to specify to be able to deploy solidity contracts using Truffle in the config file? I am using Metamask to store test ether and have a unique mnemonic to define ...
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 ...
1
vote
1answer
482 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....
0
votes
1answer
258 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 ...
0
votes
1answer
427 views

Pass address[] array to Truffle deployer (MultisigWallet)

I am trying to deploy the MultisigWallet contract on testrpc. However, I can't figure out how to provide the address[] _owners constructor parameter in the deployment command. I've tried several ...
3
votes
1answer
215 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-...
2
votes
3answers
795 views

Unknown error while installing testrpc in Ubuntu

I was trying to install testrpc using sudo npm install -g ethereumjs-testrpc. But no ERR messages are shown. Only this is the output: /home/***/.npm-global/bin/testrpc -> /home/***/.npm-global/...
3
votes
1answer
4k views

Web3 - Uncaught TypeError: contract.abi.filter is not a function

I have compiled and deployed a simple Hello World contract using truffle: pragma solidity ^0.4.4; contract Greeter { function Greeter() { } function sayHello() returns(string) { ...
12
votes
3answers
7k views

Truffle console - How can I get and print the value returned by a contract function?

This is an absolute newbie question. Given this simple Hello World contract: pragma solidity ^0.4.4; contract Greeter { function Greeter() {} function sayHello() returns(string) { ...
5
votes
2answers
2k views

How to deploy a new version of the contract?

Probably this is not possible, but I still have to ask. Let me follow the example created in truffle init. It contains a contract called MetaCoin.sol. Say, I have deployed it on the network (the ...
5
votes
2answers
2k views

Truffle test with async/await

Has anyone got Truffle tests to work with async/await? My sample code for testing require('babel-polyfill'); var ERCToken = artifacts.require("./ERCToken.sol"); var Proxy = artifacts.require("./...
1
vote
0answers
270 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,[ { "...
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 ...
2
votes
0answers
375 views

truffle log location?

Does anyone know where truffle keeps logs? I am unable to perform a migration. It gives me no error message; it just hangs on: Running migration: 1_initial_migration.js Deploying Migrations... ...
0
votes
1answer
2k views

Testing contract function after transaction with Truffle

I try to test this contract with Truffle but the test of checkGoalReached function Fail and I do not understand why. The code to reproduce this problem is available here With Remix Solidity IDE, the ...
4
votes
2answers
558 views

Failing Transaction within Truffle Testing

How does one test a transaction that is supposed to fail when testing with truffle? For example, say I was testing an ERC token, in which accounts[0] had a balance of 20. Within a test, I call ERC....
7
votes
1answer
2k views

Truffle : Call that returns contract is returning tx

Using Truffle v3.2.1 and solidity 0.4.4 I have an issue with a Factory contract (that create some kind of contract), to simplify my factory contract look like this : contract HelloFactory { uint ...
2
votes
1answer
2k views

Deploying to testnet using Truffle and Metamask

Is it possible to deploy a smart contract developed using truffle to testnet using just Metamask (without a local eth client instance running)? I tried importing the private key of metamask wallet to ...