Skip to content

Commit

Permalink
refactor(supply-vault): update interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Jun 8, 2023
1 parent 50d92e2 commit b30977f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/extensions/SupplyVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract SupplyVault is ISupplyVault, ERC4626UpgradeableSafe, Ownable2StepUpgrad
/// @dev The implementation contract disables initialization upon deployment to avoid being hijacked.
/// @param morpho The address of the main Morpho contract.
constructor(address morpho) {
if (morpho == address(0)) revert ZeroAddress();
if (morpho == address(0)) revert AddressIsZero();

_disableInitializers();
_MORPHO = IMorpho(morpho);
Expand All @@ -62,7 +62,7 @@ contract SupplyVault is ISupplyVault, ERC4626UpgradeableSafe, Ownable2StepUpgrad
uint256 initialDeposit,
uint96 newMaxIterations
) external initializer {
if (newUnderlying == address(0)) revert ZeroAddress();
if (newUnderlying == address(0)) revert AddressIsZero();

_underlying = newUnderlying;
_recipient = newRecipient;
Expand All @@ -83,7 +83,7 @@ contract SupplyVault is ISupplyVault, ERC4626UpgradeableSafe, Ownable2StepUpgrad
/// The vault is not intended to hold any ERC20 tokens between calls.
function skim(address[] calldata tokens) external {
address recipientMem = _recipient;
if (recipientMem == address(0)) revert ZeroAddress();
if (recipientMem == address(0)) revert AddressIsZero();

for (uint256 i; i < tokens.length; i++) {
address token = tokens[i];
Expand Down
10 changes: 5 additions & 5 deletions src/interfaces/extensions/ISupplyVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ interface ISupplyVault is IERC4626Upgradeable {

/// @notice Emitted when the recipient is set.
/// @param recipient The recipient.
event RecipientSet(address recipient);
event RecipientSet(address indexed recipient);

/// @notice Emitted when tokens are skimmed to `recipient`.
/// @param token The token being skimmed.
/// @param recipient The recipient.
/// @param amount The amount of rewards transferred.
event Skimmed(address token, address recipient, uint256 amount);
/// @param amount The amount of tokens transferred.
event Skimmed(address indexed token, address indexed recipient, uint256 amount);

/* ERRORS */

/// @notice Thrown when the zero address is passed as input or is the recipient address when calling `transferRewards`.
error ZeroAddress();
/// @notice Thrown when an address used as parameter is the zero address.
error AddressIsZero();

/* EXTERNAL */

Expand Down

0 comments on commit b30977f

Please sign in to comment.