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
Sometimes multiple hooks need dynamic input from the calldata during the transaction time. For example, we may want to check the recipient address in a hook. A workaround would be decoding the existing transaction calldata and deducing the position of recipient address according to function selector and established knowledge of the function itself. However, this hardcoded approach might not scale well when we support new target contract.
For hooks that need dynamic input, the transaction can pack the extra information after the existing calldata and call into the existing execute, which is straightforward if only single hook requires input. However, it becomes more complicated if multiple hooks need input. We need an efficient way to unpack the calldata and route the corresponding input to each plugin correctly.
Another approach is calling a new plugin exec function if you need certain functionalities. However, this decreases the composability between plugins a little bit. Also some plugins might want to apply the check across all exec functions, but other exec functions don't really pack the additional data. So in practice, we disabled the other exec functions to make sure the check is honored by default. Maybe this particular problem can be alleviated by dynamic input or other mechanisms.
The text was updated successfully, but these errors were encountered:
Sometimes multiple hooks need dynamic input from the
calldata
during the transaction time. For example, we may want to check the recipient address in a hook. A workaround would be decoding the existing transactioncalldata
and deducing the position of recipient address according to function selector and established knowledge of the function itself. However, this hardcoded approach might not scale well when we support new target contract.For hooks that need dynamic input, the transaction can pack the extra information after the existing calldata and call into the existing
execute
, which is straightforward if only single hook requires input. However, it becomes more complicated if multiple hooks need input. We need an efficient way to unpack thecalldata
and route the corresponding input to each plugin correctly.Another approach is calling a new plugin exec function if you need certain functionalities. However, this decreases the composability between plugins a little bit. Also some plugins might want to apply the check across all exec functions, but other exec functions don't really pack the additional data. So in practice, we disabled the other exec functions to make sure the check is honored by default. Maybe this particular problem can be alleviated by dynamic input or other mechanisms.
The text was updated successfully, but these errors were encountered: