Storage access is expensive. holdingTokens length can be extracted into a variable and used where necessary to reduce the number of storage read. change this:
holdingTokens = account.holdingTokens;
holdingAmounts = new uint256;
for (uint256 idx = 0; holdingTokens.length > idx; idx++)
to this:
holdingTokens = account.holdingTokens;
uint holdingTokensLength = holdingTokens.length;
holdingAmounts = new uint256;
for (uint256 idx = 0; holdingTokensLength > idx; idx++)
Email address
pauliax6@gmail.com
Handle
paulius.eth
Eth address
0x523B5b2Cc58A818667C22c862930B141f85d49DD
Vulnerability details
Gas optimization suggestion:
Storage access is expensive. holdingTokens length can be extracted into a variable and used where necessary to reduce the number of storage read. change this: holdingTokens = account.holdingTokens; holdingAmounts = new uint256; for (uint256 idx = 0; holdingTokens.length > idx; idx++) to this: holdingTokens = account.holdingTokens; uint holdingTokensLength = holdingTokens.length; holdingAmounts = new uint256; for (uint256 idx = 0; holdingTokensLength > idx; idx++)