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
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....
2
votes
1answer
323 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
471 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
1answer
75 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
17 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
36 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
77 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
1
vote
1answer
825 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
201 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
2k 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"); ...
0
votes
1answer
471 views

Unknown network ganache

Although it compiles successfully truffle migrate --network ganache gives the following error: Unknown network "ganache". See your Truffle configuration file for available networks. I ...
0
votes
1answer
238 views

Truffle Migrate

What happens when there is a minor change in the smart contract and I run truffle migrate command. Example: //before contract test{ function display() public returns (string){ return "...
1
vote
2answers
989 views

Truffle migration deployment: Transaction was not mined within 50 blocks

I am running my own Ethereum client node (Open Ethereum 3.0.1). I am using Truffle migrate to deploy my smart contract to MainNet. However, the contract deployment is taking too long. The result from ...
0
votes
0answers
18 views

Garbage Value on Truffle console while executing the commands from a tutorial

I am following the tutorial at: JustDev tutorial on medium When I execute the command: truffle(ganache)> Victim.deployed().then(contract => victim = contract) I am getting a huge output which ...
0
votes
1answer
159 views

truffle migrate: Accessing 2_deploy_contracts.js of another Truffle project

I am executing “truffle migrate” command but I am getting one reference error related to ‘adoption’ variable:there is no error related to compilation 2_deploy_contracts.js ReferenceError: adoption ...
0
votes
0answers
407 views

Truffle stuck when deploy smart contract when using Ledger wallet

I have a little problem deploying smart contract with ledger nano s as provider on ropsten. The script just remain stuck at first migration Starting migrations... ====================== > Network ...
1
vote
1answer
470 views

Web3.py: ValueError: Could not format value when trying to deploy smart contract bytecode from Truffle

