These are chat archives for Nethereum/Nethereum

29th
Nov 2018
keepbreath
@keepbreath
Nov 29 2018 03:16
@EnigmaticUnreal_twitter ,Hello, I have a question that I am confused about, the same smart contract, the result of trading is different.Tx1:0x029d2618dd025125d75233e54833bf07c369179c7eba83c3170b14f0f104650d(Success)Tx2:0x029d2618dd025125d75233e54833bf07c369179c7eba83c3170b14f0f104650d(Fail),Can you help me with it?Thanks in advance:)
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 03:59
@keepbreath - Hey sure, could you share with us what are you working on? Is this on Ropsten/Rinkeby? I see that you have two of the same transaction hash, just wondering what's going into these transactions, and what contract are you calling.
keepbreath
@keepbreath
Nov 29 2018 04:46
@EnigmaticUnreal_twitter ,emmm...
var handler = web3.Eth.GetContractHandler(contractAddress);
var transactionHash = await handler.SendRequestAsync(transferfuction);
keepbreath
@keepbreath
Nov 29 2018 04:53
i want to send token by contract.The number of tokens that need to be passed should be received by "Value" instead of "AmountToSend"?
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 05:01

Ah. Not value, but it is as a separate parameter. I am not sure what transferfunction is in this case, but maybe you can do something like:

Dim tokentransfer = tokenContract.GetFunction("transfer")
Dim transactionHash = Await tokentransfer.SendTransactionAndWaitForReceiptAsync(account.Address, gas, value, , toAccount, numTokens)

Where value is 0. Remember that a typical transfer accepts two parameters (address to, uint amount), so that's the last two variables in SendTransactionAndWaitForReceiptAsync.

You could also use refer to this which might be better: https://nethereum.readthedocs.io/en/latest/Nethereum.Workbooks/docs/nethereum-smartcontrats-gettingstarted/

I think this uses the StandardTokenService.

Transfer is just something like:
var transfer = new TransferFunction()
{
    To = receiverAddress,
    TokenAmount = 100
};
keepbreath
@keepbreath
Nov 29 2018 05:49
@EnigmaticUnreal_twitter ,Ah,I tried passing the number of tokens to the Value, and it worked!https://ropsten.etherscan.io/tx/0xc1fff55131cfe652a64e92828dc780af4a4cdd0866a1df8ceae8711d36140527
Juan Blanco
@juanfranblanco
Nov 29 2018 06:10
yes AmountToSend is the Ether (Wei) amount, Value it is the Token value (mainly that is the name of the parameter)
This is why AmountToSend is called that way (ugly enough name to not be confused with other contract parameter values)
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 07:03
Aaaaaahhh I see what you mean @keepbreath - Thanks for letting me know. :D
:pray: @juanfranblanco
keepbreath
@keepbreath
Nov 29 2018 07:08
emmm,Learn Together with progress together
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 07:09
Yes, we will never stop learning. :D
MANOJKUMARCH
@MANOJKUMARCH
Nov 29 2018 10:28
Hi, Could someone please explain me on how the filter EthNewPendingTransactionFilter works. I have seen the sample in https://github.com/Nethereum/Nethereum.Issues/blob/master/Net.Issues.Console/PendingTransactionsSample/PendingTransactionsSample.cs
In the code does the "filterChanges " gives the quantity of the number of pending transactions?
Ronald Lino
@RonLino
Nov 29 2018 12:30
Hi, I would like to deploy smart contracts at runtime, thus I need to compile smart contracts (solidity) in Nethereum. I think that I could do this calling solc (the c++ compilier of solidity) from Nethereum. But are there any utility or tutorial to do this in an easy way? (like solc.js in web3.js)
hessam94
@hessam94
Nov 29 2018 16:13
Hey Juan, I was working with Nethereum and there was problem in my code, Actually the name of my solidity function was not as the same with my C#(nethereum) and i got error (case sensitivity of the names). But I suggest you that modify the exception because I gave me the error "gas exceeded....". it wasn't about the gas at all. for every type of error you show only this exception. and I took me 8 hours to find the problem,
Second, I still cannot connect to Robsten or any test network in infura!! don't you have any idea! I created my project and have right ProjectId. Thanks
Joshua Duxbury
@p0onage
Nov 29 2018 16:31
@RonLino at the moment I don't think Netherium can compile the smart contract for you but looking at some recent PR's there is getting better integration with truffle to be able to get closer to doing so : Nethereum/Nethereum#469
Juan Blanco
@juanfranblanco
Nov 29 2018 16:36
@MANOJKUMARCH in that scenario it returns an array of the transaction hashes
MANOJKUMARCH
@MANOJKUMARCH
Nov 29 2018 16:38
@juanfranblanco , I have tested the code, but I did not get any transaction hashes though I have pending transactions in txpool
Juan Blanco
@juanfranblanco
Nov 29 2018 16:38
@hessam94 the error is returned by the client, Nethereum does not know the function name, and uses the one provided (either in the abi or in the function message)
to build the signature
Juan Blanco
@juanfranblanco
Nov 29 2018 16:46
@MANOJKUMARCH var pendingFilter = await web3.Eth.Filters.NewPendingTransactionFilter.SendRequestAsync();
did you use the above?
Are there any queued instead of pending transactions?
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 16:47

@RonLino at the moment I don't think Nethereum can compile the smart contract for you but looking at some recent PR's there is getting better integration with truffle to be able to get closer to doing so : Nethereum/Nethereum#469

I was thinking of this before - maybe we might be able to do something using .NET's Process.start/ProcessStartInfo or similar with parameters? Then we can have the Solidity codes somewhere, grab the file path, pass it to solc, and have it compiled.

Haven't gotten around to trying it out though. :(

Juan Blanco
@juanfranblanco
Nov 29 2018 16:49
another option is to have the compiler embedded / called by c++ interop
but for simple upgrading the Process.Start is the simplest thing
here are the instructions to install / build solidity
Juan Blanco
@juanfranblanco
Nov 29 2018 16:54
i always build mine (doh)
Enigmatic
@EnigmaticUnreal_twitter
Nov 29 2018 16:56

@juanfranblanco Interop... I know that word! Used to see it when we were building Office add ins.... :P I'll try to spend some time on this next week (sample of compiling bytecode through .NET)

@RonLino - I'll read up a little. :D Between Truffle and solc I suspect solc might be easier to bundle, but I could be wrong. More to learn.

Juan Blanco
@juanfranblanco
Nov 29 2018 16:56
yes you could also call truffle too
Ronald Lino
@RonLino
Nov 29 2018 22:14
Thank you @juanfranblanco and @EnigmaticUnreal_twitter, when I wrote “that I could do this calling solc (the c++ compiler of solidity) from Nethereum“ I was thinking in solutions like the ones you have proposed, I had already read the docs of solc and I had installed it, but I would like to avoid developing all the underlying plumbing.
I will continue developing in this way.