Skip to main content

Messages

Messages are objects of the following structure:
message$_
    {X:Type}
    info:CommonMsgInfo
    init:(Maybe (Either StateInit ^StateInit))
    body:(Either X ^X)
= Message X;
  • init is an optional field of StateInit type used to initialize the contract state, stored either in-place or in a ref of the cell with a message.
  • body is the actual message content that can be stored either in-place or in a reference. Typically it is the payload of the message that will be read by the receiver.
  • info describes the type of the message, and fields specific to messages of this type:
    • Internal messages are messages from one contract to another.
    • Incoming external messages are messages from the outside world to the contract.
    • Outbound external messages are messages from the contract to the outside world. They can be interpreted as logs.

Transactions

A transaction is a record that stores the state changes of a contract. A contract’s state cannot be changed without a transaction. When a contract processes a message, a transaction may occur as the result of its processing.
  • When an internal message is processed, a transaction is always created.
  • When an incoming external message is processed, a transaction will be created only if the contract accepts the message.
  • When an outbound external message is processed, a transaction is never created, because outbound external messages can’t change contract state.
However, a transaction may be created independently of message processing by
  • tick-tock transactions
  • split-prepare transactions
  • split-install transactions
  • storage-tx transactions