# Script Types
There are three types of scripts:
- dApp script enables you to define callable functions that can be called from other accounts, accept payments to the dApp, and perform various actions on the blockchain. Also dApp script can comprise a verifier function that allows or denies transactions and orders that are sent on behalf of the dApp account.
- Account script allows or denies transactions and orders that are sent on behalf of the account (like a verifier function of a dApp script).
- Asset script allows or denies transactions involving the asset.
Features of each script type are described in the table.
# | dApp script | Account script | Asset script |
---|---|---|---|
Directives | {-# CONTENT_TYPE DAPP #-} {-# SCRIPT_TYPE ACCOUNT #-} | {-# CONTENT_TYPE EXPRESSION #-} {-# SCRIPT_TYPE ACCOUNT #-} | {-# CONTENT_TYPE EXPRESSION #-} {-# SCRIPT_TYPE ASSET #-} |
Content | Set of definitions | Boolean expression | Boolean expression |
this variable | Address structure containing dApp address | Address structure containing smart account address | Asset structure |
Transaction or order that is checked | Check is performed by the verifier function only. Annotation of the function sets the name of the variable that contains the outgoing transaction or the order, for example: @Verifier(tx) | Built-in variable tx: Transaction|Order contains the outgoing transaction or the order | Build-in variable tx: Transaction contains the transaction involving the asset.Order check is not supported |
Proofs accessibility | • Proofs of the outgoing transaction or the order are accessible to the verifier function. • Proofs of the invoke script transaction are inaccessible to the callable function | Accessible | Inaccessible |
Blockchain data | • Accessible to the callable function • Accessible to the verifier function when checking a transaction • Inaccessible to the verifier function when checking an order | • Accessible when checking a transaction • Inaccessible when checking an order | Accessible |