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.
Function | Interface | Implementation |
---|---|---|
delegateAll | 🔗 | 🔗 |
delegateAllFor | 🔗 | 🔗 |
delegateContract | 🔗 | 🔗 |
delegateContractFor | 🔗 | 🔗 |
Step by step directions
-
Set up environment variables.
Variable Meaning How to get it PRIVATE_KEY Your private key You can usually get it from the wallet REGISTRAR_ID The Royal ID of the registry If you know the registry’s address, use this function 🔗 -
If necessary, install Foundry 🔗.
-
Run these commands to use the
cast
command 🔗.Terminal window DELEGATE_REGISTRY=0x000000f1CABe81De9e020C9fac95318b14B80F14ENDPOINT=https://mainnet.base.orgcast send --rpc-url $ENDPOINT \--private-key $PRIVATE_KEY $DELEGATE_REGISTRY \"delegateAll(uint256, bytes32, bool)" $REGISTRAR_ID `cast to-bytes32 0x0` 1 -
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.