Vader.sol secondsPerEra Is Currently Initialized To One Second Instead Of One Day
Vader comments and documentation describe an "era" as taking one calendar day, which is 86400 seconds.
However, in Vader.sol, secondsPerEra is currently initialized to one second.
This will cause the first call of every single block to Vader._transfer() to make the gas-intensive subcall to _checkEmission().
This will also increment the currentEra counter incredibly quickly.
Proof of Concept
Vader.sol's constructor includes this line of code:
secondsPerEra = 1; //86400;
Handle
jvaqa
Vulnerability details
Impact
Vader.sol secondsPerEra Is Currently Initialized To One Second Instead Of One Day
Vader comments and documentation describe an "era" as taking one calendar day, which is 86400 seconds. However, in Vader.sol, secondsPerEra is currently initialized to one second. This will cause the first call of every single block to Vader._transfer() to make the gas-intensive subcall to _checkEmission(). This will also increment the currentEra counter incredibly quickly.
Proof of Concept
Vader.sol's constructor includes this line of code: secondsPerEra = 1; //86400;
Recommended Mitigation Steps
Change this: secondsPerEra = 1; //86400;
To this: secondsPerEra = 86400;