---
eip: 4987
label: ERC-4987
title: Held token interface
status: Stagnant
type: Standards Track
category: ERC
created: 2021-09-21
requires: 20, 165, 721, 1155
official: https://eips.ethereum.org/EIPS/eip-4987
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-4987.md
canonical: https://eips.huatuo.xyz/eip-4987/
lang: en
tldr: Lets staking pools, vaults and other contracts that hold tokens report who the real (functional) owner is, so depositing an NFT or token does not break governance votes, gated access or PFP checks.
tags: [nft, defi, ownership, staking, interface]
---

# ERC-4987: Held token interface

> Interface to query ownership and balance of held tokens

**TL;DR:** Lets staking pools, vaults and other contracts that hold tokens report who the real (functional) owner is, so depositing an NFT or token does not break governance votes, gated access or PFP checks.

## What problem does it solve?

When you deposit a token into a staking contract, lending pool, vesting vault or fractionalisation contract, the token's `ownerOf` or `balanceOf` now points at that contract, not at you. Any system that checks ownership (a governance vote, a token-gated Discord, a game, a PFP verifier) suddenly thinks you own nothing.

So users must choose between earning yield and keeping the utility of their tokens. ERC-4987 gives holder contracts a standard way to say "this token is held here on behalf of *this* user".

## How it works

There is one small interface per token type, each detectable through [ERC-165](/eip-165/):

| Interface | ERC-165 ID | Main function |
| --- | --- | --- |
| `IERC20Holder` | `0x74c89d54` | `heldBalanceOf(token, owner)` |
| `IERC721Holder` | `0x16b900ff` | `heldOwnerOf(token, tokenId)`, `heldBalanceOf(token, owner)` |
| `IERC1155Holder` | `0xced24c37` | `heldBalanceOf(token, owner, tokenId)` |

Each also emits `Hold` when tokens are deposited and `Release` when they are returned. The `token` address parameter lets one holder contract manage many token contracts at once.

A **consumer** that wants the functional owner does a chained lookup: read `ownerOf`; if the owner is a contract that supports the holder interface, ask it for `heldOwnerOf`; if that returns a non-zero address, use it.

## Sample code

Consumer-side lookup of the functional owner of an [ERC-721](/eip-721/) token:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IERC721Holder {
    function heldOwnerOf(address tokenAddress, uint256 tokenId) external view returns (address);
    function heldBalanceOf(address tokenAddress, address owner) external view returns (uint256);
}

library FunctionalOwner {
    bytes4 constant HOLDER_ID = 0x16b900ff;

    function of(IERC721 token, uint256 tokenId) internal view returns (address) {
        address owner = token.ownerOf(tokenId);
        if (owner.code.length == 0) return owner; // EOA

        try IERC165(owner).supportsInterface(HOLDER_ID) returns (bool ok) {
            if (!ok) return owner;
        } catch {
            return owner;
        }

        try IERC721Holder(owner).heldOwnerOf(address(token), tokenId) returns (address user) {
            if (user != address(0)) return user;
        } catch {}
        return owner;
    }
}
```

Note: the name `IERC721Holder` here is ERC-4987's interface, not OpenZeppelin's unrelated `IERC721Receiver` helper.

## Things to know

- **Status: Stagnant.** It is not in wide use; check whether the vaults you care about actually implement it.
- A malicious contract can implement the interface and report any owner it likes. Consumers should only trust holder contracts they know, and sanity-check that the holder really owns the tokens it reports.
- Existing token contracts need no changes; only holders and consumers do.
- The reverse question, how much value is locked *inside* an NFT, is addressed by [ERC-4353](/eip-4353/).


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-4987
