Make the pudding base:
Whisk the sugar, flour and cocoa powder together in a medium saucepan. Keep whisking as you add the milk in a steady stream, occasionally scraping the inner walls of the pan with your whisk to make a lump-free mixture. Whisk constantly over medium heat until it comes to a boil, 4 to 6 minutes. Count to 60 while continuously whisking once it boils. The mixture will be smooth and thick enough to coat the back of a spoon.
Scrape the contents of the pan into a shallow container, and cover with plastic wrap, pressing it directly against the surface of the pudding base to prevent a skin from forming. Let cool to room temperature, 40-60 minutes.
Make the frosting:
Bring 1 inch of water to a boil in a skillet, then turn off the heat. Place the chopped chocolate in a heat safe bowl and set the bowl in the skillet. Stir until the chocolate has melted. Remove the bowl from the heat to cool for 5 to 10 minutes. Do not allow the chocolate to solidify.
Beat the butter in a bowl of a stand mixer with the paddle attachment, or with a handheld mixer, on medium-high speed until smooth, 1 to 2 minutes. Reduce the speed to medium-low, and add the cool pudding base a few tablespoons at a time, waiting for each addition to be incorporated into the butter before proceeding. Add the vanilla, salt and melted chocolate.
On medium speed, mix until the buttercream is smooth and creamy, stopping to scrape the sides of the bowl as needed. The mixture may look curdled at first, then gradually it will smooth out - this might take as little as 30 seconds and as long as 8 minutes; take your cues from the frosting’s texture. When it is thickened and spreadable, it is ready to use.
Refrigerate the buttercream in an airtight container for up to 1 week. Let it return to room temperature before beating it back to a silky consistency; it may take a few minutes, so don't despair!