-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(withdrawal): implement fa withdrawal #560
Conversation
c558c63
to
d6b5af8
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.
Overall lgtm 🚀
Small nit on Rust style
}) | ||
} | ||
|
||
/// Execute the [FaWithdrawal] request atomically. See [fa_withdraw]. |
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.
stylistic nit: But wouldn't it make more sense to have this in an impl
for FaWithdraw
e.g. FaWithdraw::execute(rt, tx, source, gas_limit)
d6b5af8
to
bb0d0c8
Compare
bb0d0c8
to
cc627c8
Compare
Context
Adds support for direct fa withdraw from external operation
RunFunction
and through smart function call.Because this is implemented as smart function call, also closes https://linear.app/tezos/issue/JSTZ-112/fa-withdrawal-smart-function-call for free.
Description
This design is based on TZIP-029 except that the user initiates the withdrawal by calling the proxy smart function instead of the protocol.
This design has a few benefits over TZIP-029
Withdraw and FA withdraw share similarities in how they are validated. The only difference between their request objects is the body, so the
validate_withdraw_request
was refactored with a generic<T: Deserialize>
.Doc string comments were added to
TicketTable::add/sub
as the return type is an ambiguousAmount
Manually testing the PR