Skip to content

Commit

Permalink
chore: organize
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Feb 6, 2024
1 parent e215c45 commit 0b6cbc7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 49 deletions.
50 changes: 1 addition & 49 deletions src/Bases/Hooks/BaseHooks.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
51 changes: 51 additions & 0 deletions src/Bases/Hooks/Hooks.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.18;

contract Hooks is DepositHooks, WithdrawHooks, TransferHooks {}

Check warning on line 4 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

contract DepositHooks {
function _preDepositHook(
uint256 assets,
uint256 shares,
address receiver
) internal virtual {}

Check warning on line 11 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

function _postDepositHook(
uint256 assets,
uint256 shares,
address receiver
) internal virtual {}

Check warning on line 17 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks
}

contract WithdrawHooks {
function _preWithdrawHook(
uint256 assets,
uint256 shares,
address receiver,
address owner,
uint256 maxLoss
) internal virtual {}

Check warning on line 27 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

function _postWithdrawHook(
uint256 assets,
uint256 shares,
address receiver,
address owner,
uint256 maxLoss
) internal virtual {}

Check warning on line 35 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks
}

contract TransferHooks {
function _preTransferHook(
address from,
address to,
uint256 amount
) internal virtual {}

Check warning on line 43 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

function _postTransferHook(
address from,
address to,
uint256 amount,
bool success
) internal virtual {}

Check warning on line 50 in src/Bases/Hooks/Hooks.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks
}

0 comments on commit 0b6cbc7

Please sign in to comment.