Calculating Costs in Ethereum Contracts