diff --git a/src/Bases/Hooks/BaseHooks.sol b/src/Bases/Hooks/BaseHooks.sol index c6e0864..6c90ab1 100644 --- a/src/Bases/Hooks/BaseHooks.sol +++ b/src/Bases/Hooks/BaseHooks.sol @@ -1,57 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.18; +import {Hooks} from "./Hooks.sol"; import {BaseHealthCheck, ERC20} from "../HealthCheck/BaseHealthCheck.sol"; -contract DepositHooks { - function _preDepositHook( - uint256 assets, - uint256 shares, - address receiver - ) internal virtual {} - - function _postDepositHook( - uint256 assets, - uint256 shares, - address receiver - ) internal virtual {} -} - -contract WithdrawHooks { - function _preWithdrawHook( - uint256 assets, - uint256 shares, - address receiver, - address owner, - uint256 maxLoss - ) internal virtual {} - - function _postWithdrawHook( - uint256 assets, - uint256 shares, - address receiver, - address owner, - uint256 maxLoss - ) internal virtual {} -} - -contract TransferHooks { - function _preTransferHook( - address from, - address to, - uint256 amount - ) internal virtual {} - - function _postTransferHook( - address from, - address to, - uint256 amount, - bool success - ) internal virtual {} -} - -contract Hooks is DepositHooks, WithdrawHooks, TransferHooks {} - /** * @title Base Hooks * @author Yearn.finance diff --git a/src/Bases/Hooks/Hooks.sol b/src/Bases/Hooks/Hooks.sol new file mode 100644 index 0000000..dd070fb --- /dev/null +++ b/src/Bases/Hooks/Hooks.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.18; + +contract Hooks is DepositHooks, WithdrawHooks, TransferHooks {} + +contract DepositHooks { + function _preDepositHook( + uint256 assets, + uint256 shares, + address receiver + ) internal virtual {} + + function _postDepositHook( + uint256 assets, + uint256 shares, + address receiver + ) internal virtual {} +} + +contract WithdrawHooks { + function _preWithdrawHook( + uint256 assets, + uint256 shares, + address receiver, + address owner, + uint256 maxLoss + ) internal virtual {} + + function _postWithdrawHook( + uint256 assets, + uint256 shares, + address receiver, + address owner, + uint256 maxLoss + ) internal virtual {} +} + +contract TransferHooks { + function _preTransferHook( + address from, + address to, + uint256 amount + ) internal virtual {} + + function _postTransferHook( + address from, + address to, + uint256 amount, + bool success + ) internal virtual {} +}