Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
18 views

Truffle - a proper way to execute a chunk of code

Let's say I have a complex operation to execute, for example deploying 6 contracts and calling functions to each one, passing addreses to few of them and executing some extra more functions. I can, of ...
1
vote
1answer
11 views

Show truffle migration history

What is the best way to show truffles migration history or at least the last successful step. Something similar what I see when I do truffle migrate: Running migration: 1_initial_migration.js ...
1
vote
1answer
16 views

Truffle - call migration file multiple times

I would like to execute migration file "6_deploy_and_register_group.js" every time when I need to create a new group. Is this a proper way to use migrations? If yes, how can I make it working? ...
0
votes
1answer
35 views

Can't connect to local blockchain

Using Truffle, I'm trying to implement my first smart contract by running the MetaCoin webpack. After running Truffle Develop, I can see my list of accounts: Truffle Develop started at http://127.0....
1
vote
0answers
8 views

Deploy Imported Smart Contract in Test case

I have a project that contains a Token Smart Contract, it has been added to my project by means of: npm install ../token_project In my testcase I have: var MyToken = artifacts.require("...
1
vote
0answers
21 views

I want to use Ledger Nano S to deploy the contract, but not working

I wanted to deploy the contract with the Ledger Nano S wallet, but not working on truffle. I installed npm package 'truffle-ledger-provider' and followed the practice. But I got an error ...
0
votes
2answers
34 views

truffle migration fails, but initial migration was mined

I am trying to deploy this contract on a private permissioned Quorum network. The migration fails on the 1_initial_migration process. If I try to repeat the process with: sudo truffle migrate --...
0
votes
0answers
29 views

How to `truffle migrate` to private permissioned network?

I am running a private permissioned network and would like to use Truffle v5.0.1 for deployment. I use it according to the documentation: Compile my project with truffle compile so that the ./build ...
0
votes
0answers
18 views

Truffle migrate no error but does not create build directory

I'm trying to develop a simple dapp using ReactJS.I used Charterhouse/truffle-create-react-app box suggested by truffle website. The problem is truffle compile and truffle migrate do not seem to work. ...
0
votes
1answer
16 views

Migrates contract with specific account without hard-code address using truffle and Genache

Block Builders! I am trying to migrate my two smart contracts using truffle and Genache. I would like to specify the deploying accounts existing locally. However, when I try to migrate the contracts I ...
4
votes
2answers
93 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 ...
0
votes
1answer
38 views

Set up backup from private Ethereum (Ganache) [duplicate]

I have created an ethereum application with Ganache and truffle js. i have installed ganache in a server, and th application work. but when i stop the server i lose the the smart contract that i have ...
0
votes
1answer
43 views

Truffle Migrate Error: Could not find built Migrations contract: Unexpected token in JSON at position 0

Running truffle migrate with valid contract code started causing this error for me: Writing artifacts to ./build/contracts Using network 'development'. Error: Could not find built Migrations ...
2
votes
0answers
40 views

Transaction not mined error when deploying to quorum maker server

I get the following error when attempting to deploy my zeppelin erc20 token to a quorum server(used quorum maker). (master) $ node migrations/2_proj.js ``````` transactionHash ...
1
vote
0answers
18 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
0answers
26 views

Error: cannot find module hdwallet-provider - trying to deploy contract to ropsten using infura key [duplicate]

I have reviewed the other posts in the last few days following what seem like forever for get to sync to my local machine - so this is my last try to get it to deploy the petshop contract to ropsten ...
1
vote
1answer
32 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-...
1
vote
1answer
75 views

Running out of gas during a deploy due to a large number of require() statements?

I have a smart contract that has a fair number of functions, but a large number of require() statements because I carefully check every incoming parameter and some intermediate calculation results too....
0
votes
2answers
37 views

How does Truffle Migrate sign the transaction that it's dealing with?

As a newbie in this space, I'm just wondering how Truffle handles migrating contracts with the Truffle Migrate command—what does it use to sign those transactions? Does it use some wallet ...
-1
votes
0answers
54 views

Insuffient fund error deploying to Ropsten using PetShop Dapp - can confirm have valid key and sufficient eth now [duplicate]

I have been testing the petshop Dapp for serveral weeks now using local ganache and all is now working following some changes both from developers of petshop on Git Hub and the the metamask update. ...
0
votes
1answer
41 views

Error migrating contracts with Truffle

I´m having problem migrating my contracts to the private blockchain. That blockchain is located in a CentOS VirtualMachine instance. With the Geth console I connect to the blockchain and I unlock one ...
1
vote
0answers
39 views

How to get back the ownership from crowdsale?

When I started crowdsale, I transferred token ownership to the crowdsale contract. When the sale finished, I'd like to send back the ownership to token so that the next crowdsale will start. How can I ...
1
vote
0answers
101 views

Could not find artifacts for ./Election from any sources

I tried solutions provided in ethereum stack, but nothing worked for me. My smart contract file: pragma solidity ^0.4.15; contract Election { string public candidate; function Eletion () ...
0
votes
1answer
28 views

Why does “truffle migrate” to Rinkeby results two transactions per contract

I ran truffle migrate -f 2 --network rinkeby. Then, I navigated to https://rinkeby.etherscan.io/address/[ADDRESS_OF_DEPLOYER] And I got two TXs: The second TX is clear since To equals to "Contract ...
0
votes
1answer
63 views

Calling fallback function in truffle to delegate a call

I'm playing with the upgradeable contracts via DelegateProxy in Solidity. This pattern posits that a MutableForwarder contract is deployed once, and all the subsequent calls to the upgradeable ...
1
vote
1answer
47 views

Can not deploy to Rinkeby via truffle - cannot read property 'bind'

I am using truffle: "^4.1.14" and ganache-cli version "^6.1.8". When I try to migrate to ganache cli network, it works without a problem. But when I try to migrate to Rinkeby, it always fails. The ...
0
votes
0answers
37 views

Truffle Solidy based testing fails

I am new to testing the smart contract in solidity. Just for my understanding I have used Assert.notEqual in 1 test and Assert.equal in another test. I guess both are failing. I also have a question ...
-2
votes
1answer
20 views

The code was working fine few days ago(solidity) [closed]

Error parsing C:\Users\"directory"\example.sol: ParsedContract.sol:45:1: ParserError: Expected pragma, import directive or contract/interface/library definition. } ^ Compilation failed. See above. ...
1
vote
0answers
12 views

Contract mined but Truffle gives error

Something weird happened, and I can't understand what to do now. While migrating the contract to the MainNet, I received this: $ truffle migrate --network live Using network 'live'. Running ...
2
votes
1answer
22 views

How to specify the Gas price for ICO contract

I am writing a ICO contract in truffle using openzeppelin I used the below code in the truffle.js and I am trying to launch in mainnet. When I tried this I could see that the transaction is using the ...
0
votes
1answer
26 views

Ownership trasfer to crowdsale contract fails while deploying in truffle

I have created a "Token" and the "Crowdsale" contract as mentioned in the openzeppelin. Below is my deployment code in truffle. I am new to ICO related coding and solidity. The question may be very ...
0
votes
1answer
52 views

Truffle migrate: Could Not Find .sol file from any sources

I just started onto the blockchain journey a couple of hours back trying to create an elections program on the Ethereum blockchain. While trying to migrate the smart contracts using truffle migrate, I ...
0
votes
1answer
34 views

Deploying fails with different compile version

I'm trying to implement a simple card game. Actually, everything is working fine. Until I tried to move from 0.4.0 to 0.4.22. Any idea what is going wrong? Thanks a lot. And here the code: pragma ...
0
votes
1answer
51 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 ...
0
votes
2answers
100 views

Truffle : dotenv is not working in truffle.js

I am trying to get the seed words from the powershell command prompt. Hence I am using the 'dotenv' in truffle.js require('dotenv').config(); console.log('aa - process.env.MNEMONIC : '+mnemonic); ...
1
vote
1answer
41 views

Truffle fails to migrate an Oraclize contract into Ganache

I have a contract that is using Oraclize. When deploying the contract from the Remix IDE into Ganache/Ethereum-bridge via MetaMask, the contract is fully functional. However, when trying to migrate ...
1
vote
1answer
76 views

Truffle migrate got stuck

Issue I ran the official example code: truffle migrate,and stuck there for a long long time: truffle migrate Running migration: 1_initial_migration.js Deploying Migrations... Steps to Reproduce I ...
1
vote
1answer
42 views

How to deploy smart contract with visible source code (etherscan)?

I'm trying to deploy a contract to the rinkeby (hope that thats the network to use for beta testing). Deploying worked with the command truffle migrate --reset -f 2 --network rinkeby. Unfortunately,...
1
vote
2answers
69 views

Saving contract address after deploying with Truffle

To automate my development cycle I want to save the addresses of deployed contracts so that my DApp can read this information and know where to find the contracts on my private block chain: for ...
2
votes
1answer
85 views

AssertionError: error message must contain revert

I have tried a lot of research. I still somehow can't find and understand why this error occurs when im in private network. But if in 127.0.0.1:7545 which ganache, everything seems to be working, all ...
0
votes
1answer
206 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. ...
0
votes
2answers
110 views

Error: No network specified. Cannot determine current network. for Truffle Migrate

I am getting this error for truffle migrate. truffle migrate Error: No network specified. Cannot determine current network. at Object.detect (/usr/local/lib/node_modules/truffle/build/webpack:/...
2
votes
0answers
80 views

How to get Truffle to generate artifacts for contracts outside of project?

Say I have a contract MyToken.sol which has already been deployed to a public Ethereum network. Its source is maintained in an external repository and is included in my package.json file so that it ...
0
votes
2answers
34 views

Uncaught in promise error: DAI has not been deployed to detected network, network artifact mismatch

I reviewed the other questions that had a similar error and they didn't help with my problem. On my main net contract, with my MetaMask on main net, I am getting this error when processing ...
0
votes
0answers
56 views

Setup Parity PoA network compatible with truffle framework deployment mechanizm

The question from the title kind of wraps around the real problem but it is actually what I'm having trouble making work. I'm trying to setup production PoA network so using all the flags made for ...
2
votes
2answers
62 views

Truffle interaction with my smart contract getting Vm exception

pragma solidity ^0.4.23; contract Hotelbooking { event Transfer( address indexed _from, address indexed _to, uint256 _value ); mapping(address => uint256) public ...
1
vote
1answer
24 views

Link library inside contract creation

I have a contract like this pragma solidity ^0.4.24; import './MyLibrary.sol'; contract A { // Do Stuff } And I have a factory contract instanciating A contracts pragma solidity ^0.4.24; ...
0
votes
1answer
33 views

How can I persist the chain state of Truffle develop? [duplicate]

Is it possible to persist the chain state of Truffle develop? If my truffle console crash, can I restore the chain state?
0
votes
1answer
48 views

Error: Web3ProviderEngine does not support synchronous requests

Error: Web3ProviderEngine does not support synchronous requests. I have an error when deploying contract to rinkeby provider const HDWalletProvider = require('truffle-hdwallet-provider') module....
2
votes
2answers
201 views

Truffle Migrations | Same contract deployed multiple times

I'm using truffle migrations a lot, and I would like to deploy a contract twice during my migrations. Is it possible? Nowadays, I'm using migrations like const MyContract = artifacts.require('...