Skip to content

Commit

Permalink
evm: fixes access control admin removal
Browse files Browse the repository at this point in the history
  • Loading branch information
scnale committed Dec 16, 2024
1 parent 00b697a commit 788abc6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions evm/src/assets/sharedComponents/AccessControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,12 @@ abstract contract AccessControl {
}
else {
uint256 rawIndex = state.isAdmin[admin];
if (rawIndex != state.admins.length)
state.admins[rawIndex - 1] = state.admins[state.admins.length - 1];
if (rawIndex != state.admins.length) {
address tmpAdmin = state.admins[state.admins.length - 1];
uint256 newIndex = rawIndex - 1;
state.isAdmin[tmpAdmin] = newIndex;
state.admins[newIndex] = tmpAdmin;
}

state.isAdmin[admin] = 0;
state.admins.pop();
Expand Down

0 comments on commit 788abc6

Please sign in to comment.