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
0 answers
16 views

Truffle migrate Error: PollingBlockTracker

I'm trying to deploy a contract on Avalanche Fuji testnet using Truffle. Here is my truffle config: require('dotenv').config(); const mnemonic = process.env["MNEMONIC"]; const infuraUrl = ...
code_learner93's user avatar
0 votes
0 answers
92 views

truffle migrate error ""MyToken" hit an invalid opcode while deploying. Try:"

I am trying to deploy my first smart contract on ganache blockchain. The compilation of my NFT goes well but when I try the "truffle migrate" command it gives me the error in the pic. The ...
Andrea Lorenzetti's user avatar
0 votes
0 answers
3 views

Error relating to emittery package while running truffle migrate: when I am running truffle migrate following error comes. Can anyone help me on this

const mixin = emittery_1.default.mixin.bind(emittery_1.default); ^ TypeError: Cannot read properties of undefined (reading 'bind') at Object.call (C:\Users\...
MJT's user avatar
  • 1
1 vote
1 answer
13 views

Error in truffle initial migration file

I'm learning solidity with the book "Master etherum". I'm trying to use following program in truffle. https://github.com/ethereumbook/ethereumbook/blob/develop/code/Solidity/Faucet4.sol // ...
YaiMiChiLaoMa's user avatar
2 votes
0 answers
36 views

Truffle hit a require or revert statement in simple ERC777 constructor

I have incredibly simple code, taking straight from openzeppelin's ERC777 contract. When I run truffle migrate, however, I receive Replacing 'Implementation' -------------------------- *** ...
chriscrutt's user avatar
2 votes
1 answer
28 views

Two identical functions inside a truffle migration

The contract VestingWallet.sol from OpenZeppelin have two functions with the same name "vestedAmount", but different parameters to call a particular function. The first one: function ...
titoi's user avatar
  • 31
1 vote
0 answers
12 views

Deactivate clean-room environment in truffle

Everything is in the question, does anyone have a way to prevent the redeployment of the contract every time you run a test and keep using the same "contract" feature ? Edit : I've found it, ...
Raphael's user avatar
  • 31
0 votes
0 answers
76 views

Error: Expected private key to be an Uint8Array with length 32

const HDWalletProvider = require("@truffle/hdwallet-provider"); require('dotenv').config(); const privateKeys = [`0x${process.env.PRIVATE_KEY}`] this is my code in truffle-config.js but its ...
AmariS1's user avatar
  • 77
0 votes
0 answers
18 views

Truffle migrations - it doesn't recognize the network from external file, why?

1_initial_migration.js file: const Globals = require("../globals.js"); const Migrations = artifacts.require("Migrations"); const Test = artifacts.require("Test"); ...
Radek_pl's user avatar
  • 731
1 vote
0 answers
40 views

network ID error while deploying a truffle project to ganache cli. how do i resolve it

when I deploy my truffle project to ganache I get the error, network id are not the same. and when I checked the network id on ganache and truffle, i changed the network id of truffle to match that of ...
grog's user avatar
  • 11
0 votes
1 answer
12 views

How to create an instance of a contract in Truffle that deployed by another Ethereum node?

I set Truffle to my private network. Now, I need to interact to a contract (C1) that deployed by another node of this network and I need to do that by Truffle. As I understood, I should define C1 to ...
Alireza's user avatar
  • 511
0 votes
0 answers
16 views

How do i remove a testnet account in GETH?

Can someone help? I am trying to deploy a smart contract to alfajores testnet via GETH. Everything seems to work fine except in my first account i have lost my password. I have a second account "(...
Golanger's user avatar
0 votes
1 answer
151 views

Truffle Migrate Error: The network id specified in the truffle config (5777) does not match the one returned by the network (1)

I'm a bit new here and I've been trying to migrate truffle however I keep running into this error: Error: The network id specified in the truffle config (5777) does not match the one returned by the ...
Madds's user avatar
  • 11
0 votes
1 answer
76 views

Why doesn't my upgradeble contract upgrade properly?

I have an upgradeable contract, but when I upgrade it, it doesn't go to the same address. After I deploy the upgrade, the console shows TransparentUpgradeableProxy getting a new address, but that ...
Antheloth's user avatar
0 votes
1 answer
38 views

Deploying Multiple Contracts with Truffle

Hoping someone can answer a couple questions regarding deploying multiple contracts with truffle. 1.)I can create one contract in the the deploy, something like 2_deploy_contracts.js and all the ...
Blockpain's user avatar
  • 133
0 votes
1 answer
143 views

Truffle migrate - TypeError: migrations.setCompleted is not a function

I ran $ npx truffle migrate to deploy 2 contracts to Ganache but I got an error: This version of µWS is not compatible with your Node.js build: Error: Cannot find module './uws_darwin_x64_88.node' ...
aahd_fr's user avatar
2 votes
1 answer
463 views

why command Truffle init not creating Migrations.sol?

