Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 19 2020 14:34

    juanfranblanco on master

    Create2 contract address calcul… (compare)

  • Nov 15 2020 13:02

    juanfranblanco on master

    More .net 5 Hd wallet .net 5 Hd wallet testing .net 5.0 (compare)

  • Nov 12 2020 13:34

    juanfranblanco on master

    #655 adding cancellation token … (compare)

  • Nov 11 2020 22:07

    juanfranblanco on master

    Rsk custom field now uses hex .Net5 initial migration, Abi de… Hd blazor test start migration … (compare)

  • Nov 10 2020 09:27

    juanfranblanco on master

    Adding a seed to secure random … (compare)

  • Nov 10 2020 09:26

    juanfranblanco on master

    #654 ManagedAccountTransactionM… Merge branch 'master' of https:… (compare)

  • Nov 03 2020 18:46

    juanfranblanco on master

    Update bug_report.md (compare)

  • Nov 02 2020 18:29

    juanfranblanco on master

    Update README.md (compare)

  • Oct 31 2020 11:17

    juanfranblanco on master

    Signer adding overload DIDs initial commit Merge branch 'master' of https:… (compare)

  • Oct 29 2020 11:19

    juanfranblanco on master

    Update README.md (compare)

  • Oct 29 2020 10:48

    juanfranblanco on master

    Update README.md (compare)

  • Oct 29 2020 10:46

    juanfranblanco on master

    Update README.md (compare)

  • Sep 07 2020 12:38

    juanfranblanco on master

    #646 fix hdwallet added blazor … (compare)

  • Aug 28 2020 15:28

    juanfranblanco on master

    Signing performance (start) + … Merge branch 'master' of https:… (compare)

  • Aug 19 2020 20:23

    juanfranblanco on master

    boolean flag to get compressed … Merge pull request #642 from me… (compare)

  • Aug 07 2020 16:28

    juanfranblanco on master

    Handling empty reponses eom, re… (compare)

  • Aug 07 2020 15:54

    juanfranblanco on master

    Websocket client, allow to rece… Merge branch 'master' of https:… (compare)

  • Aug 03 2020 10:57

    juanfranblanco on master

    Revert "JsonRpc/Logger: fix pos… Merge pull request #638 from Ne… (compare)

  • Aug 03 2020 10:57

    juanfranblanco on revert-637-fixPossibleNRE

    Revert "JsonRpc/Logger: fix pos… (compare)

  • Aug 03 2020 10:12

    juanfranblanco on master

    JsonRpc/Logger: fix possible Nu… Merge pull request #637 from kn… (compare)

kunalbarchha
@kunalbarchha
Juan Blanco
@juanfranblanco
will it be due to the client disconnecting the socket and need to reconnect?
kunalbarchha
@kunalbarchha
Don't have C# env setup
need to do that
Jason Payne
@NeoXtreem

I'm using EthNewPendingTransactionObservableSubscription but I'd like to filter on a contract address (Uniswap V2 Router 2). I've tried the following, but it results in no events at all, not even the Uniswap ones:

await subscription.SubscribeAsync(Event<TransferEventDto>.GetEventABI().CreateFilterInput("0x7a250d5630b4cf539739df2c5dacb4c659f2488d"));

Is it possible to do this? Or, even better, can I just subscribe to pending transactions on the Uniswap contract instead?

cesarsld
@cesarsld
@juanfranblanco Hey sorry for taking so long to get back to you! I tested your repo (uniswap pubsub) on my laptop (macbook) and it didn't work.....
BUT, I uploaded code on a ubunu server that I have and it worked there! So I think I need to update my dotnet version on my macbook or something... Thanks for helping out!
Juan Blanco
@juanfranblanco
@NeoXtreem no you cannot do that , pending transactions are not "filterable"
@cesarsld great (ish) let me know if you fix it in your mac
Behemoth
@notBehemoth_twitter
@juanfranblanco Thanks for all the help :)
Leon Do
@_LeonDo__twitter
anyone here using Nethereum + Unity? I wrote an article about it. I’d love to get some feedback https://medium.com/coinmonks/part-1-using-nethereum-in-unity-54e62f7e65d5
Behemoth
@notBehemoth_twitter

@juanfranblanco Do you see any problems in the below code?

var ethSwapHandler = web3.Eth.GetContractTransactionHandler<SwapExactETHForTokensFunction>();
                var ethSwapDTO = new SwapExactETHForTokensFunction
                {
                    AmountToSend = Web3.Convert.ToWei(wethToTrade), // wethToTrade = 1
                    AmountOutMin = Web3.Convert.ToWei(amountOutMin), // amountOutMin = 7.25
                    Path = path,
                    To = myWallet,
                    Deadline = ((DateTimeOffset)DateTime.Now).ToUnixTimeSeconds() + 1200,
                    GasPrice = Web3.Convert.ToWei(gasPriceToUse, UnitConversion.EthUnit.Gwei), // gasPriceToUse = 300 (taken from Etherscan + 200)
                    Gas = Web3.Convert.ToWei(400000)
                };

                var transactionEthSwapReceipt = await ethSwapHandler.SendRequestAndWaitForReceiptAsync(uniswapContractAddress, ethSwapDTO);

I wasn't converting the amountOutMin & Gas amounts to Wei before. Could that be the reason for getting the 'insufficient funds for gas * price' error?

