# Directives
Every Ride script should start with directives for the compiler. The directives define the script format and available functions, structures and variables.
Directive format is as follows:
{-# DIRECTIVE_NAME VALUE #-}
# Directives List
Directive name | Directive function | Possible values |
---|---|---|
STDLIB_VERSION | Version of the Standard Library | 4 (available after activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions”)3 2 1 |
CONTENT_TYPE | Script content type | DAPP : the script is a set of definitions and contains functions that can be invoked from another account.EXPRESSION : the script is a boolean expression used for transaction verification |
SCRIPT_TYPE | Entity that the script is attached to | ACCOUNT ASSET |
# Directives Examples
For a dApp script:
{-# STDLIB_VERSION 4 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}
For an account script:
{-# STDLIB_VERSION 4 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ACCOUNT #-}
For an asset script:
{-# STDLIB_VERSION 4 #-}
{-# CONTENT_TYPE EXPRESSION #-}
{-# SCRIPT_TYPE ASSET #-}
Not all combinations of directives are correct. The example below will not work, because DAPP
content type is allowed only for accounts:
# Wrong example, will not work
{-# STDLIB_VERSION 4 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ASSET #-}