Submitted by BenRai, also found by 0xAkira, 0xrex, 0xStalin, BajagaSec, Bryan_Conquer, Taiger, and zanderbyte
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_Marketplace.sol#L205-L218
Because there is no option for the admin to remove a token from the isTokenSupport mapping, a depeg of a whitelisted token can lead to significant financial loss for users and the protocol.
When selling a vesting on the marketplace, users need to specify the currency the buyer should pay for the sold tokens. To ensure the safety of the users and the safety of the protocols revenue, only currencies whitelisted in the isTokenSupport mapping can be used and according to the protocol only stable coins will be whitelisted. For a token to be whitelisted the function addCoin needs to be called by the admin.
The issue arises from the fact that there is no way to remove a coin from the whitelist once it is on it. This poses a significant risk for the users and the revenue of the protocol in case a whitelisted stable coin loses his peg and becomes worthless. Even though the coin becomes worthless:
This results in significant financial loss for users as well as the protocol.
Add an option for the admin to remove currencies from the whitelist. This way, no new listings can be created with a depegged currency. To protect the vestings already listed with the bad currency, make sure to check if the currency used for a listing is still on the whitelist before executing a sale. This way, sellers of the impacted listings are protected from selling their vestings for worthless currency and can delist their listings once they become aware of the depeg.
Koolex (judge) commented:
calvinx (SecondSwap) commented:
