I'm using ruby and would like to find out if an address is a contract one that can potentially take a lot of gas to transfer money to (and possibly failed in the middle).
In this: Using EVM assembly to get the address' code size
They suggesting to use this code:
function isContract(address addr) returns (bool) {
uint size;
assembly { size := extcodesize(addr) }
return size > 0;
}
I think this is to be executed inside ETH miner itself? If I want to perform a simple check on my browser/Ruby on Rails server, how should I do it?