Skip to content

Commit e198e90

Browse files
chore: revert on illegal value
1 parent 0ed3f84 commit e198e90

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contracts/Controller.vy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def __init__(
160160
COLLATERAL_PRECISION = pow_mod256(10, 18 - collateral_decimals)
161161

162162
BORROWED_TOKEN = _borrowed_token
163-
# TODO refactor this logic to be shared with view
164163
borrowed_decimals: uint256 = convert(staticcall BORROWED_TOKEN.decimals(), uint256)
165164
BORROWED_PRECISION = pow_mod256(10, 18 - borrowed_decimals)
166165

@@ -1173,7 +1172,7 @@ def liquidate(
11731172
), "Not enough rekt"
11741173
11751174
final_debt: uint256 = debt
1176-
# TODO shouldn't clamp max
1175+
assert _frac <= WAD, "frac>100%"
11771176
frac: uint256 = min(_frac, WAD)
11781177
debt = unsafe_div(debt * frac + (WAD - 1), WAD)
11791178
assert debt > 0

0 commit comments

Comments
 (0)