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.

Filter by
Sorted by
Tagged with
19
votes
1answer
16k views

Steps to deploy a contract using MetaMask and Truffle [closed]

i'm noob, I want to deploy my contract on Ropsten network with MetaMask & Truffle, plz explain to me the steps to deploy it.
28
votes
4answers
7k views

what does `deploy.link` exactly do in `truffle`

Please explain use cases for deploy.link() function in migrations in truffle framework. How would you use it and for what.
6
votes
1answer
695 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: ...
12
votes
1answer
8k views

Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead [duplicate]

The warning is from running sample code from Mastering Ethereum, I get the above error and it says Use "constructor(...) { ... }" instead. function Migrations() public {
4
votes
3answers
2k views

Deploying from Truffle to Infura.io

I'm trying to use the Infura or any other public provider to compile and migrate a simple test contract. I don't get any errors when I run truffle compile --network test but it seems to hang and ...
7
votes
1answer
3k views

truffle migrate specific file

Is it possible to truffle migrate only one specific file? I found this on the internet: https://github.com/trufflesuite/truffle-migrate/issues/23 but truffle migrate -from 2 starts to migrate from ...
2
votes
2answers
2k 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
1answer
338 views

Getting "gas required exceeds allowance (93846700840810) or always failing transaction" on private network. How to access geth client via nodejs?

I have recently started using Ethereum. I am trying to test my contract using multiple machines. Only solution I found was to setup a private network using Geth and add peers. Following is the genesis ...
1
vote
1answer
298 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?
36
votes
6answers
12k views

What caused this error: Attempting to run transaction which calls a contract function, but recipient address is not a contract address

I have a contract and a set of mocha tests. I recently switched from using the ethereum client that comes with truffle (the one you get when you run truffle develop) to the ganache-cli. Somehow, in ...
14
votes
2answers
6k views

Truffle migrate fails

I am using testrpc. While running truffle migrate I get the following error: /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:671 throw new Error(this....
6
votes
2answers
6k views

Truffle mingration: Error: authentication needed: password or unlock

I deploying contract using Truffle and got an error Error: authentication needed: password or unlock. I already checked related questons and found only ugly hacks like "unlock desired account directly ...
6
votes
2answers
2k views

What are explicit steps to deploy dapp to mainnet?

There doesn't seem to be much documentation on how to transition your truffle DApp from working locally to being migrated to the mainnet. Below are some steps I generally would think are necessary: ...
16
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 ...
10
votes
2answers
4k views

what is the role of Migrations.sol contract in truffle project?

I have started working with truffle since 4 months and I don't give importance to Migrations.sol, I thought it's just a "get started" contract. But when I removed it caused a problem. can anyone ...
8
votes
4answers
1k views

Truffle: Migrate to ropsten - fails silently

When I run the following command I receive no output whatsoever: truffle migrate --network ropsten This is just after creating a new project using truffle init and creating a single contract. When ...
6
votes
1answer
782 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
2answers
4k views

Deploying contracts in Ropsten with Truffle

I have another n00b question... sorry about that :( I'm trying to deploy a smart contract to Ropsten. I have synched the Ropsten network with geth --testnet --fast --rpc --rpcapi eth,net,web3,...
4
votes
2answers
379 views

Truffle hangs forever with parity with PoA

I'm trying to create a private chain using parity (PoA) and truffle but when I do truffle migrate it hangs forever with the following output: > [ > { > "jsonrpc": "2.0", &...
4
votes
1answer
427 views

Can I truffle migrate with geth --light?

I get invalid address when I try to, I suspect --light doesn't enable deploys -- is that so?
3
votes
0answers
363 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 ...
2
votes
3answers
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 ...
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 ...
2
votes
5answers
3k views

How to fix "No events were emitted"

I have been following the instructions in the Dapp university tutorial. But I am using Windows 10, Dapp University is Mac. I downloaded this truffle with smart contract ERC20 from Dapp university. ...
1
vote
1answer
101 views

truffle - should I remember the results of previous calls?

I wrote a smart contract. now, I am writing tests in truffle . the code is gonna look like this. contract('contract', accounts => { it("test1", () => { }) it("test2", ...
1
vote
1answer
21 views

inheritance behavior of 2 contract when deployed

I would like to implement two contracts that extend another contract with an information store. Example: contract MonsterData { struct Monster { string name; int8 category; } ...
1
vote
1answer
438 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/...
1
vote
1answer
391 views

Transaction not found after 50 blocks on mainnet

I updated geth & truffle today. Now I'm getting "Transaction not found after 50 blocks" when trying to deploy to mainnet. I tried setting my gas higher than anything on http://ethgasstation.info/...
1
vote
1answer
565 views

Error: The contract code couldn't be stored, please check your gas amount or exceed gas limit

I keep getting the error please check your gas amount or exceed gas limit. The truffle config file module.exports = { networks: { development: { host: 'localhost', ...
1
vote
0answers
150 views

error in WebSocket connection

error : browser-sync-client.js?v=2.26.3:15 WebSocket connection to 'ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=mW3 please i need help on this. i was getting ...
1
vote
1answer
88 views

Truffle migrate ERC820Registry

I use Truffle and Ganache and I want to test some contracts that use the ERC820 Registry. I'm new to Truffle (and JavaScript in general) and I'm struggling to follow the instructions described in EIP-...
0
votes
1answer
380 views

Swaping ETH to DAI on Uniswap

I don't get why when trying to deploy my contract it says that gas estimation errored. Forked Mainnet with ganache-cli -f <INFURA_ID> Trying to deploy and execute following code: pragma solidity ...
0
votes
1answer
165 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 ...
0
votes
1answer
241 views

Error : migrate kovan

From : truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert >truffle migrate --reset --network kovan Warning: Both truffle-config.js and ...
0
votes
1answer
144 views

truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert

I am a beginner. I can deploy to a private network but I can not deploy to a public network. I need a Deploy to the kovan test network. please help me. >truffle init >npm install truffle-...