I have a contract and inside the contract there is a non-payable function that can call externally. this function do some analysis,and calls other payable function than can make real transaction using the contract balance(like transfer,swap). So if i call the first function using eth_call(), can the inside function make real transaction?
1 Answer
No. If there's no transaction signed by a private key being broadcasted and gas paid, the chains state won't change, no matter what.
-
if i send raw transaction and if no state is changed, does still burns gas? like if reads state and finishes the excution, does still costs gas? Commented Oct 15, 2023 at 17:42
-
@BirukDamte If it's done through eth_sendtransaction or sendrawtransaction, yes. There's absolutely no point in doing that though– FoxxxeyCommented Oct 15, 2023 at 18:26
-
lets say my function reads state of the chain and decides to do no transaction and finishes the execution because some conditions aren't meet. Does this costs gas? I want to execute both the decision part and the transaction part in one call. Commented Oct 15, 2023 at 18:31
-
-
getting state of the block chain, making decision off chain and sending new raw transaction is very time costy for me. Because I'm trying to arbitrage. Any suggestion please? Commented Oct 15, 2023 at 20:20