safe-global / safe-smart-account

Safe allows secure management of blockchain assets.
https://safe.global
GNU Lesser General Public License v3.0
1.84k stars 907 forks source link

Create a pre call hook for execTransaction #775

Closed akshay-ap closed 3 months ago

akshay-ap commented 3 months ago

EDIT: Earlier it was proposed to create post hook function. But, later we realised issues:

Updated Expected outcome

So, we decided to create pre-hook rather that post-hook.

Context

#772 added a post call hook onAfterExecTransactionFromModule for execTransactionFromModule* methods. This helped to remove the overriding execTransactionFromModule function in SafeL2 which was earlier needed so that event SafeModuleTransaction gets emitted and then called parent implementation.

With #772, overriding onAfterExecTransactionFromModule and emitting the event SafeModuleTransaction does the work.

Similarly, SafeL2 also overrides execTransaction to emit the event SafeModuleTransaction. This issue aims at introducing a similar post hook method namely onAfterExecTransaction which removes the requirement for overriding execTransaction in SafeL2.

Expected outcome

- A post hook function similar to onAfterExecTransactionFromModule