Beat Eggs & Sugar: Mix sugar and egg yolks in a large bowl until creamy.
Add Dry Ingredients: Blend in cocoa powder, cornstarch, and salt until smooth.
Stir in Milk: Pour in the milk and gently mix until fully combined.
Cook the Custard: Transfer mixture to a saucepan and cook over medium heat, stirring constantly, until thickened and able to coat the back of a metal spoon.
Add Flavorings: Remove from heat and stir in butter and vanilla until melted and smooth.
Fill the Pie Shell: Pour the warm chocolate filling into the prepared pastry shell.
Chill: Refrigerate for 2 to 4 hours, or until fully set.
Garnish: Top with whipped topping just before serving.