Hidden Basil Cricket
Medium
When a user is blacklisting, their entire balance is taken, this balance should be returned back to user when removeBlacklist
is called but it is not the case here.
In
Blacklist.sol:removeBlacklist`, the seized funds are not returned back to user.
addBlacklist
function seize the user balance using _onceBlacklisted
function.
function addBlackList(
address user
) public virtual onlyRole(BLACKLISTER_ROLE) {
if (blacklisted(user)) revert AlreadyBlacklisted(user);
_onceBlacklisted(user);
// do this after so it doesnt trip blacklisted restirctions
_setBlacklist(user, true);
emit AddedBlacklist(user);
}
function _onceBlacklisted(address user) internal override {
_transfer(user, _msgSender(), balanceOf(user));
}
There is a function removeBlacklist
which can be used to remove the user from blacklist but this function doesn't return the seized funds back to user, essentially leading to the loss of fund for user.
function removeBlackList(
address user
) public virtual onlyRole(BLACKLISTER_ROLE) {
if (!blacklisted(user)) revert NotBlacklisted(user);
_setBlacklist(user, false);
emit RemovedBlacklist(user);
}
No response
BLACKLISTER
callsaddBlacklist
to blacklist user.- User is now blacklisted and his funds are seized.
- after someone
BLACKLISTER
release that he made a mistake on blacklisting a user. - He call
removeBlacklist
to remove a genuine user from blacklist. - The user is removed from blacklist but his funds seized earlier are never returned.
User funds will get lost.
No response
removeBlacklist
should return user funds.