Skip to content

Commit c41d947

Browse files
committed
feat: use error lib
1 parent 91ea3d0 commit c41d947

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Blue.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ contract Blue {
8282
/// @notice It is the owner's responsibility to ensure a fee recipient is set before setting a non-zero fee.
8383
function setFee(Market calldata market, uint256 newFee) external onlyOwner {
8484
Id id = market.id();
85-
require(lastUpdate[id] != 0, "unknown market");
86-
require(newFee <= FEE_CAP, "fee must be <= 20%");
85+
require(lastUpdate[id] != 0, Errors.MARKET_NOT_CREATED);
86+
require(newFee <= FEE_CAP, Errors.FEE_CAP_EXCEEDED);
8787
fee[id] = newFee;
8888
}
8989

src/libraries/Errors.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ library Errors {
66

77
string internal constant LLTV_TOO_HIGH = "LLTV too high";
88

9+
string internal constant FEE_CAP_EXCEEDED = "fee must be <= 20%";
10+
911
string internal constant IRM_NOT_ENABLED = "IRM not enabled";
1012

1113
string internal constant LLTV_NOT_ENABLED = "LLTV not enabled";

0 commit comments

Comments
 (0)