These are chat archives for Nethereum/Nethereum

27th
Sep 2018
Schalk Dormehl
@sjalq
Sep 27 2018 14:05
Hey guys
How would I go about using Nethereum to build a simpler type of decoder?
Something like
T Decode<T>(byte[] Data)
byte[] Encode<T>(T Input)
Juan Blanco
@juanfranblanco
Sep 27 2018 15:22
well you have already the IntType and so on
Michael Ilchuk
@Ilchuk-Mihail
Sep 27 2018 15:27

Hi.

If I Have Token with 8 decimals.
Which convertind do I need to do for transfer ?

For example- if I want to send 0.1 ETH - I convert it
var weiAmount = Web3.Convert.ToWei(amount);

What to do for token with different decimal ?

Schalk Dormehl
@sjalq
Sep 27 2018 15:35
@juanfranblanco if I wanted to build something a little more involved like taking an object of type T and having inspecting it's members with reflection to map them to default solidity types how can I leverage the Nethereum code to ease that decoding? IE Which classes do I need to look at?
Juan Blanco
@juanfranblanco
Sep 27 2018 15:36
well you will need to create the same as a function encoder
but you need the order of elements
and you have issues with arrays
and other stuff
so mainly everything that is done for encoding at the moment / decoding at the moment
(function encoder / decoder) reflection etc, etc
now.. how you get the order right of the elements...
Juan Blanco
@juanfranblanco
Sep 27 2018 15:43
multiple arrays and complex objects will get very interesting
Michael Ilchuk
@Ilchuk-Mihail
Sep 27 2018 17:06

I have function in contract with this parameters - cashout(address _to, uint256 _amount, bytes32 _msgHash, bytes _signature, address _coinAddress)

In body I am checking if (_coinAddress != address(0)) ... and send eth, or erctokens

if I set to parameters coinAddress - all it's work
but if i want to send eth, and not set coinadddress - I get error
if I set coinaddress to null, or "" - get error with encoding

How to set this optional parameter ?

Twilight Punkster
@twilightpunkster
Sep 27 2018 20:56
where can I find web3.eth.accounts.sign in the Unity release? It seems not present, most examples use the old scripting backend without Accounts.
Twilight Punkster
@twilightpunkster
Sep 27 2018 21:07
nvm
proBeejay141
@proBeejay141
Sep 27 2018 21:36
am getting this error for token transfer : "gas required exceeds allowance or always failing transaction"
Twilight Punkster
@twilightpunkster
Sep 27 2018 22:31
ugghh TransactionSignedUnityRequest seemed to be the solution, but I can't seem to find a simple data, privatekey sign method like web3.accounts has