Abstract Metal contacts to two-dimensional semiconductors play a crucial role in determining the electrical performance of the electronic devices. However, traditional three-dimensional metal deposition processes will bring damage to two-dimensional semiconductors and cause significant Fermi-level-pinning effects. In this work, we report a hexagonal boron nitride (h-BN)-assisted-transferred method for metal contacts to few-layered InSe for construction of two-dimensional functional electronic devices. Using transferred Pt electrodes as the contact, p-type dominated ambipolar conduction behavior with the hole Schottky barrier height (SBH) approaching 0 meV was observed in field-effect transistors (FETs) based on multilayered InSe. Based on this, using a dual-gate modulating method, multiple types of InSe homojunctions, including p-p, n-n, p-n and n-p junctions, could be constructed. For InSe p-n homojunctions, a current rectification ratio of over 104 and optoelectronic detection capabilities were achieved. Furthermore, a complementary metal-oxide-semiconductor (CMOS) inverter with an ultra-high voltage gain exceeding 60 at VDD = -1 V was constructed. Our h-BN-assistedtransferred metal contact method can be easily extended to other two-dimensional semiconductors for the construction of complementary electronic and optoelectronic devices.