Juan Blanco
@juanfranblanco
@_LeonDo__twitter great articles!!!
Juan Blanco
@juanfranblanco
@notBehemoth_twitter hmm i cannot see any issue, regarding the insufficient funds it might have been due to an error if you had not convert it, the amount will be smaller
Allen Hena
@RealAllenHena_twitter
Hi is there any way in Nethereum to write everything in C# and somehow it compiles or ports to an ETH ABI/smart contract?
Juan Blanco
@juanfranblanco
Hi @RealAllenHena_twitter you want to write smart contracts in C# ?
we have discussed this many years ago, it it truly did not make any sense
there was an effort to so compile at the time to convert to IL to EVM opcodes, and others to transpile.. both truly don't make any sense as you will prefer Solidity anytime as it advances much faster and is closer to the chain. Also the reuse of smart contract logic, best practices etc it is best done in Solidity.
Now having a top layer that might protect you from common solidity mistakes might have been "good" but truly it wont give you much of an advantage
Juan Blanco
@juanfranblanco
If you could take advantage of some of the .net libraries etc.. that could have been interesting.. but yet again, everything is linked to the evm with its small pitfalls but also confined to the limitations of the blockchain.
what requirements you had in mind?
Behemoth
@notBehemoth_twitter
@juanfranblanco Thanks. The swaps work on mainnet now. I have a question regarding Uniswap trades for you - When trading is paused / disabled for a token on Uniswap (by the token creators), one can see a 'UniswapV2: TRANSFER_FAILED. There is an error with one of the tokens you are trading' error message pop up on the UI as soon as you hit the 'SWAP' button. What check might this be making to figure out that the token trade is paused? I tried swaps for a token that had its trading paused by the token devs and ended up submitting a few transactions to the blockchain which all failed due to the same error, but they cost gas! The Uniswap frontend is able to figure this out without spending gas, is there any READ function on the router / factory that allows this kind of query? I will post this question to Uniswap as well, but I thought you might already know the solution. :)
Samguy036
@Samguy036
@juanfranblanco Hello Juan, when I'm compiling to Android APK by Unity, Google Play requests IL2CPP backend with ARM64. However, when I test it on phone, all the Ethereum codes are just not working, strangely I don't see any error message. By the way I already disabled "Strip engine code" option, so do you probably know what happened?
If I change to Mono backend, everything is fine.
Juan Blanco
@juanfranblanco
@notBehemoth_twitter can you send me a token example? i have not seen the function for that in the smart contracts..
Samguy036
@Samguy036

If I change to Mono backend, everything is fine.

Actually, I got the error message "NotSupportedException: System.Reflection.Emit.DynamicMethod"

Juan Blanco
@juanfranblanco
@Samguy036 ah.. are you not using the aot version? which includes the json.net aot?
the same for webgl
Samguy036
@Samguy036
image.png
Juan Blanco
@juanfranblanco
are you using these?
Samguy036
@Samguy036
I'm using this
image.png
Not sure if it's AOT
Can you distinguish?
Juan Blanco
@juanfranblanco
just replace with the others i sent you
the aot is linked to that specific version of json.net
Behemoth
@notBehemoth_twitter
@juanfranblanco Sure. This one (0xB244AC0F3ee2E9caE5dfdde5DaB8d49FA467E1A9) recently 'paused/didn't allow trading' for 20 minutes after they added liquidity to Uniswap. And so did this one (0x691ACE5e56507C008d836c8c58ed93546bDc81fF).
Uniswap shows this message as soon as you try to hit the SWAP button when trading is paused - 'The transaction cannot succeed due to error: UniswapV2: TRANSFER_FAILED. This is probably an issue with one of the tokens you are swapping.'
Juan Blanco
@juanfranblanco
what you can do is make a query beforehand (same parameters) and check for the error output this will be handled by Nethereum if an error occurs
Behemoth
@notBehemoth_twitter

@juanfranblanco Can you help me create the syntax for the query? This is the swap code that I use currently -

var wethSwapHandler = web3.Eth.GetContractTransactionHandler<SwapExactTokensForTokensFunction>();
                var wethSwapDTO = new SwapExactTokensForTokensFunction
                {
                    AmountIn = Web3.Convert.ToWei(wethToTrade),
                    AmountOutMin = amountOutMinInWei,
                    Path = path,
                    To = myWallet,
                    Deadline = ((DateTimeOffset)DateTime.Now).ToUnixTimeSeconds() + 1200,
                    GasPrice = Web3.Convert.ToWei(gasPriceToUse, UnitConversion.EthUnit.Gwei),
                    Gas = 400000
                };

                var transactionWethSwapReceipt = await wethSwapHandler.SendRequestAndWaitForReceiptAsync(uniswapContractAddress, wethSwapDTO);

                if (transactionWethSwapReceipt.Status.Value == 1)
                {
                    var wethSwapEventOutput = transactionWethSwapReceipt.DecodeAllEvents<TransferEventDTO>();

                    if (wethSwapEventOutput.Any() && wethSwapEventOutput.Last()?.Event?.Value != null)

I think I need to use 'QueryDeserializingToObjectAsync' method but I dont know what output DTO to use for this. Also, how to check for the error output? Thanks for all the help :)

Juan Blanco
@juanfranblanco
hi yes you are correct you have to use the "Query"
it returns an array of amounts so that will be a List<BigInteger>
if it errors (reverts) then it will attempt to deserialise the error and throw an exception
Yaom!ng
@FrameVolt
Does anyway can make a transaction send from specific devices?
Or, does anyway can make a transaction send from specific Android app?
Juan Blanco
@juanfranblanco
what you do mean? if you can create a mobile app and send it from that device? for sure
Yaom!ng
@FrameVolt
yes, does this possible?
Juan Blanco
@juanfranblanco
sure enjin coin wallet (as far as I know) is made with Nethereum
there is a wallet example too if you want