Quasi-potentials of the entropy functionals for scalar conservation laws