We present a novel miniaturized transmission-type optical attenuator based on optofluidic technology. A microfluidic chip has been developed which is fabricated on wafer scale, based on full-wafer-bonding with a dry film resist. The optical transmission of the chip can be changed simply by displacing a highly absorbent liquid with a transparent one. Due to the integration of an electrowetting actuator for driving the liquids, the attenuator is ultra-compact (11×23×1:6mm3) and does not need any external components. When using oil soluble dyes as the absorbent liquid, various transmission spectra can be defined. Depending on the input wavelength range, attenuations as high as 47 dB can be reached, while the switching times for a 2mm aperture can be as low as 100 ms.