How to find out if an Ethereum address is a contract?
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; }
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; }
Without the memory keyword, Solidity tries to declare variables in storage. Lead Solidity dev chriseth: “You can think of storage as a large array that has a virtual structure… a structure you cannot change at runtime – it is determined by the state variables in your contract”. That is, the structure of storage is set … Read more
Before I answer the main question, I’m going to try to define a bit more precisely what it would mean to write code in Haskell or Idris and compile it to run on an Ethereum-like blockchain. Idris is probably a better fit for this, but I’m going to use Haskell because that’s what I’m familiar … Read more