You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 calldataorder, Hook[] calldatahooks) 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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: