New answers tagged

0

I'm sure an answer is no longer needed for this, but in case anyone else has the same problem, --networks should be --network.


1

I prefer this syntax: module.exports = function(deployer, network, accounts) { deployer.then(async () => { await deployer.deploy(A); await deployer.deploy(B, A.address); //... }); }; since it's way more readable when you have lots of contracts. See also: https://github.com/trufflesuite/truffle/issues/501#issuecomment-...


0

In the migrations directory you have to reference the deployments for any new contracts. In this case that is the file 2_deploy_contracts.js: var ProofOfExistence1 = artifacts.require('./ProofOfExistence1.sol'); var ProofOfExistence2 = artifacts.require('./ProofOfExistence2.sol'); module.exports = function(deployer) { deployer.deploy(ProofOfExistence1)...


0

I was using ganache-cli, which listens on port 8545, the solution was to update the truffle-config.js file accordingly: module.exports = { // Uncommenting the defaults below // provides for an easier quick-start with Ganache. // You can also follow this format for other networks; // see <http://truffleframework.com/docs/advanced/configuration>...


0

When working with Truffle v5.0.39, the above-mentioned syntax is not valid. If the contract's constructor has arguments, the deploy function has to provide the arguments like this: deployer.deploy( myContract, arg1, arg2, ...); So, for example, if your constructor takes two addresses: deployer.deploy(towater, "0x15458ef540ade6068dfe2f44e8fa733c", "...


0

I've figured it out! truffle-hdwallet-provider module was using it's account[0] from m/44'/1'/0'/0. But I was trying to use the account from m/44'/60'/0'/0 which is by mnemonic creator tool from BIP39. This was the reason.


0

Please try this way for your config: const HDWalletProvider = require("truffle-hdwallet-provider"); require('dotenv').config() const providerFactory = network => new HDWalletProvider( process.env.MNEMONICS || "", // Mnemonics of the deployer `https://${network}.infura.io/v3/${process.env.INFURA_KEY}`, // Provider URL => web3.HttpProvider ...


Top 50 recent answers are included