Skip to content

Conversation

@coreyar
Copy link
Contributor

@coreyar coreyar commented Jan 15, 2025

Description

This is an initial Risk Steward contract that accepts updates for supply and borrow caps to be applied view permissions granted by the ACM.

@coreyar coreyar marked this pull request as draft January 15, 2025 19:04
@coreyar coreyar requested a review from chechu January 16, 2025 19:10
@coreyar coreyar force-pushed the acm-risk-steward branch 4 times, most recently from 0d56e60 to c9fa6c4 Compare January 20, 2025 15:54
@chechu chechu changed the title Initial Risk Steward contract [VEN-3018]: Initial Risk Steward contract Jan 20, 2025
@coreyar coreyar force-pushed the acm-risk-steward branch 4 times, most recently from b581081 to 16ed613 Compare January 23, 2025 11:17
@coreyar coreyar marked this pull request as ready for review January 24, 2025 17:44
@coreyar coreyar requested review from chechu and kkirka January 24, 2025 18:22
@coreyar coreyar force-pushed the acm-risk-steward branch 3 times, most recently from 9e7c889 to b73301f Compare January 27, 2025 12:28
* @dev Disabling renounceOwnership function.
*/
function renounceOwnership() public override {
revert(" renounceOwnership() is not allowed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
revert(" renounceOwnership() is not allowed");
revert("renounceOwnership() is not allowed");

Also, I would prefer @notice instead of @dev for public function

function _setMarketSupplyCaps(address[] calldata, uint256[] calldata) external;

function _setMarketBorrowCaps(address[] calldata, uint256[] calldata) external;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR would merge before this one, then we can have unified comptroller interface.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the legacy interface first, and the new one in the V2/V3 of the Risk Stewards

proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: [accessControlManager.address, 5000],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the hardcoded value 5000 with a constant or variable — this improves readability and makes future changes easier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* @notice Emitted when the max delta bps is updated
*/
event MaxDeltaBpsUpdated(uint256 oldMaxDeltaBps, uint256 indexed newMaxDeltaBps);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add indexed for oldMaxDeltaBps as well for consistency.

* @param newValue The new supply cap value
* @custom:event Emits SupplyCapUpdated with the market and new supply cap
*/
function _updateSupplyCaps(address market, uint256 newValue) internal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add ensureNonzeroAddress(market) as safety validation .

* @param newValue The new borrow cap value
* @custom:event Emits BorrowCapUpdated with the market and new borrow cap
*/
function _updateBorrowCaps(address market, uint256 newValue) internal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add ensureNonzeroAddress(market) as safety validation .

/**
* @notice Thrown when an update type that is not supported is operated on
*/
error UnsupportedUpdateType();
Copy link
Contributor

@Debugger022 Debugger022 Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error UnsupportedUpdateType(string updateType) , this will upgrade the revert to revert UnsupportedUpdateType(update.updateType);

zksyncmainnet: "",
berachainbartio: "",
berachainbepolia: "",
}[networkName];
Copy link
Contributor

@Debugger022 Debugger022 Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to fill contract addresses for remaining chains if needed or remove it .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants