I am new to this domain and have no idea how many transaction fees will be needed. They are simple operations like giving access of an image to a user and uploading images.

I need to show this project to my professor today!

1

There are 1 answers

0
Petr Hejda On

The gas fees for a transaction in native token (BNB on Binance Smart Chain, ETH on Ethereum, MATIC on Polygon, ...) are calculated using the following formula:

native token fee amount = gas units * gas price


The amount of gas units for executing the transaction depends on the complexity of the code that you're executing. There's a base amount of 21 thousand gas units for sending a transaction, plus whatever amount the contract consumes. Usually, contract execution consumes from thousands to tens of thousands of gas units.

Gas price is market driven. According to BSCScan, the gas price right now is 3 Gwei ( = 3,000,000,000 wei), but it does change overtime depending on the network usage.

Given the example numbers, a transaction costing 21,000 gas units times 3 Gwei gas price results in the overall cost of 63,000 Gwei == 0.000063 BNB.

If the cost of executing the contract function is 50,000 gas units, and the gas price is still 3 Gwei, then the overall cost is 150,000 Gwei == 0.00015 BNB.