A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0
votes
1answer
3 views

Truffle test: “Cannot read property 'gasUsed' of null” error. Truffle migrate works fine

Whenever I try and do truffle test I get the error Cannot read property 'gasUsed' of null But truffle migrate --reset works fine More confusingly, to rule out something in one of my tests that is ...
0
votes
1answer
24 views

Truffle- how to deploy ERC20 on local, but not public network, without the error “X is an abstract contract or an interface and cannot be deployed”?

So, I have a contract, let's call it contract A, that needs to make call to the Dai contract (referred to as Cash). This contract already exists on Kovan, so in 2deploy_contracts.js I simply set its ...
0
votes
0answers
11 views

“truffle migrate --network ropsten” stuck after compiling

I am trying to redeploy a contract on Ropsten Testnet using the command: truffle migrate --reset -f 1567182283 --network ropsten Here, "1567182283" is the prefix of my migration file. Upon executing,...
0
votes
1answer
16 views

Redeploy contract on Ropsten Network

I have already deployed my smart contract on Ropsten network for testing using truffle suite. The command line I used was: truffle deploy --network ropsten Now, I have made some changes to my ...
0
votes
2answers
38 views

Truffle best practices - unit vs integration tests

Think about having two contracts: MockToken Faucet (which takes token address as constructor parameter) To unit test Faucet I would create two new instances: const token = await MockToken.new() ...
0
votes
1answer
35 views

Deployment Failed | hit a require or revert statement somewhere in its constructor

I create a custom ERC20Token and a contract to store data sent from web3.Js. after storing data in mapping I would like to call ERC20Token contracts functionality inside this contract. code of ...
0
votes
1answer
22 views

“Migrations” exceeded the block limit

I didn't have any problem using solc 0.5.0 (geth 1.9.3), but facing this problem after upgraded to 0.5.12 (geth 1.9.9). After doing some research, I believe it is because of the changes to the ...
0
votes
0answers
22 views

Truffle - set or disable optimizer only for selected contracts

