Suppose we want to find the electrostatic potential $\phi\_{0}$, with reference to infinity, at $r\_{0}$ resulting from a positive charge $q$ located at the origin. For simplicity, let us assume we are working in two dimensions.

[![enter image description here](https://i.stack.imgur.com/lB9wT.png)](https://i.stack.imgur.com/lB9wT.png)
By definition $\phi \_{0}$ is the work per unit charge required to bring a positive test charge that is very far away to the vicinity of $r\_{0}$.

$$\phi\_{0}=\int\_{\infty}^{r\_{0}}-\textbf{E}\cdot\textbf{dl}$$

decomposing $\textbf{dl}$ into two orthogonal vectors $$\textbf{dl}=\textbf{dr}+\textbf{dr}\_{\perp}$$

the integral becomes

$$\phi\_{0}=\int\_{\infty}^{r\_{0}}-\textbf{E}\cdot \textbf{dr}$$
We define $\hat{\textbf{r}}$ as the unit vector pointing radially away from $q$. 
 $\textbf{E}$ will be expressed as

$$\textbf{E}=\frac{q}{r^{2}}\hat{\textbf{r}}$$

and $\textbf{dr}$ as $$\textbf{dr}= \textrm{dr} \, \hat {\textbf{r}}$$

where, and I think this is important, $\textrm{r}$ starts from $\infty$ and goes all the way down to $r\_{0}$, in other words, $\textrm{r}$ is decreasing, thereby making $\textbf{dr}$ point in the $-\hat{\textbf{r}}$ direction. 

Going back to our integral 

$$\phi \_{0}= \int\_{\infty}^{r\_{0}}\frac{q}{r^2}\hat{\textbf{r}}\cdot \textrm{dr}\,\hat{\textbf{r}}$$
$$=\int\_{\infty}^{r\_{0}}\frac{q}{r^2}\textrm{dr}$$

In its final form 
$$\phi\_{0}=-\frac{q}{r\_{0}}$$

This result must certainly be incorrect since the potential ought to be positive. I suspect it is because of the way I set up $\textbf{dr}$, but I can't precisely pinpoint the incorrect step in the reasoning. Since $r$ is ranging from $\infty$ down to $0$, then $\textrm{dr} <0$, thus $\textbf{dr}$ is pointing in the correct direction. Where does the error lie in?