Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning override/delete pending values #232

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
emit EventsLib.SetRewardsRecipient(newRewardsRecipient);
}

/// @notice Submits a `newTimelock`.
/// @dev In case the new timelock is higher than the current one, the timelock is set immediately.
/// @dev Warning: Submitting a timelock a fee will overwrite the current pending timelock.
function submitTimelock(uint256 newTimelock) external onlyOwner {
if (newTimelock == timelock) revert ErrorsLib.AlreadySet();
_checkTimelockBounds(newTimelock);
Expand All @@ -203,6 +206,8 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
}

/// @notice Submits a `newFee`.
/// @dev In case the new fee is lower than the current one, the fee is set immediately.
/// @dev Warning: Submitting a fee a fee will overwrite the current pending fee.
function submitFee(uint256 newFee) external onlyOwner {
if (newFee == fee) revert ErrorsLib.AlreadySet();
if (newFee > ConstantsLib.MAX_FEE) revert ErrorsLib.MaxFeeExceeded();
Expand Down Expand Up @@ -232,6 +237,8 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph

/// @notice Submits a `newGuardian`.
/// @notice Warning: the guardian has the power to revoke any pending guardian.
/// @dev In case there is no guardian, the gardian is set immediately.
/// @dev Warning: Submitting a gardian a fee will overwrite the current pending gardian.
function submitGuardian(address newGuardian) external onlyOwner {
if (newGuardian == guardian) revert ErrorsLib.AlreadySet();

Expand All @@ -247,6 +254,8 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
/* ONLY CURATOR FUNCTIONS */

/// @notice Submits a `newSupplyCap` for the market defined by `marketParams`.
/// @dev In case the new cap is lower than the current one, the cap is set immediately.
/// @dev Warning: Submitting a cap a fee will overwrite the current pending cap.
function submitCap(MarketParams memory marketParams, uint256 newSupplyCap) external onlyCurator {
Id id = marketParams.id();
if (marketParams.loanToken != asset()) revert ErrorsLib.InconsistentAsset(id);
Expand Down
Loading