Questions tagged [truffle-deployment]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24
votes
5answers
15k 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' (...
14
votes
5answers
3k 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 ...
8
votes
1answer
2k 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 ...
7
votes
2answers
7k views

What is use of HDWalletProvider in Truffle config?

The sample code here for deploying to Ropsten used HDWalletProvider and a mnemonic in the config, but I am not sure I understand its purpose. Is this just telling it the account that will become the ...
6
votes
2answers
6k 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&...
6
votes
1answer
758 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
4answers
3k 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
4answers
1k 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
1answer
710 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
4answers
1k 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
1answer
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 ...
4
votes
0answers
745 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
1answer
2k 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 ...
3
votes
1answer
1k 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
3answers
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
1answer
588 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
1answer
1k 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
1answer
2k 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 ...
3
votes
2answers
1k 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
1answer
151 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
0answers
525 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
0answers
58 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
1answer
71 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.
3
votes
1answer
887 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 ...
2
votes
1answer
1k 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
2answers
4k 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
1answer
799 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
2answers
7k 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
1answer
133 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", ...
2
votes
0answers
29 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
1answer
539 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: 1) Base.sol pragma solidity ^0.4.22; ...
2
votes
0answers
43 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
0answers
318 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
1answer
151 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
0answers
598 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....
1
vote
1answer
3k 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
3answers
984 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
2answers
651 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
2answers
486 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
4answers
248 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
1answer
406 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 { ...
1
vote
2answers
62 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
2answers
1k views

Truffle Error: ContractName has no network configuration for its current network id (1575203139857)

Im doing the tutorial at https://github.com/ConsenSys-Academy/proof-of-existence-exercise and running into the following error: $ truffle console truffle(development)> var poe = await ...
1
vote
1answer
931 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
1answer
1k views

how to use truffle to read state value of a smart contract

I'm a newbie. I have following dummy contract contract A{ uint public test = 6; address public myaddress; uint public dummy; /** * The logs that will be emitted in every step of the contract's ...
1
vote
1answer
361 views

Help with inheritance and Truffle tests

I have two contracts that both inherit from OpenZeppelin's Whitelist. After deploying both contracts, I use an instance of the first contract to add a "trusted" address to the whitelist. Since both ...
1
vote
1answer
347 views

Gas limit being reached when deploying

I currently have a contract which requires around 16M gas to deploy and execute. Trying to deploy using Parity on Kovan net fails due to gas limit being reached. On my private network I just ...
1
vote
3answers
2k views

How to deploy a truffle app in heroku?

I have working truffle app that interacts with Ropsten Testnet but currently, I'm on my local machine environment at localhost:3000. I want to deploy this app to heroku such that my ropsten testnet ...
1
vote
1answer
30 views

Accidentally deployed two identical contracts on blockchain. How can I pick the one I wish to interact with?

I deployed two identical contracts on the same blockchain. contract V1 address:0x48A2a37fF1Cff6eB1984aCA7fCA4cAa25B1C9287 contract V2 address:0xdfaDE9c110eBD5C00243Ca0b3AdCf5B73A8f0e42 However I ...
1
vote
2answers
84 views

Why does this contract cost 1 Eth to deploy?

Truffle is telling me that it costs 1 Eth to deploy. Is that seriously the cost of deploying a simple contract (this is my first Mainnet deploy)? Or is there something else going on? mainnet: { ...