4

Here's the contract:

contract Martyr{
  function Martyr(){ 
    var address0 = 0x093ff7d4edbd201f1762297e31afcde50bdf4c81;
    address0.call(bytes4(0x2808241a),0x85a46e616d65a673746f726533a870726f647563747390a4696e666fc0ae7375626d61726b6574416464727390aa7472616e73706f7274739183a26964a737353837373439a474797065a461736664a57072696365a132);
    suicide(msg.sender);
  }
}

And here's the error it generates

:3:60: Error: Member "call" not found or not visible after argument-dependent lookup in uint160 var address0 = 0x093ff7d4edbd201f1762297e31afcde50bdf4c81; address0.call(bytes4(0x2808241a),0x85a46e616d65a673746f726533a870726f647563747390a4696e666fc0ae7375626d61726b6574416464727390aa7472616e73706f7274739183a26964a737353837373439a474797065a461736664a57072696365a132);

Whats the error trying to say, and how can I solve it?

J-B
  • 8,941
  • 16
  • 46
  • 77
Akhil F
  • 1,928
  • 3
  • 19
  • 29

1 Answers1

2

Use address address0 = 0x093ff7d4edbd201f1762297e31afcde50bdf4c81;

Then put quotes around 0x85a46....

Those will fix the errors in https://ethereum.github.io/browser-solidity

There will be warnings about the address (check that it's correct) and use bool unused = address0.call... to avoid Warning: Return value of low-level calls not used.

eth
  • 85,679
  • 53
  • 285
  • 406
  • Nice, thank you. How come quotes are needed around 0x85...? Won't that cause it to be interpreted as a string? I need it to be interpreted as bytes – Akhil F Feb 24 '16 at 23:32
  • 1
    Solidity Browser was giving error "Integer constant too large"... I think with quotes it will still be treated as bytes. EDIT March 2017: The quotes will now treat it as a string so need to try this for bytes: http://ethereum.stackexchange.com/questions/13483/how-to-pass-arbitrary-bytes-to-a-function-again – eth Feb 24 '16 at 23:39
  • var is solidity – RFV Mar 25 '17 at 02:52
  • @RFVenter Right, I forgot about var since it's rarely used and possibly an anti-pattern like http://solidity.readthedocs.io/en/develop/security-considerations.html#minor-details – eth Mar 31 '17 at 09:15