-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Zoe] Zoe Release v0.3.0 #685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some early comments to give Kate a head start on anything that needs to be added. More comments coming. Most of my requests are about documentation or testing, which shouldn't be too surprising.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most suggestions at #700
aac6689
to
ee7533b
Compare
The difference LGTM so you can now squash as you wish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that my review skips
chainmail file
most tests
the wrong myFirstDapp that should be deleted anyway
The review is not yet done. But zoe.js is done, which is the most important part. More soon.
Both differential commits LGTM. Squash when you wish. I'm glad you deleted myFirstDapp despite my misunderstanding. If we can, please leave it deleted. |
(I don't know why, once I've started a review, I can't comment in place on review comments like #685 (comment) ) At #685 (comment) @katelynsills writes:
Well, at least that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything reviewed except for the exclusions already mentioned + autoswap and bondingCurves. I'm done for the night, busy a whole day tomorrow, and autoSwap is hard. @dtribble what's your feeling about merging this before I review those two, and then doing post-merge review and fixing-if-needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looking at autoswap. All else reviewed.
As of your tenth commit, I've also done all the differential review, so squash at will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
45082c7
to
d71b053
Compare
I'm okay with the merge/refactoring of redeem. Now to look at the tests... |
We decided I'm going to add back in any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was scary!
I did happen to have in my local git the last zoe.js that I approved. Comparing it with the current merged one was easy. Took less than a minute. Reviewing the diff below would have taken hours more.
LGTM
015a1dd
to
cdb88d3
Compare
This is the release PR for "Zoe Keywords" (Release v0.3.0).
"OfferRules", or the declarative statement portion of an offer, have
been renamed to "proposal". The structure of a proposal has changed to:
(*
moola
is an alias formoolaAmountMath.make
, and likewise forsimoleans
.)There are no longer any keys such as 'payoutRules' or 'exitRule'. Most
importantly, we no longer rely on the specific order of payoutRules
arrays and payment/payout arrays to be the same. In fact, we can even
make a partial proposal that will be filled in.
Asset
andPrice
in the above example are called "keywords". Eachcontract has its own specific keywords. For instance, an auction
might have "Asset" and "Bid". Keywords are unique identifiers per
contract, that tie together the proposal, payments to be escrowed, and
payouts to the user.
Users should submit their payments using keywords:
const payments = { Asset: moolaPayment };
And, users will receive their payouts with keywords as the keys of a
payout object:
moolaPurse.deposit(payout.Asset);
In summary, the arrays that were part of the previous API have been
replaced with records keyed by keywords.
Below is a summary of the changes:
Changes to the Zoe Service (User-facing) API:
makeInstance
now takes in three arguments:installationHandle
,issuerKeywordRecord
, andterms
.issuerKeywordRecord
should have stringsas keys (called
keyword
s), and issuers as values (calledargs
).For instance,
{Asset: moolaIssuer, Price: simoleanIssuer }
.Terms
no longer needs an
issuers
property. Instead,terms
should be used forany contract-specific parameters, such as the number of bids an
auction should wait for before closing.
keywords
ratherthan an array
object keyed by keywords where the values are promises for
payments
getOffer
,getOffers
, andisOfferActive
. Note thatgetOffer
andgetOffers
will throw if the offer is not found, whereasisOfferActive
is safe to check whether an offer is still active ornot.
Changes to the Contract Facet API and contract helpers:
userFlow
helpers have been renamed tozoeHelpers
hasValidPayoutRules
is no longer a helper function due to thechange in the proposal structure
assertKeywords
which can beused to make sure that the keywords on instantiation match what
the contract expects,
rejectIfNotProposal
which rejects anoffer if the proposal have the wrong structure, and
checkIfProposal
which checks if the proposal match theexpected structure and returns true or false.
getAmountMathForIssuers
andgetBrandsForIssuers
no longer existgetAmountMaths
is added. It takes in aissuerKeywordRecord
record that maps keywords to issuers.
getInstanceRecord
is added. It allows the contracts to get accessto their keywords, issuers and other "instanceRecord" information from
Zoe.
issuerKeywordRecord
(a record withkeyword
keys and issuer values) andkeywords
(an array ofstrings). The keywords in
issuerKeywordRecord
and thekeywords
arrayare the same.
an
amountKeywordRecord
, an object withkeywords
as keys andamount
values.
array of the above
amountKeywordRecord
s keyed on keywords.Closes #97
Closes #392
Closes #469
Closes #564
Closes #677
Closes #686