-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add adapter for mellow erc4626 (#141)
* feat: add adapter for mellow erc4626 * fix: change type function to constant * chore: warnings cleanup
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
// Gearbox Protocol. Generalized leverage for DeFi protocols | ||
// (c) Gearbox Foundation, 2023. | ||
pragma solidity ^0.8.17; | ||
|
||
import {ERC4626Adapter} from "../erc4626/ERC4626Adapter.sol"; | ||
import {AdapterType} from "@gearbox-protocol/sdk-gov/contracts/AdapterType.sol"; | ||
import {NotImplementedException} from "@gearbox-protocol/core-v3/contracts/interfaces/IExceptions.sol"; | ||
|
||
/// @title Mellow ERC4626 Vault adapter | ||
/// @notice Implements logic allowing CAs to interact with a ERC4626 vaults, but with `withdraw` / `redeem` restricted, to avoid | ||
/// CA's being exposed to Mellow's asynchronous withdrawals | ||
contract Mellow4626VaultAdapter is ERC4626Adapter { | ||
AdapterType public constant override _gearboxAdapterType = AdapterType.MELLOW_ERC4626_VAULT; | ||
|
||
/// @notice Constructor | ||
/// @param _creditManager Credit manager address | ||
/// @param _vault ERC4626 vault address | ||
constructor(address _creditManager, address _vault) ERC4626Adapter(_creditManager, _vault) {} | ||
|
||
/// @dev For Mellow ERC4626 vaults all withdrawals revert to avoid CA's interacting with Mellow's delayed withdrawals | ||
function withdraw(uint256, address, address) external view override creditFacadeOnly returns (uint256, uint256) { | ||
revert NotImplementedException(); | ||
} | ||
|
||
/// @dev For Mellow ERC4626 vaults all withdrawals revert to avoid CA's interacting with Mellow's delayed withdrawals | ||
function redeem(uint256, address, address) external view override creditFacadeOnly returns (uint256, uint256) { | ||
revert NotImplementedException(); | ||
} | ||
|
||
/// @dev For Mellow ERC4626 vaults all withdrawals revert to avoid CA's interacting with Mellow's delayed withdrawals | ||
function redeemDiff(uint256) external view override creditFacadeOnly returns (uint256, uint256) { | ||
revert NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters