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()
)?
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");
}
}
target
is a contract, success = true
if the call successful and success = false
if the call reverted, depends on the logic of the target contracttarget
is a normal address (EOA), success is always true