Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 932 Bytes

delegatecall-untrusted-callee.md

File metadata and controls

12 lines (8 loc) · 932 Bytes

Delegatecall to Untrusted Callee

Delegatecall is a special variant of a message call. It is almost identical to a regular message call except the target address is executed in the context of the calling contract and msg.sender and msg.value remain the same. Essentially, delegatecall delegates other contracts to modify the calling contract's storage.

Since delegatecall gives so much control over a contract, it's very important to only use this with trusted contracts such as your own. If the target address comes from user input, be sure to verify that it is a trusted contract.

Sources