Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [truffle]

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

3
votes
1answer
5k views

Account is locked, after running Truffle migrate command [duplicate]

I am new to this technology and I am trying to Deploy the contract to Ropsten test network. I have my geth running in one terminal. In my truffle console I have an account with some ether. I unlock it,...
1
vote
2answers
703 views

Compile errors on sample project in Truffle 3.0.2

I tried to compile some smart contracts in truffle 3.0.2 (which works without problems in browser solidity and even older versions of truffle) and got compile errors. So I created a sample truffle ...
2
votes
1answer
417 views

How to display the result returned from Oraclize's _callback function in dapp frontend?

I am using testrpc as client and truffle as development framework.And also using ethereum-bridge for Oraclize. This is the contract code.I have downloaded the 'Oraclize API' (oraclizeAPI_0.4.sol)from ...
1
vote
1answer
777 views

I want to use crypto-js module in truffle / app.js

I want to use npm module "crypto-js" in app.js of truffle_project. But I can't use it. app.js: var CryptoJS = require("crypto-js"); // ... I build app, then I open build/index.html by browser, I ...
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'...
1
vote
1answer
652 views

How to run contracts with 'Oraclize' using truffle?

This is the contract code.I have downloaded the 'Oraclize API' (oraclizeAPI_0.4.sol)from the Oraclize github repo.I have added this file to the truffle contracts folder, and rename the file to ...
1
vote
1answer
520 views

Function calling constructor of another contract seems to silently fail

Ok so I am trying to initialize a new contract. From what I understand, creating this contract will only return a transaction hash. So I'm trying to access the new contract from data structures in the ...
0
votes
1answer
322 views

A promise was created in a handler but was not returned from it

Hey I'm new to javascript promises. I am getting several errors stating a promise is created but not returned. How do you return from a promise?
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 ...
6
votes
2answers
3k views

Creating contracts via new doesn't work

