These are chat archives for Nethereum/Nethereum

14th
Mar 2017
Juan Blanco
@juanfranblanco
Mar 14 2017 05:27
@vladyslavmunin there is a problem deserialising the json abi
Juan Blanco
@juanfranblanco
Mar 14 2017 05:33
@deanott top of my head have you increased the gas to support the extra parameter?
Juan Blanco
@juanfranblanco
Mar 14 2017 06:22
 public async Task Test()
        {
            /*
             * 
             * contract test{
    mapping(bytes32 => bytes32) public values;
    function Store(bytes32 param1, bytes32 param2, bytes32 param3, bytes32 param4, bytes32 param5, bytes32 param6){
        values["1"] = param1;
        values["2"] = param2;
        values["3"] = param3;
        values["4"] = param4;
        values["5"] = param5;
        values["6"] = param6;

    }
       }*/

            var contractByteCode =
                "6060604052341561000c57fe5b5b6102b88061001c6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f5c1aae14610046578063ccc2195f146100ab575bfe5b341561004e57fe5b6100a960048080356000191690602001909190803560001916906020019091908035600019169060200190919080356000191690602001909190803560001916906020019091908035600019169060200190919050506100eb565b005b34156100b357fe5b6100cd600480803560001916906020019091905050610274565b60405180826000191660001916815260200191505060405180910390f35b85600060007f3100000000000000000000000000000000000000000000000000000000000000600019168152602001908152602001600020816000191690555084600060007f3200000000000000000000000000000000000000000000000000000000000000600019168152602001908152602001600020816000191690555083600060007f3300000000000000000000000000000000000000000000000000000000000000600019168152602001908152602001600020816000191690555082600060007f3400000000000000000000000000000000000000000000000000000000000000600019168152602001908152602001600020816000191690555081600060007f3500000000000000000000000000000000000000000000000000000000000000600019168152602001908152602001600020816000191690555080600060007f360000000000000000000000000000000000000000000000000000000000000060001916815260200190815260200160002081600019169055505b505050505050565b600060205280600052604060002060009150905054815600a165627a7a72305820aedb538a1396ec036bb784eadbaa1546182416206911342b7e27ddb13f3430260029";

            var abi =
                @"[{'constant':false,'inputs':[{'name':'param1','type':'bytes32'},{'name':'param2','type':'bytes32'},{'name':'param3','type':'bytes32'},{'name':'param4','type':'bytes32'},{'name':'param5','type':'bytes32'},{'name':'param6','type':'bytes32'}],'name':'Store','outputs':[],'payable':false,'type':'function'},{'constant':true,'inputs':[{'name':'','type':'bytes32'}],'name':'values','outputs':[{'name':'','type':'bytes32'}],'payable':false,'type':'function'}]";

            var addressFrom = "0x12890d2cce102216644c59dae5baed380d84830c";
            var pass = "password";

            var web3 = new Web3Geth(new ManagedAccount(addressFrom, pass));
            await web3.Miner.Start.SendRequestAsync();
            var pollingService = new TransactionReceiptPollingService(web3);
            var contractAdress =  await pollingService.DeployContractAndGetAddressAsync(
                () => web3.Eth.DeployContract.SendRequestAsync(contractByteCode, addressFrom, new HexBigInteger(900000)));
            var contract = web3.Eth.GetContract(abi, contractAdress);
            var functionStore = contract.GetFunction("Store");
            var txReceipt = await pollingService.SendRequestAsync(
                () =>
                    functionStore.SendTransactionAsync(addressFrom, new HexBigInteger(900000), new HexBigInteger(0), "hello1", "hello2",
                        "hello3", "hello4", "hello5", "hello6"));
            await web3.Miner.Stop.SendRequestAsync();
            var functionValues = contract.GetFunction("values");
            var result = await functionValues.CallAsync<string>("1");

        }
@deanott exampble above of multiple parameters (more than 4)..
vladyslavmunin
@vladyslavmunin
Mar 14 2017 07:15

@juanfranblanco Yes , I know that problem with abi , but
I can't do anything.
can you look ?
https://etherscan.io/address/0x853f78306c15cf79d2e484558335fe2e8e1d1d69#code

code verifed , and I insert in GetContract this abi and get error!

Juan Blanco
@juanfranblanco
Mar 14 2017 07:25

public async Task Test2()
        {
            string abi =
                "[{'constant':true,'inputs':[],'name':'syncDate','outputs':[{'name':'','type':'uint256'}],'payable':false,'type':'function'},{'constant':false,'inputs':[{'name':'id','type':'uint256'},{'name':'chargerAddress','type':'address'}],'name':'setChargerAddress','outputs':[],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'InvestmentsCount','outputs':[{'name':'','type':'uint256'}],'payable':false,'type':'function'},{'constant':false,'inputs':[{'name':'id','type':'uint256'}],'name':'sendToCharger','outputs':[],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'ChargersCount','outputs':[{'name':'','type':'uint256'}],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'Manager','outputs':[{'name':'','type':'address'}],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'getAllInvestments','outputs':[{'name':'ids','type':'uint256[]'},{'name':'addresses','type':'address[]'},{'name':'chargerIds','type':'uint256[]'},{'name':'balances','type':'uint256[]'},{'name':'states','type':'bool[]'},{'name':'lastUpdateDates','type':'uint256[]'},{'name':'totalSum','type':'uint256[]'}],'payable':false,'type':'function'},{'constant':false,'inputs':[{'name':'_from','type':'address'},{'name':'_charger','type':'uint256'}],'name':'investInQueue','outputs':[{'name':'success','type':'bool'}],'payable':true,'type':'function'},{'constant':true,'inputs':[],'name':'Owner','outputs':[{'name':'','type':'address'}],'payable':false,'type':'function'},{'constant':false,'inputs':[{'name':'_to','type':'address'}],'name':'returnMoney','outputs':[{'name':'success','type':'bool'}],'payable':true,'type':'function'},{'constant':false,'inputs':[{'name':'manager','type':'address'}],'name':'setManager','outputs':[],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'getChargers','outputs':[{'name':'chargers','type':'uint256[]'},{'name':'addresses','type':'address[]'},{'name':'states','type':'bool[]'}],'payable':false,'type':'function'},{'constant':true,'inputs':[],'name':'Proxy','outputs':[{'name':'','type':'address'}],'payable':false,'type':'function'},{'inputs':[{'name':'proxy','type':'address'}],'payable':false,'type':'constructor'}]";
            var web3 = new Web3();
            var contract = web3.Eth.GetContract(abi, "x");
        }
try this @vladyslavmunin ^^
vladyslavmunin
@vladyslavmunin
Mar 14 2017 07:50
thanks, but this is too strange . If I'm not mistaken , earlier everything worked with double quotes
Juan Blanco
@juanfranblanco
Mar 14 2017 07:51
oh it does
single quore is simpler to read
vladyslavmunin
@vladyslavmunin
Mar 14 2017 08:01
ok , I got it.
Dean P. Ottewell
@deanott
Mar 14 2017 21:45
@juanfranblanco thanks, that works and I have tried increaseing the gas on the contract last time but no use
I have several large mapping of structs at the start of my contract and believe the combinations of all these is preventing me adding new parameters.
If I remove them my tests work again but I am still playing, I am going to write some tests with dapple and see