These are chat archives for Nethereum/Nethereum

25th
Jul 2018
ShermanMeredith
@ShermanMeredith
Jul 25 2018 00:04
What happens if you have an overloaded function in your contract?
Does the Unity function getter contract.GetFunction("overloadedFunctionName") care whether there are two functions with the same name?
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 07:15
but still you will need to change the path.. or come up with workarounds to create the hierarchies
@juanfranblanco Why need to change the path ? I can use this for hierarchies m/44'/60'/0'/0/x
Juan Blanco
@juanfranblanco
Jul 25 2018 07:21
yeah.. so if you want to have extra hierarchies your path will change correct?
Was that not your question on the first instance?
Maybe I am bit lost now.. on the conversation ;) so please bear with me
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 07:54

I need (maybe) m/44'/60'/0'/0/x/x hierarchy .

My question was - how to init wallet from public master key
and init from master private key

now I will use only seed for generating addresses and get private keys for them

One more question : How to create multisig addresses. Only with contract ?
How to implement signing?

I want to create 3 of 3 multi sig addres, and generate keys from 3 different seed (master key).

Nuke Dukem
@nuke001_gitlab
Jul 25 2018 08:38
Hi guys! I'm working on a server wallet to accept payments. Which filter is it better to use to track an address for new incoming transactions? What model should I use for that: delegate filtering of the address to a node using NewFilter or parse every block by myself? Thanks in advance!
Juan Blanco
@juanfranblanco
Jul 25 2018 08:44
@Ilchuk-Mihail you can start an hd wallet from a seed byte array
that will create your master key
then changing your path will allow you to create the hierarchies, but that depends on your needs
multisignature that all depends of what you do in your contract
but it is all contract driven
check christian's example of a simple multi signature
the plan is to provide out of the box solutions for different established multi / signature solutions
gnosis safe is another example
@nuke001_gitlab the latter or if using parity, parity filters.
Juan Blanco
@juanfranblanco
Jul 25 2018 08:49
but block processing is not specific to a chain implementation
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 08:52
check christian's example of a simple multi signature
@juanfranblanco where ?
ChinhP
@Chinh-P
Jul 25 2018 08:54
I think he mentioned about this one https://github.com/christianlundkvist/simple-multisig
btw, thank for the information on Quorum account, now I use managedAccount instead of Account, seems it works
Nuke Dukem
@nuke001_gitlab
Jul 25 2018 09:02
@juanfranblanco Thanks a lot! Does it mean that I should do something like: use NewBlockFilter, then call GetFilterChanges from time to time, request blocks by returned block hash and then parse them?
Juan Blanco
@juanfranblanco
Jul 25 2018 09:21
Thanks @ChinhPLQ that's the one :)
@nuke001_gitlab well I would just iterate through the blocks / transactions if you are looking only at Ether transfer for an account. Although contracts do also send ether, which you won't see there..
in that scenario parity filters help you
Nuke Dukem
@nuke001_gitlab
Jul 25 2018 09:25
@juanfranblanco I see, big thanks!
Juan Blanco
@juanfranblanco
Jul 25 2018 09:25
with a link helps :)
ChinhP
@Chinh-P
Jul 25 2018 09:26
and Juan, about the quorum account, currently, there are 2 things in my mind. 1, if we have to use managed accounts to interact with the chain, is it possible for us to export the private or sthing out, in order to import to Metamask, or any other third party
Juan Blanco
@juanfranblanco
Jul 25 2018 09:27
yeah you can get the private key using the KeyStore library
ChinhP
@Chinh-P
Jul 25 2018 09:28
ok, let me check that one, and 2, what is the purpose of not use private key, how compatible the managed account is with HD account
ChinhP
@Chinh-P
Jul 25 2018 09:29
when I unlock 1 account from 1 node, after connect to 2nd node, I should unlock again, no need to add new account, am I right
Juan Blanco
@juanfranblanco
Jul 25 2018 09:29
each node will have their own accounts in the keystore
ChinhP
@Chinh-P
Jul 25 2018 09:30
oh, it means, i need to create the same account again if I connect to the node2
Juan Blanco
@juanfranblanco
Jul 25 2018 09:30
well just copy the keystore file
and use the same password
ChinhP
@Chinh-P
Jul 25 2018 09:31
ya, because first I thought it will be synced between nodes
Schalk Dormehl
@sjalq
Jul 25 2018 09:31
@juanfranblanco Excellent, thank you. Do you have a link to an example perhaps please?
Juan Blanco
@juanfranblanco
Jul 25 2018 09:31
@ChinhPLQ no it will be like sharing the keys to your house
ChinhP
@Chinh-P
Jul 25 2018 09:32
Ic
Juan Blanco
@juanfranblanco
Jul 25 2018 09:32
you will normally connect to some specific nodes if you are using the constellations and privatefor
Schalk Dormehl
@sjalq
Jul 25 2018 09:33
OK, I'm able to pass my arrays in
:-)
this is for a return
Schalk Dormehl
@sjalq
Jul 25 2018 09:35
I'm having trouble now reading the mapping that they are stored in. How do I do this?
They are in a mapping (address => Signer) public members;
So 3 questions:
Can I return a mapping ?
Is members just going to return a list of addresses or something more complex?
How do I output it?
@juanfranblanco Ah, ok, I'll have a look there so long
that is the function definition
@sjalq you can code generate your interface
using vscode
that might help you
in that scenario you are having an struct actually
and that is only supported in the v2 experimental
and code generation does not do that yet for you
ChinhP
@Chinh-P
Jul 25 2018 09:40
you will normally connect to some specific nodes if you are using the constellations and privatefor
Thank Juan for the information.
Im getting some options for a chain for enterprise environment, quorum is the first 1 I try
Schalk Dormehl
@sjalq
Jul 25 2018 09:50
Excuse my noobness Juan, I'm having some difficulty with the links you sent me
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 10:08
@juanfranblanco If I creating contract for each user .
I can do it with Nethereum
1) Deploy contract for each user 2 of 2 multisig
2) Interact with contract, and confirm sending
?
Juan Blanco
@juanfranblanco
Jul 25 2018 10:16
yes you can
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 10:23
Any problem with contract wallet ?
1) Send tokens to multi sig adress
2) Most exchanges don't support receiving ether from a contract wallet yet. Be sure to move your balance to an account address first!
Juan Blanco
@juanfranblanco
Jul 25 2018 10:37
an address is an address contract or account
so an exchange can received an amount from a contract
the contract has a balance
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 10:42

