During token creation and token transfer some ethers are used as gas. What is the most efficient way to refill an account with the same amount of ether? So that it doesn't run out of funds(ether). I'm using a web3 version-1. Any suggestions are welcome.
1 Answer
when creating transactions, you can adjust gasLimit through option.
And Solidity offers the following keywords.
msg.gas msg.gasprice gas(Transaction fee)= UsedGas * gasPrice = (GasLimit - msg.gas) * gasPrice
- To find UsedGas eth.getTransactionReceipt can be used.coderforfun– coderforfun2018-12-04 09:18:24 +00:00Commented Dec 4, 2018 at 9:18