Algorand Contract Cost

I am brand new to the community. I am a mathematician with a strong software engineering background. I am reading the documentation for TEAL, ASA and ASC-1. Here are the things I care for about which I cannot find good information about:

  1. What is the cost of executing calls to a smart contract? Both, computationally and in Algos.
  2. Even better, what is the formula?
    2.a Is it (ops)*(cost of ops) + knownFee? How much does each op cost in Algos?
  3. What is the cost of moving ASA around from a wallet to another?
    3.a Even better, what determines this cost? In Algos please. A formula would be nice.

On a related but dissimilar note: could ASA created on Algorand become list on exchanges at some point?

Thank you!

The minimum fee per transaction does not depend on the type of transaction: payment in Algos, transfer of ASA, smart contract call, …
It is always 0.001 Algo. In case of congestion, nodes require a minimum fee per byte, but again this is independent of smart contracts.

Smart contracts execution time/cost and size are restricted as explained there: The Smart Contract Language - Algorand Developer Portal

Furthermore, when you “opt-in” or “create” a smart contract, your account’s minimum balance increases. See Overview - Algorand Developer Portal

ASA also requires min balance. See Assets - Algorand Developer Portal

See Algorand Parameter Tables - Algorand Developer Portal for a table with parameters.

1 Like

@fabrice Thank you.

A couple of follow up questions:

  1. Could you please explain the purpose and mechanics of the
    “Minimum Balance” requirement?
    1.a Are these just Algos required to be in the account that created the ASA/ASC-1 for the duration of the existence of that ASA/ASC-1? Do they get consumed at any point? Do they get returned when the ASA/ASC-1 is deleted/burned/retired-from-the-blockchain?

  2. When an ASA is created, who gets the opt-in charge of every user that opts-in the ASA?

  3. To move ASA from one wallet to another I want to create a transfer function as a ASC-1 to manage movement of my ASA, can users move the ASA directly outside my ASC-1 transfer function? That is, outside my management workflow. It seems to me, they could directly transfer ASA using the blockchain directly and bypass any ASA management I would want to enforce.

Thanks!

  1. Minimum balances are here to limit the total size of the account table stored by all the nodes. It ensures that this account table does not grow too large. Indeed, all ASA balances and contract states need to be stored by all the nodes, to be able to properly validate transactions.
  2. There is no “opt-in charge”. The opt-in transaction has a fee. This fee goes to the fee sink as all transaction fees. See question about fee sink there: https://algorand.foundation/faq#miscellaneous-
  3. ASA are like Algos (or if you come from the Ethereum world, Ether). They are NOT smart contracts. This makes them much simpler. See Assets - Algorand Developer Portal If you want to restrict the way ASA are transferred, see freezing (Assets - Algorand Developer Portal), Assets and Custom Transfer Logic | Algorand Developer Portal, and Securities and Permissioned Tokens | Algorand Developer Portal