-
Notifications
You must be signed in to change notification settings - Fork 206
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 release 0.7.0 #1143
Zoe release 0.7.0 #1143
Conversation
815cddc
to
949589c
Compare
4ac8b55
to
2222eb6
Compare
730a66f
to
218fc61
Compare
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.
It looks like this won't be too hard to merge with the new-SES branch (which might be my responsibility, or yours, depending on which one manages to land first). I've called out the places that will need to be changed to match the API changes on the new-SES branch, but of course don't make those changes yet.
Thanks for the detailed analysis! this will be very helpful |
893e6cf
to
7fb2529
Compare
d3033d0
to
3481678
Compare
cba7bff
to
77e9b0f
Compare
…ntract and a contract for minting items (#1110) * chore: split opera ticket contract into an item minting contract and a generalized selling contract.
Add new method: `zcf.initPublicAPI` and remove publicAPI from the return values of makeContract (#1035) * feat: add zcf.initPublicAPI method, makeContract should only return invite * fix: update mintAndSellNFT and sellItems contracts as well
zoe.makeInstance() add instanceRecord to the invite previously being returned. Many calls on getInstanceRecord() were able to be removed, and the code simplified.
* feat: add installationHandle to invite extent * chore: address PR comments
…tsConserved (#1155) * refactor: remove the use of keywords from `areRightsConserved`, meaning sparseKeywords can be removed from reallocate
* fix: canTradeWith should use the current allocations, not give * chore: add test to show difference in give and allocation
…hat keywords match (#1129) * refactor: Zoe facet parameters deposit by brand and IssuerTable by brand have been extracted * refactor: more getAmountMath by brand convert assertNatMathHelpers() to be by brand add assertNatMathHelpersKeyword() temporarily move more code to get amountMath by brand sellItems gets amountMaths by brand * refactor: reinstate changes for deposit and issuerTable by brand * refactor: get rid of getAmountMaths [WIP] * refactor: make multipoolAutoswap use In & Out keywords for swap() * refactor: remove objective keywords for clients of multipoolAutoswap The contract still has to deal with consistent keywords across all the liquidity pools * refactor: Simplify barterExchange and multipoolAutoswap Make use of facet parameters to clean up some contracts. clean up canTradeWith alternatives: * drop canTradeWithIgnoreKeywords * improve canTradeWithMapKeywords convert barterExchange to consistent keywords in multipoolAutoswap cleanup names, and use user Math for user amounts * chore: review changes Build mockZcf using a builder in test-zoeHelper Co-authored-by: Kate Sills <kate@agoric.com>
* fix: canTradeWith should use the current allocations, not give * chore: add test to show difference in give and allocation
…hat keywords match (#1129) * refactor: Zoe facet parameters deposit by brand and IssuerTable by brand have been extracted * refactor: more getAmountMath by brand convert assertNatMathHelpers() to be by brand add assertNatMathHelpersKeyword() temporarily move more code to get amountMath by brand sellItems gets amountMaths by brand * refactor: reinstate changes for deposit and issuerTable by brand * refactor: get rid of getAmountMaths [WIP] * refactor: make multipoolAutoswap use In & Out keywords for swap() * refactor: remove objective keywords for clients of multipoolAutoswap The contract still has to deal with consistent keywords across all the liquidity pools * refactor: Simplify barterExchange and multipoolAutoswap Make use of facet parameters to clean up some contracts. clean up canTradeWith alternatives: * drop canTradeWithIgnoreKeywords * improve canTradeWithMapKeywords convert barterExchange to consistent keywords in multipoolAutoswap cleanup names, and use user Math for user amounts * chore: review changes Build mockZcf using a builder in test-zoeHelper Co-authored-by: Kate Sills <kate@agoric.com>
closes #1104 Also fixes test to test deposit on a non-empty purse.
closes #1104 Also fixes test to test deposit on a non-empty purse.
I was going to touch every contract in order to change the way that zcf is declared for typescript, so I fixed all the documentation as well. switch makeContract declaration and export to a simpler format
…of both sides (#1147) * refactor(Zoe): add new Zoe helpers - trade, satisfies, isOfferSafe. Remove canTradeWith, canTradeWithMapKeywords * chore: address PR comments * refactor: calcNewAllocation is now functional * chore: address PR comments * chore: address PR comments
Co-authored-by: Dean Tribble <tribble@agoric.com>
77e9b0f
to
9175e53
Compare
Release v0.7.0 (29-June-2020)
Zoe Service changes:
zoe.makeInstance
returning an invite only, it nowreturns a record of
{ invite, instanceRecord }
such thatinformation like the
instanceHandle
can be obtained directly fromthe instanceRecord.
installationHandle
, the identifier for the code that is used tocreate a new running contract instance, is added to the extent of
invites for contracts so that interested parties can easily check
whether their invite is using the code they expect.
brandKeywordRecord
is added as a property ofinstanceRecord
alongside
issuerKeywordRecord
.brandKeywordRecord
is an objectwith keyword keys and brand values.
zoe.install
now only accepts a single argument (bundle
) andthe old module format will error.
Zoe Contract Facet (zcf) changes:
zcf.reallocate
no longer accepts a third argumentsparseKeywords
and no longer expects the keywords for different offers to be the
same. Within reallocate, the offer safety check compares the user's
proposal to the user's allocation, and the rights conservation check
adds up the amounts by brand to ensure the totals are the same.
Neither of these checks requires that the keywords for the
allocations be the same for different offers.
zcf.getCurrentAllocation
andzcf.getCurrentAllocations
no longertake sparseKeywords as a parameter. Instead, brandKeywordRecord is
an optional parameter. If omitted, amounts are returned only for
brands for which an allocation currently exists.
zcf.getInstanceRecord()
no longer takes a parameterbrandKeywordRecord
is added as a property ofinstanceRecord
alongside
issuerKeywordRecord
.brandKeywordRecord
is an objectwith keyword keys and brand values.
zcf.getAmountMaths
has been subsumed byzcf.getAmountMath
whichtakes a single brand parameter.
zcf.getBrandForIssuer
has been added. It synchronously returns thebrand for a given issuer already known to Zoe.
zoe.getInstance
, which was deprecated earlier, has been removed.cancelObj
andcancelObj.cancel()
, which were deprecated earlier,have been removed.
Changes for Zoe contract developers:
result of
makeContract
. If the contracts want to have apublicAPI
, they can do so throughzcf.initPublicAPI
.the same issuers. For example, publicAuction, the second price
auction contract, uses 'Asset' and 'Ask'
for the seller keywords and 'Asset' and 'Bid' for the buyer
keywords.
Built-in Zoe contract changes:
generic
sellItems
contract that sells fungible or nonfungibleitems at a set price for money, and a generic
mintAndSellNFT
contract that mints NFT tokens and then immediately creates a new
sellItems
instance to sell them. The original operaTicket testsare able to use these contracts.
getCurrentPrice
helper inbondingCurves.js
has been renamedto
getInputPrice
and now only returns theoutputExtent
.Exchange takes offers for trading arbitrary goods for one another.
be taken. For example, a swap should have the keywords 'In' and
'Out'.
be taken as well. For example, adding liquidity has the keywords:
'SecondaryToken' and 'CentralToken' and returns a payout with
keyword
Liquidity
.buyer keywords are 'Asset' and 'Bid'.
ZoeHelpers changes:
Some helpers were removed, and others were added. The built-in Zoe contracts were rewritten to
take advantage of these new helpers.
satisfies
was added. It checks whether an allocation would satisfya single offer's wants if that was the allocation passed to
reallocate
.isOfferSafe
was added. It checks whether anallocation for a particular offer would satisfy offer safety. Any
allocation that returns true under
satisfy
will also return trueunder
isOfferSafe
. (isOfferSafe
is equivalent ofsatisfies
||gives a refund).
trade
was added.Trade
performs a trade betweentwo offers given a declarative description of what each side loses
and gains.
Swap
remains but has slightly different behavior: anysurplus in a trade remains with the original offer
canTradeWith
was removed and subsumed by
satisfies
.inviteAnOffer
was alreadydeprecated and was removed.
assertNatMathHelpers
was added, whichchecks whether a particular keyword is associated with an issuer
with natMathHelpers.
ERTP changes:
purse.deposit()
now returns the amount of the deposit, rather thanthe purse's new balance.
calling
makeDepositFacet
on any purse.#dapp-encouragement-branch: zoe-release-0.7.0