You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @dev Ensures that the given address is not already present in the `adminsAccounts` array.
53
-
* This check helps in avoiding duplicate admin entries. Since this function iterates
54
-
* over the `adminsAccounts` array, be cautious of gas costs when the array size grows.
55
-
* @param _addr The address to verify against the admin accounts mapping.
56
-
* @return bool Returns true if the address is not an admin, false if it already exists as an admin.
57
-
*/
58
-
function ensureAdminDoNotExist(address_addr) internalviewreturns (bool){
59
-
returnuint(adminRoles[_addr]) ==uint(Role.None);
60
-
}
61
-
62
-
/**
63
-
* @dev Verifies that the given address is not already listed in the `superAdminsAccounts` array.
64
-
* Useful for maintaining a clean list of SuperAdmins without duplicates. As with `ensureAdminDoNotExist`,
65
-
* be mindful of potential gas costs due to array iteration.
66
-
* @param _addr The address to check against the super admin accounts list.
67
-
* @return bool Returns true if the address is not a super admin, false if it already exists as a super admin.
68
-
*/
69
-
function ensureSuperAdminDoNotExist(address_addr) internalviewreturns (bool){
70
-
returnuint(adminRoles[_addr]) ==uint(Role.None);
71
-
}
72
-
73
-
/**
74
-
* @dev Adds a new SuperAdmin to the contract.
75
-
* This function can only be called by the contract owner. It ensures that the address being added does not already exist as either a SuperAdmin or Admin. After verification, it assigns the SuperAdmin role to the address and emits an event.
76
-
* @param _addr Address to be added as a SuperAdmin.
77
-
* @notice This action is irreversible through this function and can only be performed by the contract owner.
78
-
*/
79
-
function addSuperAdmin(address_addr) external onlyOwner {
* @dev Ensures that the given address is not already present in the `adminsAccounts` array.
54
+
* This check helps in avoiding duplicate admin entries. Since this function iterates
55
+
* over the `adminsAccounts` array, be cautious of gas costs when the array size grows.
56
+
* @param _addr The address to verify against the admin accounts mapping.
57
+
* @return bool Returns true if the address is not an admin, false if it already exists as an admin.
58
+
*/
59
+
function ensureAdminDoNotExist(address_addr) internalviewreturns (bool){
60
+
returnuint(adminRoles[_addr]) ==uint(Role.None);
61
+
}
62
+
63
+
/**
64
+
* @dev Verifies that the given address is not already listed in the `superAdminsAccounts` array.
65
+
* Useful for maintaining a clean list of SuperAdmins without duplicates. As with `ensureAdminDoNotExist`,
66
+
* be mindful of potential gas costs due to array iteration.
67
+
* @param _addr The address to check against the super admin accounts list.
68
+
* @return bool Returns true if the address is not a super admin, false if it already exists as a super admin.
69
+
*/
70
+
function ensureSuperAdminDoNotExist(address_addr) internalviewreturns (bool){
71
+
returnuint(adminRoles[_addr]) ==uint(Role.None);
72
+
}
73
+
74
+
/**
75
+
* @dev Adds a new SuperAdmin to the contract.
76
+
* This function can only be called by the contract owner. It ensures that the address being added does not already exist as either a SuperAdmin or Admin. After verification, it assigns the SuperAdmin role to the address and emits an event.
77
+
* @param _addr Address to be added as a SuperAdmin.
78
+
* @notice This action is irreversible through this function and can only be performed by the contract owner.
79
+
*/
80
+
function addSuperAdmin(address_addr) external onlyOwner {
0 commit comments