Skip to content
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

chore: add invariant helper and constant product example #3090

Merged
merged 3 commits into from
May 13, 2021

Conversation

katelynsills
Copy link
Contributor

This PR adds a zoeHelper called wrapZCF which allows for an assertion to be checked before reallocate is called.

I used a wrappedZCF to ensure the constant product invariant holds in multipoolAutoswap swaps.

Also added a test and moved the multipoolAutoswap tests into a folder.

@katelynsills katelynsills added the Zoe package: Zoe label May 13, 2021
@katelynsills katelynsills self-assigned this May 13, 2021
Copy link
Member

@dtribble dtribble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it.

I propose that we rename wrappedZCF to something more focused on what it's for rather than how it is implemented; e.g., checkedZCF. But that's a nit.

@@ -36,6 +36,7 @@ export {
withdrawFromSeat,
saveAllIssuers,
offerTo,
wrapZCF,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed "checkedZCF"?

packages/zoe/src/contractSupport/zoeHelpers.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Zoe package: Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants