diff --git a/.gitmodules b/.gitmodules index ecfb3aad..c137467e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,6 +19,7 @@ [submodule "lib/ERC-7540-Reference"] path = lib/ERC-7540-Reference url = https://github.com/ERC4626-Alliance/ERC-7540-Reference + branch = main [submodule "lib/solidity-bytes-utils"] path = lib/solidity-bytes-utils url = https://github.com/GNSPS/solidity-bytes-utils diff --git a/src/interfaces/external/safe/IModuleGuard.sol b/src/interfaces/external/safe/IModuleGuard.sol new file mode 100644 index 00000000..d1e2e2d9 --- /dev/null +++ b/src/interfaces/external/safe/IModuleGuard.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: LGPL-3.0-only +/* solhint-disable one-contract-per-file */ +pragma solidity >=0.7.0 <0.9.0; + +import {IERC165} from "safe-smart-account/contracts/interfaces/IERC165.sol"; + +enum Operation { + Call, + DelegateCall +} + +/** + * @title IModuleGuard Interface + */ +interface IModuleGuard is IERC165 { + /** + * @notice Checks the module transaction details. + * @dev The function needs to implement module transaction validation logic. + * @param to The address to which the transaction is intended. + * @param value The value of the transaction in Wei. + * @param data The transaction data. + * @param operation The type of operation of the module transaction. + * @param module The module involved in the transaction. + * @return moduleTxHash The hash of the module transaction. + */ + function checkModuleTransaction( + address to, + uint256 value, + bytes memory data, + Operation operation, + address module + ) external returns (bytes32 moduleTxHash); + + /** + * @notice Checks after execution of module transaction. + * @dev The function needs to implement a check after the execution of the module transaction. + * @param txHash The hash of the module transaction. + * @param success The status of the module transaction execution. + */ + function checkAfterModuleExecution(bytes32 txHash, bool success) external; +} diff --git a/src/peripheral/gnosis/controllerModule/DrawdownModule.sol b/src/peripheral/gnosis/controllerModule/DrawdownModule.sol index 252eb599..eadfe7a8 100644 --- a/src/peripheral/gnosis/controllerModule/DrawdownModule.sol +++ b/src/peripheral/gnosis/controllerModule/DrawdownModule.sol @@ -8,6 +8,7 @@ import {Owned} from "src/utils/Owned.sol"; import {OwnerManager} from "safe-smart-account/base/OwnerManager.sol"; import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; + contract DrawdownModule is Owned { using FixedPointMathLib for uint256; diff --git a/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol b/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol index 349a2a97..93f7a0f2 100644 --- a/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol +++ b/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.12 <0.9.0; import {BaseGuard, Guard, Enum} from "safe-smart-account/base/GuardManager.sol"; -import {IModuleGuard} from "safe-smart-account/base/ModuleManager.sol"; +import {IModuleGuard} from "src/interfaces/external/safe/IModuleGuard.sol"; import {Owned} from "src/utils/Owned.sol"; contract MainTransactionGuard is BaseGuard, Owned {