These are chat archives for Nethereum/Nethereum

11th
Feb 2019
Dave Whiffin
@Dave-Whiffin
Feb 11 09:03
@RonLino Hi - what version of Nethereum are you using?
Juan Blanco
@juanfranblanco
Feb 11 10:00
@TarrahArshad no idea never used tether
EgorovOleg
@EgorovOleg
Feb 11 10:21
Hello, I have a problem. Program throw an exception "Rpc timeout 20000 milliseconds". Here is an example of my code "var web3 = new Web3("https://mainnet.infura.io");
var receiverAddress2 = "0xc117422db074e25a3d906f57d6f8acbdd2196cae";
var transferEventHandlerAnyContract = web3.Eth.GetEvent<TransferEventDTO>();
var filterTransferEventsForAllContractsReceiverAddress2 = transferEventHandlerAnyContract.CreateFilterInput<string, string>(null, receiverAddress2);
var test = await transferEventHandlerAnyContract.GetAllChanges(filterTransferEventsForAllContractsReceiverAddress2);". Tell me where there may be an error.
Ronald Lino
@RonLino
Feb 11 10:28
Hi @Dave-Whiffin - Nethereum.Web3 (3.0.0)
Dave Whiffin
@Dave-Whiffin
Feb 11 12:10
@RonLino Can you post a full example of your code?
Kevin Small
@KevinSmall
Feb 11 14:26
@EgorovOleg does it work ok if you try adding a block range to the create filter call?
BlockParameter fromBlock = new BlockParameter(5561320);
BlockParameter toBlock = new BlockParameter(5561330);
var filterTransferEventsForAllContractsReceiverAddress2 = transferEventHandlerAnyContract.CreateFilterInput<string, string>(null, receiverAddress2, fromBlock, toBlock);
EgorovOleg
@EgorovOleg
Feb 11 14:53

@KevinSmall, This fixed the error, but does not receive incoming transactions.

var web3 = new Web3("https://mainnet.infura.io");
                var receiverAddress2 = "0x6fbfd62f133b2bbaa88a4c90e6af3c97e7746348";
                var transferEventHandlerAnyContract = web3.Eth.GetEvent<TransferEventDTO>();
                BlockParameter fromBlock = new BlockParameter(7000000);
                BlockParameter toBlock = new BlockParameter(7207090);
                var filterTransferEventsForAllContractsReceiverAddress2 = transferEventHandlerAnyContract.CreateFilterInput<string, string>(null, receiverAddress2, fromBlock, toBlock);
                var test = await transferEventHandlerAnyContract.GetAllChanges(filterTransferEventsForAllContractsReceiverAddress2);

GetAllChanges returned empty list.

Kevin Small
@KevinSmall
Feb 11 16:08
@EgorovOleg it may be those receiver addresses have never received ERC-20 transfers? Looking on etherscan https://etherscan.io/address/0x6fbfd62f133b2bbaa88a4c90e6af3c97e7746348 and https://etherscan.io/address/0xc117422db074e25a3d906f57d6f8acbdd2196cae, notice that the "ERC-20 token tx" tab is missing
Compare with this address that does have some ERC20 transfers: https://etherscan.io/address/0x8b88fce7bd28f0157ac6bb37a96723705d9f3123#tokentxns
Trying the code you posted with receiver address = "0x8b88fce7bd28f0157ac6bb37a96723705d9f3123" and block = 5561322, a single event gets picked up correctly
You should see test containing a single event/log for this transaction https://etherscan.io/tx/0xbb6c66eeb17ff5c416b0d33a474a529b23c2c79a62473ebfa9b240c8fd01c865
Juan Blanco
@juanfranblanco
Feb 11 18:04
mainly you are using the zeppelin proxy upgradability storage, so the storage is kept in the proxy, so consuming the contract from the normal address will not retrieve the right values
I have modified your token implementation to include an initialise function to allow the values get stored in the proxy contract, although you seem to have commented it too.. (all this will need to be implemented with another contract the ownership one that zeppelin provides)
Also i have modified the proxy contract a delegatecall to use a higher level calls, but that is just me, you can revert to the out of the box solution
Inuka Gunawardana
@inuka_g_gitlab
Feb 11 18:23
Thanks very much @juanfranblanco
@juanfranblanco I was actually initializing the code as well... the proxy contract issue I hit was due to Ganach bug trufflesuite/ganache-cli#614. So you were absolutely right it worked on Geth. The fact that the tests worked in Ganache and not through Nethrium got me going in the wrong direction. Thanks again for help
Juan Blanco
@juanfranblanco
Feb 11 18:38
Ah I missed that initialisation when I was simplifying it. That is great
ha ha the Ganache thing confused me as well as I was looking for issues on other areas :)
Inuka Gunawardana
@inuka_g_gitlab
Feb 11 19:40
@juanfranblanco yeah that was a wild goose chase. If you hadn't pointed out Netherium should have worked fine I would be still running around in circules. Thanks again, and keep up the good work with Netheirum... its been great
Jason Du
@jsdu
Feb 11 20:23

Hi guys, I've been working with smart contracts for some time now, just recently diving into Unity and working with unity and metamask. I tried finding any sample code but none seem to be up to date. Just wondering if there is any sample code that could help me read and write to smart contracts in WebGL.

I downloaded the latest version of Unity 2018.3.5 but I also heard that Nethereum runs on deprecated .Net 3.5.

Juan Blanco
@juanfranblanco
Feb 11 21:52
Nethereum runs on both, mainly co routines are supported.
That is a recent sample
Juan Blanco
@juanfranblanco
Feb 11 22:01
Using co routines together with UnityWebRequest required for webgl https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html
That uses net351 but usage is the same for net461 which you can use too with normal out of the box asynx Nethereum
If not using coroutines :)
DLLs can be found in the release page
EgorovOleg
@EgorovOleg
Feb 11 22:15

@KevinSmall,


                var web3 = new Web3("https://mainnet.infura.io");
                var receiverAddress2 = "0x8B88fCE7Bd28f0157AC6Bb37a96723705d9f3123";
                var transferEventHandlerAnyContract = web3.Eth.GetEvent<TransferEventDTO>();
                BlockParameter fromBlock = new BlockParameter(5561322);
                BlockParameter toBlock = new BlockParameter(5561322);
                var filterTransferEventsForAllContractsReceiverAddress2 = transferEventHandlerAnyContract.CreateFilterInput<string, string>(null, receiverAddress2, fromBlock, toBlock);
                var test = await transferEventHandlerAnyContract.GetAllChanges(filterTransferEventsForAllContractsReceiverAddress2);

Program sometimes throw an exception "Rpc timeout 20000 milliseconds" again. But GetAllChanges returned empty list again.Could you give an example of your code for example. Maybe I'm doing something wrong.