Omniscia Tokemak Network Audit

AirdropPush Code Style Findings

AirdropPush Code Style Findings

APH-01C: Data Location Optimization

TypeSeverityLocation
Gas OptimizationInformationalAirdropPush.sol:L11, L12

Description:

The linked variables are declared as memory in an external function.

Example:

contracts/airdrop/AirdropPush.sol
9function distribute(
10 IERC20 token,
11 address[] memory accounts,
12 uint256[] memory amounts
13) external {
14 require(accounts.length == amounts.length, "LENGTH_MISMATCH");
15 for (uint256 i = 0; i < accounts.length; i++) {
16 token.safeTransferFrom(msg.sender, accounts[i], amounts[i]);
17 }
18}

Recommendation:

We advise them to be set as calldata greatly optimizing their gas cost.

Alleviation:

Both variables were properly set to calldata.