  We use the exact degeneracy formula of single-centred $\frac14$ BPS dyonic
black holes with unit torsion in 4D $N=4$ toroidally compactified heterotic
string theory to improve on the existing formulation of the corresponding
quantum entropy function obtained using supersymmetric localization. The result
takes the form of a sum over Euclidean backgrounds including orbifolds of the
Euclidean $AdS_2 \times S^2$ attractor geometry. Using an $N=2$ formalism, we
determine the explicit form of the Abelian gauge potentials supporting these
backgrounds. We further show how a rewriting of the degeneracy formula is
amenable, at a semi-classical level, to a gravitational interpretation
involving 2D Euclidean wormholes. This alternative picture is useful to
elucidate different aspects of the gravitational path integral capturing the
microstate degeneracies. We also comment on the relation between the associated
1D holographic models.
