These are chat archives for Nethereum/Nethereum

21st
Jan 2019
Enigmatic
@EnigmaticUnreal_twitter
Jan 21 04:25
Hey nice stuff @hessam94!
hessam94
@hessam94
Jan 21 04:37
thanks all
Kevin Small
@KevinSmall
Jan 21 10:13
@hessam94 I like it, good to see more games using Nethereum :)
Craig Waite
@craigvl
Jan 21 11:21
Hello, we have just released an app that uses Nethereum that makes earning Ethereum for completing issues on GitHub easy and instant. You can login to the beta and see a video demo at www.gitman.app . We would love to work with you guys to help the Ethereum community and are happy to sponsor a few issues. Any questions or feedback let me know.
Roy
@Shammah
Jan 21 11:33
Sounds like a great project, but I'm going to be a bit of a party pooper here: how does your website differ from Gitcoin? I'm all for competition, but I'd like to hear about the differences. For example, Gitcoin allows any ERC20 token, including DAI.
Craig Waite
@craigvl
Jan 21 11:37
@Shammah Ok so we have tried to make the whole process as simple as possible, once a pull request is accepted the Ethereum is transferred straight to the developers wallet, if you watch the video you will see how simple it is.
Also funding and sponsoring issues is very easy.
All done through smart contracts, locking the reward, making it transparent, and very secure
Roy
@Shammah
Jan 21 12:27
How will you settle disputes? Do you also support multiple collaborators on a single issue?
Schalk Dormehl
@sjalq
Jan 21 13:06
@juanfranblanco , are there command line tools for the generation of C# classes from solidity?
Dave Whiffin
@Dave-Whiffin
Jan 21 14:08

@sjalq Yes, there are. See below. It's in pre-release at the moment but pretty stable.

https://github.com/Nethereum/Nethereum/tree/master/src/Nethereum.Generator.Console

Schalk Dormehl
@sjalq
Jan 21 14:19
Thank you @Dave-Whiffin
Dave Whiffin
@Dave-Whiffin
Jan 21 14:20
@sjalq If you have any problems/questions/suggestions please don't hesitate to get in touch.
Schalk Dormehl
@sjalq
Jan 21 14:28
Actually, @Dave-Whiffin , I want to start migrating a test suite of mine so that it uses PoCos generated from the latest Solidity code. How would I go about setting up such a build process. Has someone maybe done this before?
Schalk Dormehl
@sjalq
Jan 21 14:38
Establish end-to-end consistency of types and versioning. Sometimes I forget to compile before I run the tests, and then obviously stuff doesn't exactly work.
Dave Whiffin
@Dave-Whiffin
Jan 21 14:39

@sjalq We have done very similar things. Namely the Nethereum.ABI.Autogen package. It wraps the code generator console. The theory is that you add the ABI.Autogen package to a C# project containing the solidity files. A build dependency (target) is injected that triggers the C# to be built whenever the project is built. There are some basic checks to avoid re-writing files unecessarily.

Again - it's pre release but we're not anticipating any breaking changes. It's not available on myget or nuget yet, so you'd need to clone the repo and create and host your own local nuget package.

https://github.com/Nethereum/Nethereum/tree/master/src/Nethereum.ABI.Autogen

@sjalq Here's a bit of documentation - apologies it might be slightly inconsistent due to being pre-release but it shouldn't be too hard to follow.

https://nethereum.readthedocs.io/en/latest/nethereum-abi-autogen/

Schalk Dormehl
@sjalq
Jan 21 14:52
@Dave-Whiffin , also, while I have you. Is there a simple way to access encoding and decoding in Nethereum.
Something to this effect
public T Encode<T>(byte[] data) {...}
public byte[] Decode<T>(T obj) {...}
Something that could simply decode a data stream given an object with a comparable set of type and visa-versa?
Dave Whiffin
@Dave-Whiffin
Jan 21 14:57
@sjalq There are extension methods in the "Nethereum.Contracts.Extensions" namespace which may well give you what you need. I think they were introduced in v3. They relate to event and function DTO's.
Juan Blanco
@juanfranblanco
Jan 21 15:08
note that these extensions are for FunctionMessage or ContractDeploymentMessage
there is also the AbiEncodingHelper https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.ABI/ABIEncode.cs which is not released yet
but you can get it from the CI nugets
Schalk Dormehl
@sjalq
Jan 21 15:43
How hard would it be to extract that code into it's own static class as a sort of Nethereum "lite"? Something focused purely on encoding and decoding.
Juan Blanco
@juanfranblanco
Jan 21 16:16
That is Nethereum.ABI @sjalq, you cannot get lighter than that
and that is why is a separate component
if you just want to do that, but at the moment every component is very light if you are not targeting another chain
which you could contribute (hint)
obviously if you want more stuff signing, etc, it is all combined
Juan Blanco
@juanfranblanco
Jan 21 16:23
but even if you are not targeting another chain, feel free to provide feedback and/or contribute.
although Nethereum.Abi depends on Nethereum.Hex and Nethereum.Util
but still light enough
Juan Blanco
@juanfranblanco
Jan 21 16:29
@craigvl That is pretty cool, thanks for the offering
Schalk Dormehl
@sjalq
Jan 21 16:33
Cool, I want to actually extract some of the Nethereum.ABI stuff into a bit more of a functional set of libs. Probably more personal preference that necessity really.
Juan Blanco
@juanfranblanco
Jan 21 16:33
but as per other thoughts it seems very similar to Gitcoin, have you thought in adding extensions to Gitcoin? It will add lots of value to the ecosystem @craigvl
well all the Nethereum.ABI is needed for encoding / decoding
@sjalq
when you mean "functional" you mean f#?
Juan Blanco
@juanfranblanco
Jan 21 16:40
also there are elements of structs that still need refining, so the ABI area is not completed
but I guess it will never be like everything in this world
but sure whatever you come up with mainly make a pull request, it might be useful.
Juan Blanco
@juanfranblanco
Jan 21 16:46
Web3j was based originally in Nethereum they have slightly less classes https://github.com/web3j/web3j/tree/master/abi/src/main/java/org/web3j/abi
although they don't support attribute mapping
Schalk Dormehl
@sjalq
Jan 21 16:50
Well it's possible to write purely functional code in C#, but yes, something in the "spirit" of F#, but accessible in both languages.
Juan Blanco
@juanfranblanco
Jan 21 16:56
Sure but for that you would only the need they entry decoding / encoding functions
so you just want / need static classes for the simple ABI encoding / decoding?
obviously F# in a puristic way does not want to have classes
or types with properties
but that will be interesting to do the mapping of complex structs
so another thought will be like developing Json.Net in a functional manner, does that exist?
Juan Blanco
@juanfranblanco
Jan 21 17:12
but sure pull something it will be interesting to see it ! @sjalq