I have over 40 contracts in my project, for example: admin groups votings registry token In my truffle config I have optimizer enabled with 600 runs. compilers: { solc: { version: "0.5....
0
votes
1answer
24 views

TypeError: balance.toNumber is not a function

I need check that token has no balance when selfDestruct was called, but shows an error that balance.toNumber is not a function in the test file. DappTokenSale.sol function endSale() public { //...
4
votes
3answers
57 views

I got this error during migration in truffle. : ParserError: Expected '(' but got identifier

This is my smartcontract code pragma solidity ^0.5.0; contract DappToken{ uint256 public totalSupply; constructor DappToken() public{ totalSupply = 10000; } } This is code for ...
0
votes
0answers
11 views

Truffle to Ropsten Testnet Deployment Issue: No migration

I am trying to deploy my contract on Ropsten test network through Truffle Framework. I use the command truffle migrate --network ropsten. Following is my truffle-config.js: const HDWalletProvider = ...
0
votes
2answers
36 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 ...
0
votes
1answer
67 views

Truffle Migrate for metacoin truffle box example failing

truffle migrate Compiling your contracts... =========================== > Compiling .\contracts\ConvertLib.sol > Artifacts written to C:\blockchain_projects\truffle_projects\metacoin\build\...
0
votes
2answers
38 views

truffle migrates the contract with a weird account which is not from my mnemonic

I set my infura endpoint and mnemonic to deploy the contract to the Rinkeby testnet. Like this below. const infuraKey = process.env.INFURA_KEY const test_mnemonic = process.env.TEST_MNEMONIC ...
1
vote
1answer
30 views

What is the best way to deploy and test smart contracts on multiple machines?

I have recently started developement on Ethereum and the concepts are pretty much new to me. I need to test event emitting/listening on multiple machines for my contract. For the same, I have tried ...
0
votes
1answer
71 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 ...
0
votes
1answer
45 views

truffle compile/migrate gives error: “ParserError: Expected pragma, import directive or contract/interface/library definition.”

The tutorial I'm following created a 2_Migrations.sol with the following: const Token = artifacts.require("Token"); module exports = function(deployer) { deployer deploy(Token); }; "Truffle ...
0
votes
0answers
27 views

truffle migration: tokenName and tokenSymbol do not show up in explorer (Ropsten)

I created an ERC20 contract with Truffle, everything went right except for one thing: the name and symbol of the token does not show up in etherscan. I used the ERC20.sol provided by openZeppelin. My ...
0
votes
0answers
18 views

Can't migrate, ropsten randomly throws out of gas

I have the following migration files with 50 contracts' deployment and their setup (calling each other functions like privileges, access and so on): On the development network everything works fine. ...
0
votes
0answers
41 views

Truffle how to test with reference to mainnet smart contract - Error: while migrating VM Exception while processing transaction: revert

I would like to run a truffle test on a smart contract that includes a smart contract address deployed on mainnet. However, this results in the following error Error: Error: Error: while migrating ...
4
votes
0answers
44 views

What's the point of Truffle Migrations?

I've been reading a few articles and StackExchange posts (e.g. What are truffle migrations?) about Truffle Migrations, but I still don't get it: why do we need them? It seems they do only one thing (...
0
votes
1answer
41 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
57 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-...
0
votes
0answers
42 views

Error: Error: ProviderError: VM Exception while processing transaction: revert

Error: Error: ProviderError: VM Exception while processing transaction: revert at Object.run (C:\Users\WINDOWS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\...
2
votes
1answer
470 views

I got “ VM Exception while processing transaction: invalid opcode” error

I am trying to do truffle migrate but I got this error $ truffle migrate Compiling your contracts... =========================== > Everything is up to date, there is nothing to compile. Starting ...
0
votes
1answer
298 views

Error: Truffle is currently using solc 0.5.8,

i run migrate in the terminalbut 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 config or ...
1
vote
2answers
50 views

Truffle Migrations run only if not dry run (different account0 in dry run)

I noticed that using HDWalletProvider using the account parameter in the migration you get random/unexpected accounts during dryRun. I added a safety line that an address should be as expected but ...
0
votes
0answers
12 views

Truffle migrations - get deployed contracts list

I have the following problem: migrations no. 7: (deploy proxies) await deployer.deploy(TestProxy); await ExportUtils.addDeployed(await TestProxy.deployed(), true, { privileges: [ { ...
2
votes
0answers
173 views

Contract not deploying on private network

I have a smart contract a little bit like this: pragma solidity ^0.5.10; contract sc { struct element { uint96 firstKey; uint96 secondKey; bytes32 firstData; ...
0
votes
1answer
112 views

How to set allowUnlimitedContractSize in Ganache V2.1.0 with windows 10

while following this or this solution I found nowhere any file to make change for allowUnlimitedContractSize = true so my problem is same as in link but how I can change this in Ganache v 2.1.0
0
votes
0answers
27 views

truffle - toUtf8 on Migrations not working

I'm deploying my contracts via migrations and would like to show some info on the console about them just by getting data from these contracts and displaying it. I'm sending a deployed contract to the ...
0
votes
1answer
107 views

Migration 2_deploy_contracts invalid or does not take any parameters at Object.run()

I am trying to compile my smart contracts using truffle pet-shop. I have the following contract in directory election/contracts/election.sol ; pragma solidity >=0.4.0 <0.6.0; contract Election{ ...
0
votes
1answer
16 views

How to get an instance for a previously migrated contract with truffle?

Scenario: Token contract migration file Dapp contract migration file I want to interact with the already deployed token contract in the dapp contract migration file.
0
votes
0answers
9 views

truffle exec scripts/seed-exchange.js --network kovan

I've been running into an error when I attempt to seed my exchange/contracts on the kovan test network. Any help would be appreciated. Using network 'kovan'. Token fetched ...
0
votes
1answer
71 views

truffle deploy --network ropsten issues

I am having an issue deploying to ropsten. I am receiving an insufficient funds error but I believe my address to have ether on ropsten. This command: truffle migrations --network ropsten Also ...
0
votes
1answer
137 views

Deploy smart contract on Ropsten with Truffle without truffle-hdwallet-provider

Here is my truffle-config.js networks: { ropsten: { network_id: 3, host: '127.0.0.1', port: 8545, gas: 4000000, from: "address_in_metamask" }, I ran a geth node using the command: geth --...
0
votes
1answer
147 views

Error: Invalid JSON RPC response | ropsten.infura

I'm trying to deploy my contracts to the ropsten test network, but I get this error. the message error : C:\Users\acer\test>truffle migrate --reset --network ropsten Using network 'ropsten'. ...
1
vote
1answer
67 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 ...
0
votes
0answers
43 views

How to fix? Tx nonce go out of sync when using multiple unit tests on the same contract under Ganache+Truffle

Here is my example contract (ignore the fact this could be pure, this is a simplified example and my real example is not a pure function, it changes state, but I can reproduce the bug with this simple ...
0
votes
0answers
50 views

Running Migrate in Truffle does not work

I have been using Remix for developing my dapp but decided I should use Truffle to make things a little more robust and professional. I have truffle and ganache installed. I run truffle migrate and ...
0
votes
2answers
95 views

Truffle migrate --network ropsten always runs development network

I am trying to deploy a simple contract to the Ropsten network using Truffle and Infura. I have set up the Ropsten network in the truffle-confug.js file but it seems truffle always uses the ...
0
votes
2answers
199 views

Truffle error when deploy a contract

Does anybody know how to solve this? I've try to compile and deploy my contract to get the address, why obtained this error Error: 1_initial_migration.js ====================== Deploying '...
-1
votes
1answer
31 views

Truffle ganache error

I have this error~! Contract has not been deployed to detected network (network/artifact mismatch) Can you help me thank you!
0
votes
1answer
136 views

Migrations ran out of gas

I have unboxed pet-shop. Then inside the contracts folder, I made a file Election.sol which has the code - pragma solidity ^0.5.8; contract Election{ string public candidate; constructor() ...
2
votes
2answers
325 views

What's the difference between Truffle Migrations and ZeppelinOS upgradeable contracts?

It was my understanding that Truffle migrations will move updated contracts to new addresses. As a developer, you can use this feature to update already deployed contracts with new code. ZeppelinOS ...
0
votes
0answers
243 views

“Migrations” hit an invalid opcode while deploying on deploy Migrations.sol with Truffle

An error occurs when truffle migrate try to deploy Migrations.sol contract, i don't understand why pragma solidity >=0.4.21 <0.6.0; contract Migrations { address public owner; uint public ...
0
votes
1answer
623 views

TRUFFE MIGRATE: Saving migration to chain.Error: Error: Error: Returned error: VM Exception while processing transaction: invalid opcode

$ truffle migrate Compiling your contracts... =========================== > Everything is up to date, there is nothing to compile. Starting migrations... ====================== > Network name: ...
0
votes
0answers
35 views

Truffle migration contract [duplicate]

Why do we have to deploy the migration solidity contract in truffle? Do we also have to deploy it during production? Why do we have to deploy it so many times and why can't we use a single large ...
2
votes
2answers
451 views

Transaction exited with an error (status 0) after consuming all gas

I developed some smart contracts to be deployed to a private PoA (Proof of Authority) blockchain. I spun up a private blockchain via truffle develop and got the following receipt: Compiling your ...
-1
votes
1answer
163 views

Error while deploying smart contract (quorum-examples tutorial by truffle)

:~workspace/myproject$truffle migrate --reset Compiling your contracts... Everything is up to date, there is nothing to compile. Running migration: 1_initial_migration.js Replacing Migrations... ...