but I have
NOTE

Most exchanges don't support receiving ether from a contract wallet yet. Be sure to move your balance to an account address first!

in Ethereum wallet Mist

Send ERC20 tokens to multi sig address ?
Schalk Dormehl
@sjalq
Jul 25 2018 10:55
Sorry @juanfranblanco , I've lost the plot a bit here in getting that value back.
I'm presently writing a set of xUnit tests and I have the Contract object.
Whats' the standard way to return a mapping if you have a property on the smartcontract that is a mapping?
Juan Blanco
@juanfranblanco
Jul 25 2018 11:04
@Ilchuk-Mihail I did not know that, how they identify is a contract address
Mist.. if you are sending from an ERC20 smart contract to a contract address should not be a problem
the extra logic is doing the call to the erc20 contract from the multisig contract
@sjalq the best thing if not using the generator is to check the abi
Schalk Dormehl
@sjalq
Jul 25 2018 11:17
Cool, I'm checking out the encoder now.
In the meanwhile, I've check out the ABI, it returns is a function that accepts an address and returns an address?
I am not sure what this implication here is. Do I need to use it as a function that I pass an address to and receive an address from?
Is there a mechanism to get all the values stored in the mapping?
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 11:30
@juanfranblanco I mean send erc20 token to my address (multi sig contract)
Juan Blanco
@juanfranblanco
Jul 25 2018 11:57
@sjalq yeah.. what you are getting
is a get method using as a parameter the address and returns the contract address
@Ilchuk-Mihail yes addresses are the same so the only thing you are doing in the erc20 contract is changing the balance of that address
Schalk Dormehl
@sjalq
Jul 25 2018 11:59
OK, so is there any means to get all the members that were stored in the mapping?
Juan Blanco
@juanfranblanco
Jul 25 2018 11:59
you are using a contract
you could use a struct
but that is only in solidityv2
and for that you cannot use the codegen
a sample is here
Schalk Dormehl
@sjalq
Jul 25 2018 12:05
Can I do it on v1 with the genetrator?
Also what is the installation process for the generator? I assume I have to build one of the projects to get the dll?
Juan Blanco
@juanfranblanco
Jul 25 2018 12:05
you cannot return structs in v1
Schalk Dormehl
@sjalq
Jul 25 2018 12:05
Can I return arrays in v1?
Juan Blanco
@juanfranblanco
Jul 25 2018 12:06
yes
but not mixed with dynamic elements
you can just use vscode
for the generator
Schalk Dormehl
@sjalq
Jul 25 2018 12:06
OK, but where do I get the dll?
Juan Blanco
@juanfranblanco
Jul 25 2018 12:06
oh.. right install vscode
Schalk Dormehl
@sjalq
Jul 25 2018 12:07
done
Juan Blanco
@juanfranblanco
Jul 25 2018 12:07
then add the vscode solidity extension
Schalk Dormehl
@sjalq
Jul 25 2018 12:07
done
Juan Blanco
@juanfranblanco
Jul 25 2018 12:07
now..
Schalk Dormehl
@sjalq
Jul 25 2018 12:09
...
Juan Blanco
@juanfranblanco
Jul 25 2018 12:10
apologies visual studio is restarting and taking over my pc
i am uploading an animated gif that explains
but mainly compile using vscode
CodeGenConstructors.gif
then on the bin folder
select the json file
and select code generate csharp project
the newer version will generate c# partial classes per each function definition, and dtos (events and function outputs) in a single file, so you can regenerate and add extra logic to them
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 13:30

