5.7.1.4 Contracts
These functions create and interact with contract representations.
—
Returns a Reach contract abstraction after starting the deployment of a Reach DApp contract based on the bin
argument provided.
This bin
argument is the "input.mjs" module produced by the JavaScript backend.
This function does not block on the completion of deployment.
To wait for deployment, see ctc.getInfo
.
—
Returns a Promise for an object that may be given to attach
to construct a Reach contract abstraction representing this contract.
This object may be stringified with JSON.stringify
for printing and parsed again with JSON.parse
without any loss of information.
The Promise will only be resolved after the contract is actually deployed on the network.
If you are using {deployMode: 'firstMsg'}
,
avoid blocking on this Promise with await
until after the first publish
has occurred.
Awaiting getInfo
too early may cause your program to enter a state of deadlock.
—
Returns a Reach contract abstraction based on a deployed Reach DApp contract provided in the ctcInfo
argument (or a Promise for ctcInfo) and the bin
argument.
This bin
argument is the "input.mjs" module produced by the JavaScript backend.