Preheat the oven to 180°C/350˚F (conventional oven).
Place the softened butter and sugar in the bowl of a stand mixer and whisk until creamy.
Add the flour and salt and knead by hand until you have a smooth dough. Divide into two pieces.
Line the base of a square or round cake tin with baking parchment (not a springform tin) and place the first half of the pastry on top. Flatten with your fingers and a spoon.
Using a teaspoon, sprinkle dollops of dulce de leche over the base. Sprinkle with the chopped chocolate and cover with the second half of the pastry.
This is a bit trickier, but if you don't get it right, don't worry, it'll be fine once it's baked! Brush the pastry with the beaten egg.
Bake in the oven for about 30 minutes or until golden brown. It will be wobbly. That's because butter cake only firms up when it cools.
Cut into small pieces when it has cooled completely!