-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Right now hooks are arbitrary calls with no contexts. If I want to write something permissioned for the hook callback there is no way to do it reliably right now because there is no information about the order, order's owner, etc. Exposing the context in general would allow the hooks consumers to use it and open more possibilities of what can be done. I suggest something like:
Order public order;
modifier withOrder(Order memory _order) {
order = _order;
_;
order = EMPTY_ORDER;
}
function execute(Order calldata order, Hook[] calldata hooks) external onlySettlement withOrder(order) {
...
}This will set the order variable transiently for the call stack and context of each hook and clear it at the end. The hook contract can then query the same from trampoline contract if they want to.
Metadata
Metadata
Assignees
Labels
No labels