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.