Sender's account only has: 0 when forking Ganache-cli

Hello Guys,

I have had this problem for a while, and any advice would be highly appreciated. I tested my ideas using Ganache-cli, and I tried to send some ether to a smart contract. The wallet have lots of ether, but I always got the error saying "sender doesn't have enough funds to send tx. The upfront cost is:********************* and the sender's account only has: 0"

I saw someone said "changing Mnemonic in truffle-config to match Mnemonic generated from Ganache-cli very time could solve this problem. Could anyone here walk me through this??

Here is the transfer code in Node.js:

           await WETH_contract.methods
          .transfer(Contract.address, 10000000)
          .send({from: MyAccount})

truffle-config setup:   development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: 999,       // Any network (default: none)
      gasPrice: 20000000000,
      gas: 3716887,  
    },
    mynetwork: {
      host: "localhost",
      port: 9545,
      network_id: '*',
      gasPrice: 20000000000,
      gas: 3716887    
    },

Thanks a lot.

``` ganache-cli --account "{uint256 PrivateKey},{uint256 StartingWei}" --networkId {uint256 NetworkID} ```

Here's an example.

ganache-cli --account "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140,10000000000000000000000" --networkId 1337

Then just use that private key in your truffle project when connected to ganache network.

(post deleted by author)

Thanks so much for your reply! Then I can use "--unlock " and other functions after this format, right?