(2) During the existence of the contract, the sheriff and the deputies of the sheriff shall exercise such authority as may be vested in them by terms of the contract, including full power and authority to arrest for violations of all duly enacted ordinances of the contracting city. [1967 c.236 §1]