According to the official doc, a contract can create a new contract using the new keyword. But it does not work when I test the code from this post. My dev environment is truffle 2.1.1 and testrpc (or ...
3
votes
1answer
473 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
0answers
307 views

Truffle overwrite MetaMask web3 wrong msg.sender address

Considering this contract : pragma solidity ^0.4.7; contract Test { function Test() { // constructor } function getMsgSender() constant returns (address account) { ...
1
vote
1answer
444 views

Truffle serve not finding css and javascript files

the directory is getting served wrong in truffle and I can't figure out where to change it.... The terminal response is... Couldn't find file at .//app/app.js. My build file....... module.exports =...
6
votes
3answers
7k views

What is the correct way to access public variable from contract in Truffle: then or standard callback?

There are some similar posts to this but none seem to be able to solve my problem. I have a contract deployed with Truffle running with testrpc. I want to access the value of a public uint variable ...
3
votes
1answer
1k views

How would you integrate an Angular 2 CLI frontend project with a Truffle 2 project?

I'm using Angular 2, with TypeScript, Webpack and all that on my main projects, so every time I have to go back to a Truffle project using AngularJS 1.x, a kitten dies and my head hurts a little. How ...
21
votes
2answers
5k views

Oracle (oraclize.it) with Truffle and Testrpc

As I understood in the blockchain, it is "not" possible to interact with webservices outside the blockchain. This must be done over oracles in order to verfiy that the request is secure, and the state ...
5
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 ...
3
votes
1answer
1k views

Preset testRPC account balances not showing up in Solidity contract mapping, during truffle console session

I notice that preset balances in testrpc, like this: unix$ testrpc --account="privKey1,balance1" --account="privKey2,balance2" ... don't get passed to this Solidity data structure: mapping(address =...
1
vote
1answer
167 views

Ethereum Contract Issue

I have written a contract Transfer and the functions defined in the contract Transfer is used in another contract SecondTransfer.I have defined a constructor in the contract Transfer and initialized ...
4
votes
1answer
370 views

Watching events defined in libraries

Is it possible to watch for event triggers when the actual event and trigger is defined in a library? I get no console output with the following code library ObjectHistoryLib { event ...
3
votes
1answer
3k views

How to find out the value using call() method in truffle and testrpc?

pragma solidity ^0.4.2; contract Transfer { address public owner; mapping (address => uint) balances; // constructor ...
3
votes
2answers
453 views

Where does web3 come from?

I used Truffle to setup a basic example dapp, which includes a frontend javascript file in which I see the following lines: window.onload = function() { web3.eth.getAccounts(function(err, accs) { ...
5
votes
1answer
2k views

Getting new BigNumber() not a number: [object, object] error

I am getting a BigNumber() error from the standard token function balanceOf(). The function returns uint256, but it seems like it's returning an array of objects. Here is my javascript testing in ...
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?
1
vote
0answers
322 views

How to send message to an address using solidity contract + truffle

Here is the link to my code: https://github.com/nandinicbit1981/hello-truffle The problem with this is: If I am sending a message: Hello World, I am getting the input field in the mined transaction ...
3
votes
0answers
100 views

Ethereum pudding transaction hash

Is it possible to get the transaction hash of a function call in Ethereum Pudding/ Truffle?. It seems that it works straight forward with web3 but Pudding is hiding it?
1
vote
1answer
1k views

How to migrate a contract that has a constructor parameter of address type via truffle

as the official simple of solidity contract SimpleAuction { … function SimpleAuction(uint _biddingTime, address _beneficiary) { beneficiary = _beneficiary; auctionStart = now; ...
1
vote
1answer
423 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 { ...
11
votes
2answers
4k views

How to pass constructor parameters to a contract using Truffle?

I am using testrpc and truffle for deploying contracts.I want to pass constructor parameters while deploying. contract User { string public userName; function User(string ...
2
votes
0answers
634 views

reference a deployed contract in truffle or node.js

I have a previously deployed contract on my PRIVATE-NET which I know its address. Now I am using truffle. How do I reference this contract in truffle console using its address? I looked through web3....
6
votes
1answer
666 views

Problem with start() in web3-provider-engine

While trying to connect to a provider(infura) I get the above error below is the full stack trace: bundle.js:54318 Uncaught TypeError: this.provider.sendAsync is not a function at Web3Subprovider....
1
vote
1answer
1k views

Setting up private network w Geth, can't unlock account and deploy contracts

I have set up a private network with Geth with the following command: geth --datadir="PathToDatadir" --mine -minerthreads 2 -verbosity 3 -maxpeers 5 --ipcapi "admin,debug,eth,miner,net,personal,shh,...
3
votes
3answers
457 views

Contract inheritance? Need some help to understand certain things

I'm using testrpc, and truffle. I created a simple token as seen in many tutorials which shall be used to buy or enable certain actions when clicking a button on an UI. contract MyToken { mapping ...
5
votes
1answer
2k views

Accessing struct fields in Web3 returned by a promise in Truffle

I'm using web3js (via Truffle) to make a call to a contract, to access a struct in a mapping. mapping (bytes32 => entry) public entries; struct entry { Mode status; Deed deed; uint ...
4
votes
1answer
590 views

Out of gas exception: error when using GUI/JS but not within truffle

I'm trying something with Ethereum and my current testing environment is Truffle. In the smart contract I have a struct with 5 fields (bytes32, bytes32, bytes32, address, bool). If a call a function (...
1
vote
1answer
1k views

How to send Metacoins to other accounts with truffle console and testrpc local blockchain?

Playing around with the default project provided by truffle. I compiled the contracts with truffle compile.Then deployed with truffle migrate and after that switched to the console via truffle console....
3
votes
1answer
291 views

Using eth-lightwallet and truffle

I've tested with accounts created and unlocked in geth and my sample app works fine. I'm now going distributed with my accounts and have added eth-lightwallet and HookedWeb3Provider to put the account ...
6
votes
2answers
635 views

Events being fired twice

Given a function and a event in a contract: event OtherCreated(address other, address addr1, address addr2); function doSomething(address addr1, address addr2){ if(aBool == true){ ...
1
vote
1answer
115 views

testrpc throwing error “This has not yet been implemented”

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. Could you please help me. Thanks, ERROR:jsonrpc.manager:API Exception: {'...
1
vote
2answers
250 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
2answers
808 views

truffle account lock

I was trying to deploy the default truffle project following this guide: https://steemit.com/ethereum/@brennanhm/ethereum-smart-contract-testing-installing-truffle-and-testrpc I am running the sample ...
1
vote
1answer
204 views

Error : BlockGasLimitReached: <Transaction(45f6)>: 'gaslimit' actual:4712388 target:3141592

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. I even tried to manually set the gas_limit variable in tester.py to ...
13
votes
2answers
5k views

Truffle Migrations Account Locked Error with --network command

I have started a private blockchain using the command, geth --networkid 1337 --datadir ~/home/xyz/testnet --ipcpath /home/xyz/.ethereum/geth.ipc --rpc --rpcapi eth,web3 --rpcport 8545 --rpcaddr ...
4
votes
1answer
226 views

TestRPC - Pythereum - No handlers could be found for logger “jsonrpc.manager”

I am trying to get the standard init tests to work but I am getting the subject error. could you please help me to resolve this. Thanks, TestRPC/0.8.7/linux2/python2.7.12 Available Accounts ...
2
votes
1answer
243 views

In javascript, what does the line var meta = MetaCoin.deployed(); mean and what does it return?

I am following the official Truffle docs to create a Dapp and am reviewing the code. I am repeatedly seeing the line var meta = MetaCoin.deployed(); What is the deployed function? What does it ...
3
votes
0answers
325 views

Using Truffle with Ethercamp Ethereum Studio

I'm trying to use the Truffle development environment inside of EtherCamp Ethereum Studio. My main reference is this issue in the Truffle issue tracker. It suggests using eth-lightwallet and hooked-...
1
vote
0answers
730 views

Web3 sending transaction fails, works in truffle console

Developing an application which relies on a blockchain. Have test chain running with help of testrpc and I'm using truffle to compile and deploy contracts. This way I've created some contracts and ...
8
votes
1answer
527 views

What is the most correct way to test modifiers?

As per the title, which testing method is most correct for modifiers? Something like testing via inheritance and creating a function specifically designed to test modifiers or testing via a framework ...
3
votes
1answer
148 views

Different return value Truffle & online compiler

Using the online solidity compiler startGame() returns false, but using truffle this function returns a long hex string: 0xf697bd4ff4f5574f3cf73cd46a18087a5a0cf1aa1580fd4992ab20f574a808fe function ...
9
votes
1answer
489 views

Configure Truffle Compiler: Default Import Folder

I want to use an external library. I guess it is good to load the library in production from a CDN because this requires less space and should be faster. import "github.com/Arachnid/solidity-...