An address in Solidity can be an account or a contract (or other things, such as a transaction). When I have a variable x, holding an address, how can I test if it is a cont
Yes you can, by using some EVM assembly code to get the address' code size:
function isContract(address addr) returns (bool) { uint size; assembly { size := extcodesize(addr) } return size > 0; }