Lipo 1s charger with only arduino

Massive red flags in the sums too.

Its a charger, the implication being that the battery could be flat, perhaps someone would even be idiot enough to attach a completly flat battery.

So the pin that is supposed to be high could be grounded through a 10ohm resistor, this will severly overload the pin, and you have to pray that it does not fail with it fried to 5v, never assume a pin will fail in a 'safe' way.

So now we have the battery connected to 5V direct, accepting all the current the supply can manage, not good.