OpenZeppelin / OpenZeppelin/cairo-contracts

Docs: ERC20 dispatcher import path differs in current OpenZeppelin Cairo versions

Open
#1,650 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
909
Forks
397
Avg merge
2d 4h
Merged PRs (30d)
4

Description

Description

While following the Interfaces and Dispatchers guide, I ran into a mismatch between the documented import path and the one required by the current OpenZeppelin Cairo crate structure.

The docs show examples like:

use openzeppelin_interfaces::erc20::{
    IERC20Dispatcher,
    IERC20DispatcherTrait,
};

However, in recent OpenZeppelin Cairo versions, the working import path is:

use openzeppelin::interfaces::token::erc20::{
    IERC20Dispatcher,
    IERC20DispatcherTrait,
};

The underlying concept explained in the docs is correct (dispatcher + dispatcher trait must be in scope), but the module path differs depending on how interfaces are organized in the current crate.

This caused some confusion because the documented path does not compile unless openzeppelin_interfaces is added as a separate dependency, while the re-exported path under openzeppelin::interfaces::token::erc20 works out of the box.

Suggestion:
It might help to either:

  • Mention the version-specific import path, or
  • Add a short note clarifying that interface dispatcher paths may differ by OpenZeppelin Cairo version and that developers should rely on compiler resolution.

Happy to help clarify further if needed.


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Interfaces and Dispatchers guide and compare its documented openzeppelin_interfaces::erc20 import with the current openzeppelin::interfaces::token::erc20 path described in the issue. Update the guide or add the version-specific clarification so readers can identify a working dispatcher import path without adding an unnecessary dependency.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.