web3.unity icon indicating copy to clipboard operation
web3.unity copied to clipboard

Added Generic<T> Extension Methods for Contract

Open oleksandrchainsafe opened this issue 1 year ago • 1 comments

Original Call & Send methods of Contract class operate with arrays of object object[], for both input and output values. This leads to a lot of boilerplate code each time you want to interact with a smart-contract.

The extension methods automate most of this work for you.

oleksandrchainsafe avatar Mar 26 '24 18:03 oleksandrchainsafe

What if there's more than 3 params that are being passed on? :D

Then there are 2 options:

  • Do it using the old ugly way,
  • Create your own extension method with 4, 5, 6.. parameters (and ideally post it as PR)

But from my experience so far, 3 arguments are more than enough for 99% of the cases.

oleksandrchainsafe avatar Apr 22 '24 16:04 oleksandrchainsafe