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.

159 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
719 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 ...
4
votes
2answers
474 views

Uniswap Router deployment error: "UniswapV2Router02" -- Cannot create instance of UniswapV2Router02; no code at address 0xxxxxxxxx

I am trying to fork Uniswap and deploy on Ropsten testnet for educational and testing purposes. From what I gathered, it seems that we need to first deploy the UniswapV2Factory contract, followed by ...
4
votes
0answers
75 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 (...
4
votes
1answer
303 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 ...
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", &...
3
votes
1answer
174 views

deploying a simple ERC721 contract: transaction could not be decoded: could not recover secp256k1 key: calculated Rx is larger than curve P

You can check out the code here: https://github.com/lopeselio/Chainlink-VH-DynamicNFT Command: truffle migrate --reset --network rinkeby -f 3 Then response is as follows: Compiling your contracts... =...
3
votes
0answers
569 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
106 views

Tracking Non-Deployer Transaction Gas Use In Truffle Migrate

In Truffle, gas used by a Migration in deployer.deploy() is tracked by a Reporter using events emitted by the Migration. If I have code of the form: deployer.deploy(MyContract) .then(instance =>...
3
votes
1answer
358 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 ...
3
votes
0answers
542 views

Truffle contract migration deploying same contract on multiple address

I deployed multiple contracts of which some are linked to one another using truffle migration on the testrpc . In my web3 call for a function of one of the contract, instead of returning the current ...
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 ...
3
votes
0answers
491 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 ...
2
votes
1answer
131 views

Truffle incompatible with ESMs (ES5 / ES6 modules with "type": "module" in package.json)?

is it possible to execute truffle commands inside a folder in "ESM mode", i.e. package.json contains "type": "module", uses import instead of require etc.? Here is what I ...
2
votes
1answer
386 views

Error when migrating contracts using truffle

When using traffle deploying contracts it gives these errors: "Migrations" -- Unable to decode sender address from transaction: Incompatible EIP155-based V 38 and chain id 3. See the ...
2
votes
1answer
387 views

Truffle migration with TypeScript

I've been able to run truffle tests successfully using TypeScript, but when it comes to migration, I get stuck. 1) My current setup: tsconfig.json { "compilerOptions": { "...
2
votes
0answers
49 views

Deploy contracts without deploying Migrations

I would like to deploy my contracts to mainnet using truffle. I figure it's the easiest and safest way to do it since I already deploy to testnet using truffle. The problem is I don't want to deploy ...
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
0answers
450 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 ...
2
votes
2answers
167 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 ...
2
votes
1answer
602 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
128 views

How to get deployed library from truffle migration script?

I have smartcontract that linked to library. I see both address in truffle migrate results but I want to have their address inside migration script. While I can get contract's address by contract....
2
votes
0answers
117 views

ZeppelinOS: zos push --network mainnet returns nonce too low

Im trying to deploy a set of contracts. These are the steps I've followed (the same steps work fine in infura v3 ropsten): zos add Result: { "name": "0.1.0", "version": "0.1.3", "contracts"...
2
votes
0answers
50 views

Configure Truffle to automatically run tests before contract deployment

How do I configure Truffle to automatically carry out all my tests before it deploys the smart contract? Ideally, it should also halt deployment in case of any test errors.
2
votes
0answers
316 views

truffle migrate fails:Insufficient gas limit or exceed gas limit

$ truffle migrate Compiling .\contracts\Migrations.sol... Compiling .\contracts\Voting.sol... Writing artifacts to .\build\contracts Using network 'development'. Running migration: ...
1
vote
0answers
18 views

Truffle dry-run on Ethereum Main reports different gas cost (less) than actual deployment gas

Just wanted to ask about something weird that I keep running into: I've been deploying smart contracts on Ethereum through truffle, and the estimated deployment cost during the --dry-run (simulation) ...
1
vote
0answers
46 views

Compiling contract failes

I want to create crowdsale, but when compiling contracts i got: Compiling your contracts... =========================== > Compiling ./contracts/Migrations.sol > Compiling ./contracts/TubblySale....
1
vote
0answers
180 views

Is it possible to recreate the contract artifacts with Truffle

When trying to interact with a deployed contract I'm getting uncaught errors. For example if I try something simple as getting the name of the contract: let instance = await [contract].deployed() ...
1
vote
0answers
64 views

Error in Ropsten: The network id specified in the truffle config (3) does not match the one returned by the network (1)

There are similar questions but I could not find the solution. maybe because smart contract tools are developing so fast. here is the setting for ropsten in truffle config. ropsten: { ...
1
vote
0answers
31 views

Why does Ganache's contract information not accurately display hex values?

Difficulties are as stated above. Running Truffle v3.5.3, Solidity ^0.8.0, Ganache v2.5.4 local test net. I have a contract upcomingRace which has the following constructor: constructor(string memory ...
1
vote
0answers
96 views

Web3ProviderEngine does not support synchronous requests on deploy to private network

I know there are many similar questions, but I've been through all of them and haven't got the answer I'm looking for. I'm trying to deploy a smart contract (that's already been compiled and deployed ...
1
vote
1answer
166 views

How to use truffle-plugin-verify when you are not deploying the contract?

Here is my A contract: // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract A { B public b; constructor() public { b = new B(); } } contract B {} As ...
1
vote
0answers
11 views

Manage migrations with truffle

Is there a way to manage migrations with truffle ? I mean by migrationa change to a new version of a smartcontract. Let's suppose this smartcontract: contract SimpleStorage { uint storedData; ...
1
vote
2answers
64 views

how to verify a contract using truffle-plugin-verify

I'm trying to verify a simple contract. The contract is already deployed on the Ropsten network. import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/...
1
vote
0answers
368 views

What factory (UniswapV2Factory) shoud I use when deploy Sushiswap clone?

Hi I'm forking Sushiswap and about to deploy contract to mainnet. While I'm writing deploy_contract.js in Truffle. Which Factory shoud I use in my migration code? I saw several code example but ...
1
vote
0answers
648 views

UniswapV2 addLiquidityETH() reverting when trying to deploy to ganache locally

I'm trying to locally deploy a contract similar to sushiswap, but I keep getting a revert from addLiquidityETH(), no message other than VM Exception while processing transaction: revert //module....
1
vote
1answer
128 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 ...
1
vote
3answers
837 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 --...
1
vote
3answers
1k 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 ...
1
vote
0answers
886 views

Error: Cannot create instance of X; no code at address

Having a little issue. I have deployed a Mock ERC20 contract on development network like so: const ERC20Mock = artifacts.require("ERC20Mock"); module.exports = async function(deployer, network, ...
1
vote
1answer
1k views

Error when deploying with infura ropsten, rinkeby and kovan

when deploying to infura ropsten i get error Running migration: 1_initial_migration.js Deploying Migrations... ... 0x0ed88dd40f380a805ed0ba1b5b0a9d8178321ab6da9e5c0cb247f5700337b173 Migrations: ...
1
vote
1answer
203 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? ...
1
vote
0answers
40 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
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-...
1
vote
0answers
91 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
20 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 ...
1
vote
1answer
96 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 ...
1
vote
1answer
92 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
1k 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
0answers
38 views

truffle can not build success

when I fllow this document step by step enter link description here,I have something wrong with my truffle build,and I delete truffle.js ,this is photo, please help thx!!