Nethereum: Value Parameter in Function.SendTransactionAsync() Explained

nethereum

I am running a private blockchain node using geth as a client and nethereum to interface to a .net application.

In order to mine a function call I am currently using the function Function.SendTransactionAsync() like below:

var transactionHash = await newFunction.SendTransactionAsync(senderAddress, new HexBigInteger(700000), new HexBigInteger(1), parameter1, parameter2, parameter2);

The first HexBigInteger(700000) signifies the gas.
What does the second HexBigInt refer to and how do I determine what value I should pass to it ?

Best Answer

The value parameter refers to the amount of Ether you want to send to the contract with that transaction.

When sending a transaction there are common parameters:

  • To (the address where you sending the transaction, in this case, the contract address which is automatically set)
  • From (the address from)
  • Gas (the total amount of gas you want to spend, or gas limit)
  • Gas Price (gas price)
  • Value (the amount of ether (in Wei) you want to send, this can be to an account or a contract, in your scenario, you will be sending it to a contract. Your function in solidity should be able to access it using msg.value)
  • Data (in your scenario, this is the function and parameters encoded)
Related Topic