These are chat archives for Nethereum/Nethereum

5th
Dec 2018
MANOJKUMARCH
@MANOJKUMARCH
Dec 05 2018 06:05
@EnigmaticUnreal_twitter , Thank you very much for your help. I am able to retrieve the arrays as required. I am still exploring on how can I use the code generated from solidity from visual studio code.
Igor Bondarenko
@cube27rus
Dec 05 2018 13:17
Hello everyone. Please, can anybody tell me, is it possible to subscribe and receive all incoming transactions to my account using nethereum?
Raúl
@rsantirso
Dec 05 2018 14:42
Hi, folks. I'm updating the code of a deployed contract and I'm updating the compiler version too from 0.4.21 to 0.5.1. I've got a single compiling error due to a breaking change of >=0.5 versions related to keccak256() function input, in which I have to call abi.encodePacked() to build its input. Former input I was given to it was a type 'address'. I've read that in 0.4.x versions was keccak256 itself who called abi.encodePacked, so I understand that the behavior of my fixed code must be the same of the previous one. But once the fixed contract is deployed, the transaction that uses the keccak256 function is not completed and I have no idea why. Any suggestion?
Roy
@Shammah
Dec 05 2018 14:56
Not sure if it's Nethereum related. Either way, I think your best option is to try and debug a local instance using Truffle? https://truffleframework.com/tutorials/debugging-a-smart-contract
Raúl
@rsantirso
Dec 05 2018 15:00
It works properly in Truffle and remix. My problem arises when I call the function from my C# code.
Raúl
@rsantirso
Dec 05 2018 15:17
I've checked that hash value returned by keccak256 is the same in both situations
Juan Blanco
@juanfranblanco
Dec 05 2018 15:21
@rsantirso if you could post a sample, as I am failing to see the problem
mainly the solidity contract / function to see the input you want, I assuming it needs an abi.encoded for a proxy call, multisig (but i am truly guessing here :))
Raúl
@rsantirso
Dec 05 2018 15:27
It's something like:
function MyFunction (address id, uint8 v, bytes32 r, bytes32 s) external returns (address)
{
byte32 hash = keccack256(abi.encodePacked(id));
address recovId = ecrecover(hash,v,r,s);
require(id == recovId);
.... more code
}
Running that in Remix's JS VM the transaction is OK, but in my blockchain isn't (and remix doesn't allowed me to debug there). My Geth node has byzantium off.
Juan Blanco
@juanfranblanco
Dec 05 2018 16:41
sorry i jumped to a meeting
turtlewen
@turtlewen
Dec 05 2018 16:41
hi
Juan Blanco
@juanfranblanco
Dec 05 2018 16:41
so are you signing the address?
@rsantirso
turtlewen
@turtlewen
Dec 05 2018 16:42
i meet something error of this
  • $exception {"Generic Type should have a Function Ouput Attribute"} System.ArgumentException
i have no idea where the error come from
but i know this msg is print from nethereum
Juan Blanco
@juanfranblanco
Dec 05 2018 16:42
yes it is due to decoding
so you are deserialising to an object with a "generic type?"
do you have sample line for that?
@rsantirso mainly if you do the following
turtlewen
@turtlewen
Dec 05 2018 16:45

@juanfranblanco yup

var result = await getFunction.CallDeserializingToObjectAsync<complianceReportData>(index);
var result2 = await get2Function.CallDeserializingToObjectAsync<complianceReportData_2>(0);

the first line dont have problem but the second have this problem come out

Juan Blanco
@juanfranblanco
Dec 05 2018 16:45
new Nethereum.ABI.AddressType.Encode("address") that will encode your address
then use the Message.HashAndSign
@rsantirso
Juan Blanco
@juanfranblanco
Dec 05 2018 16:51
@turtlewen complianceReportData_2
how does that look like? Does it have the [FunctionOutput] attribute?
turtlewen
@turtlewen
Dec 05 2018 16:55
yup it have
public class complianceReportData_2
{
[Parameter("string", "requestID", 1)]
public string requestID { get; set; }
[Parameter("string", "complianceRules_7", 2)]
public string complianceRules_7 { get; set; }
        [Parameter("string", "complianceChecking_date", 3)]
        public string complianceChecking_date { get; set; }

        [Parameter("string", "complianceChecking_time", 4)]
        public string complianceChecking_time { get; set; }

        [Parameter("string", "examinerID", 5)]
        public string examinerID { get; set; }
    }
this the DTO
function getComplianceReport_2 (uint index) view public returns (string,string,string,string,string){
     complianceReportData_2 storage c = complianceReport_2[index];

    return (c.requestID,c.complianceRules_7,c.complianceChecking_date,c.complianceChecking_time,c.examinerID);

}
Juan Blanco
@juanfranblanco
Dec 05 2018 16:57
and it has the FunctionOutput attribute and the interface IFunctionDTO?
turtlewen
@turtlewen
Dec 05 2018 16:57
this is my smart contract function
Juan Blanco
@juanfranblanco
Dec 05 2018 16:57
tripple checking
turtlewen
@turtlewen
Dec 05 2018 16:59

total 5 attributes

each of one attributes i got FunctionOutput and the get set for them

Juan Blanco
@juanfranblanco
Dec 05 2018 16:59
I mean at the top of the class like this
 [FunctionOutput]

    public class GetAllowedTimeOutputDTOBase :IFunctionOutputDTO 

    {

        [Parameter("uint256", "", 1)]

        public virtual BigInteger ReturnValue1 {get; set;}

    }
i cannot see anything else missing
turtlewen
@turtlewen
Dec 05 2018 17:04
image.png
i put like that also meet the same problem

with :IFunctionOutputDTO or without :IFunctionOutputDTO

also meet same problem

Dave Whiffin
@Dave-Whiffin
Dec 05 2018 17:05
@turtlewen I think you're consuming implementing an interface with an attribute. You need to do both.
turtlewen
@turtlewen
Dec 05 2018 17:05
@Dave-Whiffin hi
@Dave-Whiffin what mean to do both
like this
turtlewen
@turtlewen
Dec 05 2018 17:06
@juanfranblanco i try now
turtlewen
@turtlewen
Dec 05 2018 17:13
@juanfranblanco thanks it works ^^
@Dave-Whiffin thanks u too ^^
what I meant originally was the generic type T passed as an argument
fruor
@fruor
Dec 05 2018 17:26
Hey everyone, I just switched to Nethereum 3 using nuget packages - awesome to see it moving forward
I'm playing with ENS and in the old version I could use this neat StartAuctinAsync(senderAddress, fullNameNode2.HexToByteArray(), gas, gasprice);
Juan Blanco
@juanfranblanco
Dec 05 2018 17:27
thanks :) it has been in 3 for a while, we were just making sure there was nothing major before release
in ENS mainly it has been upgraded to latest contracts
fruor
@fruor
Dec 05 2018 17:28
In the new version it seems I should use StartAuctionsAndBidRequestAsync, but they only take some bytearray and a sealedBid - how do I construct those?
Last time I pulled before today was sometime in August - so couple of new things here and there
Juan Blanco
@juanfranblanco
Dec 05 2018 17:30
yes i upgraded ENS in September I believe
(top of my head)
fruor
@fruor
Dec 05 2018 17:31
I'm not sure how I can dig up the supposed construction of the List<byte[]> hashes for StartAuction
Juan Blanco
@juanfranblanco
Dec 05 2018 17:32
yes I was going to suggest that
two seconds (need to refresh my memory)
fruor
@fruor
Dec 05 2018 17:36
ok, no worries :)
I just thought I'd rather ask sooner, last time you also helped me (on another account) after some days of frustration - you're my hero already ;-)
yes ens you don't know when you need a name label or a hash
so in this scenario you just need the Sha3 Hash of the name
So if you use EnsUtil.GetLabelHash("name") that will do
which is mainly the sha3 kecckak
fruor
@fruor
Dec 05 2018 17:43
but where goes the owner? and what about gas?
Juan Blanco
@juanfranblanco
Dec 05 2018 17:44
oh that is the sender address
and the gas is calculated for you
fruor
@fruor
Dec 05 2018 17:44
neat
Juan Blanco
@juanfranblanco
Dec 05 2018 17:45
so in simple terms you just need to do something like
fruor
@fruor
Dec 05 2018 17:45
so I just need an unlocked web3 account and that's it
Juan Blanco
@juanfranblanco
Dec 05 2018 17:45
yeah
EnsUtil.GetLabelHash("name") .HexToByteArray()
that will be 1 item in the array of start auctions
fruor
@fruor
Dec 05 2018 17:46
do you know if the .eth tld is attached automatically? just because I will use testnet
anyway, will try that tonight... thank you so much
and this is really convenient
Juan Blanco
@juanfranblanco
Dec 05 2018 17:48
yeah if you look at the ens tests in Nethereum.ENS.IntegrationsTests
ENSLocalTests
it is setup the eth tld
so if you used the Registrar
fruor
@fruor
Dec 05 2018 18:07
the second parameter, the sealedbids bytes, comes from ShaBidQueryAsync, right?
although it would seem I need something offline generated
Juan Blanco
@juanfranblanco
Dec 05 2018 18:21
yeah
if you follow the docs your bid is generated using a call
so it is mainly a hash
which can be then submitted with a price which does not match the real value
to hide it
Raúl
@rsantirso
Dec 05 2018 19:00
Yes, @juanfranblanco , I'm signing the address. I don't get your answer: do I need to encode the address (Nethereum.ABI.AddressType.Encode("address")) and use it as input to the call of my function? I'm at home and I can't access to the code from here and tomorrow is national holiday. I'll try it on friday.
hessam94
@hessam94
Dec 05 2018 21:49
hi, I want to get my transaction "return" but it just send me the Transaction.Receipt. I can get it for CALL functions. Also the "Logs" of returned receipt is null. For example I want ti return a message after the finishing the transaction as "yes" or "no". how can i do this ? thanks
hessam94
@hessam94
Dec 05 2018 22:48
also I add an event but the return values of event is not as the same as I get by REMIX, actually the logs does not contain the return value of the event
event TestEvent(bool);
...
if (// some conditions)
{
GameBoard[i][j] = mark;
emit TestEvent(true);
return true;
}
else
{
emit TestEvent(false);
return false;
}