Describe the bugn = length of the recipients
You should compare the gas cost of (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) vs (n transferFrom(msg.sender, recipient[i])
You should be able to find the value of n at the point where (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) becomes cheaper than (n transferFrom(msg.sender, recipient[i]).
If that n is too large, then n transferFrom(msg.sender, recipient[i]) will be better to use,
and if n is moderate or small, then (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) will be better to use.
Find that n and decide which one to use.
Configuration
Severity : Gas Optimization
Impact
Depending on the number of recipients, users could waste more on gas.
Describe the bug
n
= length of the recipients You should compare the gas cost of (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) vs (n transferFrom(msg.sender, recipient[i])You should be able to find the value of n at the point where (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) becomes cheaper than (n transferFrom(msg.sender, recipient[i]). If that n is too large, then n transferFrom(msg.sender, recipient[i]) will be better to use, and if n is moderate or small, then (1 transferFrom(msg.sender, address(this)) + n transfer(recipient[i])) will be better to use. Find that n and decide which one to use.
Configuration
Impact Depending on the number of recipients, users could waste more on gas.
Recommendation Add Test code about this.