I have a working solidity contract which compiles and gets deployed successfully by both truffle and web3.js + metamask. Importing the very same contract into python and deploying it using web3.py (...
0
votes
1answer
169 views

Truffle testing a contract against an already-deployed external contract

Let's say I'm writing an escrow contract. The conditions of this escrow are based on the properties of a second already-deployed contract on Kovan and mainnet. Should I skip testing my escrow contract ...
0
votes
2answers
641 views

Do I have to create a custom ERC20 to test transfers in Truffle?

I have a smart contract that escrows and transfers a specific ERC20 token to and from users (with their approval). I'm a bit confused as to how to test transfers of existing tokens. Do I have to copy+...
0
votes
2answers
632 views

web3 in truffle.js file

I am trying to deploy my contracts with the specific account the user is using instead of hard coding it. But in this code, I get an error as such: Error: Cannot find module 'web3' the truffle-...
0
votes
0answers
346 views

Truffle Error: invalid argument 0: hex string without 0x prefix

I'm trying to deploy and test the smart contracts on the Goerli network using Truffle. While migrating getting below error. Contract: Simple Storage Test suite Simple Storage Set ...
8
votes
2answers
7k views

Truffle Deployment Error: Invalid number of parameters for "undefined". Got 1 expected 0!

I am trying to deploy my smart contract. When I run truffle compile everything works however when I run truffle migrate, I get this occurring error message: Error: * Deployment Failed * "KJToken&...
0
votes
1answer
72 views

not able to deploy contract

I'm working on API'S for smart contract. I'm using tronbox to compile and migrate. Error is this contract constructor expected 1 arguments, received 0 I tried to add arguments in migrations like this ...
0
votes
1answer
31 views

looking for a start in solidity [duplicate]

I am totally new to the Solidity Programing. I was working on NodeJS, express and mongoDB. Few days ago I started working on blockchain. I have to write the API'S for contracts. We are using truffle ...
0
votes
2answers
657 views

Truffle deployment error while deploying with Infura (Error: Callback was already called)

I am trying to deploy a token smart contract to Ropsten test network with Infura, but I am always getting an error as I am using truffle migrate --reset --network ropsten_infura Compiling your ...
0
votes
2answers
3k views

Timeout error on deploying to Rinkeby from truffle migrate

I have just finished the CryptoZombies tutorials, and was trying to deploy the file following their instructions to the Rinkeby network. But I keep getting this timeout error and am lost on how to ...
1
vote
1answer
419 views

How to act as another wallet when using Truffle exec scripts?

I am writing a seed to add data on the smart contract after I deploy it. I'm using ropsten network, setted up like this in truffle-config: ropsten: { provider: function () { return new ...
0
votes
2answers
27 views

What causes .deployed() to return same contract instances in each test

It took me awhile to diagnose the problem. At first I just noticed that the states of my contracts were being affected by previous tests when running truffle test I then looked in the terminal tab in ...
1
vote
1answer
51 views

How to add gas to a Truffle generated account imported to MetaMask

I am a beginner and was building a dapp using truffle unbox react. In my app, I was just taking input of a string and printting it using a simple contract. Everything is working fine. But, when i ...
0
votes
0answers
122 views

If I set unlimited gas in a dev environment, am I just postponing dealing with a problem in my contract or is it a Truffle issue?

Booted up ganache with this command: ganache-cli --gasLimit=0x1fffffffffffff --allowUnlimitedContractSize -e 1000000000 because I was running into this error on truffle migrate in my development ...
0
votes
1answer
100 views

Smart Contract Deployment Failed PowerShell

A beginner smart contract developer here. This is my smart contract: pragma solidity ^0.5.16; contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; ...
0
votes
1answer
289 views

Unable to deploy contract on Besu network(docker) using dynamic IP

I am stuck with a weird situation. I create a local Ethereum network with Hyperledger Besu in docker environment. I try to deploy contracts to a rpc node using Truffle(different container in same ...
0
votes
1answer
1k views

Cannot find module '@truffle/hdwallet-provider' [duplicate]

I am trying to deploy a smart contract that works nicely in Ganache to a test net (Kovan). However, all the tutorials out there use a package called hdwallet provider. When I follow the ...
0
votes
2answers
109 views

How to prevent someone to replace our smart contract

I'm still learning to develop dApp and currently, I conduct some testing on my dApp. I found out that someone who is part of the blockchain network (miner and node) can replace our deployed smart ...
0
votes
1answer
36 views

When i am doing migration, the netwrok name is ganache instead of development and multiple errors are there

D:\>truffle migrate --reset Compiling your contracts... =========================== > Compiling .\contracts\Migrations.sol > Artifacts written to D:\build\contracts > Compiled ...
1
vote
1answer
242 views

How to use solidity library with truffle

I'm using truffle V5.1.13 and when I run truffle test the res variable contains a transaction receipt rather than the expected 2. I notice if I remove everything that has to do with the library things ...
0
votes
1answer
23 views

How of should I migrate my Smart Contract?

I am developing a scraper which scrapes data and puts it on ethereum blockchain(ganache for dev) every week. So as to put this data onto the blockchain should I migrate my smart contract each time I ...
0
votes
1answer
495 views

How do you pass an array as an argument to a contract *constructor* using Truffle deployment script

I need to pass array as argument to contract constructor using truffle deployment script. My contract code looks like this: pragma solidity ^0.5.0; contract ArrayArgument { uint[] public arrsv;...
0
votes
1answer
125 views

How to use older version of Solidity in Truffle suite

I've tried to migrate contract on an older version of solidity, I have modified the config.js to be as in the following and the smart contract solidity code I'm trying to deploy as follows The ...
1
vote
0answers
52 views

Not able to populate my smart contract with data after deployment [closed]

I want to populate my smart contract with data. I am using truffle framework. In migrations file for the smart contract I'm populating the data but it is giving error: TypeError: instance.create is ...
1
vote
1answer
125 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
125 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
1answer
1k 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,...
1
vote
1answer
207 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
222 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
2k 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
123 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 ...
2
votes
1answer
2k 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
140 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 ...

1 2
3
4 5
9