Open code423n4 opened 2 years ago
p4st13r4
The claim function does not check if the provider index of the lock actually exists, leading to waste of gas for the transaction sender
claim
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L122
Editor
Add this check
require(i < userLocks.length)
Adding additional check may be waste of gas. Function will fail if i out of bounds here
i
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L124
https://github.com/code-423n4/2021-12-vader-findings/issues/106
Handle
p4st13r4
Vulnerability details
Impact
The
claim
function does not check if the provider index of the lock actually exists, leading to waste of gas for the transaction senderProof of Concept
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L122
Tools Used
Editor
Recommended Mitigation Steps
Add this check