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

Guess37 mutiple participants #23

Merged
merged 5 commits into from
Oct 29, 2019

Conversation

DavidBruant
Copy link
Contributor

This PR builds on top of #22

Only guess37-multiple-participants.md is relevant to review

I left questions at the end because i'm puzzled about how to prove an object is a genuine invite

smart-contracts-tutorial/first-contract.md Outdated Show resolved Hide resolved
smart-contracts-tutorial/first-contract.md Outdated Show resolved Hide resolved
smart-contracts-tutorial/first-contract.md Outdated Show resolved Hide resolved
smart-contracts-tutorial/guess37-multiple-participants.md Outdated Show resolved Hide resolved
```
TODO
Figure out how to:
- guarantee this is a genuine invite produced by the contract host (via comparison with the invite assay?)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The fact that the contract host redeemed the invite is what ensures that the seat is a real one. Before doing that, you could call contractHost~.getInviteAssay()~.claimAll(invite) to prove that it was issued by the assay. If you wanted to verify the provenance before passing it to someone else, this would make sense. Otherwise redeem() is usually enough.

Copy link
Contributor Author

@DavidBruant DavidBruant Oct 22, 2019

Choose a reason for hiding this comment

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

The fact that the contract host redeemed the invite is what ensures that the seat is a real one

Yes, but that also "consumes" the invite. If you've been handed the object, you may want to invest time studying the terms and contract source code. However, there exists a risk that the object is not a genuine invite and you're wasting time studying a fake invite
Hence the need to be able to verify the object you're holding is a genuine invite before redeeming

Before doing that, you could call contractHost~.getInviteAssay()~.claimAll(invite) to prove that it was issued by the assay. If you wanted to verify the provenance before passing it to someone else, this would make sense

oh cool, i think that was the answer i was looking for, thanks! I'm puzzled by the name claimAll. It also seem to be doing a lot more than i expect (return true only if the argument is a genuine invite) but i'll take it for now

My first guess was to do something like contractHost~.getInviteAssay() === invite~.getAssay(), but it returned false in the REPL (contractHost~.getInviteAssay() === contractHost~.getInviteAssay() also returns false so i stopped that track). This guess assumes only the contract host can mint invites and i didn't verify this assumption

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand a bit better ERTP mint and i realize contractHost~.getInviteAssay() === invite~.getAssay() wouldn't work

smart-contracts-tutorial/guess37-multiple-participants.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

This looks great! thanks for the changes

@barbaraliau
Copy link
Contributor

@Chris-Hibbert @DavidBruant is this complete? If so, I will merge and place the files into the appropriate place for the doc site.

@Chris-Hibbert
Copy link
Collaborator

It's ready.

@barbaraliau barbaraliau merged commit df80cb8 into Agoric:master Oct 29, 2019
@barbaraliau barbaraliau mentioned this pull request Oct 31, 2019
@DavidBruant
Copy link
Contributor Author

Thank you for merging this PR

@barbaraliau
Copy link
Contributor

barbaraliau commented Oct 31, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants