This page describes the costs to interact with low level Phat Contract (rust sdk). It may not reflect that in a higher level (e.g. Javascript-based Phat Contract).
gas
. (weight
in ink terminology). You must pay the gas fee calculated by gas * gasPrice
to execute the transaction. Currently, gasPrice
is a constant. (See #parameters for details.)
gasLimit
and storageDepositLimit
when sending a transaction, which can be estimated by an estimation API. Then the max fee is defined below:
maxFee
before executing a transaction. Once executed, the VM will refund the remaining fee to your account (maxFee - fee
). If the transaction runs out of the gas or Storage Deposit, the transaction will be revered with an error (OutOfGas
or StorageDepositLimitExhausted
).
gas * gasPrice
) is usually less than 1 PHA. The storage deposit fee is a bit more complex.
When you add an entry to the contract storage like below, you will be charged a small storage deposit. It takes a few bytes to store the key and the value.
env.terminate_contract()
(doc)