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

# Use approval revocation permission

[Advanced Permissions (ERC-7715)](/smart-accounts-kit/concepts/advanced-permissions/) supports the token approval revocation permission type that allows you to request permission to revoke existing token approvals on behalf of the user.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

- [Install and set up the Smart Accounts Kit.](/smart-accounts-kit/get-started/install/)
- [Configure the Smart Accounts Kit.](/smart-accounts-kit/guides/configure-toolkit/)
- [Create a session account.](/smart-accounts-kit/guides/advanced-permissions/execute-on-metamask-users-behalf/#3-set-up-a-session-account)

## Token approval revocation permission[​](#token-approval-revocation-permission "Direct link to Token approval revocation permission")

This permission type enables revoking existing token approvals on behalf of the user.

For example, a user signs an ERC-7715 permission that lets a dapp revoke any ERC-20 token allowances periodically, or during an ongoing exploit.

See the [token approval revocation permission API reference](/smart-accounts-kit/reference/advanced-permissions/permissions/#token-approval-revocation-permission) for more information.

- example.ts
- client.ts

```
import { sepolia as chain } from 'viem/chains'
import { walletClient } from './client.ts'

// Since current time is in seconds, convert milliseconds to seconds.
const currentTime = Math.floor(Date.now() / 1000)

// 30 days from now.
const expiry = currentTime + 60 * 60 * 24 * 30

const grantedPermissions = await walletClient.requestExecutionPermissions([
  {
    chainId: chain.id,
    expiry,
    // The requested permissions will be granted to the
    // session account.
    to: sessionAccount.address,
    permission: {
      type: 'token-approval-revocation',
      data: {
        erc20Approve: true,
        erc721Approve: false,
        erc721SetApprovalForAll: false,
        permit2Approve: true,
        permit2Lockdown: false,
        permit2InvalidateNonces: false,
        justification: 'Permission to revoke ERC-20 token approvals',
      },
      isAdjustmentAllowed: false,
    },
  },
])

```

```
import { createWalletClient, custom } from 'viem'
import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'

export const walletClient = createWalletClient({
  transport: custom(window.ethereum),
}).extend(erc7715ProviderActions())

```
