I am new to solidity and trying to deploy a contract to see whether the address is EOA or Smart Contract. The code is listed below. I am not able to see the boolean value when I executed the contract in the mainnet.
pragma solidity ^0.4.0;
contract Ballot {
event isEOAOrNot(bool val);
function isContract(address addr) returns (bool) {
uint size;
assembly { size := extcodesize(addr) }
bool val = size > 0;
isEOAOrNot(val);
return val;
}
}
Best Answer
Here's the best way I know:
And there you have it; the event and the arguments.