> For the complete documentation index, see [llms.txt](https://docs.quickswap.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickswap.exchange/technical-reference/smart-contracts/v2-uniswap-fork-overview/pair-erc-20.md).

# Pair (ERC-20)

This documentation covers ERC-20 functionality for denominating pool tokens. For Uniswap-specific functionality, see Pair.

## Code

[`UniswapV2ERC20.sol`](https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint value);
```

Emitted each time an approval occurs via [approve](broken://pages/RRMrmoJ1PW7FNlmln1Wy) or [permit](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint value);
```

Emitted each time a transfer occurs via [transfer](broken://pages/RRMrmoJ1PW7FNlmln1Wy), [transferFrom](broken://pages/RRMrmoJ1PW7FNlmln1Wy), mint, or burn.

## Read-Only Functions

### name

```solidity
function name() external pure returns (string memory);
```

Returns `Uniswap V2` for all pairs.

### symbol

```solidity
function symbol() external pure returns (string memory);
```

Returns `UNI-V2` for all pairs.

### decimals

```solidity
function decimals() external pure returns (uint8);
```

Returns `18` for all pairs.

### totalSupply

```solidity
function totalSupply() external view returns (uint);
```

Returns the total amount of pool tokens for a pair.

### balanceOf

```solidity
function balanceOf(address owner) external view returns (uint);
```

Returns the amount of pool tokens owned by an address.

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint);
```

Returns the amount of liquidity tokens owned by an address that a spender is allowed to transfer via [transferFrom](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### DOMAIN\_SEPARATOR

```solidity
function DOMAIN_SEPARATOR() external view returns (bytes32);
```

Returns a domain separator for use in [permit](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### PERMIT\_TYPEHASH

```solidity
function PERMIT_TYPEHASH() external view returns (bytes32);
```

Returns a typehash for use in [permit](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### nonces

```solidity
function nonces(address owner) external view returns (uint);
```

Returns the current nonce for an address for use in [permit](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

## State-Changing Functions

### approve

```solidity
function approve(address spender, uint value) external returns (bool);
```

Lets `msg.sender` set their allowance for a spender.

* Emits [Approval](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### transfer

```solidity
function transfer(address to, uint value) external returns (bool);
```

Lets `msg.sender` send pool tokens to an address.

* Emits [Transfer](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### transferFrom

```solidity
function transferFrom(address from, address to, uint value) external returns (bool);
```

Sends pool tokens from one address to another.

* Requires approval.
* Emits [Transfer](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

### permit

```solidity
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
```

Sets the allowance for a spender where approval is granted via a signature.

* See Using Permit.
* Emits [Approval](broken://pages/RRMrmoJ1PW7FNlmln1Wy).

## Interface

```solidity
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2ERC20.sol';
```

```solidity
pragma solidity >=0.5.0;

interface IUniswapV2ERC20 {
  event Approval(address indexed owner, address indexed spender, uint value);
  event Transfer(address indexed from, address indexed to, uint value);

  function name() external pure returns (string memory);
  function symbol() external pure returns (string memory);
  function decimals() external pure returns (uint8);
  function totalSupply() external view returns (uint);
  function balanceOf(address owner) external view returns (uint);
  function allowance(address owner, address spender) external view returns (uint);

  function approve(address spender, uint value) external returns (bool);
  function transfer(address to, uint value) external returns (bool);
  function transferFrom(address from, address to, uint value) external returns (bool);

  function DOMAIN_SEPARATOR() external view returns (bytes32);
  function PERMIT_TYPEHASH() external pure returns (bytes32);
  function nonces(address owner) external view returns (uint);

  function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
```

## ABI

```typescript
import IUniswapV2ERC20 from '@uniswap/v2-core/build/IUniswapV2ERC20.json'
```

<https://unpkg.com/@uniswap/v2-core@1.0.0/build/IUniswapV2ERC20.json>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.quickswap.exchange/technical-reference/smart-contracts/v2-uniswap-fork-overview/pair-erc-20.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
