How Does the ‘Delegatecall’ Opcode Enable the Proxy Pattern?
The 'delegatecall' opcode executes code from a specified target contract (the logic contract) but crucially runs it within the context of the calling contract (the proxy contract). This means that any state changes made by the logic contract's code are saved to the storage of the proxy contract, effectively allowing the proxy to maintain its state while using external, changeable logic.