Skip to the content.

The dependent participation pattern

Intent

Giving the creator the right to create an arbitrary amount of invitations, which it can share with potential counter parties.

Consequences

Structure

Participants

Implementation

const start = zcf => {
  const offerHandler = seat => {
    //...
  };
  const creatorFacet = Far('creatorFacet', {
    makeInvitation: () => zcf.makeInvitation(offerHandler, 'description')
  });
  return harden({ creatorFacet });
};
harden(start);
export { start };

The smart contract returns a creatorFacet with a method makeInvitation. This allows the creator to create an arbitrary amount of invitations.

Known uses

Note that, although the sell items smart contract does return a creatorFacet with a makeBuyerInvitation method, it is not included in the list of known uses. This is because both the publicFacet and the creatorFacet offer this makeBuyerInvitation method: there is thus no guarantee that the creator gets to choose the counter parties that it will trade with.