Skip to main content

Questions tagged [truffle-deployment]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
29 votes
5 answers
22k views

What is the real price of deploying a contract on the Mainnet?

I'm trying to deploy a contract on the mainnet, but I've been getting some issues deploying with Truffle. ➜ ballot git:(master) ✗ truffle migrate --network mainnet --dry-run Using network 'mainnet' (...
V. Kartoplya's user avatar
22 votes
5 answers
4k views

Prevent 'truffle test' from invoking 'truffle deploy (migrate)'

It seems that truffle test automatically invokes truffle deploy (aka truffle migrate). As far as I'm concerned, these two functionalities are completely unrelated. So I cannot quite figure out why ...
goodvibration's user avatar
11 votes
1 answer
4k views

Truffle migrate vs Truffle deploy

Is there any difference between truffle migrate and truffle deploy, as of now what I observed is both the command perform deployment on desired networks one recognizable difference which we can see ...
SwapnilKumbhar's user avatar
9 votes
2 answers
15k views

Truffle Deployment Error: Invalid number of parameters for "undefined". Got 1 expected 0!

I am trying to deploy my smart contract. When I run truffle compile everything works however when I run truffle migrate, I get this occurring error message: Error: * Deployment Failed * "KJToken&...
Kaya Jones's user avatar
9 votes
3 answers
13k views

What is use of HDWalletProvider in Truffle config?

The sample code here for deploying to Ropsten used HDWalletProvider and a mnemonic in the configuration, but I am not sure I understand its purpose. Is this just telling it the account that will ...
Robin Jayaswal's user avatar
6 votes
1 answer
980 views

Best practice for sharing truffle build files between developers

I am working on a few projects using truffle, as you know truffle compiles and migrates contracts to various ethereum networks e.g. MyContract.sol produces MyContract.json which contains a reference ...
Jimbob1987's user avatar
5 votes
1 answer
3k views

how is it different .deployed() and .new() ??

When I try to test my contract in truffle test javascript, how is it different to create new instant for my contract by instant = await myContract.deployed() and instant = await myContract.new()? is ...
Kronos's user avatar
  • 896
5 votes
4 answers
4k views

Truffle v5 runs out of gas but Truffle v4 deploys the contract

Truffle v4 used to deploy the contract successfully, but Truffle v5 truffle migrate command fails. My process to deploy: 1) delete buidl/ folder 2) truffle compile 3) truffle migrate Truffle v5 ...
Dziugas's user avatar
  • 141
5 votes
5 answers
2k views

Unhandled promise rejection(gas limit) when deploying Contract to rinkeby using truffle-hdwallet-provider

I am trying to Deploy a beginners contract onto the rinkeby test network through Infura node. It is throwing the following error. (node:35183) UnhandledPromiseRejectionWarning: Unhandled promise ...
Finn Rothacker's user avatar
5 votes
1 answer
2k views

Contract deployed successfully to Ganache via Truffle, fails to deploy on live network

I basically followed this Zeppelin crowdsale tutorial, just changed the names of the contracts. I was able to successfully deploy on a local Ganache, but then when trying to deploy to the live ...
shaharsol's user avatar
  • 561
5 votes
1 answer
1k views

Using truffle migrations for seeding lots of data inside a smart contract?

I have been developing a smart contract (ERC-721 compliant) which needs to be populated with lots of various pieces of data. Approximately 300 ERC721 tokens need to be minted inside the contract at ...
Jimbob1987's user avatar
4 votes
5 answers
2k 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 ...
lsankar4033's user avatar
4 votes
1 answer
3k views

Is it OK to use the reset flag with every Truffle compile and migrate when using the TestRPC client?

I just spent a fair amount of time scratching my head trying to figure out why my truffle migration wasn't doing anything when trying to deploy to the TestRPC client. It just kept saying "using ...
Robert Oschler's user avatar
4 votes
1 answer
1k views

Deploying on contract on main net - Error: insufficient funds for gas * price + value

Running geth v 1.7.3 truffle 4.0.5 truffle-config.js module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id ...
Michael O'Rourke's user avatar
4 votes
0 answers
819 views

Truffle migrate Error Invalid number of arguments to Solidity function

Truffle 4.0.1 I've got a contract declared "is Pausable" (OpenZeppelin framework) and I want to pause it as part of the deployment logic. I'm getting an error, however, when invoking pause() Error: ...
sofend's user avatar
  • 241
3 votes
1 answer
2k views

How Can I Get the Gas Cost of Contract Creation *within* Truffle (Migrations/Test)

When running truffle migrate or truffle test, how can I get the gas usage (for example, see below the log from testrpc)? Transaction: ...
carlolm's user avatar
  • 2,326
