Transformation of graphene flakes to fullerenes assisted by Ni clusters is investigated using molecular dynamics simulations. The bond-order potential for Ni-C systems is developed. The potential reproduces the experimental and first-principles data on the physical properties of pure Ni as well as on relative energies of carbon species on Ni surfaces and in Ni bulk. The potential is applied for molecular dynamics simulations of the transformation of graphene flakes consisting of 50 -400 atoms with and without Ni clusters attached. Free fullerenes, fullerenes with Ni clusters attached from outside and fullerenes encapsulating Ni clusters (Ni endofullerenes) are observed to form in the presence of Ni clusters consisting of 5-80 atoms. Moreover, a new type of heterofullerenes with a patch made of a Ni cluster is found to form as an intermediate structure during the transformation. The Ni clusters are shownto reduce the activation energy for the graphene-fullerene transformation from 4.0 eV to 1.5 -1.9 eV,