0

I am working on a smart contract and using Ganache for testing when I run

truffle migrate

the smart contract migrates to ganache successfully and the blocks are created however the balance on the account section is not changing.

it's showing a 100 balance for all accounts no matter how many transactions I complete.

why is that?

ganache: {
      host: "localhost",
      port: 7545,
      network_id: "*"
    },
2
  • Are you using the ganache graphical interface? And by migrating to ganache successfully, do you mean that you can see the contracts in the contracts section of the graphical interface? Feb 24, 2022 at 16:18
  • yes, I am using ganache gui and I can see block creating and transaction details too but the balance is still 100. when I import the account to MetaMask then it does not show the 100 then it shows the balance remaining after a transaction.
    – Younas
    Feb 24, 2022 at 16:55

2 Answers 2

0

truffle migrate runs migrations on local ganache instance included within truffle itself.

To tell truffle to use ganache-gui you need to use

truffle migrate --network ganache

as you defined ganache as a network in truffle-config.js

1
  • tried truffle migrate --network ganache too same issue.
    – Younas
    Feb 24, 2022 at 16:47
0

Make sure that u have added network_id as 5777(network_id of ganache) not *

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.