truffle icon indicating copy to clipboard operation
truffle copied to clipboard

Issue using latest truffle migrate

Open etherbase404 opened this issue 1 year ago • 4 comments

Truffle v5.11.5 (core: 5.11.5) Solidity - 0.8.21 (solc-js) Node v20.8.0 Web3.js v1.10.0

I am using a geth private node for testing, I can send requests to the node from web3.py without any issues. I am trying to deploy a smart contract on it using truffle but nothing happens.

truffle migrate --network private

Happening:

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Network up to date.

I looked everywhere online and cant find any solution :S

My truffle config:

const HDWalletProvider = require('@truffle/hdwallet-provider');
const mnemonicPhrase = "** ** ** ** ** ** ** ** ** ** ** **"; //I got the mnemonic phrase from MetaMask (First Account - ETH Mainnet)

module.exports = {
  networks: {
     development: {
      host: "127.0.0.1",
      port: "8986",
      network_id: "83711",
     },
     private: {
       provider: () => new HDWalletProvider(mnemonicPhrase, "http://127.0.0.1:8986"),
       network_id: "83711"
     }
  },
  mocha: {
  },
  compilers: {
    solc: {
      version: "0.8.21",
    }
  },
};

My deploy contract migration:

var MyToken = artifacts.require("MyToken");

module.exports = function(deployer) {
  deployer.deploy(MyToken);
};

I checked if anything was deployed on the private chain and it shows nothing..

Expected:

Deploying 'MyToken'
--------------------
> transaction hash:    0x.........
> contract address:    0x........

etherbase404 avatar Oct 08 '23 18:10 etherbase404

hi @etherbase404 - Truffle is being sunset. For more information and migration options, click here.

MadelineMurray avatar Oct 10 '23 23:10 MadelineMurray

@etherbase404

Truffle v5.11.5 (core: 5.11.5) Solidity - 0.8.21 (solc-js) Node v20.8.0 Web3.js v1.10.0

I've noticed versions solc 0.8.19 is the highest that doesn't fail.

TechnicallyWeb3 avatar Jan 28 '24 05:01 TechnicallyWeb3

I face same issue,

Try change your pragma and solc version

Migrations.sol

// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0;

truffle-config.js

compilers: { solc: { version: "0.5.1" } Sometimes, solc works for me with 0.8.20 or 0.7.3

AhsanHafeez2525 avatar Jan 30 '24 07:01 AhsanHafeez2525

Hello, can you help me? The same problem appeared and I did not find a solution

8dci avatar Feb 14 '24 18:02 8dci