- Storage fees are charged in the storage phase.
- Compute fees are charged in the compute phase.
- Forward and action fees are charged in the action and bounce phases.
- Import fees apply at the start of smart contract execution, not a specific phase.
- Storage fees are set in config parameter 18.
- Compute fees are set in config parameters 20 and 21.
- Forward, import, and action fees are set in config parameters 24 and 25.
Storage fees
account.bits and account.cells from AccountStorage, excluding ExtraCurrencyCollection stored in the other field. The other field is replaced with a single 0 bit that represents an empty HashmapE.
Compute fees
All computation is measured in gas units. A TVM operation typically has a fixed gas cost, but that is not always the case. Network configuration defines gas prices; users cannot override them.Flat gas limit
A contract invocation pays for at leastflat_gas_limit gas units. Spending up to that limit costs flat_gas_price TON. If the contract spends gasUsed gas units, the fee is:
Forward fee
Forward fee is calculated with this formula:lumpPriceis the fixed value from config paid once for the message.msgSizeInCellsis the number of cells in the message.msgSizeInBitsis the number of bits in all the cells of the message.bitsInRootis the number of bits in the root cell of the message.
lumpPrice covers that root cell.
Action fee
Action fee is the portion offwdFee granted to the validator of the message’s source shard. The remaining fwdFee - actionFee amount goes to the validator of the destination shard.
Action fee exists only for internal messages.
Import fee
Import fee mirrors forward fee for inbound external messages. The root cell and its contents are covered bylumpPrice in the same way as internal messages.