2

done , wrong question. better to use this

contract ERC20 {
  function transfer(address _recipient, uint256 _value) public returns (bool success);
}

contract Airdrop {
  function drop(ERC20 token, address[] recipients, uint256[] values) public {
    for (uint256 i = 0; i < recipients.length; i++) {
      token.transfer(recipients[i], values[i]);
    }
  }
}
  • I notice the decimals of your Straddle Token are 1 and not the usual 18, and that in this original code (not that which you have posted), within the function sendTokens(), the line that says "uint256 toSend = values[i] 10^18;" used to have that 10^18 there, so possibly yours is off by a factor of 10? It's a long shot, but might possibly be what caused your error. I'm trying to use this code right now to airdrop a token, and not really understanding what I'm doing. Could anyone explain exactly in detail how to call/use the smart contract after it's deployed, to actually send the ["A","B","C – Allen Rice Jan 20 '18 at 22:09
  • you're supposed to answer not to ask more questions – Davide C Feb 02 '18 at 20:18
  • If you have a question it is better to create a new one, question in comments will not receive much attention. – Ismael Feb 09 '18 at 15:32
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – Roman Frolov Feb 09 '18 at 18:11

1 Answers1

0

Ensure the contract address as 0x93136f0d37f8f6830f61847edbab794b81d99dbc and token address as 0x14fd8dd229ba04881bfd443c6216d84fe19e1edf (derived from the links that you have given) and check again.

Rajesh
  • 706
  • 6
  • 23
  • Please try it with the Token address, I am losing hope now. –  Nov 29 '17 at 12:15
  • Am not the owner, I will not be able to do it. Deploy the contract again with proper token address. The one you have used in the contract 0xe34c1960fbf05d4e08c19248491dfbcdbeab6e44 doesn't seems to be of a token address. Check this out. – Rajesh Nov 29 '17 at 12:16
  • Try now, i have smart contract on ropsten and the airdrop contract also on ropsten network deployed, but things are not working :( –  Nov 29 '17 at 12:20
  • Few questions, you have created the token from this same contract? and used the token address properly? give me gist link to your code so that I can review it again for you. address _tokenAddr =0xe34c1960fbf05d4e08c19248491dfbcdbeab6e44; this line to have token's address here – Rajesh Nov 29 '17 at 12:22
  • I am testing everything on testnet so dont have gist now. –  Nov 29 '17 at 12:48
  • Take a break and try again later, seems you are confused now. Have this check list when you review this later. 1. You should creaet this contract from the same ERC20 address that created the token. 2. The token should have the transfer method that would allow it to have sent. 3. In this airdrop contract, ensure you have used the address of the token. 4. Have some tokens sent to this contract from your token creator address. – Rajesh Nov 29 '17 at 13:51
  • 1
    hey, were you able to complete it? – Rajesh Nov 30 '17 at 04:18
  • Not with the code given above but was able to do by this : https://pastebin.com/hjKmsMp8 I am still surprised why the above code did not worked for me. –  Nov 30 '17 at 04:28
  • Glad something worked out. May be the token created was not of same style. – Rajesh Nov 30 '17 at 04:34
  • you can use the Dapp: https://rstormsf.github.io/multisender/#/ – rstormsf Jul 04 '18 at 19:09