code-423n4 / 2021-10-union-findings

0 stars 0 forks source link

list of _admins #89

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

I think that having a private list of _admins in Controller is redundant. The only place where it is used is when checking if the address is not an admin already: require(_admins[account] == address(0), "Controller: admin already existed"); this can be effectively replaced with a call to function isAdmin: require(!isAdmin(account)), "Controller: admin already existed");

GalloDaSballo commented 3 years ago

Given that isAdmin is public, I agree with the finding, am not convinced this would bring any gas savings (potentially increase gas cost as using a function means a jump), will change to non-critical