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; |
For purposes of this smart-contract there's no actual need to maintain arrays of
adminsandblacklisted. It's enough to just maintainisAdmin[*address*]andisBlacklisted[*address*]mappings. Looping through those lists cost unnecessary gas fees.Function
addAdminshould emitadminAddedeventFunction
removeAdminshould emitadminRemovedeventFunction
addBlacklistedshould emitblacklistedAddedevent (I suggest we renameaddToBlacklisttoaddBlacklisted)Function
removeBlacklistedshould emitblacklistedRemovedeventWith 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.
streamtide-smart-contract/streamtide.sol
Lines 19 to 20 in 5740c35