kopanitsa / web3-arduino

an Arduino (or ESP32) library to use web3 on Ethereum platform.
MIT License
105 stars 45 forks source link

insufficient funds for gas * price + value #21

Open toutou8148 opened 3 years ago

toutou8148 commented 3 years ago

Hello, I can interact with Ethereum network using this library but I can't interact with smart contracts as I receive the error "insufficient funds for gas * price + value". However, the account that I use has enough ether. The problem is related to the private key, I think I am not accessing to my account. May you help me.

I am setting my private key as a string and I got it using Metamask. In provided example, the form of the private key is as follow: const char PRIVATE_KEY[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; How can I get this form.

ghost commented 3 years ago

You are using mnemonic right? You tried using the key as it is given by metamask in account details and passing it as a string?

Also, if you dont mind, how can you make this library work? it worked at first try without changing anything? im having a lot of problems trying to simply make a call with the samples

toutou8148 commented 3 years ago

Hi, Actually, I made some changes to get the library work. I don't remember exactly what changes I have made. But, I think that I deleted some files and making some changes on the code. You can send me what errors you get and I will tell you what you must do to fix the errors. the private key must be set as a tab of char and not string, otherwise it will not work. I passed weeks to get it works.