These are chat archives for Nethereum/Nethereum

23rd
May 2018
aspramsh
@aspramsh
May 23 2018 06:17

@juanfranblanco I have one more question. I think maybe I pass wrong parameters or something like that. When I want to burn tokens, I call this method:
var contract = _web3.Eth.GetContract(abi, contractAddress);
var multiplyFunction = contract.GetFunction("burn");
var etherEquvalent = UnitConversion.Convert.ToWei(amount);
var result = await multiplyFunction.CallAsync<bool>(etherEquvalent );

The problem is that my result is always false.

Juan Blanco
@juanfranblanco
May 23 2018 07:00
@aspramsh if you want to burn tokens you will need to SendTransaction
instead of a call
the calls just peform queries / calcutlations etc but not affecting the state
aspramsh
@aspramsh
May 23 2018 07:02
Ok @juanfranblanco, thanks a lot.
Juan Blanco
@juanfranblanco
May 23 2018 07:08
@wtlab just create a full transactionInput
instead
that includes all the parameterers
value, gas, gas price, to, etc
Michael van der Veeken
@mvdv
May 23 2018 14:41
@juanfranblanco : I'm trying to connect to my new Kaleido deployment, but need to provide a username/password (basic auth). I've tried including it in the URL, but I get a 401 unauthorized when doing RPC requests. Is there a way to create a Web3 with basic auth?
Juan Blanco
@juanfranblanco
May 23 2018 14:43
I have not had done it myself
the RpcClient accepts a AuthenticationHeaderValue
that might help you
but I have not tried Kaleido.. so I cannot comment on that one
Michael van der Veeken
@mvdv
May 23 2018 14:55
let me look into that. Thank you.
Matthew
@ThatSlyGuy
May 23 2018 17:42
Hey @juanfranblanco, how does Wallet creation work with different mnemonic phrase sizes? For example, creating a new Wallet with a 12 word phrase which is usable with Metamask produces the same result as Metamask. However, what if I want to use a 24 word phrase for example, like the one used to generate the Ledger ethereum wallet? I have tried using the default path, as well as some others but I'm not sure why I'm not seeing the same results as with the Ledger. Any thoughts?
aspramsh
@aspramsh
May 23 2018 18:47

@juanfranblanco hi again. I have a question again.

var etherEquvalent = UnitConversion.Convert.ToWei(amount);
var result = await SendTransactionAndWaitForReceiptAsync(abi, "0x72e17678A65913f7189D454030d21a7D1dD51484", "burn", 4000, 490, etherEquvalent);

when I want to burn my tokens from this address, the transactions succeeds in ropsten testnet, but the balance of my tokens remains the same.

Juan Blanco
@juanfranblanco
May 23 2018 19:54
@ThatSlyGuy It should work (in theory) with the following path ELECTRUM_LEDGER_PATH = "m/44'/60'/0'/x"
raise an issue if that doesn't work for you (as it might have change the standard)
@aspramsh i cannot see the function in your wrapper call
have you checked the status in your recipt?
receipt**
aspramsh
@aspramsh
May 23 2018 19:58

@juanfranblanco sorry, my function is
public virtual async Task<TransactionReceipt> SendTransactionAndWaitForReceiptAsync(string abi, string contractAddress, string methodName, int gas, int gasPrice, params object[] arguments)
{
try
{
var contract = _web3.Eth.GetContract(abi, contractAddress);
var gasPriceHex = new HexBigInteger(UnitConversion.Convert.ToWei(gasPrice, UnitConversion.EthUnit.Kwei));
var gasLimit = new HexBigInteger(UnitConversion.Convert.ToWei(gas, UnitConversion.EthUnit.Gwei));

            var multiplyFunction = contract.GetFunction(methodName);
            var result = await multiplyFunction.SendTransactionAndWaitForReceiptAsync(_account.Address, gasPriceHex, gasLimit, null, null, arguments);

            return result;
        }
         catch (Exception exp)
       {             
            Debug.Write(exp);
            throw;
        }

    }

Yes the status is 1. Sorry for the mess in my code.

Matthew
@ThatSlyGuy
May 23 2018 20:01
You're right, that path produced the correct results, thanks! Does there happen to be a list anywhere online with the different phrase lengths and their respective paths? I know there are other phrase sizes with 18 words and 21 words for example, but I don't fully understand the mechanics behind how a path derives the keys that it does.