> For the complete documentation index, see [llms.txt](/llms.txt).

# Invalid delegate

The [Delegation Manager](/smart-accounts-kit/development/reference/glossary#delegation-manager)**Delegation Manager** The ERC-7710 component that validates and redeems delegations, including signature checks and caveat enforcer hooks. reverts with `InvalidDelegate()` in the following two cases.

## Account is not the delegate[​](#account-is-not-the-delegate "Direct link to Account is not the delegate")

The account redeeming the delegation is not the [delegate](/smart-accounts-kit/development/reference/glossary#delegate-account)**Delegate account** The account that receives delegated authority and can redeem a delegation under its constraints. specified in the delegation. The Delegation Manager checks that `msg.sender` matches the `delegate` field of the delegation, unless it's an [open delegation](/smart-accounts-kit/reference/delegation/#createopendelegation).

### Solution[​](#solution "Direct link to Solution")

Verify that the account redeeming the delegation matches the address in the delegation's `to` field. If the delegate is a smart account, send the [user operation](/smart-accounts-kit/development/reference/glossary#user-operation)**User operation** A pseudo-transaction object defined by ERC-4337 that describes what a smart account should execute. User operations are submitted to the alternate mempool managed by bundlers.from that smart account.

## Broken redelegation chain[​](#broken-redelegation-chain "Direct link to Broken redelegation chain")

When Delegation Manager validates a [redelegation chain](/smart-accounts-kit/guides/delegation/create-redelegation/), each child delegation's [delegator](/smart-accounts-kit/development/reference/glossary#delegator-account)**Delegator account** The account that creates and signs a delegation to grant limited authority to another account.must match the parent delegation's [delegate](/smart-accounts-kit/development/reference/glossary#delegate-account)**Delegate account** The account that receives delegated authority and can redeem a delegation under its constraints.. If any link in the chain fails this check, the authority is invalid.

### Solution[​](#solution-1 "Direct link to Solution")

Verify that the redelegation chain is consistent. For each pair of adjacent delegations, the child's `delegator` must be the parent's `delegate`.

This error can also occur if the delegations are not passed in the correct order. The delegation array order should be from leaf to root.

For example, if the delegation chain is Alice to Bob to Carol, the order should be following:

```
const rootDelegation = createDelegation({
  from: '0xAlice',
  to: '0xBob',
  //..
})

const leafDelegation = createDelegation({
  from: 'OxBob',
  to: '0xCarol',
  parentDelegation: rootDelegation,
  // ...
})

const data = DelegationManager.encode.redeemDelegations({
  // Make sure the order is from leaf to root.
  // Passing them in the wrong order causes the authority validation to fail.
  delegations: [[leafDelegation, rootDelegation]],
  modes: [ExecutionMode.SingleDefault],
  executions: [[execution]],
})

```
