you are almost asking someone to write the contract for you. You should post what code you have tried so far, what errors you are getting and ask for some particular pointers.
Nevertheless, here's some code that should get you on the right track.
I'm assuming you are the owner of these tokens. Notice that the only way for this contract to transfer the tokens is for it to use the transferFrom function from the ERC20 tokens.
That means that before using the code below you will have to call the approve function from your account in order to allow this contract to use your tokens.
pragma solidity ^0.4.18;
contract ERC20 {
function transferFrom(address _from, address _to, uint _value) returns (bool success);
}
contract TokenAirdrop {
function sendTokens(address[] beneficiaries) public {
ERC20 token = ERC20(OXO...); //Token address
for (uint8 i = 0; i< beneficiaries.length; i++){
address beneficiary = beneficiaries[i];
token.transferFrom(OWNER_OF_TOKENS, beneficiary, 1);
}
}
}
I;ve reokaced OXO... with the original token address, it gave me an error for 0.4.18 so I changed to 0.4.16 but now its telling me:
Undeclared identifier. token.transferFrom(OWNER_OF_TOKENS, beneficiary, 1); ^-------------^
for this line
token.transferFrom(OWNER_OF_TOKENS, beneficiary, 1);
– Matthew Hughes Nov 14 '17 at 17:22