"would-be witty or clever person," 1854, from smart (n.) + -y (3). Extended form smarty-pants first attested 1939.
smart aleck; smart-ass, wise-ass • Most often used in address: I will bid seven on hearts, smarty (1861+)