A stochastic model of autocatalytic reaction networks