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

Truffle v5.4.15 deploy error with newly create project

truffle deploy returns with the following error, in a newly create project (using flutter init) 1_initial_migration.js Deploying 'Migrations' Error: *** Deployment Failed *** "Migrations" -...
0
votes
1answer
12 views

How to save truffle artifact for already deployed contract?

I have several contrats to deploy on different chains. Normally, when I just deploy the contract with truffle-v5 it creates/updates json object of artifacts by the path ./build/contracts/MyContract....
0
votes
0answers
8 views

Truffle gas price on mainnet

I am trying to deploy my contract on mainnet. My truffle config says: live: { provider: function () { return new HDWalletProvider(MNEMONIC, API_URL) }, network_id: 1, ...
0
votes
1answer
16 views

How to deploy from a particular address in truffle

I have the following code in my token_migrations.js: const WETH = artifacts.require("WETH") const USDC = artifacts.require("USDC") module.exports = function (deployer, accounts) { ...
0
votes
1answer
24 views

How to get list of all emitted events in truffle console?

I wrote a very simple smart contract which emits an event everytime I call one of its functions: pragma solidity ^0.8.0; contract MyContract { event Score( uint date, string ...
0
votes
1answer
17 views

Construction function [closed]

My construction function accepts three arguments, one of which has to be a specific amount written in Wei. Whenever I try to compile and migrate my contract an error shows up notifying me that number ...
0
votes
0answers
11 views

Truffle compile error. ParseError: Expected ';' but got '}'

I am trying to compile my contract but I get ParseError while compiling Migrations.sol. I got this error after running E:\blockchain-learning\hooks-truffle-ganache>truffle develop truffle(develop)&...
0
votes
0answers
17 views

Hit a require or revert statement somewhere in its constructor

I have created a contract which creates a new UniswapV3Factory contract in the TopLevelContract constructor. The code is below pragma solidity = 0.7.6; import './../v3-core/contracts/UniswapV3Factory....
0
votes
0answers
23 views

Interrogation about Truffle deployer.deploy function arguments

I have the following Truffle migration: module.exports = function (deployer, networks, accounts) { var receiver = accounts[1]; var balance = 50000000000000000000; deployer.deploy(MPC, receiver, {...
0
votes
0answers
31 views

Saving migration to Binance smart chain testnet failed using truffle

I am trying to migrate my contracts to the BSC testnet but I constantly get an error message: Saving migration to chain.Error: PollingBlockTracker - encountered an error while attempting to update ...
0
votes
0answers
22 views

Cannot migrate contract to blockchain on Truffle's Pet Shop tutorial

I have completed Truffle's Pet Shop tutorial up to the point of migrating the Adoption.sol contract with 2_deploy_migration.js . This is the error that shows up in the terminal. Starting migrations... ...
0
votes
1answer
25 views

ERC721Burnable TypeError: Definition of base has to precede definition of derived contract

I'm getting an error due to Burnable but it's not even in my contract. @openzeppelin/contracts/token/ERC721/ERC721Burnable.sol:12:46: abstract contract ERC721Burnable is Context, ERC721 ...
1
vote
1answer
15 views

inheritance behavior of 2 contract when deployed

I would like to implement two contracts that extend another contract with an information store. Example: contract MonsterData { struct Monster { string name; int8 category; } ...
0
votes
2answers
69 views

Issue while migrating to Ropsten network

I am trying to migrate the contract to ROPSTEN network. It fails for the following reason. Please advice. migrate command $env:MNEMONIC=' XX XX XX';truffle migrate --reset --network ropsten Error ...
0
votes
0answers
10 views

Where to find the routerAddress, pairAddress, routerForkAddress, pairForkAddress? I am trying to make a clone of the UniswapV2

const BonusToken = artifacts.require('BonusToken.sol'); const LiquidityMigrator = artifacts.require('LiquidityMigrator.sol'); const Migrations = artifacts.require('Migrations'); module.exports = ...
0
votes
1answer
91 views

Cancelling truffle migrate to mainnet. With previous pending transactions that have low gas prices

I am exporting my smart contract to the Ethereum mainnet and I am using Truffle to export my smart contract. However when deploying I was trying out multiple parameters and as a result have 11 ...
1
vote
0answers
38 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....
0
votes
0answers
16 views

Truffle : Source code in build/contracts/HelloWorld.json doesn't change after first migrate

build/contracts/HelloWorld.json line 890: "source": "// SPDX-License-Identifier: MIT\r\npragma solidity 0.8.7;\r\n\r\ncontract HelloWorld{\r\n function hello() public pure returns(...
0
votes
0answers
11 views

"Error: Returned values aren't valid, did it run Out of Gas?" while calling ownerOf method in truffle develop

I am using the following code of NFT // contracts/MyNFT.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; // pragma solidity ^0.7.1; import "@openzeppelin/contracts/token/...
0
votes
2answers
53 views

Migration to test net works, but not to main net

I am trying to deploy my contract to the ETH mainnet / livenet. Everything works fine for the testnet, and also the dry-run for the mainnet works, but not the actual migration. Here is the output: ...
-1
votes
1answer
38 views

BSC testnet seems to be not up to date at truffle

it looks like my truffle setup is far behind the actual testnet, resulting that I cant deploy anything (getting timeout) 🔢 Code to reproduce truffle-config.js bsctestnet: { provider: () => ...
0
votes
1answer
126 views

"Uncaught ReferenceError: global 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 ...
1
vote
0answers
165 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() ...
0
votes
1answer
41 views

Contract has not been not deployed to detected network

I'm trying to access a smart contract in my local dev environment, but it doesn't appear to be deploying fully. In summary, I get what seems to be a successful migration, however, I am not able to ...
0
votes
0answers
20 views

Unable to deploy contract using Truffle on local network Geth : "ProxyAdmin" hit an invalid opcode while deploying

I am trying to deploy a simple contract using truffle on my local Geth network. But it is throwing the following error: Santanu@ITS-7 MINGW64 /d/xampp/htdocs/truffle_nft_example_nuxt (main) > ...
0
votes
0answers
43 views

Error with Truffle React (the contract doesn't have address)

Someone knows something about this error with Truffle React box? Must be my Metamask wallet address but it is already in my truffle-config file. I leave the App.js file here (I didn't make it. It's ...
0
votes
2answers
75 views

Contract is NOT deployed Despite calling truffle migrate

I'm trying to call a contract I've created. I've set up my truffle deployment script like so: var SafeYieldAggregator = artifacts.require("SafeYieldAggregator") module.exports = function(...
0
votes
1answer
18 views

The second contract is not getting deployed in migration

const Input = artifacts.require("Input"); const Register = artifacts.require("Register"); module.exports = function (deployer) { deployer.deploy(Input, "test_name") ....
1
vote
2answers
67 views

Cannot find module '@chainlink/contracts/truffle/v0.4/LinkToken'

I was following these steps in order to use Chainlink on Kovan testnet. when I've finished the configuration (truffle-config.js, npm install to get all the dependencies, etc.) and I've compiled the ...
2
votes
1answer
88 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 ...
0
votes
1answer
88 views

How to deploy a new version of a smart contract to a testnet?

So I have deployed a contract to the Rinkeby testnet but I have added some new features to it and I've tried deploying the contract again but it just says the following: √ Fetching solc version list ...
1
vote
0answers
53 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: { ...
0
votes
1answer
36 views

When migrating truffle second time, I get "Could not connect to your Ethereum client with the following parameters:"

When I first run truffle migrate yesterday, it worked. But today I am getting this error: - host > 127.0.0.1 - port > 8545 - network_id > * Please check that your Ethereum client: ...
0
votes
1answer
62 views

Truffle compiler version not changing

truffle.js: var HDWalletProvider = require("truffle-hdwallet-provider"); var mnemonic = ""; module.exports = { networks: { testnet: { provider: () => new ...
0
votes
0answers
42 views

Truffle Test - migration and test deploy contracts but test uses the parameter of migrations

I rage with this messed up truffle suit :D I have two contracts. One contract is owner of the other contract and is set at deployment. Now when I test it with truffle... I got 4 diffrent Contracts... ...
0
votes
1answer
48 views

truffle migrate ran out of gas

I'm trying to migrate my contract to a mainnet fork using ganache-cli: ganache-cli -f https://mainnet.infura.io/v3/{infuraKey} -l 8000000000000 --defaultBalanceEther 1000000000 --...
0
votes
1answer
14 views

Is it possible to construct objects in javascript and pass it to Solidity?

Let's say I have these 2 contracts defined in the same solidity file. contract Coin { string public name; constructor(string _name) public { name = _name; } } contract MetaCoin { ...
0
votes
1answer
54 views

I can't compile my solidity contract, can someone help correct the code. i've been trying for about 24 hours now

This is my smart contract: pragma solidity ^0.5.0; contract Agent { struct patient { string name; string dob; address[] doctorAccessList; uint[] diagnosis; ...
0
votes
0answers
51 views

Truffle migrate --reset issues

Been on this for hours. Those Dapp tutorials are terrible. Why is this happening? My truffle.js file is fine. Why can't it read the javascript? `Ryans-MBP:hidalgo ryan$ npx truffle migrate --reset /...
1
vote
0answers
21 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 ...
0
votes
1answer
187 views

Timeout error while attempting to migrate in the ganache-cli

I'm trying to deploy the smart contract using ganache-cli local blockchain server. I started the ganache-cli server and this is how my truffle-config.js file looks like... Truffle-config.js module....
0
votes
1answer
117 views

Deploy multiple truffle contracts with dependency

Suppose I would like to migrate 2 contracts that are dependent on each other. This can can be done with var contract1 = artifacts.require("contract1"); var contract2 = artifacts.require(&...
0
votes
1answer
103 views

Contract constructor parameter which is also a contract

I have contract in solidity MasterChef.sol which can be seen at the link below https://github.com/pancakeswap/pancake-farm/tree/master/contracts I want to deploy it using truffle on the Binance smart ...
0
votes
1answer
59 views

Is it compulsory to deploy 1_initial_migration.js every time I deploy a contract?

When I run truffle deploy, it deploys 1_initial_migration.js before every contract. Is there anyway this can be avoided? Or is this part of protocol and is supposed to happen everytime? Thank you.
0
votes
0answers
20 views

Can't find funded ropsten account using truffle console

I am not able to see my account on the ropsten network in truffle console when connecting to the ropsten network. I copied the mnemonic out of metamask and start truffle console with 'truffle console -...
0
votes
0answers
11 views

Truffle deploy smart contract from specific file [duplicate]

My contracts folder has the following files: AdSpace.sol,Migration.sol,AdSpaceV2.sol, and EAdSpace.sol. I have earlier deployed AdSpace.sol, and just added the other 2 files. AdSpaceV2.sol contains ...
1
vote
0answers
63 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 ...
0
votes
0answers
39 views

Not able to understand migration file for Crowdsale in ERC20

I am trying to understand nuts and bolts of the simple CrowdSales in ERC20. In the simplest way, we have a smart contract that mint the fixed number of tokens (SimpleToken) and then we have the ...
0
votes
0answers
83 views

Receving Error "'Migrations'-- invalid sender" during deployment to BSC mainnet

I have tried each of the suggestions mentioned in the official issue pointing to this problem to no prevail in BSC MainNet. I have had success in BSC TestNet as well as Ropsten TestNet. However, the ...
0
votes
2answers
353 views

Truffle Deployment Error: has no network configuration for its current network id (97)

I'm having an issue deploying a contract with Truffle. The contract constructor takes 7 parameters which are all within the 2_deploy_xxx.js file. However, every time I do, I get an error when I get to ...

1
2 3 4 5
9