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.

0
votes
1answer
30 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 --...
1
vote
1answer
45 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
35 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
37 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
38 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
16 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
10 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
25 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
17 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
17 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
24 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
40 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
75 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
33 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
16 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
19 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
15 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
33 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
44 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
27 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
28 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
158 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
35 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
33 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
32 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
153 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
31 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
21 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 ...
1
vote
1answer
18 views

During gas-free transaction get an error “No relay responded! 4 attempted, 4 pinged”

I did all modification related to this instruction https://github.com/tabookey/tabookey-gasless However, when I'm trying to write some tests it fails and provides me the following error Error:...
0
votes
1answer
106 views

invalid number value (arg=“_goal”, coderType=“uint256”, value=2000000000000000000)

i am following a tutorial from here. And upon running truffle test. It produces following error. 2_HashnodeCrowdsale.js ====================== Deploying 'HashnodeCrowdsale' ------...
1
vote
1answer
70 views

Deploy new contract through another contract function in Truffle

I have a function in my contract minter.sol that creates another contract etnX.sol: function createNewContract(string memory name, string memory symbol, uint256 _maxSupply) public onlyOwner { ...
0
votes
0answers
25 views

Manage accounts in Remix Web3 Provider env connected to a TestRPC client node

When I run the TestRPC client (ganache-cli), it provides me with 10 different accounts and private keys along with a local server at localhost:8545 Available Accounts (0) ...
0
votes
0answers
13 views

Can ganache serve at a directory in addition to a port?

Using the ganache command line interface I can set a seed and a port: ganache-cli --seed 2048 --port 2020 Which serves to Listening on 127.0.0.1:2020 Can I get it to serve to a directory of my ...
0
votes
2answers
70 views

Can I automate the truffle (smart contracts) test scripts?

As we all aware about smart contract testing using truffle framework. Currently, we are writing the test scripts either in solidity or in java-script manually. Is there any way so that I can auto ...
0
votes
1answer
16 views

Error: sets the total supply upon deployment

Please help ! When i try to run test from truffle, i got this problem, here my test js code: var DappToken = artifacts.require("./DappToken.sol") contract(DappToken, function(accounts) { it ('...
1
vote
1answer
24 views

Return each struct value from a key inside a mapping, where the key is also a value from array inside another mapping

I have a project that I'm working on and I'm trying to figure out a way to do as the title says. I'm looking for the easiest and/or cheapest way(gas wise) and since I'm stuck I'm open to better ways ...
0
votes
1answer
21 views

This declaration shadows an existing declaration

When i try to run migration from truffle, i got this problem, here my contract code: pragma solidity ^0.5.0; contract DappToken { uint256 public totalSupply; function DappToken () public ...
1
vote
2answers
49 views

Truffle Ropsten Deployment Issues

I just made some updates to my contracts and tried to redeploy them - but I'm getting this message, over and over again. Its not even attempting any of the migrations - it just goes right to this ...
0
votes
0answers
10 views

Solidity: (why) is it considered an anti-pattern to inherit a contract in a truffle test?

There are some functions I'd like to expose on my contract but only for testing purposes. It seems reasonable to specify them with a visibility modifier of internal and have the test contract inherit ...
0
votes
1answer
19 views

How truffle share (is it?) the addresses of the previously deployed contracts between migrations files?

We have 2 migrations files (2,3) and in 2 we are deploying singletons contracts which later be used in the contracts we deploy on migrations file number 3. How Truffle pass the address of the ...
1
vote
3answers
121 views

Can't compile old solidity contracts(version 0.4.17)

I'm new with blockchain development. I'm working on an old project which use solidity 0.4.17 and truffle ^4.0.0-beta.2; These versions were in the package.json file of the project. When I installed ...
0
votes
0answers
24 views

Problem with Bonding Curve Contract from Relevant

I’m trying to get the relevant bonding curve contract to work. The only thing I changed is that I added an older compiler version in truffle config. compilers: { solc: { version: "^0.4.25", }...
0
votes
0answers
32 views

Oraclize: Truffle migrate failed

I'm trying to migrate a contract into a ganache chain. It needs to use Oraclize - in the end, the plan is to have a private chain using Oraclize via ethereum-bridge. However, truffle migrate fails ...
0
votes
1answer
61 views

deploying simple contract on quorum 7nodes example

I am trying to deploy contract with privateFor tag in migration and for set function same as shown in truffle quorum 7node example. started nodes with these commands ./raft-init.sh ./raft-start.sh ...
0
votes
3answers
56 views

Truffle and Remix compiles differently

I have a smart contract that outputs a different bytecode when compiled with truffle, and with remix, even though both seem to use the same compiler version: 0.5.7+commit.6da8b019 Is that a known ...
0
votes
0answers
30 views

How to send a value from interface to smart contract function

I have the below contract to create document details: pragma solidity ^0.5.0; contract Documents { struct Document { uint256 creationDate; uint32 documentCreationTimestamp; ...
1
vote
0answers
19 views

When does 'truffle deploy' yield a different output every time?

truffle deploy (aka truffle migrate) is documented here. I'm doing the following sequence: Starting a local Ganache node Running truffle deploy I'd expect this sequence to yield the exact same ...
0
votes
0answers
86 views

Truffle.js file is not created with truffle init command

I have run the truffle init command successfully with creating the following directories and files such as contracts, migrations, test, and truffle-config.js but the one file is missing as truffle.js? ...
0
votes
0answers
36 views

Smart contract hanging in react

I'm trying to make a call to my smart contract and write data to my blockchain, which is successful. However, after that completes I want to make an entry in a firebase database. The code appears to ...
2
votes
2answers
349 views

Error while migrating contracts to Ropsten using truffle - Error: legacy access request rate exceeded

I'm deploying some contract to Ropsten ethereum test network using Truffle but it gave me this error: Error: legacy access request rate exceeded I have no idea what does it means and what should I ...