# V1 → V2 migration

Registry V2 brings two key new features: batch delegation and subdelegations, all while reducing gas costs by 30-60%. Batch delegation lets users create multiple delegations in a single transaction. Subdelegation lets users split up the rights associated with a single token, for example pointing airdrop claiming to wallet B and governance rights to wallet C.

These are expansions on the core featureset of V1; if you simply wish to continue using V1-esque features then a direct migration table is provided below.&#x20;

## Migration

### **Delegating your wallet**

**v1**

```solidity
delegateForAll(delegate, value)
```

**v2**

```solidity
delegateAll(delegate, "", value)
```

> We've added the ability to use subdelegations which is what `""` is for.

### **Delegating a contract**

**v1**

```solidity
delegateForContract(delegate, contract_, value)
```

**v2**

```solidity
delegateContract(delegate, contract_, "", value)
```

> We've added the ability to use sub-delegations which is what `""` is for.

### Delegating Tokens

**v1**

```solidity
delegateForToken(delegate, contract_, tokenId, value)
```

**v2**

In v2, we've added support for fungible tokens and split up the token calls into 3 seperate functions.

**v2 - ERC721**

```solidity
delegateERC721(delegate, contract_, tokenId, "", value)
```

**v2 - Fungibles**

```solidity
delegateERC20(delegate, contract_, "", amount)
delegateERC1155(delegate, contract_, tokenId, "", amount)
```

> Users can now specify an amount when delegating fungible tokens

### Revoke Calls

**v1**

```solidity
revokeAllDelegates()
revokeDelegate(delegate)
revokeSelf(vault)
```

**v2**

These functions are removed in favor of using the delegate functions and providing `false` as the value.

**Fetching Incoming Delegations**

**v1**

```solidity
getDelegationsByDelegate(delegate)
```

**v2**

```solidity
getIncomingDelegations(delegate)
```

> All enumeration methods now return the same struct, no matter the delegation type

### Fetching Outgoing Delegations

**v1**

```solidity
getDelegatesForAll()
getDelegatesForContract()
getDelegatesForToken()
getContractLevelDelegations()
getTokenLevelDelegations()
```

**v2**

```solidity
getOutgoingDelegations(vault)
```

> These methods have all been rolled into one single enumeration that returns a list of all delegations a vault has issued

### Checking Wallet Delegations

**v1**

```solidity
checkDelegateForAll(delegate, vault)
```

**v2**

```solidity
checkDelegateForAll(delegate, vault, "")
```

### Checking Contract Delegations

**v1**

```solidity
checkDelegateForContract(delegate, vault, contract_)
```

**v2**

```solidity
checkDelegateForContract(delegate, vault, contract_, "")
```

### Checking Token Delegations

**v1**

```solidity
checkDelegateForToken(delegate, vault, contract_, tokenId, "")
```

**v2**

**v2 - ERC721**

```solidity
checkDelegateForERC721(delegate, vault, contract_, tokenId, "")
```

**v2 - Fungibles**

```solidity
checkDelegateForERC20(delegate, vault, contract_, "")
checkDelegateForERC1155(delegate, vault, contract_, tokenId, "")
```

> Fungible token queries return a uint256 instead of a boolean representing the amount delegated


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.delegate.xyz/upgrade-to-v2/v1-v2-migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
