sherlock-audit / 2023-04-unitasprotocol-judging

4 stars 3 forks source link

stopthecap - Unconditional EMC => usd1 swap will fail if reserve ratio ≤ 100% #155

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

stopthecap

high

Unconditional EMC => usd1 swap will fail if reserve ratio ≤ 100%

Summary

The unconditional EMC => usd1 swap will fail if reserve ratio goes below 100%

Vulnerability Detail

The burn of any EMC, such as usd91 is unconditional according to the docs. In the case, an EMC has to be swapped (burned) for usd1 in a ratio below 100%, the swap will fail due to the EMC being paused.

https://github.com/sherlock-audit/2023-04-unitasprotocol/blob/d5328421bea80e3b0fd4595e4eb6b732a40e421e/Unitas-Protocol/src/ERC20Token.sol#L184

As you can see, https://github.com/sherlock-audit/2023-04-unitasprotocol-0xffff11/tree/main/Unitas-Protocol#reserve-ratio--100 if the reserve ratio is below 100% they pause all type of mintings

Impact

Unable to swap back EMCs to usd1 below a 100% reserve ratio

Code Snippet

https://github.com/sherlock-audit/2023-04-unitasprotocol/blob/d5328421bea80e3b0fd4595e4eb6b732a40e421e/Unitas-Protocol/src/ERC20Token.sol#L184

Tool used

Manual Review

Recommendation

Do not pause both functionalities (mint and burn) at the same time