Questions tagged [truffle-migration]
Truffle Migrations are JavaScript files that help you deploy contracts to the Ethereum network. These files are responsible for staging your deployment tasks, and they're written under the assumption that your deployment needs will change over time. As your project evolves, you'll create new migration scripts to further this evolution on the blockchain.
479
questions
0
votes
1
answer
639
views
Calculate required funds for truffle migrate to live network
Trying to deploy a dapp to the live network. Got this insufficient funds for gas * price + value:
My wallet currently has 0.05 ether... How do I calculate the required funds?
1
vote
1
answer
160
views
Unable to deploy contract on ropsten
Firstly
I installed geth and it's running
I created an account and verified keystore file in the location:
~/Library/ethereum/testnet/keystore
Then I used:
Web3.personal.newAccount('password')
...
2
votes
1
answer
980
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 ...
0
votes
4
answers
6k
views
How to get blockNumber of contracts deployed with truffle?
We deploy our contracts with truffle migrate.
We need the blockNumber of the contract deployment transaction in the webapp.
We could use web3.eth.getTransaction(txhash).blockNumber() but can't get ...
2
votes
1
answer
1k
views
UnhandledPromiseRejectionWarning: Error: Web3ProviderEngine does not support synchronous requests
I've been struggling on this for days, and been googling a bunch of things but still no luck. Here's my code for 2_deploy_contracts.js:
const CoinCrowdsale = artifacts.require("./CoinCrowdsale.sol")
...
2
votes
2
answers
3k
views
How does Truffle know the address of contracts published via truffle migrate?
In Truffle's documentation, it says DeployedAddresses.sol is how Truffle identifies and stores the addresses of contracts published to the blockchain via truffle migrate.
How does this file work, and ...
0
votes
2
answers
325
views
unable to deploy contract on ropston testnet
I am trying to deploy contract on ropston testnet. I have created an account through truffle console and got three test ethers from https://faucet.bitfwd.xyz/. I have confirmed that my account has ...
0
votes
1
answer
625
views
Truffle "Replacing" durring migration
what does "Replacing" mean in migration?
a simple test contract C.sol:
pragma solidity ^0.4.17;
contract C{
uint public ConstructorUint;
function C(uint SetConstructorUint)public{
...
0
votes
3
answers
2k
views
Truffle: Migrate to ropsten, unknown network "true" error
I am trying to deploy a work in progress dapp to the ropsten network using:
truffle migrate --network ropsten
I have a geth instance running in terminal and I receive the following error:
Unknown ...
0
votes
2
answers
442
views
How to communicate with a deployed token?
Using Truffle, I am trying to deploy the following contract:
pragma solidity ^0.4.13;
contract ERC20Events {
event Approval(address indexed src, address indexed guy, uint wad);
event ...
0
votes
2
answers
3k
views
Truffle migrate to rinkeby fails with insufficient gas price
I'm trying to migrate my contracts to rinkeby using truffle (truffle migrate --network rinkeby), but it keeps telling me that I don't have enough funds:
Using network 'rinkeby'.
Running ...
2
votes
2
answers
7k
views
Truffle migrate Could not connect to your Ethereum client
Issue:
I fail to migrate(connect) a ethereum private chain on cloud server.
Actual Results
Will:dragon zhuangweiming$ truffle migrate --network development
Using network 'development'.
Running ...
0
votes
0
answers
221
views
Debugging amount of funds needed to deploy +network state unknown error on Ropsten
Wrote a simple contract. Attempting to deploy to testnet and get error.
eth --testnet --fast --rpc --rpcapi eth,net,web3,personal
truffle.js config:
module.exports = {
// See <http://...
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 ...
6
votes
3
answers
414
views
Why does truffle always fail with "Error: Don't set config.from directly. Instead, set config.networks and then config.networks[<network name>].from"
I have a problem that suddenly appeared, and now I get it every time that I try to run truffle test or truffle migrate, regardless of which project it is. I've even tried fetching the Petshop from the ...
1
vote
1
answer
808
views
Unable to deploy contract from inside another contract (works on Remix but returns revert on truffle)
I have been stuck on this for days trying to figure out why I am unable to create new contract instances from inside my parent. I am working on a larger project and couldn't understand so I created an ...
3
votes
0
answers
390
views
Upgrading the truffle Migrations contract
In the standard truffle migrations contract the purpose of the upgrade function is upgrade the Migrations contract itself by copying the last_completed_migration of the old Migrations contract to the ...
1
vote
1
answer
161
views
Is a truffle migration effectively the same thing as a fork?
I'm confused as to the distinction between a migration (in truffle) and a fork (project, not ethereum). After the initial migration (deploy), any future migrations create new contracts with new ...
0
votes
1
answer
622
views
Truffle Deploy Doesn't Work [duplicate]
2_deploy_contracts.js
var Regulator = artifacts.require("./Regulator.sol");
var TollBoothOperator = artifacts.require("./TollBoothOperator.sol");
module.exports = function(deployer) {
...
0
votes
0
answers
39
views
When i run the contract i got below mentioned error
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
at Object.callback (/usr/...
1
vote
0
answers
937
views
Why can I deploy my contract to the testnet, but not to the mainnet?
I deployed my smart contract to the ropsten testnet and everything worked fine. Now I wand to deploy it to the mainnet and I always get an error. How is that possible? What can I do?
Setup
Truffle ...
0
votes
3
answers
2k
views
Truffle migrate to ganache-cli (testrpc) hangs on deploying Migrations.sol
I am trying to truffle migrate Metacoin to debug why Tuffle migrate is not working to testRPC/ganache-cli. It gets hung up on deploying for testRPC/ganache but if I do it from truffle develop and not ...
3
votes
0
answers
514
views
Contract not stored and out of gas in migration at Truffle ganache
I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and ...
5
votes
2
answers
2k
views
Printing uint256 value to console while debugging with Truffle
I am trying to figure out how to print values to the console while doing truffle debug <txhash>. So far I have tried using an event called "TestValue", but I am not seeing the output in the ...
9
votes
1
answer
4k
views
Return Token Contract address on truffle deploy
I am trying to figure out how to return the address of a contract when I deploy it with truffle's deployer.deploy. So the goal is that when I deploy a contract that is a custom token, I want to ...
0
votes
1
answer
184
views
Error linking library when deploying with via Infura (ropsten)
I'm trying to deploy via Infura to ropsten and get this error.
The local deployment works without a hitch.
Linking SafeMath to contracts
Error encountered, bailing. Network state unknown. Review ...
5
votes
2
answers
2k
views
Truffle. How to link deployed library by address during migration?
For now I use this code to link library during truffle migration:
deployer.deploy(SafeMathLibExt);
deployer.link(SafeMathLibExt, [CrowdsaleTokenExt]);
deployer.deploy(CrowdsaleTokenExt);
This code ...
0
votes
1
answer
935
views
Why is my truffle migration failed?
I executed the following:
➜ voting_truffle truffle migrate
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Voting.sol...
Compilation warnings encountered:
/Users/glaksmono/Documents/...
1
vote
1
answer
538
views
Why the balance that I see in the Ropsten isn't reflected in Truffle console?
This is my account #1: http://ropsten.etherscan.io/address/0x6bc701e7c3b642fc12a3a6f7d1144b8200a26401
and I sent some ETH to account #2: https://ropsten.etherscan.io/address/...
2
votes
1
answer
1k
views
How to write truffle migration file for the contract that contains more than one contract
Suppose my contract named "B" look like :
contract A {
function abc(){
...
}
}
contract B is A {
function bc(){
...
}
}
then how will be the migration file look like.
0
votes
1
answer
2k
views
Truffle deploy via Infura : does it work? [duplicate]
I've read mixed things. In the docs for Truffle Framework there are instructions for deploying contracts via Infura's APIs.
But, elsewhere, I've read that Infura doesn't allow one to send ...
2
votes
1
answer
1k
views
Issue in truffle migration with Quorum
I am following this tutorial http://truffleframework.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains for Quorum installation..
I have successfully installed vargrant(Installed ...
1
vote
2
answers
374
views
Different errors while deploying with geth console and truffle
I'm trying to deploy a contract by two different ways, I can't succeed in any.
First way:
1. geth console —rinkeby —rpc —rpcapi db,eth,net,web3,personal —unlock="0x..." 2>>geth.log
I have ether ...
2
votes
2
answers
340
views
TokenTimelock gives out of gas errors when deployed within Truffle 4.0.1
I'm trying to deploy a contract using Truffle v4.0.1, within Truffle's own console but I keep getting out of gas errors.
The constructor looks like:
function MyAwesomeCrowdsale(
uint64 ...
0
votes
1
answer
2k
views
Deploying contracts in truffle while passing parameters of it constructor results in an error
I have managed to successfully compile a solidity token contract, the constructor is shown below :
function token(uint256 initialsupply, string symbol, string name, uint256
buyPrice, uint256 ...
1
vote
2
answers
2k
views
Truffle can not find artifacts
I'm trying to deploy a contract and I don't require Migrations.sol in any of my migrations. I don't even have this file in my contracts folder. And I run truffle migrate inside my project folder.
But ...
2
votes
1
answer
525
views
Understanding Truffle Migration
I'm building my dApp by modifying the pet-shop example, however, I got stuck at the migration step. 1_initial_migration.js runs successfully but 2_deploy_contracts.js gives me the following error ...
1
vote
0
answers
599
views
Truffle (4.0) test multiple contracts
I'm trying to test a contract that wrote and compiled, and I need to use another deployed contract to test it. I am writing a test for a specific contract and trying to invoke another deployed ...
2
votes
3
answers
2k
views
Truffle post-deployment actions
I have 2 contracts that deployed with truffle. Now I extended it and my contracts require some bootstrap actions like "set some address" or "set in contract1 address of contract2".
I will not change ...
1
vote
1
answer
522
views
testrpc How do I force development accounts to be unlocked?
Using Truffle and testrpc.
I am launching testrpc via testrpc --port 8545 --unlock 0
But when I run truffle migrate I get
Running migration: 1_initial_migration.js
Deploying Migrations...
... ...
17
votes
1
answer
18k
views
truffle migrate: How to deploy a contract whose constructor takes a parameter
I'm using Truffle Version 4 to develop a simple smart contract and am stuck on something I think reflects a very basic misunderstanding that I just can't get my head around.
Here's my simple contract,...
3
votes
1
answer
910
views
Having to set reset flag with truffle migrate
I am having a weird issue where my migrations are not being deployed when I run truffle migrate --network development. But when I run truffle migrate --network development --reset, the contracts are ...
2
votes
2
answers
1k
views
Truffle migrate not updating dependency
I have created a ProductFactory contract which creates instances of another Product contract.
Now I change code in the Product contract which is imported into the ProductFactory and run
truffle ...
2
votes
1
answer
395
views
truffle migrate restarts from first migration after restarting testrpc
I’m trying to create sort of private chain on testrpc so i use testrpc -u 0 -d --db /path/to/db to start testrpc each time. The thing is that if I restart testrpc (kill it and start it again) truffle ...
6
votes
1
answer
720
views
Truffle exits with "Error: The contract code couldn't be stored, please check your gas amount." error when migrating the 1_initial_migration.js
I am trying to migrate the basic truffle example (the one created via truffle init) to rospten using Parity but I get the following error even thought the contract is correctly deployed on Rospten:
...
1
vote
1
answer
301
views
How does Parity decide which account to use when migrating a contract?
Parity 1.7.6
Three accounts active, two have funds.
Am migrating a contract using truffle.
Parity UI prompts me for the password for one of the accounts with funds. Why did it choose this one?
0
votes
2
answers
943
views
Token not found on Etherscan after Deploying Crowdsale
I am deploying contract that creates a token and a crowdsale, based on code slightly modified from zeppelin-solidity.
Problem: After deploying the contract to Rinkeby using Truffle and Infura, ...
2
votes
1
answer
5k
views
Truffle migrate does not run 2_deploy_contracts.js
I am having problems with truffle migrate on the default Truffle project and using Infura as the provider.
Steps to reproduce problem
truffle init
npm install ethereumjs-wallet bip39 web3-provider-...
1
vote
0
answers
186
views
How to deploy contracts within the same Truffle project at different times
If I have a Truffle project with two different contracts in it, can I deploy them at two separate times? Can I run an additional command alongside truffle migrate that will allow me to deploy just one,...
0
votes
1
answer
197
views
Truffle test error: setter does not works
I have very basic contract like this:
pragma solidity ^0.4.0;
contract Playground {
uint public tokenPrice = 1;
function setTokenPrice(uint newTokenPrice) public returns (uint) {
...