Questions tagged [truffle-deployment]
The truffle-deployment tag has no usage guidance.
183
questions
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' (...
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 ...
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 ...
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&...
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 ...
6
votes
1
answer
975
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 ...
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 ...
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
...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
4
votes
0
answers
818
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: ...
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: ...
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 ...
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 ...
3
votes
1
answer
658
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 ...
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 ...
3
votes
1
answer
637
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",
...
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 ...
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 ...
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 ...
3
votes
0
answers
371
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 ...
3
votes
0
answers
994
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();
...
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, ...
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.
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 ...
2
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 ...
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 ...
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 ...
2
votes
1
answer
977
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 ...
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 ...
2
votes
1
answer
548
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 (...
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 ...
2
votes
1
answer
915
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 ...
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 ...
2
votes
0
answers
409
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 ...
2
votes
1
answer
214
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) {
...
2
votes
0
answers
676
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....
2
votes
2
answers
987
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 ...
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 ...
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 ...
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 ...
1
vote
2
answers
934
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 ...
1
vote
3
answers
262
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 ...
1
vote
2
answers
920
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 ...
1
vote
4
answers
582
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 ...
1
vote
1
answer
489
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 {
...