Skip to content

Zoe API

Zoe v0.24.0. Last updated August 25, 2022.

The Zoe framework provides a way to write smart contracts without having to worry about offer safety. To use Zoe, we put things in terms of "offers". An offer proposal is a statement about what you want and what you're willing to offer. It turns out, many smart contracts (apart from gifts and one-way payments) involve an exchange of digital assets that can be put in terms of offer proposals.

Start creating your own contract or build on any of our existing contracts. Explore our pre-built contracts.

The Zoe API supports the following objects:

ObjectDescription
Zoe ServiceDeploys and works with smart contracts.
UserSeatUsed outside contracts to access or manipulate offers.
Zoe Contract FacetAccesses a running contract instance.
ZCFSeatUsed within contracts to access or manipulate offers.
ZCFMintUsed by a contract to issue digital assets.
Price AuthorityGives quotes for prices.

The Zoe API provides the following libraries:

LibraryDescription
ZoeHelpersFunctions that extract common contract code and patterns into reusable helpers.
Ratio MathFunctions that let you create and manipulate Ratios.

The Zoe API introduces and uses the following data types:

Data TypeDescription
AllocationThe Amounts to be paid out to each seat upon exiting an Offer.
AmountKeywordRecordA record in which the property names are Keywords and the values are Amounts.
HandleA Far object without any methods whose only useful property is its unique identity.
InstanceA handle to an opaque object that represents a contract instance.
InvitationA non-fungible eright that can be held in Payments or Purses, just like any other eright.
InvitationIssuerAn Issuer for Invitations, which grant the right to participate in a contract.
KeywordAn ASCII identifier string that must begin with an upper case letter.
MutableQuoteStatement from a PriceAuthority as to the current price level at a particular time when multiple calls, replacing the trigger value, are expected.
ParsableNumberDefined as a bigint, number, or string.
PriceQuoteStatement from a PriceAuthority as to the current price level at a particular time when only a single calls is expected.
RatioPass-by-value record that consists of a numerator Amount and a denominator Amount.
TransferPartAllocation changes for one or two existing ZCFSeats. TransferParts are the individual elements of the transfer array passed into the atomicRearrange() function.