From c32130b4a4b6418d214defa7595b4b14f21c0185 Mon Sep 17 00:00:00 2001 From: cristovaoth Date: Mon, 9 Oct 2023 10:48:25 +0200 Subject: [PATCH] Add comment to Modifier.sol --- contracts/core/Modifier.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contracts/core/Modifier.sol b/contracts/core/Modifier.sol index 7452f024..b050b36c 100644 --- a/contracts/core/Modifier.sol +++ b/contracts/core/Modifier.sol @@ -30,6 +30,14 @@ abstract contract Modifier is Module, SignatureChecker, IAvatar { /// @dev `setModules()` was already called. error SetupModulesAlreadyCalled(); + /* + -------------------------------------------------- + You must override both of the following virtual functions, + execTransactionFromModule() and execTransactionFromModuleReturnData(). + It is recommended that implementations of both functions make use the + onlyModule modifier. + */ + /// @dev Passes a transaction to the modifier. /// @notice Can only be called by enabled modules. /// @param to Destination address of module transaction. @@ -56,6 +64,10 @@ abstract contract Modifier is Module, SignatureChecker, IAvatar { Enum.Operation operation ) public virtual returns (bool success, bytes memory returnData); + /* + -------------------------------------------------- + */ + modifier moduleOnly() { if (modules[msg.sender] == address(0)) { if (modules[moduleTxSignedBy()] == address(0)) {