From what I know and understood so far, every call to an address can succeed if not properly handled. So for example if I want a contract to own ERC tokens or only allow contracts to interact with my contract, you can use extcodesize to detect if an address is a contract. What it does is it checks the code size of the entered address. Since regular addresses cannot have code, every return >0 would mean it's a contract (contains code).
Read more here:
https://ethereum.stackexchange.com/questions/15641/how-does-a-contract-find-out-if-another-address-is-a-contract

Dec 8, 2020, 8:33 PM

© 2024 Draquery.com All rights reserved.