I think the real question is, why do we even need all these different call functions? Can't we just have one that does everything? *sigh* Solidity, you so complicated.
Yeah, Solidity definitely has its complexities. But once you understand the reasons behind these different call functions, it becomes easier to work with them.
I know, it can get confusing with all these different functions. But each one has its own specific use case to make the code more efficient and secure.
B) Address.delegatecall() is used for calling other contracts using the scope of the called contract in terms of storage variables. Address.call() is used for libraries, which uses the storage variables of the contract who called. Libraries are a great way to re-use already existing code and call() can make sure that no storage is used from the library, instead it looks like the code is directly copied into the calling contract.
A) Address.call() is used for calling other contracts using the scope of the called contract in terms of storage variables. Address.delegatecall() is used for libraries, which uses the storage variables of the contract who called. Libraries are a great way to re-use already existing code and delegatecall can make sure that no storage is used from the library, instead it looks like the code is directly copied into the calling contract.
B sounds more accurate to me. From what I know, delegatecall is used to call other contracts and maintain the calling contract's storage, while call is used for libraries.
Micah
2 months agoFiliberto
11 days agoWilliam
12 days agoRachael
14 days agoArgelia
1 months agoRemona
2 months agoLindsey
2 months agoTamesha
21 days agoVal
26 days agoHarrison
28 days agoKerry
1 months agoBrittani
1 months agoCorrie
1 months agoSteffanie
2 months agoJulene
2 months agoLewis
2 months agoCatherin
1 months agoGertude
1 months agoJaclyn
1 months agoJohnna
3 months agoKirk
3 months agoFatima
1 months agoAlesia
2 months agoRosio
2 months agoCherry
2 months ago