Skip to content
Smart contracts Audit finding Intermediate

Accesstoken sol is not erc721 compliant

The AccessToken contract's supportsInterface function returns false for the ERC721 interface ID because the super call resolves only to the ERC2981 implementation. As a result, NFT marketplaces, wallets and bridges that rely on ERC165 detection may fail to recognise the token as ERC721-compliant.

Kaysoft Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

57134 sc insight accesstoken sol is not erc721 compliant

Submitted on Oct 23rd 2025 at 19:18:51 UTC by @kaysoft for Audit Comp | Belong

Description

Brief / Intro

AccessToken.sol is an ERC721 contract but its supportsInterface(...) function returns false for the ERC721 interface ID.

When NFT marketplaces, wallets and NFT bridges try to interact with AccessToken, they call supportsInterface(...) to detect implemented interfaces. Currently supportsInterface(...) returns false for the ERC721 interface ID (0x80ac58cd).

Vulnerability Details

According to ERC-721 specification:

Every ERC-721 compliant contract must implement the ERC721 and ERC165 interfaces

The supportsInterface(...) function in AccessToken.sol currently returns false for the ERC721 interface ID (0x80ac58cd). This is caused by incorrect usage of super.supportsInterface(...) combined with Solidity inheritance linearization — the super call resolves to the implementation of the most derived parent according to C3 linearization. In the current contract layout, super.supportsInterface(...) resolves to the ERC2981 implementation, so the ERC721 parent implementation is not checked.

Current implementation snippet:

Solidity
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC2981) returns (bool) {
        bool result;
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ICreatorToken: 0xad0d7f6c, ILegacyCreatorToken: 0xa07d229a.
            // ERC4906: 0x49064906, check https://eips.ethereum.org/EIPS/eip-4906.
            result := or(or(eq(s, 0xad0d7f6c), eq(s, 0xa07d229a)), eq(s, 0x49064906))
        }

        return result || super.supportsInterface(interfaceId);//@audit super only ref ERC2981 not ERC721
    }

Impact Details

  • AccessToken may not integrate with existing NFT marketplaces and wallets (they rely on ERC165 supportsInterface to detect ERC721 support).

Recommendation

Replace the single super.supportsInterface(interfaceId) call with explicit checks for both parent implementations so both ERC2981 and ERC721 interface checks are performed. Example patch:

Diff
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC2981) returns (bool) {
        bool result;
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ICreatorToken: 0xad0d7f6c, ILegacyCreatorToken: 0xa07d229a.
            // ERC4906: 0x49064906, check https://eips.ethereum.org/EIPS/eip-4906.
            result := or(or(eq(s, 0xad0d7f6c), eq(s, 0xa07d229a)), eq(s, 0x49064906))
        }

--        return result || super.supportsInterface(interfaceId);
++        return result || ERC2981.supportsInterface(interfaceId) || ERC721.supportsInterface(interfaceId);
    }

This ensures both parents' supportsInterface implementations are considered.

Proof of Concept

{% stepper %} {% step %}

Prepare test

Copy and paste the test below into accessToken.test.ts file in the 'Deployment' test suite. {% endstep %}

{% step %}

Run test

Run the test suite:

yarn test {% endstep %}

{% step %}

Expected failing test

The test demonstrates that AccessToken.sol#supportsInterface(...) returns false for both ERC721 and ERC721Metadata interface IDs.

Solidity
it('Should support erc721 and erc721metadata interface ids', async () => {

      const {        
        accessTokenEth,
      } = await loadFixture(fixture);

      //ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f
      const interfaceIdIERC721 = '0x80ac58cd'; // ERC721: 0x80ac58cd
      const interfaceIdIERC721Metadata = '0x5b5e139f'; // ERC721Metadata: 0x5b5e139f
      
      // Returns false for both  ERC721: 0x80ac58cd and ERC721Metadata: 0x5b5e139f
      expect(await accessTokenEth.supportsInterface(interfaceIdIERC721)).to.be.false;
      expect(await accessTokenEth.supportsInterface(interfaceIdIERC721Metadata)).to.be.false;
      
    });

{% endstep %} {% endstepper %}

The original report as published on Immunefi, by kaysoft. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the use of a single super.supportsInterface call, which under Solidity's inheritance linearisation resolves only to the ERC2981 parent and skips the ERC721 parent.

Impact

AccessToken may not integrate with existing NFT marketplaces and wallets that rely on ERC165 supportsInterface to detect ERC721 support.

What the attacker needed

None

The fix

The single super.supportsInterface call should be replaced with explicit checks for both ERC2981 and ERC721 parent implementations.

How it was found

  1. Add the provided test to the accessToken test file in the Deployment suite.
  2. Run the test suite with yarn test.
  3. Observe that supportsInterface returns false for the ERC721 and ERC721Metadata interface IDs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

ERC721 is the standard for non-fungible tokens (NFTs). A helper function called supportsInterface lets other programs ask a contract which standards it follows. Here the contract says it does not follow ERC721, so tools that check first may refuse to work with it.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by Kaysoft

View all

22 more disclosed reports, best first.

More from Belong

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.