> For the complete documentation index, see [llms.txt](https://v1.docs.blueberry.garden/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v1.docs.blueberry.garden/developer-guides/contracts/utils/ensureapprove.md).

# EnsureApprove

Ensure Approve is an abstract contract with the following function

#### \_ensureApprove

```solidity
function _ensureApprove(address token, address spender, uint256 amount) internal
```

This function is used to reset the approval for `spender` to zero and set it again to `amount`. The function calls the `approve` function of the `IERC20Upgradeable` interface to reset the approval to zero and then calls it again to set the approval to `amount`

**Parameters:**

| Name      | Type    | Description                           |
| --------- | ------- | ------------------------------------- |
| `token`   | address | the token adress to approve           |
| `spender` | address | the address of the spender to approve |
| `amount`  | uint256 | the amount to approve                 |
