diff --git a/lib/safe-smart-account b/lib/safe-smart-account index bf943f80..6fde75d2 160000 --- a/lib/safe-smart-account +++ b/lib/safe-smart-account @@ -1 +1 @@ -Subproject commit bf943f80fec5ac647159d26161446ac5d716a294 +Subproject commit 6fde75d29c8b52d5ac0c93a6fb7631d434b64119 diff --git a/src/interfaces/external/safe/IModuleGuard.sol b/src/interfaces/external/safe/IModuleGuard.sol deleted file mode 100644 index d1e2e2d9..00000000 --- a/src/interfaces/external/safe/IModuleGuard.sol +++ /dev/null @@ -1,41 +0,0 @@ -// 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/transactionGuard/LoggerGuard.sol b/src/peripheral/gnosis/transactionGuard/LoggerGuard.sol index ba38caa2..6c77b3e9 100644 --- a/src/peripheral/gnosis/transactionGuard/LoggerGuard.sol +++ b/src/peripheral/gnosis/transactionGuard/LoggerGuard.sol @@ -1,38 +1,3 @@ -import {DebugTransactionGuard, Enum} from "safe-smart-account/examples/guards/DebugTransactionGuard.sol"; +import {DebugTransactionGuard} from "safe-smart-account/examples/guards/DebugTransactionGuard.sol"; -contract LoggerGuard is DebugTransactionGuard { - event ModuleTransactionDetails( - address indexed safe, - address to, - uint256 value, - bytes data, - Enum.Operation operation, - address module - ); - - event ModuleExecutionDetails(bytes32 indexed txHash, bool success); - - function checkModuleTransaction( - address to, - uint256 value, - bytes memory data, - Enum.Operation operation, - address module - ) external view { - emit ModuleTransactionDetails( - msg.sender, - to, - value, - data, - operation, - module - ); - } - - function checkAfterModuleExecution( - bytes32 txHash, - bool success - ) external view { - emit ModuleExecutionDetails(txHash, success); - } -} +contract LoggerGuard is DebugTransactionGuard {} diff --git a/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol b/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol index 93f7a0f2..7f63a3bb 100644 --- a/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol +++ b/src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.12 <0.9.0; -import {BaseGuard, Guard, Enum} from "safe-smart-account/base/GuardManager.sol"; -import {IModuleGuard} from "src/interfaces/external/safe/IModuleGuard.sol"; +import {BaseGuard, ITransactionGuard, IModuleGuard} from "safe-smart-account/examples/guards/BaseGuard.sol"; +import {Enum} from "safe-smart-account/libraries/Enum.sol"; import {Owned} from "src/utils/Owned.sol"; contract MainTransactionGuard is BaseGuard, Owned { @@ -49,7 +49,7 @@ contract MainTransactionGuard is BaseGuard, Owned { address[] memory hooks = getHooks(); for (uint256 i; i < hooks.length; i++) { - Guard(hooks[i]).checkTransaction( + ITransactionGuard(hooks[i]).checkTransaction( to, value, data, @@ -77,7 +77,7 @@ contract MainTransactionGuard is BaseGuard, Owned { address[] memory hooks = getHooks(); for (uint256 i; i < hooks.length; i++) { - Guard(hooks[i]).checkAfterExecution(txHash, success); + ITransactionGuard(hooks[i]).checkAfterExecution(txHash, success); } } @@ -105,7 +105,7 @@ contract MainTransactionGuard is BaseGuard, Owned { address[] memory hooks = getHooks(); for (uint256 i; i < hooks.length; i++) { - Guard(hooks[i]).checkModuleTransaction( + IModuleGuard(hooks[i]).checkModuleTransaction( to, value, data, @@ -125,7 +125,7 @@ contract MainTransactionGuard is BaseGuard, Owned { address[] memory hooks = getHooks(); for (uint256 i; i < hooks.length; i++) { - Guard(hooks[i]).checkAfterModuleExecution(txHash, success); + IModuleGuard(hooks[i]).checkAfterModuleExecution(txHash, success); } } diff --git a/src/peripheral/gnosis/transactionGuard/ScopeGuard.sol b/src/peripheral/gnosis/transactionGuard/ScopeGuard.sol index 42dbb78b..7ef83720 100644 --- a/src/peripheral/gnosis/transactionGuard/ScopeGuard.sol +++ b/src/peripheral/gnosis/transactionGuard/ScopeGuard.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.12 <0.9.0; -import {BaseGuard, Guard, Enum} from "safe-smart-account/base/GuardManager.sol"; +import {BaseGuard} from "safe-smart-account/examples/guards/BaseGuard.sol"; +import {Enum} from "safe-smart-account/libraries/Enum.sol"; import {Owned} from "src/utils/Owned.sol"; contract ScopeGuard is BaseGuard, Owned { @@ -171,7 +172,7 @@ contract ScopeGuard is BaseGuard, Owned { address payable, bytes memory, address - ) external view override { + ) external override { _checkTransaction(to, value, data, operation); } @@ -181,7 +182,7 @@ contract ScopeGuard is BaseGuard, Owned { bytes memory data, Enum.Operation operation, address - ) external view { + ) external override returns (bytes32 moduleTxHash) { _checkTransaction(to, value, data, operation); } @@ -219,7 +220,7 @@ contract ScopeGuard is BaseGuard, Owned { } } - function checkAfterExecution(bytes32, bool) external view override {} + function checkAfterExecution(bytes32, bool) external override {} - function checkAfterModuleExecution(bytes32, bool) external view {} + function checkAfterModuleExecution(bytes32, bool) external override {} } diff --git a/src/vaults/multisig/phase1/OracleVault.sol b/src/vaults/multisig/phase1/OracleVault.sol index 823a1554..236aa5b7 100644 --- a/src/vaults/multisig/phase1/OracleVault.sol +++ b/src/vaults/multisig/phase1/OracleVault.sol @@ -11,9 +11,9 @@ import {IPriceOracle} from "src/interfaces/IPriceOracle.sol"; contract OracleVault is MultisigVault { constructor( InitializeParams memory params, - address oracle + address oracle_ ) MultisigVault(params) { - oracle = IPriceOracle(oracle); + oracle = IPriceOracle(oracle_); } /*////////////////////////////////////////////////////////////// @@ -24,6 +24,6 @@ contract OracleVault is MultisigVault { /// @return Total amount of underlying `asset` token managed by vault. Delegates to adapter. function totalAssets() public view override returns (uint256) { - return IPriceOracle(oracle).getQuote(totalSupply(), share, asset); + return oracle.getQuote(totalSupply, share, address(asset)); } }