code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

You don't need to recalculate exclusion fee every time #302

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

if you calculate the exclusion fee only once and store it in a variable, gas costs will be reduced: mapEra_Emission[1] / 16 event better, as mapEra_Emission[1] is set initially in the constructor, this fee amount could also be calculated in the constructor and stored in a constant variable as it never changes. even comment says "Pay fee of 128 Vether". Same here: uint maxEmissions = (upgradeHeight - 1) * mapEra_Emission[1];