How to send ether from many acounts to one ?

For example :
If I have Hd wallet, and generate 10 addresses
Each address have 1 eth
How to send ether from this 10 adresses to another address ?
How to do this in one transaction ?

Juan Blanco
@juanfranblanco
Jul 25 2018 14:36
you cannot do it in one transaction
although you could create a contract
that holds the 10 ether
and sends it to the 10 addresses
you will need to check how much gas you will send vs complexity
Michael Ilchuk
@Ilchuk-Mihail
Jul 25 2018 14:41
Ok.
How the exchanges do it?
They also issue addresses. hd wallet will not help
Schalk Dormehl
@sjalq
Jul 25 2018 14:48
@juanfranblanco , ok I've generated the C# classes. That was amazing!
When did I install that stuff?
Is it part of the Solidity plug in?
Schalk Dormehl
@sjalq
Jul 25 2018 15:03
I'm looking through the generated code now. So am I correct in that it cannot return an entire array, that I have to specify an index or and address to confirm that it is correct?
Schalk Dormehl
@sjalq
Jul 25 2018 15:35
FREE AT LAST! I CAN FINALLY GET MY TEST TO PASS!
Juan Blanco
@juanfranblanco
Jul 25 2018 17:44
@sjalq yes it is part of the solidity plugin
ha ha glad they pass :)
Schalk Dormehl
@sjalq
Jul 25 2018 20:02
Hey again
If I do a GetData() from a function call and I want to use the returned string to be passed into a contract call as bytes, how do I convert that data string into bytes since converting it into byte[] would not convert it into the correct form
?
TarrahArshad
@TarrahArshad
Jul 25 2018 21:45
hi
@juanfranblanco we can in erc20 token payable method accept other erc20 token ?
example , we have Token A and we like create Token B , our client send Token A to Token B contract and receive Token B automaticaly
Juan Blanco
@juanfranblanco
Jul 25 2018 22:30
@sjalq use the extension HexToByteArray()
@TarrahArshad not in a method
If you control both Tokens you may on Transfer of TokenA include a transfer of TokenB
But that if you change the SmartContract
Juan Blanco
@juanfranblanco
Jul 25 2018 22:36
Another option would be with a proxy, which the user will do a transfer of A to you, and if successful do the Transfer of TokenB
You will need to do a delegate call