kopanitsa / web3-arduino

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

How to run a smart contract function with parameters over a transaction on Goerli? #27

Closed VDelport closed 1 year ago

VDelport commented 1 year ago

Would you please provide a code sample showing how to initiate a transaction on the Goeli testnet, where a function is called in a smart contract and parameters can also be passed to the function call, preferably as int8?

JamesSmartCell commented 1 year ago

Hi, I took on this library and am actively maintaining it here: https://registry.platformio.org/libraries/alphawallet/web3e

It has been extensively re-written where required for efficiency and use.

Goerli has been deprecated but there are examples of sending transactions in this repo, I will update to Sepolia which is successor of Goerli. Use:

lib_deps = Web3E

VDelport commented 1 year ago

In my smart contract I have a function setLed(int8). My problem was that in Contract::SetupContractData(const string func, ...), among other things, the string "int" is evaluated as an argument of a smart contract function, but not the argument string "int8". Therefore I extended the function Contract::SetupContractData(const string func, ...) to evaluate the argument string "int8" and solved my problem. Of course, it doesn't matter whether the smart contract was deployed in Goerli or in Sepolia.