1

Say I have a contract with a method that does a low level call on an address _addr assuming the target address is a contract with a certain method isValid():

contract Dummy { function doCall(address _addr) public returns (bool) { return _addr.call(abi.encodeWithSignature("isValid()"); } }

What happens if the address _addr is not a contract but an EOA? Trying it in Remix indicates that the call returns true when _addr is an EOA.

If this is indeed the case can someone explains or point me to the part of the documentation where this is exlained?

Thanks in advance!

  • 2
    Yes, this call should succeed. In general, a call will succeed unless the receiving address reverts. The difference between an EOA and a contract is that the contract has code (and so that code might revert, e.g. if it doesn't have a given function defined and lacks a fallback function). An EOA doesn't have code, so it can't possibly revert. – smarx Aug 17 '18 at 8:33
  • @smarx Could you post your comment as an answer so people can find it more easily? – Henk Aug 17 '18 at 11:00
1

(moving my comment to an answer as requested)

Yes, this call should succeed. In general, a call will succeed unless the receiving address reverts. The difference between an EOA and a contract is that the contract has code (and so that code might revert, e.g. if it doesn't have a given function defined and lacks a fallback function). An EOA doesn't have code, so it can't possibly revert.

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.