Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nethereum]

Questions related to the C# .NET Ethereum Web3 RPC Client Library, named nethereum

3
votes
1answer
22 views

Can I get the raw transaction using Nethereum?

How do I get a raw transaction using web3/Nethereum? An example of a raw transaction can be seen here: https://etherscan.io/getRawTx?tx=...
0
votes
2answers
20 views

Indexed Variables On Event Not Being Decoded

I'm currently returning back all events with no filter and all the indexed variables are being returned but they are encoded. The other none indexed variables are visible and being retrieved fine and ...
1
vote
0answers
17 views

passing byte[] to smart contract using nethereum

I made a solidity function that allow a user to send multiple transactions with the same nonce as a singleton Tx signer: function multipleTransferPreSigned ( bytes[] _signature, address[] ...
0
votes
1answer
15 views

Command “geth --rpcapi eth,web3,personal --rpc” throws Fatal Error

After deploying an private Ethereum blockchain with Azure Template "Proof of Work" we are not able to run the following command successfully. "geth --rpcapi eth,web3,personal --rpc" following image ...
0
votes
0answers
20 views

Nethereum: In a Factory Contract, how to obtain the event log of all new contracts

I understand that in Nethereum, the address of the contract is used to assign the filter, but what if I have different addresses of equal contracts and I just want to have a log of the event they ...
1
vote
0answers
34 views

Nethereum Getting TransactionHash of SendTransaction

I am using Nethereum for Unity3d and I have managed to muddle my way through a lot of issues, but I have a huge problem I just can't seem to solve. I can get this to work with signed transaction ...
0
votes
0answers
20 views

Nethereum transaction

How can I send the msg.data together with my transaction? Nethereum.StandardTokenEIP20.StandardTokenService(Web3, Add).TransferAsync(...)
2
votes
1answer
34 views

How can I decode the inputs to a transaction written by a smart contract constructor with Nethereum?

I've been able to decode the inputs to a contract function transaction given the ABI as follows: var myFunction = contract.GetFunction("MyFunction"); var myFunctionTxn = await contract.Eth....
0
votes
1answer
23 views

NewEventDTO is not a valid Event Type

The solidity code pragma solidity ^0.4.24; event NewEvent(uint32 tag, uint32 idx); My Nethereum code public class NewEventDTO { [Parameter("uint32", "tag", 1, false)] public uint Tag { get; ...
0
votes
0answers
25 views

How do I monitor event on Main Ethereum Account using Nethereum

What I mean is the real ETH transferred to my account, not Token. Let says I have an account (address 0x1234567890) Someone send me 1 ETH. I wish I can monitor and see that transaction, without ...
3
votes
2answers
54 views

Capturing an event fired from a contract that was called from another contract

I'm trying calculate tax on arbitrary items/values. To do this I have a single contract is used as an 'Oracle' to get the tax from an external system. This contract defines functions to be called from ...
0
votes
0answers
43 views

Listing all the smart contracts deployed on ethereum [duplicate]

I want to list all smart contracts deployed on a private Ethereum chain, using Nethereum, and also those which were deployed by a certain address. I have seen here and here but I cannot get anywhere ...
0
votes
1answer
24 views

Am I setting my gas price and gas limit correctly?

web3.TransactionManager.DefaultGas = 210000; // Gas limit? web3.TransactionManager.DefaultGasPrice = 10 * 1000000000; // Gas Price? I have intended to set the gas price at 10Gwei.
1
vote
0answers
19 views

How would I connect subscribe to the websocket to get transactions of a certain address with Nethereum(C#)?

I can only find tutorials on how to do it with Web3.JS. With Infura btw (wss://mainnet.infura.io:443/ws)
0
votes
0answers
20 views

Smart Contract returning random values in logs when a transaction is initiated using nethereum

My smart contract is as follows pragma solidity ^0.4.6; contract update { uint startTime; int public counter = 1; event Counter(address indexed sender, int result); function counterincrement() ...
0
votes
0answers
121 views

Nethereum C# automated ether transfer

I wish to automate the transfer of ether to a list of people. Assume the list is in a csv. I wrote some code to automate the process. class Program { int nonce = 0; static void Main(string[] ...
0
votes
1answer
206 views

Nethereum // Infura/RPCclients

I am having a heck of a time getting transactions to post on mainnet. The issue is not my wallet balance or gas related. A balance lookup on the same contract works correctly.. However, i cannot get ...
0
votes
0answers
104 views

Passing signature parameter to ERC865 contract and ecrecover()

I'm trying to deploy ERC865 Token while using C# Nethereum. The ERC865 contract expect to get signature length of 65 and when i tray to use "geth attach" web3.sha3(privatekey) i get 68 characters long ...
0
votes
0answers
85 views

How to get pending transactions

I try using txpool_content and txpool_inspect so,Is there anyway to get pending transactions using geth via .net and Json?
0
votes
1answer
37 views

Is this the only way that I can tell if a transaction is success / failed?

My solidity: function Test(address to, uint amount) public { require(amount == 1000000000000000000); } In Nethereum var r = contract.GetFunction("Test").SendTransactionAsync(<Owner Address&...
0
votes
0answers
58 views

Why I can't get any status from Nethereum TransactionReceipt?

Sample code below (simplified for illustrative purposes only): var a = new ManagedAccount(mOwner, mOwnerPwd); var w = new Web3(a, mNodeUrl); w.TransactionManager.DefaultGas = mGasLimit; w....
2
votes
1answer
69 views

Deploy contract with truffle, how to call in Nethereum?

I am currently deploying my ChangeManager contract in truffle and I want to call the contract later in Nethereum. For this I need the contract address in Nethereum. I figured I could just create an ...
1
vote
0answers
67 views

How can I import the Accounts from ganache-cli into Nethereum?

Is there a way to automatically load the Accounts created by ganache-li into a project which uses Nethereum?
0
votes
1answer
151 views

Error occurred when trying to send rpc requests(s)

I am using the nethereum package in .Net and trying to invoke a smart contract with web3. Initially it was working fine, but suddenly I am getting an error while trying to get the transaction count. ...
0
votes
0answers
28 views

SmartContract determine timestamp of saving data

I have really simple solidity smartcontract for saving and fetching data structs. When I ask for data struct (fetching function) I need to know timestamp (or block ID) when was the struct saved. How ...
0
votes
0answers
120 views

create ethereum wallet using c#

I already learn how to create encrypted private key using Nethereum and I find how to create account. var ecKey = Nethereum.Signer.EthECKey.GenerateKey(); var privateKey = ecKey.GetPrivateKeyAsBytes()...
0
votes
0answers
36 views

Nethereum SendTransactio and Getting a Mapping value always 0

I have the following contract: pragma solidity ^0.4.23; contract NatCoin { struct UserBalance { uint natcoins; string email; string login; } mapping (uint => ...
0
votes
0answers
21 views

Making RPC calls without setting up my own node [duplicate]

My application is using web3 or Nethereum to connect to my own ethereum node (setup using geth). Is it a must for me to setup my own node to make RPC calls (or connect to a specific node that setup ...
0
votes
0answers
71 views

Using string as an indexed variable in an Event

Hi I have written a contract that has an event like this: event Creation(string indexed _id,string _transType, string _ownerFirstName,string _ownerLastName); I am trying to listen to the Event ...
0
votes
0answers
115 views

Send ether to contract account by nethereum

I want to send ether to contract account address my code is : Account ac = new Account("4df253b63a39512893df2bbd48d31ff160a304ced892eb2c66a32e9d352081fa"); var web3 = new Nethereum.Web3.Web3(ac, "...
0
votes
1answer
62 views

Account vs ManagedAccount in Nethereum

Account to this text, they are different: https://nethereum.readthedocs.io/en/latest/accounts/ But it never mentioned what are the differences. Anyone know which one to choose from when implementing ...
0
votes
0answers
231 views

Nethereum Call to function seems to return correctly but state of contract is uneffected [duplicate]

I am attempting to set a variable of the contract. The setter function returns the expected value but the value of subsequent calls to get are unaffected. Nethereum Code: using System; using System....
0
votes
1answer
185 views

Nethereum contract function call throwing exception on return: hex string has length 64, want 40 for common.Address

Both a call returning and address and a call returning an int256 fail with the same error: Nethereum.JsonRpc.Client.RpcResponseException HResult=0x80131500 Message=invalid argument 0: hex string ...
0
votes
1answer
121 views

Can I assume when an event is received means the transaction is 100% confirmed?

I am listening to the even using Nethereum. May I know if an event is received means the transaction is confirmed? If not? How can I know it is failed and perform a rollback?
0
votes
0answers
24 views

Converting Solidity enum to Nethereum enum [duplicate]

Below is a snippet of code that I have extracted for illustrative purpose only. I have an enum declared in Solidity and returns in a function. enum State { start, end } function Test() public view ...
0
votes
0answers
26 views

Force caller to pay for gas without knowing their Password

Currently I wish the caller who invoke my contract (via nethereum) to pay for the gas. var a = new ManagedAccount("<add. of the user>", "<password>"); var w = new Web3(a, "http://............
0
votes
0answers
23 views

Life Span of Nethereum object

I am providing a wrapper for all my contract functions inside a C# class using Nethereum. And I found that in almost all the functions, I will start with: var a = new ManagedAccount("<address>",...
0
votes
3answers
572 views

Problem unlockaccount on Rinkeby via infura

I got "405 Method Not Allowed" error when I tried to unlock an account I created on MetaMask. Here is the code: string privateKey = "...
0
votes
0answers
49 views

Question for Nethereum and Events

Is polling for the event the only way to retrieve it? Seems like very inefficient. But luckily it doesn't cost any gas. Is event received in Nethereum means the transaction (in smart contract) had ...
0
votes
1answer
114 views

What can I do with Nethereum TransactionReceipt?

Refer to this link https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Tutorials/Nethereum.Tutorials.Account/AccountTransfer.cs Line 55: It mentioned "The transaction receipt polling ...
0
votes
0answers
39 views

Simple withdrawal transaction disappearing: what options for detecting and handling

I am using Nethereum to do a simple transfer of coins from one address to another: var web3 = new Web3(account, "https://mainnet.infura.io/asdf") { TransactionManager = ...
2
votes
1answer
287 views

Given a block number, how do I find the block hash using Nethereuem?

Using Nethereum, I would like to get the block hash given a block number (i.e. block height).
0
votes
1answer
128 views

Visual Studio using C# cannot find web3.Miner.Start.SendRequestAsync

The active using statements of the code are: using System; using System.Threading; using System.Threading.Tasks; using System.IO; using Nethereum.Web3; using Nethereum.Web3.Accounts; using Nethereum....
0
votes
1answer
386 views

Nethereum: How to get the list of pending transactions (haven't mined to a block yet)

Currently I'm using GetBlockWithTransactionsByNumber by looping into the latest 200 blocks to get the transactions sent to my address. I can actually get my transaction through the block number but ...
0
votes
0answers
50 views

A call to Function.CallAsync<int>(); crashes without any message or log

I am calling a function of a contract using C# and Nethereum via Function.CallAsync(); The function defined in solidity returns a uint256 and works as expected in Remix. This crashes the process. ...
0
votes
1answer
146 views

What is the Nethereum analog of “web3.version.network”?

I am just getting started with Nethereum and I want to ensure I am connected to the correct network.
0
votes
0answers
78 views

how to get geth address in web3 object

Web3 web = new Web3(); WhitelistService whitelist = new WhitelistService(web, "0x690a70c3bc03913adf64670bcc2656aac1fdc5a6"); Task<bool> resut = whitelist....
4
votes
1answer
635 views

how to call smart contract function in C#.net core

protected async void Page_Load(object sender, EventArgs e) { var senderAddress = "0x605a1f8d368cbdd4d0a5cbad74f75c428660f17b"; var password = "zxcasdqwe123"; ...
2
votes
1answer
524 views

Create new address in Ethereum using Nethereum

I try to create new account. var web3 = new Nethereum.Geth.Web3Geth(); var ecKey = Nethereum.Signer.EthECKey.GenerateKey(); var privateKey = ecKey.GetPrivateKeyAsBytes().ToHex(); var account = new ...
1
vote
1answer
425 views

How to check if a transaction has completed correctly or has been rejected by some assert check [duplicate]

We have developed a simple Smart Contract which offers this following public transaction method: function bid(uint256 _userCode, uint256 _amount) public { assert(_userCode> 0); ...