purchase contract function
purchase contract function