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.

1
vote
1answer
14 views

How does a Truffle migration know the address of a contract before it is created?

How does the truffle migration of this contract know what the address is of the registry contract, in the constructor: https://github.com/marbleprotocol/humanity/blob/master/contracts/Humanity.sol ...
1
vote
1answer
14 views

Getting the transaction hash on function call

I am new to Solidity, Web3, and Ethereum. I am trying to build a web application through which users can upload a file to IPFS, then store the IPFS hash in the blockchain. I am using the React truffle ...
0
votes
1answer
30 views

How do I overcome the problem of gas limit?

Here is my genesis.json file { "config": { "chainId": 1994, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0 }, "...
-2
votes
0answers
19 views

Why do I get this error when I type “truffle migrate”?

I made a smart contract and then while I am trying to deploy it I find this. Here is the exact output I am getting. I have already made changes in the truffle-config.js file. Compiling your contracts....
0
votes
1answer
11 views

How we can integrate truffle with Jenkins?

is it possible to add truffle on Jenkins pipeline?
0
votes
0answers
32 views

I can not make a transaction in the system Blockchain [on hold]

I am studying blockchain, found a project on github. Make all the necessary settings, the project launched, but I can not make a transaction when adding data to the system. The project is under the ...
0
votes
1answer
11 views

Why Could not find artifacts for contract from any sources

I am using windows 10 with truffle and ganache-cli. I have 2 contracts file to be deployed contain interfaces of other contracts defined within the contract: Contracts: ERC721Mintable.sol Ownable ...
0
votes
0answers
29 views

Web3 Cannot read property 'apply' of undefined

I'm new to dapp and trying to follow iwaldman to build an ipfs-image-dapp. Here is the repo: https://github.com/iwaldman/ipfs-image-dapp. But running yarn start gives the error Cannot read property '...
0
votes
1answer
15 views

truffle testing enum

I am trying to test an enum value from a test. This is simplified version of the contract: pragma solidity >=0.5.0 <0.7.0; contract Foo { enum State { StateA, StateB } State ...
0
votes
1answer
11 views

Quorum 7nodes example unable to finish simplestorage migration using privateFor

I'm following this example: truffle quorum example I created a cluster using docker-compose and all the nodes are up and running but when I run the truffle migrate command the migration doesn't end ...
0
votes
3answers
26 views

Solidity Compatibility Configuration

I am a cyber security analyst who is new to ethereum and working on a project to study crypto security. It's a series of 22 vulnerable smart contracts that you're supposed to exploit. For anyone who ...
1
vote
1answer
23 views

truffle unbox react - front end is unable to read / set state of the contract

I am experiencing problems with the Truffle React boilerplate code that the front end is unable to read / set state of the contract. Here are the details: I unboxed the React boilerplate using ...
-2
votes
0answers
8 views

truflle consile error BN { negative: 0, words: [ 0, <1 empty item> ], length: 1, red: null [on hold]

i was getting error in truffle console BN { negative: 0, words: [ 0, <1 empty item> ], length: 1, red: null
1
vote
0answers
38 views

openzeppelin,VM Exception while processing transaction: revert

using openzeppelin-solidity to create crowdsale. Then I use this statement to Buy Token: MyCrowdsaleInstance.sendTransaction({ from: purchaser[1], value: web3.utils.toWei("0.5", "ether"), ...
3
votes
1answer
29 views

Ganache + Truffle: how to deploy a contract without considering the gas

I am working with Ganache and Truffle. I am trying to deploy kind of a huge smart contract, but most of the functions in this smart contract are pre-prod functions, so I do not really worry about real-...
0
votes
0answers
14 views

Contract has no network id set, cannot lookup artifact data

I am using web3 v1.0.0-beta.37 and truffle contract for server.js configuration. I have defined two contracts FlightSuretyData.sol and FlightSuretyApp.sol FlightSuretyApp contract access functions ...
0
votes
0answers
26 views

Error : Could not connect to your Ethereum client with the following parameters:

Im creating my dapp with following below tutorial. http://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial however Im facing an error when I run truffle console it shows >...
0
votes
2answers
25 views

Load accounts to truffle

I'm using truffle v5.0.14 to handle my contracts. All was well while developing with ganache, but when I wanted to deploy to the real network (a private one) I have problems with the account. The ...
0
votes
0answers
17 views

truffle-assertions: TypeError: Cannot read property 'filter' of undefined

There is a part of my Solidity code: event elo(address pAddress); function test() external { emit elo(m_Registry); } And a chunk of my test: const truffleAssert = require('truffle-...
0
votes
0answers
15 views

Error occurs when I attempt to run `npm install drizzle` (Truffle product)

I am having an issue using Drizzle. When I run the command npm install drizzle I get the following error: How can I fix this?
1
vote
2answers
22 views

How do I determine the network within a truffle exec script?

I'm writing a script to be executed with truffle exec and I need to add some logic conditional on the network we're calling truffle exec with. This is (roughly) what I want in my script: const ...
0
votes
1answer
44 views

problem of call() returns null

contract permission{ struct transaction { address payable sender; address receiver; string datatype; Status status; } function getTransactionCount() public view ...
0
votes
1answer
19 views

Truffle migrations - UNABLE TO MIGRATE (Error: Deployment Failed)

The compilations goes well on the Rinkeby testnet using the command geth --rinkeby --rpc --rpcapi="personal,eth,network,web3,net" --ipcpath "~/Library/Ethereum/geth.ipc" --syncmode light --cache 64 --...
0
votes
1answer
31 views

A single exception in Truffle test causes every other test cases to fail

I'm making test script for my contract and it looks likes contract('...', async () => { let token = null; before('deploy', async () => { token = await MyContract.new(...); })...
0
votes
2answers
21 views

How to deploy truffle project on web server?

I've developed a DApp using truffle suite and now I want to deploy this dapp online so that everyone will be able to access it over the internet. I've used Rinkeby-Testnet for smart contract ...
0
votes
1answer
29 views

passing variables between different contract by solidity (0.5.0+ version)

I writed ERC20 contract and ICO contract for a test , but I meet a lot problem with compile problem. My ERC20 contract have own constructor but,I also need a ICO contract(a control)for passing ...
1
vote
1answer
31 views

Which network does truffle use for testing?

I have a network 'foo' that is configured inside truffle.js. Running my tests works just fine truffle test --network foo ./test/*.js then I realized I forgot to start 'foo'. To confirm this running ...
0
votes
0answers
15 views

Deploying multiple instances of contract, no error but no deployment

I am trying to deploy the same contract code to create multiple instance: const contract = require('truffle-contract') var Greeter3 = artifacts.require("Greeter3"); module.exports = function(...
0
votes
0answers
7 views

How to use cacheSend of drizzle library when the method needs two parameters

Should it be like the example below(2,2 as two different parametres) Ex: const stackId = drizzle.contracts.SimpleStorage.methods.set.cacheSend(2,2, {from: '0x3f...'})
0
votes
0answers
20 views

Geth - blockchain remains on genesis block, miner node doesn't mine

When attempting setup a local private PoW blockchain, an issue is arising where instead of mining new blocks, Geth instead hangs on the first attempt to 'commit new mining work'. Between the two geth ...
1
vote
1answer
15 views

Notation in npm solidity-coverage tests

I had been using the npm package solidity-coverage and while reading the coverage reports I came up with this E symbol. I am not sure what it means and there is no explanation in the documentation as ...
1
vote
1answer
15 views

How to pass account address to truffle deployer?

How do I pass my account address to the contract constructor while deploying with truffle migration? I want to pass address into MyAdress like below. deployer.deploy(MyContract, MyAddress) My ...
0
votes
1answer
18 views

I keep getting the error: “Uncaught (in promise) Error: Invalid number of arguments to Solidity function”

I have tested it in remix and the function does work, I also removed inputs just for testing purposes but it seems that it doesn't work anyway. Here is the function: struct Message{ string ...
0
votes
0answers
35 views

How to call A child Contract function in web3js?

Hey I am new at blockchain development and I need to make contract name organization that create sessions contracts. I had already implemented the solidity code but I have a problem in front-end ...
1
vote
1answer
42 views

My Solidity files are not compiling and I am getting constant error

I'm new to blockchain and I'm following a tutorial. However, I'm getting problem compiling my first contract on Truffle. Here's my code : pragma solidity ^ 0.5.2; contract ApprovalContract { ...
0
votes
0answers
30 views

How do I set constant state variables in source code before migrating to a test network?

Is there a way to change the value of address literals in solidity source code before migrating to a local test chain using Truffle? Currently, if a contract A needs to know the address of another ...
2
votes
1answer
14 views

Truffle: provide a different config file name via the CLI?

I've read through the Truffle docs on configuration, but I haven't found the option of providing a different file name other than truffle-config.js or truffle.js. In my case, I need multiple files ...
2
votes
1answer
17 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-...
0
votes
0answers
14 views

Supporting multiple HDwallets with truffle/drizzle

I have a dapp using truffle/ drizzle that implements regular user auth format (Login, id, tokn, etc). If I wanted to support each user having access to their own hd wallet, how would I do that with ...
0
votes
0answers
32 views

why .call() in Truffle did not return results as expected?

I'm deploying a contract to my private chain and try to call the contract's function. After I got in the geth console and finished deploy contract, I called the function but it doesn't work ...
0
votes
1answer
34 views

TypeError: tokenInstance.balanceOf is not a function

It happen when use truffle test, here my contract file: pragma solidity ^0.5.0; import "./DappToken.sol"; contract DappTokenSale { address payable admin; DappToken public tokenContract; ...
0
votes
1answer
21 views

tokenInstance.balanceOf is not a function [duplicate]

It happen when use truffle test, and here my DappTokenSale file: var DappToken = artifacts.require('./DappToken.sol'); var DappTokenSale = artifacts.require('./DappTokenSale.sol'); contract('...
0
votes
1answer
23 views

ReferenceError: admin is not defined

It happen when use truffle test, here my contract file: pragma solidity ^0.5.0; import "./DappToken.sol"; contract DappTokenSale { address payable admin; DappToken public tokenContract; ...
1
vote
0answers
96 views

Error: Returned values aren't valid, did it run Out of Gas?

I got this problem when follow the instruction, here my two contract: 1) token sale contract: pragma solidity ^0.5.0; import "./DappToken.sol"; contract DappTokenSale { address payable admin;...
0
votes
1answer
30 views

Operator == not compatible with type unit256 and address // TypeError: Invalid type for argument in function call

I got 2 problem when i follow instruction. Here my contract file: pragma solidity ^0.5.0; import "./DappToken.sol"; contract DappTokenSale { address admin; DappToken public tokenContract; ...
1
vote
1answer
29 views

Struct member access in web3 requires additional dummy field

If a struct contains a single field, then that field is inaccessible from web3. In the below example, field uint b must also be present in order to access field uint c from web3. Of course, it's not ...
0
votes
1answer
31 views

Create a large number of contracts with different addresses

I'm developing a performance test where I check the time a gateway spends to find a contract in a blockchain. I'm using ganache-cli to simulate the blockchain, my doubts are: 1) Is it possible to ...
0
votes
1answer
80 views

Invalid number of parameters for “undefine”. Got 0 expected 1!

I start my trial token sale contract, but it keep pop out this error when i test it with truffle. Here my token sale contract: pragma solidity ^0.5.0; import "./DappToken.sol"; contract ...
0
votes
1answer
27 views

Accessing one smart contract contained in another smart contract from javascript

I'm cross-posting this from Stack Overflow, since there seems to be more activity here. I am trying to develop a dApp with Truffle and want to test my smart contract. The contract contains a second ...
1
vote
1answer
14 views

Can ganache-cli connects to another ganache-cli?

Is it possible to create a private network using ganache-cli? Can a ganache-cli running on port 8545 connect to ganache-cli running on port 9545? Can we use ganache-cli as a node? Or it is a ...