By employing a spin-encoded scheme, we achieve OR, AND, NOT, NAND and NOR logic gates via an L-shaped optical slot nanoantenna with a footprint of 300 nm by 300 nm, and a XNOR logic gate via a rectangle optical slot nanoantenna with a footprint of 220 nm by 60 nm.