1

Below is my operation steps:

  1. I create a token 0x260c4b1cd063599949b530454d22081b94c170ef whose owner is 0xAbA5862c54254750b2EFe8BEB72f528DAF73547F You can check this token's code by https://etherscan.io/address/0x260c4b1cd063599949b530454d22081b94c170ef#code compile version is : 0.4.22+commit.4cb486ee.Emscripten.clang
  2. then publish a contract using @Rajesh code Unable to check Airdropped Tokens , the contract address is https://etherscan.io/address/0x7449605903e5e851f34d78accbe78e4c54dbab45 whose owner is also 0xAbA5862c54254750b2EFe8BEB72f528DAF73547F same as above token, compile version is also 0.4.22+commit.4cb486ee.Emscripten.clang
  3. I sent some token to above contract from owner , tx is https://etherscan.io/tx/0x6e8091e585b63c62103ebb1fbc40d90c5604f5b6459b7ddd4eecf6794a183b7b
  4. with parity I call transfer by below bash command

owner=0xAbA5862c54254750b2EFe8BEB72f528DAF73547F to=0x7449605903e5e851f34d78accbe78e4c54dbab45 methodid=0xad8733ca array_0=0000000000000000000000008138ee2d269b1d85a81df6dd925f1f83d1ffa7cf array_1=0000000000000000000000000000000000000000000000000000000000000001 data=${methodid}${array_0}${array_1}
curl -X POST -H 'content-type: application/json' --data '{ "jsonrpc": "2.0","method": "personal_sendTransaction","params": [{"from": "'"$owner"'","to":"'"$to"'","data": "'"$data"'"},"'"$PASS"'"],"id": 1}' http://127.0.0.1:$port

  1. transaction done well, but no any token is transfered , transactions is https://etherscan.io/tx/0x0dbc844714ae2d3b3310ee9b7efac6f930160e55559b1b634a59bdc4f33bef1d enter image description here

Please help me to check , thank you very much

0

Your problem is arrays are dynamic so they are encoded differently that static types like uint256. See the Solidity ABI specs for the details.

In your case it should be something like this:

d8b66ae1 // method's signature

// offset dests array
0000000000000000000000000000000000000000000000000000000000000040  
// offset values array
0000000000000000000000000000000000000000000000000000000000000080

// dests array
0000000000000000000000000000000000000000000000000000000000000001  // array length
0000000000000000000000008138ee2d269b1d85a81df6dd925f1f83d1ffa7cf  // array elements follow

// values array
0000000000000000000000000000000000000000000000000000000000000001  // length
0000000000000000000000000000000000000000000000000000000000000001  // elements
  • Thank you very much, I will try, thank you again – dongbo zhang May 18 at 17:07
  • It work well now according to your suggestion , thanks you very much – dongbo zhang May 19 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.