Skip to content

Commit 88999f9

Browse files
committed
docs(zoe): high level trading flow diagram; 2 videos
- Offer Safety: Partitioning Risk in Smart Contracts (20 min. Dec 2019) - How To Build a Composable DeFi Contract (1:47 Sep 2020)
1 parent dc2802e commit 88999f9

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

main/guides/zoe/assets/offer-safety-flow.svg

+1
Loading

main/guides/zoe/index.md

+31-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
# Zoe Overview
22

3-
## What is Zoe?
3+
The Zoe service and smart contract API support credibly trading assets with reduced risk.
44

5-
Zoe is the heart of Agoric's smart contract framework. Use Zoe to:
6-
7-
- **Run your code on-chain**
8-
- **Mint new digital assets**
9-
- **Credibly trade assets**
10-
11-
## Why Use Zoe?
12-
13-
- **Zoe is Safer for Users:** A Zoe offer guarantees that you get either
14-
what you wanted or a full refund of the assets you put in,
5+
- **Zoe is Safer for Users:** Zoe guarantees that when you make an offer, you get either
6+
what you said you wanted or a full refund of the assets you put in,
157
even if the contract is buggy or malicious.
168

17-
- **Zoe is Safer for Developers** For a given offer, if you
9+
- **Zoe is Safer for Developers**: For a given offer, if you
1810
make a mistake with the amount of assets you take or give,
1911
Zoe guarantees that your users will either get what they say
2012
they wanted or get a refund.
2113

14+
## High Level Trading Flow
15+
16+
Trading with a contract using Zoe typically goes through these steps:
17+
18+
<img src="./assets/offer-safety-flow.svg" alt="offer safety flow with contracts, zoe, and parties"
19+
style="border: 2px solid" />
20+
21+
1. Parties call [E(zoe).offer(invitation, proposal, assets)](/reference/zoe-api/zoe#e-zoe-offer-invitation-proposal-paymentpkeywordrecord-offerargs). Zoe escrows the assets.
22+
2. Zoe relays the proposal to the contract identified in the invitation.
23+
3. The contract handles proposals using its custom business logic.
24+
4. The contract instructs Zoe to [reallocate](/reference/zoe-api/zoe-contract-facet#zcf-reallocate-seats) assets among the parties.
25+
5. The contract completes (aka [exits](/reference/zoe-api/zcfseat#azcfseat-exit-completion)) the offers.
26+
6. Zoe pays out assets to the parties.
27+
28+
Note that in this flow, _assets are not sent to the contract_; only information about them. _For more on this distinction, see [The Settlers of Blockchain](https://agoric.com/blog/technology/the-settlers-of-blockchain) Jun 2021._
29+
30+
::: tip Watch: Offer Safety: Partitioning Risk in Smart Contracts (20 min. Sep 2019)
31+
32+
<iframe width="400" height="225" src="https://www.youtube.com/embed/T6h6TMuVHKQ?si=NzWre0vhlxjBxG-5&amp;controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
33+
34+
:::
35+
2236
## Bundling a Contract
2337

2438
In [deploying the basic dapp contract](../getting-started/#starting-the-dapp-smart-contract),
@@ -292,7 +306,11 @@ and tests that it's what she wanted.
292306

293307
<<< @/../snippets/zoe/contracts/alice-trade.js#payouts
294308

295-
## Example Contracts
309+
## Live Coding and Example Contracts
310+
311+
::: tip Watch: How To Build a Composable DeFi Contract (1:47 Dec 2020)
312+
313+
<iframe width="560" height="315" src="https://www.youtube.com/embed/e9dMkC2oFh8?si=3Luwp25R8d23elAa" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
296314

297315
Agoric has written [a number of example contracts that you can
298316
use](./contracts/index), including:

0 commit comments

Comments
 (0)