-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/flows-and-eth-fee' into feat/reallocate-by-flow
- Loading branch information
Showing
5 changed files
with
65 additions
and
58 deletions.
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 |
---|---|---|
@@ -1,14 +1,7 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.21; | ||
|
||
import { | ||
IMetaMorpho, | ||
IMorpho, | ||
MarketAllocation, | ||
Id, | ||
IOwnable, | ||
MarketParams | ||
} from "../../lib/metamorpho/src/interfaces/IMetaMorpho.sol"; | ||
import {IMetaMorpho, IMorpho, MarketAllocation, Id} from "../../lib/metamorpho/src/interfaces/IMetaMorpho.sol"; | ||
|
||
struct FlowCap { | ||
uint128 maxIn; | ||
|
@@ -33,9 +26,11 @@ struct Withdrawal { | |
/// @dev This interface is used for factorizing IPublicAllocatorStaticTyping and IPublicAllocator. | ||
/// @dev Consider using the IPublicAllocator interface instead of this one. | ||
interface IPublicAllocatorBase { | ||
function fee() external view returns (uint256); | ||
function OWNER() external view returns (address); | ||
function VAULT() external view returns (IMetaMorpho); | ||
function MORPHO() external view returns (IMorpho); | ||
|
||
function fee() external view returns (uint256); | ||
function supplyCap(Id) external view returns (uint256); | ||
|
||
function withdrawTo(Withdrawal[] calldata withdrawals, MarketParams calldata depositMarketParams) | ||
|
@@ -58,6 +53,6 @@ interface IPublicAllocatorStaticTyping is IPublicAllocatorBase { | |
/// @custom:contact [email protected] | ||
/// @dev Use this interface for PublicAllocator to have access to all the functions with the appropriate function | ||
/// signatures. | ||
interface IPublicAllocator is IOwnable, IPublicAllocatorBase { | ||
interface IPublicAllocator is IPublicAllocatorBase { | ||
function flowCap(Id) external view returns (FlowCap memory); | ||
} |
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 |
---|---|---|
|
@@ -8,6 +8,9 @@ import {Id} from "../../lib/metamorpho/src/interfaces/IMetaMorpho.sol"; | |
/// @custom:contact [email protected] | ||
/// @notice Library exposing error messages. | ||
library ErrorsLib { | ||
/// @notice Thrown when the `msg.sender` is not the `owner`. | ||
error NotOwner(); | ||
|
||
/// @notice Thrown when the address passed is the zero address. | ||
error ZeroAddress(); | ||
|
||
|
@@ -20,8 +23,8 @@ library ErrorsLib { | |
/// @notice Thrown when flow configuration for market `id` has min flow > max flow | ||
error InconsistentFlowConfig(Id id); | ||
|
||
/// @notice Thrown when the reallocation fee given is too low | ||
error FeeTooLow(); | ||
/// @notice Thrown when the reallocation fee given is wrong | ||
error IncorrectFee(uint givenFee); | ||
|
||
/// @notice Thrown when the fee recipient fails to receive the fee | ||
error FeeTransferFail(); | ||
|
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