code-423n4 / 2021-07-sherlock-findings

0 stars 0 forks source link

ps.govPool in function tokenInit #71

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

Eliminate extra storage read and if statement:

if (_govPool != address(0)) {
  ps.govPool = _govPool;
}
require(ps.govPool != address(0), 'ZERO_GOV');

can be replaced with:

require(_govPool != address(0), 'ZERO_GOV');
ps.govPool = _govPool;
Evert0x commented 3 years ago

_govPool can be non zero, as the tokenInit() can be called multiple times.

ghoul-sol commented 3 years ago

per sponsor comment, invalid