Skip to content

Commit

Permalink
don't set empty address as admin
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Jun 8, 2024
1 parent 4851728 commit 6d73fcd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tokens/ERC6160Ext1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ contract ERC6160Ext1155 is ERC1155, ERC165Storage, IERC6160Ext1155 {
delete _rolesAdmin[MINTER_ROLE][_msgSender()];
delete _rolesAdmin[BURNER_ROLE][_msgSender()];

if (newAdmin == address(0)) {
return;
}

_rolesAdmin[MINTER_ROLE][newAdmin] = true;
_rolesAdmin[BURNER_ROLE][newAdmin] = true;
}
Expand Down
4 changes: 4 additions & 0 deletions src/tokens/ERC6160Ext20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ contract ERC6160Ext20 is ERC165Storage, ERC20, IERC6160Ext20 {
delete _rolesAdmin[MINTER_ROLE][_msgSender()];
delete _rolesAdmin[BURNER_ROLE][_msgSender()];

if (newAdmin == address(0)) {
return;
}

_rolesAdmin[MINTER_ROLE][newAdmin] = true;
_rolesAdmin[BURNER_ROLE][newAdmin] = true;
}
Expand Down
4 changes: 4 additions & 0 deletions src/tokens/ERC6160Ext721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ contract ERC6160Ext721 is ERC721, ERC165Storage, IERC6160Ext721 {
delete _rolesAdmin[MINTER_ROLE][_msgSender()];
delete _rolesAdmin[BURNER_ROLE][_msgSender()];

if (newAdmin == address(0)) {
return;
}

_rolesAdmin[MINTER_ROLE][newAdmin] = true;
_rolesAdmin[BURNER_ROLE][newAdmin] = true;
}
Expand Down

0 comments on commit 6d73fcd

Please sign in to comment.