diff --git a/src/tokens/ERC6160Ext1155.sol b/src/tokens/ERC6160Ext1155.sol index a787daf..fbc3ad6 100644 --- a/src/tokens/ERC6160Ext1155.sol +++ b/src/tokens/ERC6160Ext1155.sol @@ -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; } diff --git a/src/tokens/ERC6160Ext20.sol b/src/tokens/ERC6160Ext20.sol index 7bad247..bd451cc 100644 --- a/src/tokens/ERC6160Ext20.sol +++ b/src/tokens/ERC6160Ext20.sol @@ -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; } diff --git a/src/tokens/ERC6160Ext721.sol b/src/tokens/ERC6160Ext721.sol index fdf3deb..ff863ee 100644 --- a/src/tokens/ERC6160Ext721.sol +++ b/src/tokens/ERC6160Ext721.sol @@ -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; }