-
Notifications
You must be signed in to change notification settings - Fork 207
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
Calling zoe.redeem inside a contract may be a footgun #822
Comments
Autoswap uses |
I'm having an intuition that there is an underlying design problem somewhere I'm reopening and i'm going to try to find what the underlying design problem may be |
Zoe provides "offer safety". My understanding of offer safety is that it protects against bugs in a smart contract code and this protection makes that it's not possible to loose an asset even if there is a bug in the contract. I think that letting smart contracts manipulate directly assets/invites/payouts is a breach of the separation of concerns that enable offer safety and this could lead to Zoe not really providing offer safety I looked at where/how redeem is used in all existing contract code. I see 3 instances of redeem that are internal to contracts:
agoric-sdk/packages/zoe/src/contracts/autoswap.js Lines 148 to 155 in 0ab9ebf
agoric-sdk/packages/zoe/src/contracts/helpers/zoeHelpers.js Lines 108 to 111 in 0ab9ebf
agoric-sdk/packages/zoe/src/contracts/operaConcertTicket.js Lines 88 to 103 in adc846a
As i highlighted, the 3 usages have one thing in common which is creating an invite first and then redeeming it right away At least, i think this would be better served by a dedicated method on the zoe contract facet Interestingly, the usages i showed above are the only usages of |
Interestingly, this was actually the design we started with! It got changed to |
Happy to revisit. Until then, I do like the way it is now better. Will explain when we revisit. |
On a call today, @erights suggested that a contract should be able to do what any participant can do and i understand and agree with this idea But i still believe that |
I misunderstood the intent. Yes, I support doing some like this. Perhaps this itself but my understanding isn't that solid yet. And we all now support keeping Good idea and good analysis. My apologies for not reading deeper earlier. Thanks! |
Is #993 enough of a solution to close this issue? |
Yes. |
Yes, i think it's good enough for now |
Closed by #993 |
Issue created after the analysis here: #780 (comment)
The text was updated successfully, but these errors were encountered: