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
7 views

“Uncaught ReferenceError: TodoList is not defined” as I tried to call Todolist.deployed() in truffle console

I was trying this Beginner tutorial on smart contracts and solidity. I typed truffle compile, truffle migrate and they ran without any error and I got my gas cost used up in Ganache. When I opened ...
0
votes
0answers
7 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 ...
0
votes
0answers
14 views

Using functions from a library

I'm working on a Dapp for voting in a municipality and national election. There is a lot of code, and I've met the max limit of the contract size many times but have been able to keep it under the ...
0
votes
1answer
18 views

Build with multiple solc versions?

My tokens and basic setup scripts are built in solidity 0.8.0 and I just downloaded GSN with OpenZeppelin because I need a platform which will fund users' few things. Now I can't compile because it ...
0
votes
1answer
8 views

Truffle Migrate Endless Run

I am trying to deploy my contracts with const Migrations = artifacts.require("Migrations"); const Market = artifacts.require("Market"); module.exports = function (deployer, ...
3
votes
1answer
120 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... =...
0
votes
0answers
25 views

Not able to deploy NFT contract on reinkeby .Seems like truffle is not able to decode private key from the mnemonic

Here is the truffle config module.exports = { networks: { cldev: { host: '127.0.0.1', port: 8545, network_id: '*', }, ganache: { host: '127.0.0.1', port: ...
0
votes
1answer
19 views

Sending Transaction From the created contract address

I am trying to deploy my Roadmap contract from the address of another newly built contract with Truffle. I tried to do something like this: module.exports = function(deployer) { deployer.deploy(...
0
votes
0answers
23 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": { "...
0
votes
0answers
57 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 ...
1
vote
1answer
22 views

Error while deploying contract to the Ropsten testnet

I'm trying to deploy a contract (called "FilesDetailsManager") to the Ropsten Testnet using Truffle and Infura as provider. But when I type into terminal truffle migrate --network ropsten, I ...
0
votes
1answer
47 views

Cannot connect to Ethereum client using truffle/ganache

I first started ganache and see in the log that "Ganache started successfully" with the RPC Server set as: HTTP://127.0.0.1:7545 While running truffle migrate command, I've received the ...
3
votes
0answers
224 views

Deployment Failed : “Migrations” — only replay-protected (EIP-155) transactions allowed over RPC

I am trying to migrate the code which is already tested in mainnet to ropsten network. I wonder why it is throwing the below strange error. We as a team unable to find a solution for this for past 2 ...
0
votes
1answer
44 views

Unable to deploy smart contract on private blockchain

I'm trying to setup a private blockchain and deploy some contracts to it. I have the blockchain running but I am running into issues when I'm trying to deploy a contract to it. This is my genesis ...
0
votes
0answers
14 views

ESOCKETTIMEDOUT ERROR while trying to deploy to Rinkeby

Unable to deploy a simple smart contract to Rinkeby
0
votes
0answers
22 views

Truffle Mainnet - “No contracts deployed.”

I really need help! I created an ERC721 smart contract and deployed into the rinkeby test network. All was nice, after that I deployed into mainnet. I set the gas price to 65 Gwei. Now the contract is ...
0
votes
1answer
20 views

Chaining smart contract deployments through instantiation in constructors

As the title suggests, I'm not sure what is considered to be good practice when it comes to deploying smart contracts that interact with each-other. My example: migrate contract A. Contract A creates ...
1
vote
2answers
52 views

Why does this contract cost 1 Eth to deploy?

Truffle is telling me that it costs 1 Eth to deploy. Is that seriously the cost of deploying a simple contract (this is my first Mainnet deploy)? Or is there something else going on? mainnet: { ...
0
votes
1answer
26 views

“Truffle Networks” spits out error and can't migrate to Mainnet

I'm trying to deploy to Mainnet (for the first time) but the initial migration (1_initial_migration) is getting stuck. Deploying to Kovan works fine and is super fast. I have enough Eth to deploy to ...
0
votes
2answers
21 views

Compile error on address.call

My syntax seems to be ok, so I do not understand this CompileError
0
votes
0answers
66 views

Migration 2_deploycontract invalid or does not take any parameters

I am trying to create this token and for some reason, the second migration keeps giving me this Migration 2_deploycontracts.js invalid or does not take in any parameters 1_initial_migrations.js seems ...
0
votes
0answers
13 views

Gas price to deploy contracts in ETC Mainnet

What is the standard Gas price to specify while deploying contracts in ETC mainnet? We can always reference ethereum gas station when it comes to ethereum network. But is there any trusted source like ...
0
votes
0answers
27 views

Truffle Migration: deploy or upgrade

I would like to write the following logic in the migration script for my truffle project with upgradeable contracts: if(contract is not yet deployed) { const mynewcontract = deployProxy(MyContract, ...
1
vote
0answers
9 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; ...
0
votes
1answer
97 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 ...
2
votes
1answer
119 views

Checking transactions in ganache-cli

Is there a command to enter into the terminal to check past transactions on the locally deployed ganache-cli blockchain? With ganache gui one gets the transactions button. Is there some similar ...
0
votes
1answer
115 views

Error: Could not find artifacts for Migrations from any sources

I was trying to deploy my contracts to Ropsten testnet. But in the process, my Dapp suddenly stopped working even on Ganache. When I now try to "truffle migrate --reset," I get the message &...
0
votes
1answer
37 views

Truffle test deploys everytime a new contract with .deployed()

I want to test some contracts^^ And now Im wondering because like I understand .deployed() should take the contracts from the migration in truffle and dont deploy new ones? My test.js: const one = ...
0
votes
1answer
30 views

Factory Pattern Migration With Truffle

have a standard factory pattern for my contract and I am trying to get it up and running using Truffle Migrations. In my factory truffle migration script I have await deployer.deploy(ContractFactory); ...
1
vote
1answer
25 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", ...
0
votes
0answers
13 views

truffle deployer - addess is still there without deploy

First Question: // Stage deploying A before B deployer.deploy(A); deployer.deploy(B); This is found on the truffle website. It says stage deploying A before B. So this must mean that deploying B ...
0
votes
1answer
29 views

truffle - should I create migrations files by myself?

I am using truffle. I run truffle compile and I get json files in build/contracts directory. Now, truffle says I should run truffle migrate , but in the migrations folder, I only got ...
0
votes
0answers
40 views

Getting CompileError raised on OpenZeppelin Utils code, when trying to migrate a simple ERC20 contract

CompileError: @openzeppelin/contracts/utils/Address.sol:56:42: ParserError: Expected ';' but got '{' (bool success, ) = recipient.call{ value: amount }(""); Disclaimer: Learning how ...
0
votes
3answers
20 views

How to get token address inside a crowdsale contract, if you create separate migration files?

To expand on the question, I have created an erc20 token contract, & a crowdsale contract. For each file, I intend to create separate migration files. How can i get the token address for reference ...
0
votes
0answers
263 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(); ...
0
votes
1answer
206 views

Truffle artifacts are not being generated when compiling

I am new to smart contract development and I am trying to deploy my first contract. When running the truffle compile for the first time I can see that a build folder was generated on my project ...
1
vote
1answer
35 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
19 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 ...
0
votes
0answers
242 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
246 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
95 views

How to test your smart contract against currently existing ones on mainnet locally using Truffle?

Background I am fairly new to smart contracts and am currently experimenting using Ganache and Truffle to test on my local machine. My goal would be to have the smart contract interacting with other ...
0
votes
1answer
230 views

Why is truffle migration failing to deploy contracts? “cannot read options of undefined”

I am trying to deploy a local version of SushiSwap on a local test Ethereum chain. I am using Ganache and Truffle to deploy the smart contracts locally. When I run truffle migrate and attempt to ...
0
votes
0answers
14 views

SyntaxError when setting instance of deployed contract to token variable

I'm following this tutorial: https://www.youtube.com/watch?v=044h0ZI-fDI At 22:45, the following command is run: DappToken.deployed().then(function(i){token=i;}) In the video, after this command is ...
0
votes
1answer
39 views

When truffle migrate required account to be unlocked?

I've done several deployment using truffle, but it didn't ask me to unlock the account while deploying the contract on my private chain. But recently I have done one deployment and it asked me to ...
0
votes
0answers
14 views

Migrate with truffle deployer by using new

Hi I am trying to figure out what is the right way to migrate the contract by using new() method of the contract. The following does not work, the contract does not seam to be migrated (though it is ...
0
votes
2answers
23 views

Truffle not deploy updates

Truffle not deploy contract updates. truffle migrate compiles it but falsely say network up to date. OS: Windows Truffle v5.1.39 npm 6.14.5
0
votes
1answer
17 views

Truffle re-deploy unchanged contracts on every migrate

On every truffle migrate truffle deploy contracts even if they are not changed. although it doesn't re-compile Truffle v5.0.5
0
votes
1answer
225 views

How to re-compile contracts using truffle which are updated?

I deployed something in the test-net(ropsten). Later, realized that one of my contracts needs some amendments. In such cases how to compile specific contracts and deploy only that contract using ...
0
votes
1answer
83 views

Saving migration to chain.insufficient funds for gas * price + value

It looks like the contract was deployed well on mainnet However, eventually this error occurs Saving migration to chain.insufficient funds for gas * price + value Does it mean that the migration was ...
1
vote
1answer
482 views

Transaction underpriced at 5000000 gas but overpriced at 10000000

I've been developing a smart contract for a while on the Ropsten network using the Truffle framework, quite successfully. My truffle-config.js looks like this: const path = require("path"); ...

1
2 3 4 5
8