DBR: Use unchecked increment in DBR#invalidateNonce
Since incrementing the user's nonce will never realistically overflow, you can safely use an unchecked increment in DBR#invalidateNonce. (Note that you're already doing so when incrementing the nonce in other functions):
function invalidateNonce() public {
nonces[msg.sender]++;
}
Suggestion:
function invalidateNonce() public {
unchecked {
nonces[msg.sender]++;
}
}
Fed: Use unchecked subtraction in Fed#contraction
Since an earlier require statement ensures that amount is less than or equal to supply, you can safely perform an unchecked subtraction in Fed#contraction.
Market: Use unchecked subtraction in getWithdrawalLimit
Since an earlier require check ensures that collateralBalance is less than or equal to minimumCollateral, you can safely perform an unchecked subtraction in getWithdrawalLimit:
Market: Use unchecked increment in invalidateNonce
Since incrementing the user's nonce will never realistically overflow, you can safely use an unchecked increment in Market#invalidateNonce. (Note that you're already doing so when incrementing the nonce in other functions):
DBR
: Use unchecked increment inDBR#invalidateNonce
Since incrementing the user's nonce will never realistically overflow, you can safely use an unchecked increment in
DBR#invalidateNonce
. (Note that you're already doing so when incrementing the nonce in other functions):DBR#invalidateNonce
Suggestion:
Fed
: Use unchecked subtraction inFed#contraction
Since an earlier
require
statement ensures thatamount
is less than or equal tosupply
, you can safely perform an unchecked subtraction inFed#contraction
.Fed#contraction
Suggestion:
Market
: Use unchecked subtraction ingetWithdrawalLimit
Since an earlier
require
check ensures thatcollateralBalance
is less than or equal tominimumCollateral
, you can safely perform an unchecked subtraction ingetWithdrawalLimit
:Market#getWithdrawalLimit
Suggestion:
Market
: Use unchecked increment ininvalidateNonce
Since incrementing the user's nonce will never realistically overflow, you can safely use an unchecked increment in
Market#invalidateNonce
. (Note that you're already doing so when incrementing the nonce in other functions):Market#invalidateNonce
Suggestion:
Market
: Use unchecked subtraction inrepay
Since an earlier
require
statement ensures thatdebts[user]
is greater than or equal toamount
, you can safely use an unchecked subtraction inrepay
:Market#repay
Suggestion: