These are chat archives for Nethereum/Nethereum

13th
Jan 2018
shareworlds
@shareworlds
Jan 13 2018 12:15
Given: event Transfer(address indexed _from, address indexed _to, uint256 _value);
i want to filter by "_to" address = "0x1234...", how to write the filter?
this function "CreateFilterAsync" need "firstIndexedParameterValue", but i only want to filter by second indexed parameter.
how can i ignore the first index parameter?
TarrahArshad
@TarrahArshad
Jan 13 2018 12:24
@juanfranblanco hi i need after recive ETH contract automatic send my token to sender its possible ?
Juan Blanco
@juanfranblanco
Jan 13 2018 14:05
@TarrahArshad yes it is
make a method payable or the catch all
and from the do a conversion of Ether / token and set the balance of msg.sender to it
@shareworlds make the first topic null
@nanexcool cool
@hak check the TransactionSigner
not the message signer
just convert your TransactionInput to a Transaction
Michael Herman (Toronto)
@mwherman2000
Jan 13 2018 19:27
@juanfranblanco RE: Nethereum.SimpleWindowsWallet. Hi, what does the build environment look like for the wallet? ...assuming I'm starting with VS 2017 Community Edition
Michael Herman (Toronto)
@mwherman2000
Jan 13 2018 20:32
I've made some progress and then ran into the InitiailizeComponent() problem in Zamarin. The fix at the very bottom of this post worked to resolved this: https://forums.xamarin.com/discussion/96447/the-name-initializecomponent-does-not-exist-in-the-current-context
hak
@hakart_twitter
Jan 13 2018 22:59

@juanfranblanco Thanks for response!
I was able to sign transaction and get SigV, SigR, SigS with following code

 var transactionMessage = "0x19" + "00" + contractAddress.Remove(0, 2) + destination.Remove(0, 2) + LeftPad(amountByWei.ToString("x"), 64, '0') + LeftPad(nonce.ToString("x"), 64, '0');

 var transactionhash = "0x" + new Sha3Keccack().CalculateHashFromHex(transactionMessage);
 var transactionbytes = transactionhash.HexToByteArray();
 var signature = signer.Sign(transactionbytes, new EthECKey(privateKey));
 var sigRSV = EthereumMessageSigner.ExtractEcdsaSignature(signature);

but seems i have issue with solidity ecrecover when i build transaction message and pass to contract

  bytes32 txHash = keccak256(byte(0x19), byte(0), this, destination, value, data, nonce);
  address recovered = ecrecover(txHash, sigV, sigR, sigS);

Netehereum signer.EcRecover(transactionbytes, signature); works fine for me

So my questions are

  • do we have any alternative method insteed of constructing transaction message in Nethereum
    var transactionMessage = "0x19" + "00" + contractAddress.Remove(0, 2) + destination.Remove(0, 2) + LeftPad(amountByWei.ToString("x"), 64, '0') + LeftPad(nonce.ToString("x"), 64, '0');
  • Is there any difference of Nethereum signer.EcRecover and ecrecover(txHash, sigV, sigR, sigS) ?
  • what do you think why i'm not getting same result when call solidity ecrecover(txHash, sigV, sigR, sigS)
@juanfranblanco I'm really appreciate your help