Closed 08xmt closed 6 years ago
Not an issue
weiToPaticipate
depends on requestedSupply
and hence on newTokes
.
On the other hand, if weiToParticipate
is not 0, then the requestedSupply
and newTokes
must be recalculated.
Therefore these lines can not be moved bellow the if
statement.
Thank you for your input.
The lines:
122: uint256 newTokens = weiToParticipate.mul(rates.total); 123: uint256 requestedSupply = totalSupply.add(newTokens);
And
130: newTokens = weiToParticipate.mul(rates.total); 131: requestedSupply = totalSupply.add(newTokens);
are slightly redundant. By moving lines 122 and 123 to after the if statement started in line 128, a slight amount of gas can be saved on execution and deployment.