Delegate
  • Overview
  • Delegating a wallet
  • Comparison with Others
  • FAQ
  • Audits
  • Integrate In Your Project
    • Smart Contract Examples
    • Token Ownership Claiming
  • Upgrade to V2
    • V2 is a Separate Contract
    • V1 → V2 migration
    • Batching
    • Subdelegations
  • Advanced Use Cases
    • Shadow Delegation
  • Delegate Market
    • Overview
    • FAQ
  • Gaming
    • Delegate for Gaming
  • Technical Documentation
    • Delegate Registry
      • Contract Addresses
      • IDelegateRegistry.sol
    • Javascript SDK
      • Installation / Importing
      • Setup
      • Check Delegations
        • checkDelegateForAll
        • checkDelegateForContract
        • checkDelegateForERC721
        • checkDelegateForERC1155
        • checkDelegateForERC20
      • Fetch Delegations
      • Delegate/Revoke
        • delegateAll
        • delegateContract
        • delegateERC721
        • delegateERC1155
        • delegateERC20
    • REST API
      • v2
      • v1
  • Resources
    • Media Kit
    • Github
    • Twitter
    • Live Stats
  • V1 Registry (Legacy)
    • Technical Documentation
Powered by GitBook
On this page
  • Migration
  • Delegating your wallet
  • Delegating a contract
  • Delegating Tokens
  • Revoke Calls
  • Fetching Outgoing Delegations
  • Checking Wallet Delegations
  • Checking Contract Delegations
  • Checking Token Delegations
  1. Upgrade to V2

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.

Migration

Delegating your wallet

v1

delegateForAll(delegate, value)

v2

delegateAll(delegate, "", value)

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

Delegating a contract

v1

delegateForContract(delegate, contract_, value)

v2

delegateContract(delegate, contract_, "", value)

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

Delegating Tokens

v1

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

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

v2 - Fungibles

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

Users can now specify an amount when delegating fungible tokens

Revoke Calls

v1

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

getDelegationsByDelegate(delegate)

v2

getIncomingDelegations(delegate)

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

Fetching Outgoing Delegations

v1

getDelegatesForAll()
getDelegatesForContract()
getDelegatesForToken()
getContractLevelDelegations()
getTokenLevelDelegations()

v2

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

checkDelegateForAll(delegate, vault)

v2

checkDelegateForAll(delegate, vault, "")

Checking Contract Delegations

v1

checkDelegateForContract(delegate, vault, contract_)

v2

checkDelegateForContract(delegate, vault, contract_, "")

Checking Token Delegations

v1

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

v2

v2 - ERC721

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

v2 - Fungibles

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

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

PreviousV2 is a Separate ContractNextBatching

Last updated 1 year ago