3 votes
1 answer
3k views

Best security practices for contract deployment?

I'm using Truffle to develop an ERC721 smart contract. Truffle expects HDWalletProvider to be installed so that Truffle can sign transactions for you, however this requires storing your mnemonic ...
BarefootDev's user avatar
3 votes
3 answers
8k views

Unable to connect to polygon mumbai test network using truffle

I'm trying to use Polygon test network with truffle and I followed this document and youtube video to configure Polygon network for truffle. But when I'm trying to execute truffle deploy --network ...
metadata's user avatar
  • 260
3 votes
3 answers
1k views

Truffle deploying without linking

I'm deploying two contracts, one of which depends on another, plus they depend on a number of other contracts via the import statements. However, although in my deployment script I haven't included ...
ulu's user avatar
  • 740
3 votes
1 answer
659 views

Quorum privateFor not working with truffle-hd-wallet-provider

I'm trying to deploy a contract private to one node in the Quourm 7-nodes example. The migrate works as expected when deployed normally with truffle, but ignores the privateFor part and deploys a ...
Ketan Bhokray's user avatar
3 votes
1 answer
2k views

Contract has not been deployed to detected network

I ran truffle compile and truffle migrate to deploy my contract: admin@admin-PC ~/Desktop/Coding Projects/truffleTestProject (master) $ truffle migrate Using network 'development'. Running ...
Carol.Kar's user avatar
  • 140
3 votes
1 answer
639 views

Why does smart contract successfully deploying to Rinkeby fail to deploy to mainnet?

