# Standard Library
Standard library is a set of built-in functions, structures and variables.
The version of the Standard library in the script is set by the STDLIB_VERSION
directive.
We recommend to use version 4 of the Standard Library when developing applications. Standard library version 4 is available since activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions”.
⚠️ Standard library version 5 is added in node version 1.3.0 and enabled by feature #16 “Ride V5, dApp-to-dApp invocations, Continuations”. Versions 1.3.x are now available for Stagenet only.
Changes in versions are shown in the table.
# | Version 3 | Version 4 | Version 5 |
---|---|---|---|
Script | Added: • dApp script • Directives • Annotations • Custom functions • FOLD<N> macro | Added: • dApp-to-dApp invocation • Continued computations | |
Data types | Added: • List | Added: • Any | |
Variables | Added built-in variables: • this • lastBlock • nil • Rounding methods: CEILING, DOWN, FLOOR etc. • Designations of hashing algorithms: NOALG, MD5, SHA1 etc. | Added strict variables | |
Structures | Added: Script actions: • DataEntry • ScriptTransfer Script results: • ScriptResult • TransferSet • WriteSet Common structures: • Asset • AttachedPayment • BlockInfo • Invocation Transaction structures: • InvokeScriptTransaction | Added: Script actions: • BinaryEntry • BooleanEntry • IntegerEntry • StringEntry • DeleteEntry • Issue • Reissue • Burn • SponsorFee Common structures: • BalanceDetails Transaction structures: • UpdateAssetInfoTransaction Modified: Common structures: • Asset • BlockInfo • Invocation Transaction structures: • DataTransaction • InvokeScriptTransaction • IssueTransaction Deleted: • DataEntry • ScriptResult • TransferSet • WriteSet | Added: Script actions: • Lease • LeaseCancel |
Built-in functions | Added: Blockchain functions: • assetInfo • blockInfoByHeight • transferTransactionById Converting functions: • parseInt • parseIntValue • toInt • toUtf8String • toString(Address) Decoding functions: • fromBase16String Encoding fuctions: • toBase16String Math functions: • log • pow String functions: • indexOf • lastIndexOf • split Union functions: • value • valueOrErrorMessage Verification functions: • checkMerkleProof • rsaVerify Deleted: • transactionById | Added: Blockchain functions: • calculateAssetId Converting fuctions: • transferTransactionFromProto List functions: • containsElement • indexOf • lastIndexOf • min/max • removeByIndex Math functions: • median String functions: • contains • makeString Union functions: • valueOrElse Verification functions: • bn256groth16verify • createMerkleRoot • ecrecover • groth16verify Deleted: • checkMerkleProof • extract | Added: dApp-to-dApp invocation function: • Invoke Blockchain functions: • calculateLeaseId Account data storage functions: • getBinary(key: String): ByteVector|Unit • getBinaryValue(key: String): ByteVector • getBoolean(key: String): Boolean|Unit • getBooleanValue(key: String): Boolean • getInteger(key: String): Int|Unit • getIntegerValue(key: String): Int • getString(key: String): String|Unit • getStringValue(key: String): String |
Operators | Added: • :+ • ++ | ||
Complexity changes | • - operator: 9 → 1 • ! operator: 11 → 1 • != operator: 26 → 1 • throw: 2 → 1 • isDefined: 35 → 1 | • + operator: 10 → 2 for ByteVector values, 10 → 20 for strings • Functions: see complexity changes in the Built-in Functions article • Added blake2b256_<N>Kb , keccak256_<N>Kb , sha256_<N>Kb ,rsaVerify_<N>Kb , sigVerify_<N>Kb range of similarfunctions with different complexity depending on the argument size limit | |
Data size | • String : up to 32,767 bytes• ByteVector : up to 32,767 (except the bodyBytes fieldof the transaction structure) |