Common
List of the most commonly used built-in global static functions.
Contextual
now
Returns the current Unix time.
Usage example:
myBalance
Returns the nanoToncoin balance of the smart contract as it was at the start of the compute phase of the current transaction.
Usage example:
myAddress
Returns the address of the current smart contract as an Address
.
Usage example:
sender
Returns the Address
of the sender of the current message.
Usage example:
context
Returns Context
Struct, that consists of:
Field | Type | Description |
---|---|---|
bounced | Bool | Bounced flag of the incoming message. |
sender | Address | Internal address of the sender on the TON blockchain. |
value | Int | Amount of nanoToncoins in a message. |
raw | Slice | The remainder of the message as a Slice . It follows internal message layout of TON starting from the destination Address (dest:MsgAddressInt in TL-B notation). |
Usage example:
Addressing
newAddress
Creates a new Address
based on the chain
id and the SHA-256 encoded hash
value.
This function tries to resolve constant values in compile-time whenever possible.
Usage example:
contractAddress
Computes smart contract’s Address
in a workchain based on its StateInit
.
Usage example:
contractAddressExt
Computes smart contract’s Address
based on the chain
id, contract’s code
and contract’s initial state data
. Use initOf
expression to obtain initial code
and initial data
of a given contract.
Usage example:
Communication
send
Queues the message to be sent using a SendParameters
Struct.
Usage example:
emit
Queues the message body
to be sent to the outer world with the purpose of logging and analyzing it later off-chain. The message does not have a recipient and is gas-efficient compared to using any other message sending functions of Tact.
Usage example: