These are chat archives for Nethereum/Nethereum

22nd
Jun 2018
Truong Dang Nghia
@DangNghia123_twitter
Jun 22 2018 05:17
@juanfranblanco hi, i was asking you about how to tranfer eth from one address to multiple addresses at same time, i'm using 1 instant of web3 and this is my code
public async Task<string> TransferEqualAmounts(string TO_ADDRESS)
        {
            var dem = await web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(ADDRESS);
            BigInteger hex = dem.Value + index;
            Console.WriteLine("hex: "+ new HexBigInteger(hex).HexValue);
            var input = new TransactionInput()
            {
                Nonce = new HexBigInteger(hex),
                To = TO_ADDRESS,
                From = ADDRESS,
                Gas = new HexBigInteger(BigInteger.Parse("21000")),
                Value = new HexBigInteger(AMOUNT)
            };
            input.GasPrice = new HexBigInteger(BigInteger.Parse(FEE + "000000000"));
            var send =await web3.Eth.TransactionManager.SignTransactionRetrievingNextNonceAsync(input);
            Console.WriteLine(send);
            var sendd =await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync(send);
            index++;
            Console.WriteLine(sendd);
            return sendd;
        }
Juan Blanco
@juanfranblanco
Jun 22 2018 05:26
you need to do each transfer separately
@h2odysee from a transaction you will not get any results, but you can use events to get some output
and decode them from the logs receipt
@zeshanvirk it mainly iterates the blockchain blocks / transactions / etc and stores them in azure storage
Truong Dang Nghia
@DangNghia123_twitter
Jun 22 2018 05:32
@juanfranblanco i just tested with 100 addresses, i got 100 transactionHash but can not check it on etherscan
Juan Blanco
@juanfranblanco
Jun 22 2018 05:38
they will need to be mined etc
by the way Web3.Convert.ToWeit
will help you on the GasPrice
and the Gas value is already in Transaction.DEFAULT_GAS
also if you don't put it it will work as it is already the default gas
lastly the TransactionManager.SendTransaction()
already does the nonce check and sends it for you
Truong Dang Nghia
@DangNghia123_twitter
Jun 22 2018 05:58
@juanfranblanco i have a question, when i use metamask to make transactions, txHash can be check on etherscan immediately but when i use nethereum it need about 5-6 hour for checking
Michael van der Veeken
@mvdv
Jun 22 2018 07:18
@DangNghia123_twitter : Can it have to do with the gasprice? A low gasprice will mean your transaction will not be picked up by miners in a timely manner.
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:40
when we send the erc20 it requires gas which is calculated in eth balance, and the address from which you are sending the tokens must have the eth balance in order to pay the gas amount, but on exchanges when we send tokens we don't have eth in our address but still the transaction got confirmed, How they are managing this?
is it mandatory for the address to have the eth balance in order to transfer tokens?
Juan Blanco
@juanfranblanco
Jun 22 2018 07:42
what type of exchanges
centralised or dex
decentralised
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:42
decentralized
Juan Blanco
@juanfranblanco
Jun 22 2018 07:43
what dex
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:43
binance
Juan Blanco
@juanfranblanco
Jun 22 2018 07:44
binance is centralised not?
Michael van der Veeken
@mvdv
Jun 22 2018 07:44
binance is not decentralized?
Juan Blanco
@juanfranblanco
Jun 22 2018 07:44
never used it
but looking at it, is centralised
Michael van der Veeken
@mvdv
Jun 22 2018 07:45
There is a proposal to allow contracts to pay for gas: ethereum/EIPs#61
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:45
is the scenario different in centralized or dex?
of course in a dex the transactions are in the blockchain
so you control your assets
in a centralised exchange you transfer controls of your assets to them
and trade using their interface
but they have your assets until you withdraw them
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:47
ohh.
Juan Blanco
@juanfranblanco
Jun 22 2018 07:48
so all the transactions are done using a normal server / database
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:48
yes.
i think its contract issue, as @mvdv showed the proposal
Juan Blanco
@juanfranblanco
Jun 22 2018 07:48
well that is how Ethereum works
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:49
hmm
Juan Blanco
@juanfranblanco
Jun 22 2018 07:49
you could pay for people's transactions
by relaying their transactions
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:49
hmm
Juan Blanco
@juanfranblanco
Jun 22 2018 07:49
verifying them etc
but that opens another can of worms
Michael van der Veeken
@mvdv
Jun 22 2018 07:50
@zeshanvirk : Can you talk a little bit more about what you are trying to achieve? What kind of service/experience?
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:52
I'm developing a wallet for an ERC20 token, that wallet will send and recieve tokens only, not eth. so i'm facing a problem here when i send tokens, the address requires the eth balance for gas, and as per my view the gas should be paid from contracts/ token's balance or their should be an option to set it.
Juan Blanco
@juanfranblanco
Jun 22 2018 07:54
well yep you need ether to be able to pay for the transaction..
Michael van der Veeken
@mvdv
Jun 22 2018 07:54
You could have some kind of oracle that would perform the transactions so you can pay for the gas, but that introduces centralization and a server component to your wallet (and as @juanfranblanco a whole can of worms)
Juan Blanco
@juanfranblanco
Jun 22 2018 07:54
the other way is to have a centralised proxy
as above :)..
Zeshan Virk
@zeshanvirk
Jun 22 2018 07:55
okay
Got your point.
Juan Blanco
@juanfranblanco
Jun 22 2018 07:56
user creates transaction message (verifyable).. server picks the message validates it, etc ... sign and send it (pay) the messsage .. contract extracts the message and do the rest
Cryt1c
@Cryt1c
Jun 22 2018 13:25
Hi, I have a question: Is the usage of address[] as parameter in a function supported by Nethereum? If so, can I pass the addresses in as string[]?
Juan Blanco
@juanfranblanco
Jun 22 2018 14:52
yes addresses are strings
Cryt1c
@Cryt1c
Jun 22 2018 16:03
thanks!
tmyngu11
@tmyngu11
Jun 22 2018 21:45
hey I was wondering if anyone knows if nethereum with unity could somehow connect with a browsers metamask?
Also if there was any documentation for watching events using nethereum with unity