Questions tagged [truffle]

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

556 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
1answer
572 views

Filtering on events of the entire blockchain not possible in testrpc via truffle

A contract I wrote has an event in its constructor. Since I want to find it back in the logs it doesn't seem possible to start listening to the latest block. Because the event is already 'fired' ...
7
votes
1answer
520 views

Truffle unbox drizzle not working properly

truffle version = 4.1.4 truffle unbox drizzle truffle compile truffle migrate npm run build npm run start this gets me this error: Truffle Drizzle-box fails with TypeError: (0 , _drizzle....
7
votes
2answers
2k views

Conversion of address to string in Solidity

The Solution given in Convert address to string did not help. Motive: To convert an address to string type so that I can use it as a parameter to a function for which string type is necessary. Code ...
7
votes
1answer
697 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....
5
votes
1answer
384 views

Truffle error “Don't set config.from directly”

I have parity running on my mac and I can start it with parity --rpcaddr 0.0.0.0 --rpcport 8547 --port 30305 --rpccorsdomain '*' --rpcapi "eth,net,web3" Once It's all sync'd up I then make a new ...
5
votes
0answers
167 views

Dapp Development using Truffle framework getting error

I am using truffle framework, which has pudding functionality. I have compiled the same contract on the both Dapps and deployed it on the one Dapp. Now i am trying to access it from another Dapp using ...
4
votes
0answers
42 views

What's the point of Truffle Migrations?

I've been reading a few articles and StackExchange posts (e.g. What are truffle migrations?) about Truffle Migrations, but I still don't get it: why do we need them? It seems they do only one thing (...
4
votes
1answer
163 views

Can't debug transactions that fail during the Web3.js estimateGas() call? No Tx Hash

NOTE: I am doing my work with the Ganache v1.2.2 GUI client on a Linux Ubuntu 18.04 station. There are many revert errors that happen during the estimateGas() call that precedes the actual Web3.js ...
4
votes
0answers
275 views

How to get Truffle to generate artifacts for contracts outside of project?

Say I have a contract MyToken.sol which has already been deployed to a public Ethereum network. Its source is maintained in an external repository and is included in my package.json file so that it ...
4
votes
0answers
294 views

Running a geth light client, how do I resolve the error: “No trusted canonical hash trie”?

I've been running a geth light client to deploy smart contracts through Truffle Migrations to mainnet. I'm getting: "Error: No trusted canonical hash trie". Any help in what this entails and how to ...
4
votes
1answer
276 views

Truffle hangs forever with parity with PoA

I'm trying to create a private chain using parity (PoA) and truffle but when I do truffle migrate it hangs forever with the following output: > [ > { > "jsonrpc": "2.0", &...
4
votes
1answer
350 views

Truffle test fails to call the base function, wants the override

I have an extended ERC20 contract with ERC827 functions, which are overrides of ERC20 with an extra callback parameter. I have these two pairs of base/override functions: Base: function ...
4
votes
0answers
672 views

Truffle migrate Error Invalid number of arguments to Solidity function

Truffle 4.0.1 I've got a contract declared "is Pausable" (OpenZeppelin framework) and I want to pause it as part of the deployment logic. I'm getting an error, however, when invoking pause() Error: ...
4
votes
0answers
511 views

How can I retrieve transaction hashes using web3 batch requests?

When I send a transaction using Truffle's contract wrappers - or using plain web3 sendTransaction() - I get a tx hash back that I can use to confirm the tx has completed. While using batch requests (...
4
votes
1answer
380 views

How long does it take to “save artifacts” to Ropsten?

Migrating contracts with Truffle I get stuck at Saving artifacts... Sometimes for 10 minutes or more. I also get: Error: Transaction 0x123...123 wasn't processed in 240 seconds! Is it normal that ...
4
votes
0answers
225 views

how to get revert at the previous timestamp of evm in testrpc

I am testing my contracts so at some point i need to increase the timestamp of evm that i achieve through evm_timeIncrease but now i want to execute some functions on the basis of current timestamp ...
4
votes
1answer
310 views

How do I get configuration variables (such as gasPrice) in a truffle test?

I learned from this answer that truffle configures gasPrice in truffle.js, defaulting to 100000000000. I'd like to use gasPrice in a test, without hardcoding the raw number. Is there any way to ...
4
votes
0answers
291 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 ...
4
votes
0answers
423 views

Deploying contracts on geth returns {“jsonrpc”:“2.0”,“error”:{“code”:-32600,“message”:“EOF”}}

I'm trying to connect geth with truffle to deploy my contracts to my testrpc. When I run truffle deploy it's running but when I do http://localhost:8545/ it's throwing {"jsonrpc":"2.0","error":{"...
3
votes
0answers
159 views

Installing Truffle without npm

I'm a student trying to install a truffle test RPC client (just for simple contract deployment in small scale). I am using a remote Ubuntu machine in my university, and i don't root privileges. ...
3
votes
0answers
136 views

Truffle test of two transactions during the same block

I'm trying to test a solidity function that only allows it to be called once per block. E.g. (my desired functionality): Tx1 calls Fn during block #100, and when successful sets a boolean flag for ...
3
votes
2answers
777 views

Truffle Compile with Solidity 0.5.0

I just upgraded my code to Solidity 0.5 and am trying to use the truffle framework with it. I did update my code in Remix and it does seem to work. The problem I have is that I am unable to compile ...
3
votes
0answers
51 views

Many Contract Testing strategies

I'm trying to wrap my brain around how to effectively test multi "projects" in Truffle, assume a simple ganache setup, also assume that these contracts seem to work, in remix, and in unit tests, but, ...
3
votes
0answers
347 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
3
votes
2answers
1k views

Invalid address error

I keep getting Error: Invalid address when trying to run the application. My current setup of web3 using infura node is if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } ...
3
votes
0answers
294 views

Testing solidity default function with Truffle and async/await

I am developing a crowd sale contract in solidity. The fallback function is payable so that investors can send ether to the contract. If incoming transaction is accepted then information about the ...
3
votes
0answers
69 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
3
votes
1answer
76 views

Non-specific error from truffle debugger

I am testing a contract which is using ecrecover function of solidity. While its testing when i go with a failed test case while debugging, it doesn't go step by step and at the end return the same ...
3
votes
0answers
259 views

Invalid JSON RPC response: {“id”:6,“jsonrpc”:“2.0”}

I'm following this tutorial https://medium.com/@ConsenSys/a-101-noob-intro-to-programming-smart-contracts-on-ethereum-695d15c1dab4 I have downloaded the code from github repo. I'm using ganache as ...
3
votes
1answer
476 views

Deploying on contract on main net - Error: insufficient funds for gas * price + value

Running geth v 1.7.3 truffle 4.0.5 truffle-config.js module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id ...
3
votes
0answers
306 views

Upgrading the truffle Migrations contract

In the standard truffle migrations contract the purpose of the upgrade function is upgrade the Migrations contract itself by copying the last_completed_migration of the old Migrations contract to the ...
3
votes
0answers
473 views

Contract not stored and out of gas in migration at Truffle ganache

I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and ...
3
votes
0answers
705 views

Sign transaction using truffle-contract

Is it possible to call contract methods protected with modifier like onlyOwner without access to the node with the keyfile using only private key? I know that I can create raw transaction and sign it ...
3
votes
0answers
261 views

Problem migrating contract using truffle. Unknow account message

I am trying to migrate a contract using truffle but I get a "Unknown account" message eventhough I tried various ways to unlock the account beforehand. Am I missing something? Any help really ...
3
votes
0answers
586 views

ParserError: Source “contracts/Token.sol” not found: File import callback not supported

I have problem when I use truffle test. I seperated files used in contract with Solidity framework and I can't compile my code(see below). When code is not seperated works fine. I tried reinstall ...
3
votes
0answers
134 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 ...
3
votes
0answers
349 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. ...
3
votes
0answers
106 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?
2
votes
1answer
49 views

How to trace the line where a tx failed in truffle tests?

I know about 0x's sol-compiler and sol-trace. I used them before and they do exactly what I'm looking for, but these modules bring significant overhead when used with truffle. Check out this file to ...
2
votes
1answer
29 views

Truffle: how to override compiler settings via the CLI?

This is a highly specific bottleneck encountered when using Truffle. In my normal truffle-config.js file, I have the optimizer enabled. I run a CI pipeline which has a coverage job. I use 0x/sol-...
2
votes
0answers
38 views

Truffle exec ETIMEDOUT

I'm running a batch script that would create up to hundreds of concurrent transactions and wait for their completion truffle exec scripts/....js --network rinkeby ... everything works but after ...
2
votes
0answers
71 views

Why truffle deploy fail with address value=0 after I upgrade to version 5.0.5?

I have a truffle 2_deploy_contracts.js something like this : const sample = artifacts.require('./Sample.sol'); module.exports = function(deployer) { deployer .then(()=>deployer.deploy(...
2
votes
1answer
355 views

How to debug transaction from truffle test on development network

I am trying to debug a failing solidity function, which I am calling from the JS test files with truffle. When I run my test, I am successfully able to get a transaction id. However, my solidity ...
2
votes
0answers
67 views

Function call always returns 0

Working with a simple contract to get the hang of this. I can't seem to get the correct value back from my contract function. It always outputs 0. Truffle version: 4.1.15 Contract: pragma solidity ...
2
votes
0answers
194 views

Error when I try to deploy with infura

Running migration: 1_initial_migration.js Deploying Migrations... ... 0x0ed88dd40f380a805ed0ba1b5b0a9d8178321ab6da9e5c0cb247f5700337b173 Migrations: 0xcfc4ba0488f20c7a2bb24e735f43e240bf249bc8 Saving ...
2
votes
0answers
87 views

web3: getPastEvents works in Truffle on instance, not in web3 script on page

I am looking to collect the previously logged events of a certain type using getPastEvents. It does not seem to work in my web3 script on my site but it does work in truffle console on a deployed ...
2
votes
0answers
45 views

Tracking Non-Deployer Transaction Gas Use In Truffle Migrate

In Truffle, gas used by a Migration in deployer.deploy() is tracked by a Reporter using events emitted by the Migration. If I have code of the form: deployer.deploy(MyContract) .then(instance =>...
2
votes
0answers
62 views

IntelliJ + truffle tests

I would like to run truffle tests from IntelliJ. I found a tutorial here: https://charterhouse.github.io/2017/05/12/running-truffle-unit-tests-in-intellij-idea.html Unfortunately, it does not seem ...
2
votes
0answers
45 views

Unable to send large transactions on ethereum private chain

I have a small contract pragma solidity ^0.4.17; contract A10test{ mapping(uint=>string) public data; uint public revisionNo=0; function setdata(string _data) public { data[revisionNo] = ...
2
votes
0answers
217 views

Transaction not mined error when deploying to quorum maker server

I get the following error when attempting to deploy my zeppelin erc20 token to a quorum server(used quorum maker). (master) $ node migrations/2_proj.js ``````` transactionHash ...