parse contract into context