I created new folder in truffle with command truffle init version of truffle and others Truffle v5.5.30 (core: 5.5.30) Ganache v7.4.0 Solidity - 0.8.17 (solc-js) Node v16.16.0 Web3.js v1.7.4 but it ...
vishal's user avatar
  • 23
0 votes
2 answers
910 views

Console Goerli not functioning on Truffle - This version of µWS is not compatible with your Node.js build

When i try to run npx truffle console --network goerli to start the console and then migrate my contracts on goerli testnet using truffle, I get the following error. MacBook-Pro sample-nftrender % npx ...
SideChain Labs's user avatar
0 votes
2 answers
32 views

Truffle migration: invalid number of parameters

Truffle migrate: Invalid number of parameters I have got following two smart contracts (SCs): pragma solidity 0.5.16; contract Phishable { address public owner; constructor () public{ ...
zak100's user avatar
  • 1,376
0 votes
1 answer
51 views

Truffle: { Error: Invalid number of parameters for "undefined". Got 0 expected 1! at module.exports

I am trying to execute the following smart contract using Truffle: pragma solidity 0.5.16; contract Phishable { address public owner; constructor (address _owner) public{ owner = ...
zak100's user avatar
  • 1,376
0 votes
0 answers
79 views

Error in compiling and migrating ERC721 contract

I am triying to deploy mi ERC721 contract in my private Blockchian. This is the Smart Contract: // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/...
WakiApi's user avatar
  • 33
0 votes
1 answer
124 views

Smart Contract deployment error

I am trying to deploy a smart contract on Rinkeby testnet and I am getting the following error truffle-config.js settings networks: { development: { host: "127.0.0.1", // ...
imhans4305's user avatar
1 vote
0 answers
122 views

Error deploying contract via Truffle to Polygon mainnet

When I try deploying with command npx truffle migrate --config=truffle-config.js --network polygon, I get the following error. Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object]) at ...
P A S H's user avatar
  • 138
0 votes
1 answer
19 views

Hardhat: Order of execution of Multiple scripts inside scripts folder?

In Truffle, we can have multiple deployment scripts inside the migrations folder, like 01_deploy.js, 02_deploy.js and truffle executes them in ascending order of the starting number, ie: 01_deploy.js,...
Somjit's user avatar
  • 255
0 votes
0 answers
260 views

How to increase an account nonce on web3js?

i'm running a script using web3js in which one i have my accounts[0] that is running 2 transactions. When i do: await web3.eth.getTransactionCount(accounts[0]) , i receive X (number) as a response. ...
Wallace's user avatar
0 votes
0 answers
55 views

usr/local/lib/node_modules/truffle/build/4889.bundled.js:21755 throw new Error("Could not find artifacts for " + import_path + " from any sources"); ^

I'm trying to run https://github.com/dappuniversity/governance However I keep running into this issue when I deploy the contracts I'm running everything out the box without making any changes at all ~...
Jinxlo's user avatar
  • 1
0 votes
0 answers
67 views

Truffle Migrate: Solidity SyntaxError: Unexpected identifier

Here's my initial_migration importing LinkToken and and Oracle libraries to deploy. const Migrations = artifacts.require("Migrations"); const { LinkToken } = require('../node_modules/@...
Sagar Atalatti's user avatar
0 votes
0 answers
106 views

ganache-cli ganache-cli --fork after machine restart

I use ganache-cli to fork from mainnet and develop. But everytime I reset my computer, I need to restart the ganache-clie and changes that I have done on forked version are lost. Is there a way to ...
adam's user avatar
  • 101
0 votes
0 answers
27 views

Could not find artifacts for " + import_path + " from any sources"

I'm following this tutorial on creating my own nft and I came across this problem. Can someone help me PS C:\Users\caclc\contracts> truffle migrate Compiling your contracts... Everything is up to ...
IJC's user avatar
  • 1
0 votes
0 answers
26 views

Truffle test not running completely

I am a beginner in Solidity and truffle. Trying to create something from scratch so I am not using anything from openzeppelin. I created an ERC20 token smart contract and created a second smart ...
António Pires's user avatar
0 votes
1 answer
189 views

Encountered an error while attempting to update latest block (error code 1020 on Polygon mainnet)

I'm trying to migrate a smart contract on Polygon (Matic) mainnet through truffle, but I get the following error: node_modules\@trufflesuite\web3-provider-engine\subproviders\rpc.js:57 const ...
Ehsan Khodarahmi's user avatar
1 vote
1 answer
195 views

truffle installed but not working

I'm using node version 12.20.2 and npm version 6.14.11 and installed truffle with cmd as administrator, the truffle framework version 5.5.12 has been installed but when I run any command in the vs ...
Prabhat Dongare's user avatar
0 votes
0 answers
55 views

Truffle with weird behavior dealing with uint type of variables

I´ve spent a couple weeks try to understanding what was heppening. The same solidity code worked great in REMIX but not in Truffle/Ganache. Let´s me explain. I wrote a code bases on Openzeppelin, but ...
p3cardoso's user avatar
0 votes
1 answer
172 views

concatenated string reason message in require() not displaying

I'm using Solidity 0.8.13 and Truffle 5.5.6. I'm just trying to debug a transaction call that fails then reverts when I do truffle migration. I temporarily changed my onlyOwner modifier to make the ...
CodeCalibre's user avatar
0 votes
0 answers
15 views

my transaction triplicates and all of them fail

I am new to creating smart contracts, I followed this video in order to create a simple to-do list. I needed to update some code in order to make it work since the video is more than 2 years old. This ...
Robert Vitoriano's user avatar
0 votes
0 answers
88 views

how to unlock my ethereum private network account in geth version 1.10.16

when I try to unlock my Ethereum private network account in go-Ethereum version 1.10.16, it show error like this, how could I overcome this? Error: Error: account unlock with HTTP access is forbidden ...
user97534's user avatar
0 votes
1 answer
311 views

Invalid number of parameters for "undefined". Got 3 expected 5!

I am using truffle 5.5.5 with Ganache as my dev blockchain. When I run truffle migrate I get the following error: > Compiled successfully using: - solc: 0.8.13+commit.abaa5c0e.Emscripten.clang ...
Carol.Kar's user avatar
  • 120
0 votes
1 answer
202 views

Truffle migrate: exited with an error (status 0): Please check that the transaction: satisfies all conditions set by Solidity `require` statements

I'm learning to use Truffle for the first time, and when I run migrate in the Truffle Develop console, I get the following error: 1_initial_migration.js: const FilePermissions = artifacts.require(&...
Spencer Goff's user avatar
0 votes
1 answer
3k views

How to fix "underflow"?

I am using Truffle v5.5.5 and solidity 0.8.0. I have the following constructor in my contract: contract rNFT is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; string ...
Carol.Kar's user avatar
  • 120
0 votes
1 answer
387 views

Deploying same contract with different owner using alchemy

I am trying to deploy contract to polygon mumbai testnet. It works with the first wallet address, but when i use a different wallet address it doesn't work. I am using the same alchemy rpc url truffle ...
Asif Alamgir's user avatar
0 votes
1 answer
76 views

Export contracts to two or more folders

I´m trying to automate as much as I could my truffle process and I wanna export the contracts during the "truffle migrate" command to two separate folders. Imagine that I have a frontend and ...
gustavomr's user avatar
0 votes
1 answer
81 views

Avoiding transaction failures in truffle migration to mainnet

I am trying to deploy my smart contract with truffle and an Infura HDWalletProvider. Here's my dry run (I edited/shortened it for brevity): Migrations dry-run (simulation) =============================...
wrightcode's user avatar
0 votes
1 answer
417 views

ERC721 contract deployed to mainnet gives enormous minting fees

I'm experiencing some weird behavior of the ERC721 contracts on the mainnet. I developed two very simple contracts using OpenZeppelin that are based on ERC721, ERC721URIStorage, and ERC721Enumerable. ...
Tali Oat's user avatar
0 votes
1 answer
533 views

Could not find artifacts for " + import_path + " from any sources

I'm working through a Solidity course on Udemy. I'm trying to run migrate on truffle. Here's my code: MyToken.sol // contracts/GLDToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; ...
DBWeinstein's user avatar
0 votes
1 answer
1k views

"Migrations" ran out of gas

I am trying to deploy 3 contracts to Avalanche. I have already deployed these same contracts to Ropsten, Rinkeby, and Ethereum mainnet. When I try to deploy to Avalanche, I get this error message: ...
Tom Blackstone's user avatar
2 votes
0 answers
178 views

Cannot deploy to polygon

Truffle migrate keeps my transaction stuck in pending forever. From my understanding I'm basically saying here "Whatever it takes, whatever it costs, just do it"; if i keep increasing the ...
shredding's user avatar
  • 169
0 votes
1 answer
372 views

Truffle deployment/migration error with Infura - contract got deployed once but could not be deployed again

I am stuck when deploying a Smart Contract to rinkeby testnet by running (on macOS 12.1) this: sudo truffle migrate --reset --network rinkeby The contract compiles and I can deploy it locally, but ...
DatamineR's user avatar
  • 101
0 votes
2 answers
799 views

Uncaught TypeError: contract.name is not a function

I`m trying to check if I correctly deploy a contract with truffle and ganache. I run truffle console and then contract = await Kryptobird.deployed(). But when I try to get the name of the contract I ...
Mariia Synelnyk's user avatar
0 votes
1 answer
329 views

Truffle-upgrades - deployProxy - Type/values mismatch despite correct syntax

Asking my first question here, hope it's in the right format. I'm trying to deploy my contract using a transparent proxy, using OpenZeppelin's truffle-upgrades, as they explain here. However, I keep ...
ethdude12's user avatar
0 votes
1 answer
482 views

"Election" hit an invalid opcode while deploying. truffle migrate

I'm just getting started with Solidity and ran into a problem that I can't solve. The error below displays when you try to migrate truffle migrate --reset 2_deploy_contracts.js ===================== ...
keron31's user avatar

1
2 3 4 5
10