Delegatecall Function Misuse

Architecture

Delegatecall function misuse occurs when a smart contract triggers an external call to an untrusted or maliciously crafted contract, effectively executing that external code within the context of the calling contract. This operation forces the caller to grant the callee full access to its own storage, state, and balance. In the realm of financial derivatives and automated market makers, this design flaw allows an attacker to manipulate internal accounting or drain collateral pools by modifying storage slots that should remain immutable.