# [Ride v5] Standard Library Version 5
Standard library version 5 is added in node version 1.3.0 and enabled with feature #16 “Ride V5, dApp-to-dApp invocations”. Versions 1.3.x are now available for Stagenet only.
# dApp-to-dApp Invocation
A dApp callable function can invoke a callable function of another dApp, or another callable function of the same dApp, or even itself. The invoked function returns a value that the invoking function can use. The subsequent operations of invoking function are executed, taking into account script actions of invoked function (as if the actions are applied to the blockchain state). All callable functions are executed within a single Invoke Script transaction. The total complexity is limited. More about dApp-to-dApp invocation
Changes in Ride:
- Added the Invoke function for dApp-to-dApp invocation.
- Added strict variables that are evaluated before the next expression to ensure executing callable functions and applying their actions in the right order.
- Modified the Invocation structure: in case of dApp-to-dApp invocation, the structure contains the address and public key of both the sender of the Invoke Script transaction and the dApp account that invokes the callable function.
- Modified the callable function result by adding a return value.
# Lease and LeaseCancel Script Actions
Added script actions that the callable function can perform:
Using these actions, you can change the amount of the lease, in particular, withdraw a part of the leased funds. If you cancel a lease for a larger amount and create a new lease for a smaller amount with the same recipient in the same script invocation, the recipient's generating balance decreases by the difference. Otherwise, if you send two separate transactions: a Lease Cancel transaction and a Lease transaction, they can be added to a different blocks and therefore generating balance decreases by the amount of the canceled lease immediately and increases by the amount of the new lease after 1000 blocks.
Added the function calculateLeaseId that calculates ID of the lease formed by the
# Big Integers
Added the BigInt data type of 64 bytes (512 bits) and functions supporting it:
- fraction(BigInt, BigInt, BigInt): BigInt
- fraction(BigInt, BigInt, BigInt, Union): BigInt
- log(BigInt, Int, BigInt, Int, Int, Union): BigInt
- max(List[BigInt]): BigInt
- median(List[BigInt]): BigInt
- min(List[BigInt]): BigInt
- pow(BigInt, Int, BigInt, Int, Int, Union): BigInt
- parseBigInt(String): BigInt|Unit
- parseBigIntValue(String): BigInt
- toBigInt(ByteVector): BigInt
- toBigInt(ByteVector, Int, Int): BigInt
- toBigInt(Int): BigInt
- toBytes(BigInt): ByteVector
- toInt(BigInt): Int
- toString(BigInt): String
Added the following built-in functions: