Teal Note
TEAL Basic knowledge#
- @2022-01-14
- TEAL example walk through: The smart contract language
-
TEAL example: Smart contract details
- stateful smart contracts on Algo chain
- generate asset + Escrow accounts
- store values on the blockchain, globally(on blockchain) or locally(in accounts balance record)
- NoOp, OptIn, DeleteApplication, UpdateApplication, CloseOut, ClearState
- PyTeal can write smart signatures and smart contracts
- @2022-01-20
-
As a new stack language programmer, this tutorial gives an idea of how stack language works. This is turing complete. But with a of repetition/redundancy if we don't use the "memory addressing" thing. GodBa recommended this :Forth language
programs are processed one line at a time pushing and popping values on and off the stack. These stack values are either unsigned 64 bit integers or byte strings.
This is a stack language, according to GodBa
Dynamic operational cost
Maybe we can abuse this and use a lot of public accounts to increase the operational cost for smart contract.
- @2022-01-28
- Return Int(1) means success, Int(0) means failure. Also works for the "Smart Contract Methods"
- We can consider
Seq
,Return
like they are returning a function.
Learning resources#
- TEAL full docs(not so detailed): Transaction Execution Approval Language
- TEAL operators: Opcodes Transaction Execution Approval Language (TEAL)
- TEAL Guidelines
- TEAL debugger: Smart contract debugging
- Installing
goal
can be useful here(failed testing)
Problems#
- @2022-01-30
- Can we create many false users to expand the key-value pair stuck? Should we?
- A contract can store up to 64 key-value pairs in global state and up to 16 key-value pairs per user who opts into the contract. Once these values are set, they can never be changed. Said here