If I create a token, and then want to distribute it to 1000 people, I am worried about the gas price of those transactions. Which is why I wanted to analyse the different options for distributing and their inherent costs.
option 1: function in token that distributes to an array of users
function distributeToken(address[] addresses, uint256 _value) onlyOwner {
for (uint i = 0; i < addresses.length; i++) {
balances[owner] -= _value;
balances[addresses[i]] += _value;
Transfer(owner, addresses[i], _value);
}
}
source: Distribute token to multiple address
ELABORATIONG ON OPTION ONE: is it possible to use parameters with an array of 1000 different addresses? That would be a massively large parameter and I'm curious as to what the gas price would look like.
option 2: using an exchange
This option is very restrictive however. It would allow anyone to buy the coins, and I don't necessarily want them to be bought but given away for free to specific users.
QUESTIONS
- Are there other options people are aware of?
- Which option would be most suitable and cost the least amount of gass?
DIFFERENCES BETWEEN THE LINKED DUPLICATE QUESTION AND THIS ONE: ( How to transfer tokens to bounty participants? )
The questions have noticeable differences
- The details that are being discussed.
- I also have 2 specific questions at the end which are not identical to that
while the question linked that is similar asks:
- What is best practice to send ERC20-compliant tokens to bounty participants?
It doesn't provide the specific criteria for what best would refer to, while I do, and I also ask the other available options to make a comparison with. Even though they have similarities, they are not the same.