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
75 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
0answers
100 views

Error “The contract code couldn't be stored, please check your gas amount” [duplicate]

UPDATE: I manage to figure out what's wrong is in this line var byteCode = compiledCode.contracts[':TestStorage'].***byteCode***; and it should be var byteCode = compiledCode.contracts[':...
0
votes
1answer
267 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
228 views

Cannot use Metamask with my smart contract

I am unable to call my smart contract in Metamask over Ganache. These were the steps I took: developed the contract tested it successfully using truffle test set up a Ganache network and migrated ...
0
votes
1answer
171 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
1answer
299 views

ganache-cli issue

Until I switched to ganache-cli from testrpc things were working fine. Now I ran testrpc and 10 accounts are displayed as shown below. But I am unable to deploy any contract. it is stuck after this- I ...
0
votes
2answers
85 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
175 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
1answer
713 views

React/Truffle: How to call a function with passing a variable?

I have a React component within which a web3js function queries numbers from Ethereum by using getNumber() function. I want to call another function called setNumber() that takes one uint256, by ...
0
votes
2answers
152 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
629 views

Error: Provider not set or invalid

I'm not able to connect metamask with nodejs. var Web3 = require('web3'); var web3 = new Web3(); if (typeof web3 !== 'undefined') { // Use Mist/MetaMask's provider web3 = new Web3(...
0
votes
1answer
45 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
684 views

Ganache with Metamask

Currently I'm using Ganache desktop application for ether transactions and I'm able to view transaction log details in it. But I need to connect it with metamask so that while an ether is transferred, ...
0
votes
1answer
338 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
3answers
864 views

Implementing a Simple Voting DApp on Ethereum Blockchain

I am new to Ethereum, Truffle and Solidity. I am looking for a good resource to get started on implementing a DApp for Voting on Ethereum Blockchain. Could you please point me to the correct resource? ...
0
votes
0answers
483 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
245 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
247 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
680 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
330 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
870 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
459 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
295 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
153 views

Solidity: Not able to call super function in trufffle test may be because of modifier defined

When I am testing my class with truffle test ./test/testinheritance.js I am getting an error. "Error: VM Exception while processing transaction: revert". It seems to be error related to the ...
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
331 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
1answer
899 views

installed truffle but cannot run commands on commandline [duplicate]

followed up from previous post I installed truffle however this is what I get PS C:\Users\user> npm install -g truffle C:\Users\user\AppData\Roaming\npm\truffle -> C:\Users\user\AppData\Roaming\...
0
votes
0answers
58 views

command line brings up code instead of running commands [duplicate]

I am trying to run truffle commands on commandline but it brings up the code file instead like this
0
votes
0answers
450 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
307 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
318 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
236 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
3answers
2k views

I can't run truffle commands in powershell Ise

I am looking around for questions similar to mine but basically I cannot run any truffle commands in the powershell Ise ONLY. I can make it run on the node.js command line. example: > PS C:\Users\...
0
votes
3answers
409 views

Can I avoid out of gas errors using testrpc

I am writing a proof of concept using truffle and testrpc and I have to spend hours optimizing the code to avoid out of gas errors. Is there a way to bypass this error or have a very high value. I ...
0
votes
1answer
204 views

Oraclize code not compiling using TRUFFLE COMPIL

I am trying to compile below mentioned code (taken from Oraclize documents) using TRUFFLE but am getting compilation error saying : 'Cannot parse one.sol: Unexpected token p in JSON at position 0'. ...
0
votes
1answer
148 views

Why is a state-modifying function working from Truffle console, but not when calling from web3?

I have a contract which offers two functions: 1) A state modifying function which takes two parameters 2) A constant function I have a web frontend in React calling these functions. When I call the ...
0
votes
1answer
292 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
2answers
442 views

How to call Base contract function externally when only Derived contract deployed

Base pragma solidity ^0.4.18; contract ZombieFactory { event NewZombie(uint zombieId, string name, uint dna); uint dnaDigits = 16; uint dnaModulus = 10 ** dnaDigits; struct Zombie ...
0
votes
1answer
183 views

Interacting with Contract Abstraction from file

In the official Truffle Docs over here, it is demonstrated how to interact with a deployed contract. So far, I've come across only the Truffle Console, which is everything but intuitive for larger ...
0
votes
1answer
730 views

How to deploy a contract with Truffle and MetaMask [duplicate]

How do I deploy a contract with MetaMask & truffle-contract? Currently if I want to deploy a contract with truffle-contract I'll have the following code. var web3 = new Web3(new Web3.providers....
0
votes
0answers
434 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
180 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
353 views

how can you deploy smart contracts on main ethereum network? [duplicate]

I have created a dapp and using truffle I have migrated and tested it on ganache, I was wondering how can I deploy same application on main ethereum network.
0
votes
2answers
247 views

Test pass with Remix but fails with Truffle

I have two contracts: ElephanteumStorage and ElephanteumCore. Storage just keeps some data. Core is provided to change the data in the Storage. As a constructor argument, ElephanteumCore receives ...
0
votes
2answers
128 views

After deployment, interaction with functions not giving desired output using Web3, Truffle

The set of contract-functions give expected behaviour when tested on Remix. But when the same functions are deployed on TestRPC using Truffle & Web3 and accessed using a Web Interface, it doesn't ...
0
votes
1answer
428 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
211 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
410 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
104 views

Problems running truffle [duplicate]

I am trying to follow a tutorial to deploy a smart contrat on Ropsten Testnet. I am in part 4. Deploy the contract to Ropsten test network: https://medium.com/@mvmurthy/full-stack-hello-world-voting-...