On this page: Statements deploy
deploy set  Options
set  Options
deploy  Mode
verify  Arithmetic
verify  Per  Connector
ALGO Expressions Participant Definition
Participant  Class View Definition
5.4.3 Application Initialization

The body of Reach.app is an application initialization. It defines the various participants and views of the DApp, as well as sets compilation options. It is finalized with deploy() and then the application begins in a step. Statements

Any statements valid for a computation are valid for application initialization. However, some additional statements are allowed. deploy


A deploy statement, written deploy();, deploys the DApp and finalizes all of the available participants, views, and compilation options.

Its continuation is a step, which means its content is specified by Steps. It represents the body of the DApp to be compiled. setOptions

setOptions({ verifyArithmetic: true });

The compilation options for the DApp may be set by calling setOptions(OBJ_EXPR); where OBJ_EXPR is an object with the following keys and values:



'constructor' (default) or 'firstMsg'


Determines whether contract should be deployed independently ('constructor') or as part of the first publication ('firstMsg'). If deployed as part of the first publication, then the first publication must precede all uses of wait and .timeout. See the guide on deployment modes for a discussion of why to choose a particular mode.








true or false (default)


Determines whether arithmetic operations automatically introduce static assertions that they do not overflow beyond UInt.max. This defaults to false, because it is onerous to verify. We recommend turning it on before final deployment, but leaving it off during development. When it is false, connectors will ensure that overflows do not actually occur on the network.








true or false (default)


Determines whether verification is done per connector, or once for a generic connector. When this is true, then connector-specific constants, like UInt.max, will be instantiated to literal numbers. This concretization of these constants can induce performance degradation in the verifier.








[ETH, ALGO] (default)


A tuple of the connectors that the application should be compiled for. By default, all available connectors are chosen. Expressions

Any expressions valid for a computation are valid for application initialization. However, some additional expressions are allowed. Participant Definition

A participant and participant class may be declared with

Participant(participantName, participantInteractInterface)


ParticipantClass(participantName, participantInteractInterface)


participantName is a string which indicates the name of the participant function in the generated backend code. Each participantName must be unique.

participantInteractInterface is a participant interact interface, an object where each field indicates the type of a function or value which must be provided to the backend by the frontend for interacting with the participant. View Definition

Views are defined in application initialization and then they are set in consensus steps. Both of these steps are in Reach. They are accessed by frontends by using the Reach standard library of the frontend language, such as JavaScript.

View('NFT', { owner: Address })

A view is defined with View(viewName, viewInterface), where viewName is a string that labels the view and viewInterface is an object where each field indicates the type of a function or value provided by the contract associated with the specified DApp. These views are available in frontends via the ctc.getViews function. In the DApp, the result of this application argument is referred to as a view object.