  Assuming an adiabatic evolution of a gamma-ray burst (GRB) fireball
interacting with an external medium, we calculate the hydrodynamics of the
fireball with energy injection from a strongly magnetic millisecond pulsar
through magnetic dipole radiation, and obtain the light curve of the optical
afterglow from the fireball by synchrotron radiation. Results are given both
for a homogeneous external medium and for a wind ejected by GRB progenitor. Our
calculations are also available in both ultra-relativistic and non-relativistic
phases. Furthermore, the observed R-band light curve of GRB{000301C} can be
well fitted in our model, which might provide a probe of the properties of GRB
progenitors.
