Conversation
contracts/utils/MultiSendERC20.sol
Outdated
| require(_recipients.length <= arrayLimit, "Array length exceeds limit"); | ||
| uint8 i = 0; | ||
| for (i; i < _recipients.length; i++) { | ||
| token.transferFrom(msg.sender, _recipients[i], _amounts[i]); |
There was a problem hiding this comment.
transferFrom can fail silently.
| token.transferFrom(msg.sender, _recipients[i], _amounts[i]); | |
| require(token.transferFrom(msg.sender, _recipients[i], _amounts[i]), "Transfer failed"); |
There was a problem hiding this comment.
The require here will possibly stop the process in the middle of the batch. Is this what you want? Maybe you just want to emit a not transferred event and let the function continue?
There was a problem hiding this comment.
Probably best to let the entire process fail rather than sending to some addresses, so that however is calling doesn't have to after the fact process all the events that were done to check for which got tokens or not
| arrayLimit = _arrayLimit; | ||
| } | ||
|
|
||
| function multisendToken(address[] calldata _recipients, uint256[] calldata _amounts) public { |
There was a problem hiding this comment.
Don't you want this to be called only by the owner?
There was a problem hiding this comment.
No need, since the tokens are sent from the message owner we don't need that control. The only thing I want to control is the limit of how many can be sent at a time
No description provided.