These are chat archives for Nethereum/Nethereum

22nd
Aug 2018
Enigmatic
@EnigmaticUnreal_twitter
Aug 22 2018 01:33
For token transfers you'll definitely need more than 21000 gas (which only allows you to do a normal ether transfer). Try 100k, the transaction will use what it needs and refund the rest.
Then next you can start looking into how to use estimategasasyc
Michael Ilchuk
@Ilchuk-Mihail
Aug 22 2018 08:13

Hi.

How to deploy contract and pass to constructor array ?

expected array address[]

i pass array[3] and gets exection

System.Exception: Too many arguments: 3 > 1
Michael Ilchuk
@Ilchuk-Mihail
Aug 22 2018 08:27
I resolve the issue - pass List, instead array
Enigmatic
@EnigmaticUnreal_twitter
Aug 22 2018 08:34
Ah @Ilchuk-Mihail, was about to reply you once I reached my hotel. :)
I did do some work using arrays before, so am personally curious to see how you solved it.
image.png
(don't mind the comments) When I was working on my code in VB I used arrays. :)
Admittedly this isn't constructor argument though. I'll try that later and see how that works too.
Michael Ilchuk
@Ilchuk-Mihail
Aug 22 2018 08:41
I only converted string array to Lіst<string> , and it worked
Enigmatic
@EnigmaticUnreal_twitter
Aug 22 2018 08:43
:) I'll see if I could reproduce the same issue as you, and also try List myself too. Thanks @Ilchuk-Mihail
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 10:10
@EnigmaticUnreal_twitter still giving me RpcResponseException: insufficient funds for gas * price + value
with 100,000
I have enough ETH
junbest
@junbest
Aug 22 2018 11:31
use this instead decimal d = Convert.ToDecimal(txt_eth_gwei.Value);
ulong u = (ulong)(d * 1000000000m);
basemodel.GasPrice = u;
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:31
let me try - one sec
junbest
@junbest
Aug 22 2018 11:32
use gwei=2
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:33
txt_eth_gwei.Value
make this 2?
junbest
@junbest
Aug 22 2018 11:33
yes
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:33
alright
junbest
@junbest
Aug 22 2018 11:33
are sending what? Ethereum or ERC20?
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:33
ERC20
junbest
@junbest
Aug 22 2018 11:35
var account = new Account(key);
var web3 = new Web3(account, url);
            basemodel.GasPrice = gas_price;

            Ensure.ArgumentNotNullOrEmpty(addressTo, "Address To");
            Ensure.ArgumentNotNullOrEmpty(url, "Url");
            Ensure.ArgumentNotNull(account, "Account");
            Ensure.ArgumentNotNull(amount, "Token Amount");

            var transferfuction =
                new TransferFunction
                {
                    TokenAmount = Web3.Convert.ToWei(amount),
                    To = addressTo,
                    FromAddress = web3.TransactionManager.Account.Address
                };

            if (basemodel.Gas != null) transferfuction.Gas = new HexBigInteger(basemodel.Gas.Value);
            if (basemodel.GasPrice != null) transferfuction.GasPrice = new HexBigInteger(basemodel.GasPrice.Value);

            var handler = web3.Eth.GetContractHandler("EC20");
            var transactionHash = await handler.SendRequestAsync(transferfuction);
gas_price is ulong=2 gwei convert it to ulong
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:37
alright
ill lyk
whats basemodel?
@junbest
junbest
@junbest
Aug 22 2018 11:40
it is a class, do this instead ulong GasPrice
should work
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:42
and what have you set as the gas?
junbest
@junbest
Aug 22 2018 11:45
use default 21000
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:46
ulong Gas = (ulong)Nethereum.Signer.Transaction.DEFAULT_GAS_LIMIT;?
junbest
@junbest
Aug 22 2018 11:47
Yes
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:49
Still getting RpcResponseException: insufficient funds for gas * price + value
junbest
@junbest
Aug 22 2018 11:56
check your ETH balance it require funds
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:56
I have 0.19 ETH
junbest
@junbest
Aug 22 2018 11:56
when sending ERC20 transaction it deduct ETH
then check your codes and debug it
line by line
your other code have problem for sure
Abdullah Rangoonwala (Absence)
@AbsenceAbdullah_twitter
Aug 22 2018 11:57
Yes. After handler.sendrequest it throws insufficient funds
deancasey
@deancasey
Aug 22 2018 12:39
Hi all, hope oi am on the right conversation. I am getting a wierd errors on VS Code Solidity. It reads "linebreak-style: Inconsistent line-break style" on the pragma line for every smart contract I write myself. The truffle template migrations one does not have this problem. Any ideas on how to resolve?
Enigmatic
@EnigmaticUnreal_twitter
Aug 22 2018 13:56

@AbsenceAbdullah_twitter - Another possibility is that you might have to check if web3 is initialised with the account with 0.19ETH balance, or if you're on the correct chain (mainnet/ropsten/infura).

Otherwise you could put your code up on Gist and we'd be happy to have a look through.

Enigmatic
@EnigmaticUnreal_twitter
Aug 22 2018 14:06

@deancasey - Ah might be this. Double check if it's relevant to your case?

juanfranblanco/vscode-solidity#86

or if you're on the correct chain (mainnet/ropsten/infura).

I meant mainnet/ropsten/rinkeby lol

deancasey
@deancasey
Aug 22 2018 14:11
@EnigmaticUnreal_twitter
@EnigmaticUnreal_twitter - yup that was it. Sorted by adding the comment. Thanks very much
Cdpopham
@Cdpopham
Aug 22 2018 19:50
@juanfranblanco When deserializing and call output - what does an enum deserial best to. Do you set the type and "enum" or "uint" in the attibute tag
p0isoN
@p0isoNz_twitter
Aug 22 2018 21:50
@EnigmaticUnreal_twitter having the same issue as @AbsenceAbdullah_twitter
I have 1 ETH
Using the code you sent as its the one online
And getting the same issue
Main net on both
Is this a bug on Indira's side maybe?