I'm looking forward to get transaction cost for a particular function call in solidity onChain. I found methods using the
web3.estimateGasCost(). But i need is, i should be able to calculate this on-chain. Is there anyway that i can calculate this on chain.
My purpose is like, If someone deposit a amount into my contract, the gas price should be less than 1% of the amount he is depositing, otherwise it should skip some steps.