truffle.js: var HDWalletProvider = require("truffle-hdwallet-provider"); var mnemonic = ""; module.exports = { networks: { development: { host: "localhost", ...
nurkic23's user avatar
3 votes
2 answers
2k views

Cannot read property 'getBlock' of undefined

I'm having an issue with running truffle test on a Javascript test. I get the error TypeError: Cannot read property 'getBlock' of undefined. I am trying to get the time of the latest block by using a ...
adi's user avatar
  • 41
3 votes
5 answers
4k views

Truffle artifacts are not being generated when compiling

I am new to smart contract development and I am trying to deploy my first contract. When running the truffle compile for the first time I can see that a build folder was generated on my project ...
dhequex's user avatar
  • 31
3 votes
1 answer
194 views

3_deploy_contracts.js question

What is a good way to solve my deployment issue: (furtherance of issue: truffle testing problem, migration successful, testing runs out of gas with addition of testing file) When i add the ...
shaddow's user avatar
  • 308
3 votes
0 answers
384 views

Embedded vs linked libraries

I recently became aware of linked vs embedded libraries. My understanding is that if your library uses public pure functions and/or manages storage, then you need to deploy and link the library to ...
Nolan Jannotta's user avatar
3 votes
0 answers
1k views

Timeout while attempting to connect and deploy in the Ropsten network

I am trying to deploy the contract in Ropsten network. It fails with the timeout error The same is deployed in Ganache without any issues. Please advice truffle-config.js require('dotenv').config(); ...
iappmaker's user avatar
  • 813
3 votes
0 answers
64 views

Many Contract Testing strategies

I'm trying to wrap my brain around how to effectively test multi "projects" in Truffle, assume a simple ganache setup, also assume that these contracts seem to work, in remix, and in unit tests, but, ...
shaddow's user avatar
  • 308
3 votes
1 answer
81 views

Deploying smart contract through Truffle

I want to know when deploying smart contract using truffle, is there a way to do that without using the migration files? I won't be requiring the Migration features.
Tanveer Singh's user avatar
2 votes
1 answer
2k views

Truffle Flattener creates empty flat file

Using trufffle-flattener, I am trying to create a flat file merging all the related solidity based codes. After executing the flattening scripts, I see only the empty flat file getting created. Could ...
iappmaker's user avatar
  • 813
2 votes
2 answers
5k views

How to get a deployed contract instance in truffle console that was deployed without a migration?

I have a contract deployed with truffle to a testrpc local testnet. This contract has has a function that deploys a new contract. This new contract I can check the address in the testrpc console ...
mesqueeb's user avatar
  • 555
2 votes
4 answers
2k views

truffle migrate --network kovan issue

When I run truffle migrate --network kovan in the terminal the contract deployment doesn't run. Just: Compiling your contracts...==================== >Eveything is up to date, there is nothing to ...
future-developer's user avatar
2 votes
1 answer
982 views

Deploying smart contracts with truffle and geth in windows

I'm trying to deploy a contract. When running: truffle.cmd migrate network --ropsten I get the following error: No network specified. Cannot determine current network. Please help! Details are ...
CryptoQueen's user avatar
2 votes
2 answers
10k views

Error: Truffle is currently using solc 0.5.8,

I run migrate in the terminal, but it shows Error: Truffle is currently using solc 0.5.8, but one or more of your contracts specify "pragma solidity ^0.4.27". Please update your truffle ...
YwD's user avatar
  • 41
2 votes
1 answer
6k views

What is that error called "code: -32000, message: 'header not found'" when I deploy smart contracts to BSC?

I am just stuck with this error as follow; Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' }) I have no idea of any reason why I got this since I could see ...
DHC's user avatar
  • 377
2 votes
1 answer
593 views

"contract x" ran out of gas. Something in the constructor (ex: infinite loop) caused gas estimation to fail ganache

i'm trying to deploy contracts on private network ganache using ganache application. but it threw an error because of its big size: "contract x" ran out of gas. Something in the constructor (...
Seif Khédija's user avatar
2 votes
0 answers
32 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 ...
goodvibration's user avatar
2 votes
1 answer
928 views

call other contract's external function , the error: The contract code couldn't be stored, please check your gas amount

when I deploy a contract, the truffle frame told me this error:“The contract code couldn't be stored, please check your gas amount”。 the solidity code is: Base.sol pragma solidity ^0.4.22; contract ...
J.Hao's user avatar
  • 51
2 votes
0 answers
58 views

Orders Facilitator Contract has not been deployed to detected network

I'm trying to deploy a simple contract to truffle. This is very confusing now because truffle has it's own network built into it, yet the tutorial I'm following uses test-rpc. I've looked at a few ...
johnny 5's user avatar
  • 310
2 votes
0 answers
415 views

Truffle deployment with metamask to ganache leads private key error

I'm using Truffle, web3js and Metamask to build a webapp. I'm using ganache for local testing. I'm trying to deploy a contract with import TruffleDeployer from 'truffle-deployer'; import ...
Paymahn Moghadasian's user avatar
2 votes
1 answer
215 views

truffle migrate fails when I remove console.log

I have this migration script: var MyTok = artifacts.require("./MyTok.sol") var MyTok_Crowdfund = artifacts.require('./MyTok_Crowdfund.sol') module.exports = function (deployer, _, accounts) { ...
bio's user avatar
  • 121
2 votes
0 answers
680 views

Truffle delpoyment Error: unknown account

i am trying to deploy my smart contract on live network, i have successfully deployed the same contract on rinkeby but facing error while on live network, here is the detail 1 - Account balance 0....
Inzmam ul Hassan's user avatar
2 votes
2 answers
1k views

Cannot deploy by Truffle to Polygon Mumbai testnet

I`m trying to deploy by truffle to testnet polygon Mumbai a smart contract , However it does not work with my contract. It worked with another smaller contract , but with this one which imports ...
builder9999's user avatar
1 vote
4 answers
3k views

Error: HelloWorld has not been deployed to detected network (network/artifact mismatch)

I'm following the steps in this link to create a truffle project. I'm using ganache-cli as the ethereum client. rajkumar@rajkumar: Ethereum$ mkdir helloworld rajkumar@rajkumar: Ethereum$ cd ...
Rajkumar Natarajan's user avatar
1 vote
1 answer
5k views

How to estimate my contract code size? it is too big to deploy now

I think my contract is too big to deploy, because I got Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: oversized data when I am trying to deploy on ...
Kronos's user avatar
  • 896
1 vote
3 answers
2k 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 ...
Berkays's user avatar
  • 113
1 vote
2 answers
957 views

How do I implement simple JS code to deploy a compiled smart contract to ganache-cli? [closed]

Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 ...
djenning90's user avatar
1 vote
3 answers
267 views

Cannot find module '@chainlink/contracts/truffle/v0.4/LinkToken'

I was following these steps in order to use Chainlink on Kovan testnet. when I've finished the configuration (truffle-config.js, npm install to get all the dependencies, etc.) and I've compiled the ...
Joncarre's user avatar
  • 281
1 vote
2 answers
949 views

Contract deployment with "truffle-contract"

My purpose is deploying a smart contract to a private network with Node-js. I work on Truffle and Ganache. I tried it with "truffle-contract". But in deploying process an error occurs. My contract ...
Alireza's user avatar
  • 567
1 vote
4 answers
606 views

Assigning address, data, and gas to smart contract to deploy with Node-js

I used this guide to deploy a smart contract with Node-js. I followed as far as my contract was created as an object. Because the mentioned guide is old some web3 methods changed nowadays. So it looks ...
Alireza's user avatar
  • 567