trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.03k stars 2.31k forks source link

Issue using latest truffle migrate #6202

Open etherbase404 opened 9 months ago

etherbase404 commented 9 months ago

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........
MadelineMurray commented 9 months ago

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

TechnicallyWeb3 commented 5 months ago

@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.

AhsanHafeez2525 commented 5 months ago

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

8dci commented 4 months ago

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