Wherever a federal-aid secondary highway traverses or passes through any city or village, the county board may with the approval of the mayor and council or the chairman and board of trustees of such city or village, grade, pave, curb, gutter or hard-surface such highway lying in the corporate limits of such city or village; Provided, that such city or village may pay or contribute to the county highway fund of the county for paving or hard-surfacing such highway in an amount designated by the county board but not to exceed fifty percent of the cost of such project lying within the corporate limits of such city or village.