Questions tagged [truffle]

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

557 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
72 views

Contract testing works in solidity but fails in truffle - testrpc

I have a contract like this: PublishService.sol, the strings.sol is taken from here. pragma solidity ^0.4.0; import "./strings.sol"; contract PublishService { using strings for *; struct ...
0
votes
1answer
263 views

I tried to deploy a contract on Ropsten, but always get the following error

PS D:\nodejs\rff\metacoin> truffle --network ropsten migrate Using network 'ropsten'. Running migration: 1_initial_migration.js Deploying Migrations... Error encountered, bailing. Network state ...
0
votes
1answer
167 views

Why does the transaction stay in queue from more than 240 second

I am running quorum nodes via the Quorum-maker script, and when trying to call functions from my already deployed smart contract, I get this error : Transaction ...
0
votes
2answers
75 views

Having trouble figuring out Truffle testing with Javascript

I've started unit testing my contracts with Truffle (using Javascript). I'm fairly new to Truffle and Mocha both, and while I've tried to follow the tutorials, I'm struggling to follow exactly what's ...
0
votes
2answers
166 views

Empty bytes32[] in truffle console

I am trying to get from truffle develop console an array of identifiers using a custom get function but the return array is []. Here is my contract: pragma solidity ^0.4.18; contract MyInfo { ...
0
votes
2answers
148 views

Drizzle component returns BigNumber

I am using the following Drizzle (Truffle) component to call a function from a smart contract: <ContractData contract="Market" method="priceOf" methodArgs={this.props.id}/> The result is a ...
0
votes
1answer
43 views

problem with sequence deployment

I followed this way of deploying contracts using truffle. // Deploy A, then deploy B, passing in A's newly deployed address deployer.deploy(A).then(function() { return deployer.deploy(B, A.address)...
0
votes
1answer
328 views

Deploying new contract inside truffle test case

I was trying to transact between two contracts inside my truffle test case. But not been able to do it. The second contract instance comes back undefined always. As per the truffle documentation, ...
0
votes
0answers
475 views

Contract has not been deployed to detected network when deploying to main net

I'm trying to deploy a smart contract to the main Ethereum network, and I'm having trouble actually getting my front-end to work. I'm using Truffle, Geth, Infura, and web3js. var HDWalletProvider = ...
0
votes
1answer
242 views

Error: The contract code couldn't be stored, please check your gas amount during deploy

I know this issue was discussed before several times, but I cant get the solution to my problem. I'm trying to deploy a contract with Truffle on Ganache. During the deployment in 2_deploy_contracts....
0
votes
1answer
159 views

The contract code couldn't be stored, please check your gas amount while deploying contract

I'm trying to deploy 3 contract in 2_deploy_contract (I deploy all 3) but after the first is deployed I get the following error : The contract code couldn't be stored, please check your gas amount.
0
votes
1answer
245 views

Truffle “Replacing” durring migration

what does "Replacing" mean in migration? a simple test contract C.sol: pragma solidity ^0.4.17; contract C{ uint public ConstructorUint; function C(uint SetConstructorUint)public{ ...
0
votes
1answer
674 views

Out of gas on truffle test

I am following the tutorial on http://truffleframework.com/tutorials/pet-shop I am using Ganache for testing, where i am also deploying the tutorial contract. 1) TestAdoption "before all" hook: ...
0
votes
1answer
324 views

Passing command-line arguments to 'truffle test'

I have a JS script which I pass to truffle test from command line: truffle test my_script.js I would like this script to take an input argument (retrieved via process.argv[2]). Does `truffle ...
0
votes
1answer
868 views

Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: VM Exception while processing transaction: revert

Googled around and nothing could solve this error. truffle migrate --network development Using network 'development'. Running migration: 2_deploy_contracts.js 1520374082 1522102082 1000 '...
0
votes
1answer
432 views

problem starting ganache

I'm using truffle with ganache GUI. It worked fine at first, but now I am unable to start it. (I made it executable) When I run ./ganache.AppImage I get this message: installed: X-AppImage-BuildId=...
0
votes
1answer
283 views

Can I find constructor arguments from truffle artifact?

I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they ...
0
votes
1answer
187 views

Loading truffle library in remix browser IDE

Besides writing smart contracts in the browser, I would also like to write my test in this IDE. Any suggestions how to load the truffle files in http://remix.ethereum.org? I appreciate your help!
0
votes
2answers
330 views

how to debugg truffle tests with built in debugger

So I'd like to use the commandline debugger in truffle. To test I simply run truffle test I have an empty truffle.js file. I can get my transaction ID in the javascript tests. When I run: ...
0
votes
0answers
411 views

Running Npm init on powershell but its stuck and I can't proceed

I can't run truffle commands on windows powershell so I went to do the steps that I got here. However npm init got me stuck and I can't proceed: Here is the stuck screen: EDIT: After I uninstalled ...
0
votes
1answer
300 views

Truffle test: error when passing more than one file as input

I have several test files, which I can successfully execute via truffle test (having started a ganache-cli process). For example: ganache-cli truffle test test/test1.js truffle test test/test2.js ...
0
votes
1answer
315 views

How can i connect external AWS server's truffle in browser?

I have deployed geth, truffle, testrpc whichever needed in live AWS server. All the configurations are working properly. I have initiated 'truffle develop' and 'npm run dev'. Both are working fine. ...
0
votes
0answers
230 views

How can I write a test that fails a “requires(…)” in Solidity?

If calling a function in a contract would result in a failed require the whole test passes, even if the asserts are incorrect. This is extremely confusing. Look at the simple example below, which ...
0
votes
1answer
288 views

Comparing msg.value using javascript test always fails

So I have this solidity function: function claimGoodTest(uint256 typeId) public payable { if (msg.value < 4000) revert(); } I test it with the following: var result = await contract....
0
votes
0answers
432 views

Add accounts to truffle test environment at run time

I would like to add the keys and unlock some additional addresses at runtime for my truffle tests. Why? I have the need to create address from a seed generated elsewhere in my test so the private ...
0
votes
2answers
176 views

Program for interacting with deployed contracts via a GUI?

So I've deployed a contract to Rinkbey using truffle, and now I'd like to play with it. I'd like something that builds a GUI for me from the ABI like EthFiddle does. I just want something that lists ...
0
votes
1answer
419 views

Running A Smart Contract With Two Nodes on Truffle

We have installed truffle to two nodes and we initialize our private blockchain with: $geth --datadir node init genesis.json Then we run geth on both nodes with: $geth --datadir node --nodiscover -...
0
votes
1answer
210 views

Trouble while installing truffle-contract module

When I run the command sudo npm install truffle-contract it gives me this error: npm ERR! code 1 npm ERR! Command failed: /usr/bin/git clone -q https://github.com/debris/bignumber.js.git /home/ubuntu/...
0
votes
1answer
404 views

Empty/null address handling in truffle pet shop tutorial

I am trying out the Truffle Pet Shop tutorial and it seems to be working all well except for a small issue. My solidity function getAdopters() returns an address[16] function getAdopters() public ...
0
votes
1answer
55 views

Unable to change the length of a global 2D storage array

I am facing difficulties changing the length of a global 2D storage array. It seems to be working correctly on Remix IDE, but when I try to test it on ganache-cli (formerly known as testrpc) - either ...
0
votes
1answer
96 views

Truffle testing not reading contract

Here's my solidity: contract Oracle { mapping(uint => uint) oracle_values; modifier onlyOwner { require(msg.sender == owner); _; } function Oracle() public { owner = msg....
0
votes
0answers
421 views

Truffle: errors when I try to access variables of a ERC20 token contract

I got a few errors when I try to access variables of a ERC20 token contract. The contract is the "Sample fixed supply token contract" from https://theethereum.wiki/w/index.php/ERC20_Token_Standard ...
0
votes
1answer
148 views

Deploying with Truffle

I deployed a contract through remix and then I run the following code MyContract.deployed() .then(instance => { c = instance; return c.getCreator(); }) .then(result => { ...
0
votes
1answer
373 views

Error: Invalid address

I keep encountering an error saying invalid address. Why is this? const Web3 = require('web3'); const contract = require('truffle-contract'); const MyContract = require('../build/contracts/...
0
votes
1answer
60 views

When closing node (geth ropsten) I cannot save created accounts

I am pretty new to this. I downloaded the ropsten blockchain using a geth command line. Then, using Truffle, I created an account, but when I closed my node (ctrl - c on the geth command line) and ...
0
votes
0answers
169 views

Log data along with transactions on the blockchain

I have a smart contract and on my web interface I'd like to display the 5 latest transactions. Currently these include any ether being sent to my contract which are retrieved using web3.eth....
0
votes
1answer
340 views

Truffle testrpc - public variable getter method error

I'm running into a weird issue where I couldn't retrieve the value of a public variable in truffle console. It's a public variable used as a counter to track the number of records added. I spent ...
0
votes
0answers
26 views

What's the best way to monitor contract variables whilst developing?

I'm running a contract locally using Truffle, is there a way I can keep track of the variables in real-time whilst interacting with it on the front-end (Web3). I guess what I'm looking for here is ...
0
votes
1answer
423 views

Accessing Web3 in trufflebox's react-auth-box

Hi I am using trufflebox boilerplate react-auth-box. Created a new component called Foo where I am trying to access the web3 object that has been mapped from Store to this.props. However the console....
0
votes
0answers
200 views

Why does truffle console not start?

Trying to follow the tutorial on Medium, I would like to open the truffle console (Ubuntu 16.04). I get the following output: mzh@021-voting $ truffle console Error: Invalid JSON RPC response: "" ...
0
votes
2answers
399 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
0answers
220 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
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
201 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
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
1answer
464 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
3answers
239 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
37 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
110 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-...