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
0
votes
1answer
49 views

Any “testing” contracts I can migrate?

I am testing a private network and I want to test using truffle to migrate/deploy some contracts. Is there a library of test contracts somewhere that I can use for this?
0
votes
1answer
666 views

Accessing a 3rd party contract's functions using Truffle

I'm trying to build a basic dashboard that will allow me to track the status of any given ICO (assuming the token is ERC20). Right now, I managed to deploy a simple Crowdsale + Coin contract based ...
0
votes
2answers
398 views

How to detect what instruction caused “truffle test” to result in “invalid opcode” error?

I wrote a test for my contract and it returns invalid opcode as a result. Full output: 1) Contract: FPCoin1 One can purchase tokens for ether: Error: VM Exception while processing transaction: ...
0
votes
1answer
358 views

Events are not getting recognised TypeError: Contract.events.event is not a function

I am trying to get older state of a contract. I have deployed contract using truffle. my contract is pragma solidity ^0.4.15; contract NDA { bytes32 party1name; bytes32 party2name; bytes32 ...
0
votes
0answers
211 views

Console logging in Truffle promises throws exception

Does anyone know why console.log in Truffle Javascript promises causes errors given below? I have the following code, where as soon as I remove the console.log statements, the errors given below go ...
0
votes
2answers
794 views

Truffle TestRPC Error: VM Exception while executing eth_call: invalid opcode

I've created a project from a Truffle Box. I have created my own contract for voting. At this point i want to be able to vote, which seems to be working, and return the total votes for all candidates, ...
0
votes
1answer
114 views

Transfer contract address from truffle to meteor

I am very new to dApp-Development and therefore frankly i need some basic help. How can i get the address of my deployed contract by truffle in meteor? I hope there is a simple solution.
0
votes
1answer
200 views

How to chain functions in truffle framework?

I am wondering how to chain functions in truffle testing framework to avoid writing the same code twice. To give an example, I am experimenting with the old version of King of the Ether Throne ...
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 ...
0
votes
1answer
104 views

Why I am unable to write to contract in ethereum wallet?

I clicked on the watch contract and entered address and ABI. But I can't see any functions to write to contract. I compiled and deployed contract by using truffle framework ABI: { "...
0
votes
1answer
2k views

invalid address error on running code - solidity

Here is my code : var Web3 = require('web3'); var fs = require("fs"); var Artifactor = require("truffle-artifactor"); var provider = new Web3.providers.HttpProvider("http://localhost:8545"); var ...
0
votes
0answers
215 views

How to deploy smart contract using truffle , metamask with ropsten network [duplicate]

This question is an extension of Deploying to testnet using Truffle and Metamask Need to deploy smart contracts over ropsten testnet that connected through metamask . I am using truffle framework to ...
0
votes
2answers
336 views

Cannot assign value to a variable in truffle console and other problems

I'm trying to do very basic things with Truffle 3.4.6 console. I've been able to successfully compile and migrate a contract and access its contents using both: CoinCrowdsale.deployed() CoinCrowdsale....
0
votes
1answer
314 views

truffle init webpack on Heroku

I'm having a hard time exporting the Truffle sample app on Heroku. I'd like to use it with Metamask. I tried simply pushing the code from my local machine (where the code is working) adding the ...
0
votes
1answer
271 views

Cannot call function and send write-Transaction from geth-console

I have a contract which has this function: function registerSensor(bytes32 name, bytes32 unit, bytes32 location) returns (bool success) { sensors[msg.sender].exists = true; sensors[msg.sender]...
0
votes
1answer
773 views

How to return the index value of an Enum?

I am trying to build a simple double escrow contract. I have an enum for the state: enum State { Created, Locked, Inactive } State public state; When I try to interact with the contract through the ...
0
votes
2answers
281 views

Contract not disbursing MetaCoin to parent account

I've combined MetaCoin and created an Ownable contract to allow for my Relay contract have access to MetaCoin methods and variables. Everything is successfully deployed using truffle. My assumption is ...
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 ...
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 (...
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 ...
0
votes
1answer
454 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 ...
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 ...
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 ...
0
votes
1answer
165 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 ...
0
votes
1answer
284 views

Some Truffle tests not running after truffle init (Mac OSX) Uncaught TypeError

I am trying to build a DApp using Truffle. I have installed Testrpc and Truffle globally with NPM. I ran testrpc in a terminal window and ran truffle test. I get 2 passing and 3 failing tests. The ...
0
votes
1answer
954 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();}) [ '...
0
votes
2answers
1k views

truffle and metacoin. How can I send a transaction?

I am trying to learn truffle, and I have compiled, migrated, and test the example contract. I load the example Dapp in my browser from local host, and I have the lists of addresses created by testRPC,...
0
votes
2answers
32 views

Effective way to compare to arrays

What is the most cost effective way to compare to arrays eg. uint arrays in solidity. Running a for loop takes too much gas.
0
votes
3answers
209 views

Truffle compile command stuck at “Compiling your contracts…”

I developed a dapp using my PC (OS: Pop_OS!) and it was running fine. Then I had to format PC and installed new OS (Ubuntu 18.04 LTS), due to some issues in compatibility and performance.After that, I ...
0
votes
1answer
36 views

How do I access the properties of a contract xyz from an enclosing contract abc?

With respect to the following code: pragma solidity ^0.4.23; contract xyz { uint x = 0; function setX(uint pX) public { x = pX; } function getX() public view returns(uint){ ...
0
votes
3answers
108 views

Error in the truffle init command, quorum

i'm trying to truffle a project but each time it shows me this message, whereas, i'm sure i installed the truffle successfully. vagrant@ubuntu-xenial:~/quorum-examples$ cd project vagrant@ubuntu-...
0
votes
1answer
30 views

Get deployed contract details from Private network in all connected Peers

I have created one Ethereum private network and added two nodes inside that n/w. I have migrate one contract using truffle in that n/w from one node. Now I want to access that contract inside ...
0
votes
1answer
2k views

Cannot read property 'deployed' of undefined issue

I am trying to launch an Election-Dapp. I have these dependencies installed: - Nodejs v9.11.1 - npm v5.8.0 - Truffle v4.1.3 - web3js v0.2 - ganache-cli Below is my solidity contract pragma ...
0
votes
1answer
393 views

Problem updating truffle framework

I have problems updating truffle. I run the command "truffle --version" and i got truffle version 4.0.1 and solc version 0.4.18. So i wanted to upgrade to 4.1.6 which is the latest version. I run "...
0
votes
1answer
616 views

How to deploy a truffle built Dapp

I've completed my truffle Dapp, the contracts are deployed to the Ropsten test network and my web code talks nicely to them, it works great from http://localhost:8080/ when I do an npm run dev. I now ...
-1
votes
1answer
26 views

Truffle ganache error

I have this error~! Contract has not been deployed to detected network (network/artifact mismatch) Can you help me thank you!
-1
votes
1answer
100 views

Problem with the compilation in the truffle framework

I made a smart contract in Remix-Solidity IDE, when I compiled it I had no errors and I was able to remove the contract but when I tried to use the truffle for my Dapp and compiled it it showed me ...
-1
votes
1answer
63 views

I want to oraclize this smartcontract to get some output on a localhost. I am desperate what should i do?

pragma solidity ^0.4.17; import "installed_contracts/oraclize-api/contracts/usingOraclize.sol"; contract DevCoin is usingOraclize { mapping (address => uint256) public balances; event ...
-1
votes
1answer
72 views

I have deployed my contract using truffle but to see my accounts i am using web3 can any one explain what is going inside my contract while deploying

web3.eth.accounts [ '0x5aad8308d0c45d2b9fc1c465316ba071d2eb6f9c', '0x9d73990623df116eb56d300773aa458a11b11e4b', '0x1ea4dc6c3ab6d9ddca32083e3d5313ee319abd29', '...
-1
votes
1answer
344 views

Cannot deploy HelloWorld contract to my netowrk (testrpc)

ANSWER TO THIS QUESTION IS HERE : https://stackoverflow.com/questions/48044742/cannot-deploy-helloworld-contract-to-my-network-testrpc pardon my basic question, bud what else do i need to deploy my ...
-1
votes
1answer
341 views

how to withdraw ether from a ERC20 token contract Address

how to add withdraw function to get smart contract ether to my wallet https://github.com/rohitsahu21/Token-Sale
-1
votes
1answer
171 views

Value of msg.sender is not changing after specifying {from} in truffle

Given two contracts : contract First { function cSender() public view returns(address){ return msg.sender; } } contract Second { First f; function Second() public { f = new First(); ...
-2
votes
1answer
45 views

I had error when I ran truffle test call which I had followed the documentation of official truffle petshop documentation [closed]

chittiError: CompileError: Error parsing /Users/rahul/pet-shop-tutorial/test/TestAdoption.sol: ParsedContract.sol:10:1: ParserError: Expected pragma, import directive or contract/interface/library ...
-2
votes
1answer
107 views

ParserError compiling Smart Contract, what's wrong?

I'm getting this error when trying to compile a contract using cmd on windows: Error parsing C:/Users/alexa/Desktop/contracts/contracts/ApprovalContract.sol: ParsedContract.sol:6:37: ParserError: ...