Line an 8-inch square pan with parchment, leaving overhang for lifting.
Warm condensed milk and butter in a medium saucepan over low heat until just steaming.
Stir in chocolate chips and fine salt. Cook gently, stirring, until completely smooth.
Remove from heat. Stir in vanilla, then fold in nuts if using.
Spread mixture into the prepared pan and smooth the top. Sprinkle flaky salt if desired.
Chill until firm, about 2 hours. Lift out and cut into small squares.