You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
Share can be minted to address(0) in TimeLockPool.sol#Deposit
Summary
Share can be minted to address(0) in TimeLockPool.sol#Deposit
Vulnerability Detail
When calling the the function deposit
function deposit(uint256_amount, uint256_duration, address_receiver) externaloverride {
if (_amount ==0) {
revertZeroAmountError();
}
The function does not verify if the _receiver address is address(0),
When the mint is called, the share that minted to address(0) is basically equal to burn the share.
_mint(_receiver, mintAmount);
Impact
Burning the share while deposit the token basically waste storage space and erode other user's share because address(0) is not supposed to get any reward anyway.
ctf_sec
medium
Share can be minted to address(0) in TimeLockPool.sol#Deposit
Summary
Share can be minted to address(0) in TimeLockPool.sol#Deposit
Vulnerability Detail
When calling the the function deposit
The function does not verify if the _receiver address is address(0),
When the mint is called, the share that minted to address(0) is basically equal to burn the share.
_mint(_receiver, mintAmount);
Impact
Burning the share while deposit the token basically waste storage space and erode other user's share because address(0) is not supposed to get any reward anyway.
Code Snippet
https://github.com/sherlock-audit/2022-10-merit-circle/blob/main/merit-liquidity-mining/contracts/TimeLockPool.sol#L85-L93
Tool used
Manual Review
Recommendation
We recommend the project check if the receiverAddress is address(0)
The text was updated successfully, but these errors were encountered: