Skip to content

No need to keep array of admins and blacklisted #10

Description

@madvas

For purposes of this smart-contract there's no actual need to maintain arrays of admins and blacklisted. It's enough to just maintain isAdmin[*address*] and isBlacklisted[*address*] mappings. Looping through those lists cost unnecessary gas fees.

Function addAdmin should emit adminAdded event
Function removeAdmin should emit adminRemoved event
Function addBlacklisted should emit blacklistedAdded event (I suggest we rename addToBlacklist to addBlacklisted)
Function removeBlacklisted should emit blacklistedRemoved event
With these events we'll be able to construct list of admins and blacklisted on server-side so the whole list can be displayed in the UI.

address[] public admins;
address[] public blacklisted;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions