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.
Any statements valid for a computation are valid for application initialization.
However, some additional statements are allowed.
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.
The compilation options for the DApp may be set by calling
OBJ_EXPR is an object with the following keys and values:
'constructor' (default) or
Determines whether contract should be deployed independently (
'constructor') or as part of the first publication (
If deployed as part of the first publication, then the first publication must precede all uses of
See the guide on deployment modes for a discussion of why to choose a particular mode.
Determines whether arithmetic operations automatically introduce static assertions that they do not overflow beyond
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.
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.
Any expressions valid for a computation are valid for application initialization.
However, some additional expressions are allowed.
22.214.171.124.1 Participant Definition
A participant and participant class may be declared with
participantName is a string which indicates the name of the participant function in the generated backend code.
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.
126.96.36.199.2 View Definition
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
In the DApp, the result of this application argument is referred to as a view object.