These are chat archives for Nethereum/Nethereum

7th
Feb 2017
vladyslavmunin
@vladyslavmunin
Feb 07 2017 07:56
Hi Juan,
I want to ask,
If I want to fill field 'DATA' ( e.g. Mist or send in transcation in geth) automatically,
I found some documentation for encoding functions and their parameters,
so the questions is "Nethereum implements this feature?".
vladyslavmunin
@vladyslavmunin
Feb 07 2017 08:08
 var getSyncDateFunction = contract.GetFunction("syncDate");
  var data = getSyncDateFunction.GetData();
function GetData() return sha3 signature , (methodId) ,
then I just need encode my params and concat string?
vladyslavmunin
@vladyslavmunin
Feb 07 2017 08:49
Oh, I wasn't careful enough, I can simply pass a parameter to a function GetData.sorry)
Juan Blanco
@juanfranblanco
Feb 07 2017 10:00
:+1: glad you found it
Btw when you do Function.SendTransaction(params) it does the encoding for you
and sends the transaction
or Function.Call
which you might have guessed does a call
vladyslavmunin
@vladyslavmunin
Feb 07 2017 10:08

yes,I know)
but in case when user uses some client and want to send some param , he does't know any fucntion name , he just sends money, and past encoded function in data field.

if we use SendTranscation - we must pay gas for payble functions, and we can't send transaction on behalf of the user 'cause we don't have his credentials , I'm right?

Juan Blanco
@juanfranblanco
Feb 07 2017 10:09
ok got you, so you want to send a transaction on behalf somebody, then yes
only thing is that your contract if uses msg.sender (you will be the sender)
other than that, should be fine

only part that confuses me is "he just sends money"
Juan Blanco
@juanfranblanco
Feb 07 2017 10:14
any interaction that is persisted in the blockchain will use some gas, interacting with a contract will use gas. (A call does not as you are just executing "offline" contract calls, or just querying the state by proxy)
vladyslavmunin
@vladyslavmunin
Feb 07 2017 10:23
I will try to explain what I mean:
I have two payable functions in contract,
first is fallback function , which call second func with default param.
second function receives param.
if user want to call second function directly ( with some param) but he knows only contract address for sending ether.
in mist client user has a posibility to fill Data field , which 'consists of' function data and param.
some software generates this data for user, and he just pastes it in this field.
so, function 2 called , param received,ehter in contract)
Juan Blanco
@juanfranblanco
Feb 07 2017 10:27
ok got you! :)
vladyslavmunin
@vladyslavmunin
Feb 07 2017 10:28
:smile:
MashB
@MashB
Feb 07 2017 13:57
Hi Guys, SendTransactionAsync() state is always in pending transaction
Juan Blanco
@juanfranblanco
Feb 07 2017 14:12
hi i guess you are mining?