> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-add-b20-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IB20.approve

> Generated B20 reference for approve(address,uint256).

[Related concept](/base-chain/specs/upgrades/beryl/b20)

## Signature

```solidity theme={null}
function approve(address spender, uint256 amount) external returns (bool);
```

| Field               | Value                      |
| ------------------- | -------------------------- |
| Selector            | `0x095ea7b3`               |
| Canonical signature | `approve(address,uint256)` |

## Description

Sets `spender`'s allowance to `amount`. Not gated by any policy or by pause. Emits `Approval`.
Dev: Reverts with `InvalidApprover` when `msg.sender == address(0)`.
Dev: Reverts with `InvalidSpender` when `spender == address(0)`.
Param: spender Account being granted the allowance.
Param: amount  Allowance amount.
Return: Always `true` on success.

## Access control

Read-only or ERC-20-standard access rules unless the NatSpec states otherwise.

## Policy interaction

No direct policy interaction.

## Example

```solidity theme={null}
IB20(target).approve(arg0, arg1);
```

## Related

* [IB20 reference](/base-chain/specs/upgrades/beryl/b20/specification/reference/interfaces/IB20)
* [Constants & addresses](/base-chain/specs/upgrades/beryl/b20/specification/reference/constants-and-addresses)
