Content pfp
Content
@
0 reply
0 recast
2 reactions

Abhishek Bhagat pfp
Abhishek Bhagat
@flamekaiser.eth
Understanding Ethereum Contract Calls: call, staticcall, and delegatecall In Ethereum, smart contracts interact with each other and external accounts using different types of calls. Understanding these call types is crucial for developers to ensure the security and functionality of their contracts. Let's delve into the three major types of contract calls: call, staticcall, and delegatecall. 1. call The call function is the most generic way to interact with other contracts. It can be used to send Ether and call functions on other contracts. When using call, the context (storage, balance, address) of the callee contract is isolated from the caller contract. Usage: (bool success, bytes memory data) = targetContract.call{value: msg.value}(abi.encodeWithSignature("functionName(args)")); Key Points: Can change state. The callee contract's code is executed in its own context. Gas is forwarded to the callee contract, but it can be limited by specifying gas.
2 replies
0 recast
1 reaction

mudgen pfp
mudgen
@mudgen
Thanks, a good article about how to use delegatecall safely is here: https://eip2535diamonds.substack.com/p/understanding-delegatecall-and-how
1 reply
0 recast
1 reaction

Abhishek Bhagat pfp
Abhishek Bhagat
@flamekaiser.eth
Thanks for sharing @mudgen
1 reply
0 recast
0 reaction

mudgen pfp
mudgen
@mudgen
You are welcome!
0 reply
0 recast
0 reaction