[6] Consider reducing if nesting by having early continue/return and else contents clause can be placed right after.
This increases readability of the code.
[7] Usually when you leave function empty it is a good practice to place a comment inside brackets { /* reason why here is no code */ }
Consider adding explanation in comments.
Impact
[1] By default, function types and state variables/constants are internal, so the internal keyword can be omitted.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[2] Magic number, consider using named constant instead.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[3] Consider using "_" separate digit capacity i.e "100000" could be replaced to "100_000". This increases code readability.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[4] Consider using IERC20 type instead of address. Or IERC20[] type instead of address[].
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[5] Typo: variable name supposed to be 'decimals'.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[6] Consider reducing if nesting by having early continue/return and else contents clause can be placed right after. This increases readability of the code.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[7] Usually when you leave function empty it is a good practice to place a comment inside brackets
{ /* reason why here is no code */ }
Consider adding explanation in comments.Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[8] Consider adding here
require(msg.value == 0);
since it is non-ETH token.Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[9] Concern: Isn't it better to break the for-loop instead of reverting whole transaction?
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
[10] Brackets aren't necessary here, consider making this code one-liner.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps