Skip to content

Commit

Permalink
fix: BanMemberGroupRule - Cannot unban while kicking from the group
Browse files Browse the repository at this point in the history
  • Loading branch information
donosonaumczuk committed Dec 20, 2024
1 parent 466a516 commit af53060
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/rules/group/BanMemberGroupRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract BanMemberGroupRule is IGroupRule {
if (_isMemberBanned[msg.sender][configSalt][account]) {
for (uint256 i = 0; i < ruleParams.length; i++) {
if (ruleParams[i].key == BAN_MEMBER_PARAM_KEY) {
require(!abi.decode(ruleParams[i].value, (bool)));
require(!abi.decode(ruleParams[i].value, (bool))); // Cannot ban while adding to the group.
_isMemberBanned[msg.sender][configSalt][account] = false;
_accessControl[msg.sender][configSalt].requireAccess(originalMsgSender, UNBAN_MEMBER_PID);
emit Lens_BanMemberGroupRule_MemberUnbanned(msg.sender, configSalt, account, originalMsgSender);
Expand All @@ -94,6 +94,9 @@ contract BanMemberGroupRule is IGroupRule {
_isMemberBanned[msg.sender][configSalt][account] = true;
_accessControl[msg.sender][configSalt].requireAccess(originalMsgSender, BAN_MEMBER_PID);
emit Lens_BanMemberGroupRule_MemberBanned(msg.sender, configSalt, account, originalMsgSender);
} else {
// Cannot unban while kicking from the group.
require(!_isMemberBanned[msg.sender][configSalt][account]);
}
return;
}
Expand Down

0 comments on commit af53060

Please sign in to comment.