Complete the contract validator: check required fields exist, check their types, and flag unexpected fields.