Platform: Code4rena
Start Date: 07/04/2022
Pot Size: $100,000 USDC
Total HM: 20
Participants: 62
Period: 7 days
Judge: LSDan
Total Solo HM: 11
Id: 107
League: ETH
Rank: 17/62
Findings: 2
Award: $770.29
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hickuphh3
Also found by: 0x1f8b, AuditsAreUS, Foundation, Kthere, Meta0xNull, WatchPug, rayn
https://github.com/code-423n4/2022-04-jpegd/blob/main/contracts/lock/JPEGLock.sol#L59
The _lockAmount
gets overwritten each time the lockFor
function is called in JPEGLock.sol
. If the function is called multiple times, the parameter will be updated wrongly.
The _lockAmount
parameter gets assigned with the amount locked each time the lockFor
function is called.
If the function is called again for locking additional tokens for the same _account
and _nftIndex
. Then the amount will be overwritten instead of adding the amount to the current amount of tokens, thereby giving the wrong number of locked tokens in further calculations.
Manual Checks
The following can be used instead:
lockAmount: lockAmount + _lockAmount
#0 - spaghettieth
2022-04-12T17:08:55Z
Duplicate of #10
🌟 Selected for report: Dravee
Also found by: 0x1f8b, 0xDjango, 0xkatana, AuditsAreUS, Cityscape, Foundation, Funen, Hawkeye, IllIllI, JC, JMukesh, Jujic, Kthere, PPrieditis, Picodes, Ruhum, TerrierLover, TrungOre, WatchPug, berndartmueller, catchup, cccz, cmichel, delfin454000, dy, ellahi, hickuphh3, horsefacts, hubble, hyh, ilan, jayjonah8, kebabsec, kenta, minhquanym, pauliax, rayn, reassor, rfa, robee, samruna
298.9412 USDC - $298.94
starting
with ending
setContractWhitelisted
function, requires a check to ensure the same value ( whitelisted contract) is not used for the call, and ensure address(0) checks are missingsetContractWhitelisted
function, requires a check to ensure the same value ( whitelisted contract) is not used for the call, and ensure address(0) checks are missingclaim
function does not have a reentrancy guardlockFor
function, no checks in place to avoid input amount=0
setContractWhitelisted
function, requires a check to ensure the same value ( whitelisted contract) is not used for the call, and ensure address(0) checks are missingwithdraw
functionsetBorrowAmountCap
, needs 0 value checks and checks required to avoid calling function for the existing values (input = current _borrowAmountCap)setDebtInterestApr
, needs checks to avoid calling function for the existing values (input = current _debtInterestApr)setValueIncreaseLockRate
, needs checks to avoid calling function for the existing values (input = current _valueIncreaseLockRate)setCreditLimitRate
, needs checks to avoid calling function for the existing values (input = current _creditLimitRate)setLiquidationLimitRate
, needs checks to avoid calling function for the existing values (input = current _liquidationLimitRate)setJPEGLockTime
,needs checks to avoid calling function for the existing values (input = current _lockTime)overrideFloor
, needs checks to avoid calling function for the existing values (input = current _floor)setOrganizationFeeRate
, needs checks to avoid calling function for the existing values (input = current _organizationFeeRate)setInsurancePurchaseRate
, needs checks to avoid calling function for the existing values (input = current _insurancePurchaseRate)setInsuranceLiquidationPenaltyRate
, needs checks to avoid calling function for the existing values (input = current _insuranceLiquidationPenaltyRate)setNFTType
, needs checks to avoid calling function for the existing valuessetNFTTypeValueETH
, needs checks to avoid calling function for the existing valuessetPendingNFTValueETH
, needs checks to avoid calling function for the existing values