0

It is done by web3js sending some data from an EOA a contract by:

myContract.methods.function().send({data:...});

Can the same be done from contract to EOA by Solidity (I mean by .call())?

1 Answer 1

1

Yes you can, but it does not send anything, and the EOA address does not receive anything (because it doesn't have bytecode logic to receive)

contract Test {
    bool public success;
    bytes public data;
    function test (address target) public {
        (success, data) = address(target).call("0x1234");
    }
}
  • If target is a contract, success = true if the call successful and success = false if the call reverted, depends on the logic of the target contract
  • If target is a normal address (EOA), success is always true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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