Saltearse al contenido

Create delegation

Esta página aún no está disponible en tu idioma.

To create a delegation, the user (or another entity acting on the user’s behalf) calls one of the delegation functions. The same functions are also called to remove delegations.

FunctionInterfaceImplementation
delegateAll 🔗 🔗
delegateAllFor 🔗 🔗
delegateContract 🔗 🔗
delegateContractFor 🔗 🔗

Step by step directions

  1. Set up environment variables.

    VariableMeaningHow to get it
    PRIVATE_KEYYour private keyYou can usually get it from the wallet
    REGISTRAR_IDThe Royal ID of the registryIf you know the registry’s address, use this function 🔗
  2. If necessary, install Foundry 🔗.

  3. Run these commands to use the cast command 🔗.

    Terminal window
    DELEGATE_REGISTRY=0x000000f1CABe81De9e020C9fac95318b14B80F14
    ENDPOINT=https://mainnet.base.org
    cast send --rpc-url $ENDPOINT \
    --private-key $PRIVATE_KEY $DELEGATE_REGISTRY \
    "delegateAll(uint256, bytes32, bool)" $REGISTRAR_ID `cast to-bytes32 0x0` 1
  4. When you get the transaction hash, you can use a block explorer 🔗 to see the log entry with your delegation. Alternatively, you can use this function 🔗 with the registrar’s ID to see your delegation.