August 2019
Intermediate to advanced
486 pages
13h 52m
English
In your contract, when you need to confirm whether an address is a contract or an EOA, you can use the Address.sol library. This library provides a function, isContract(), which checks the address and finds the byte size of the contract attached to that address. If the code size is greater than zero, that means it is a contract.
However, this is not the recommended way to check whether an address is a contract or not. During the contract's constructor execution, a contract isn't treated as a contract. Thus, if you call the isContract() function while a contract is executing its constructor, then the function would return false.
The OpenZeppelin contract present at Chapter09/openzeppelin-solidity/contracts/utils/Address.sol ...