MaxCap(maximum amount of token that can be minted) can set below number of token minted by now
Summary
can Current mining amount will exceed max capped value
Vulnerability Detail
Here below function setLocalMintCap() only called by owner, setting localMintCap to a new value.
It checks whether new value is 0 or not,
But there is absence of check whether newMintCap is greater than localMintAmount or not,
If owner set wrong value i.e(newMintCap < localMintAmount) then current minting amount exceed the capped value
Which cause logic break
0xhacksmithh
medium
MaxCap(maximum amount of token that can be minted) can set below number of token minted by now
Summary
can Current mining amount will exceed max capped value
Vulnerability Detail
Here below function
setLocalMintCap()
only called by owner, settinglocalMintCap
to a new value. It checks whether new value is 0 or not, But there is absence of check whethernewMintCap
is greater thanlocalMintAmount
or not, If owner set wrong value i.e(newMintCap
<localMintAmount
) then current minting amount exceed the capped value Which cause logic breakImpact
May cause some logic break, technical current minting amount exceed max capped minting value
Code Snippet
https://github.com/sherlock-audit/2023-01-uxd/blob/main/contracts/core/UXDToken.sol#L95-L101
Tool used
Manual Review
Recommendation
There should be functionality (or require) that checks
newMintCap
should greater thanlocalMintAmount