ERC20's Transition from Contract to Component

Hello OpenZeppelin Community,

I've been working with a modified version of the ERC20 token standard from OpenZeppelin, particularly adapted for the Cairo language. Recently, I've noticed that OpenZeppelin has migrated the ERC20 from being a standalone contract to a component-based structure. This piqued my curiosity, and I'm seeking to understand the rationale behind this significant change.

Context of Inquiry

With OpenZeppelin's recent update, ERC20 is now defined as a component rather than a direct contract. My question revolves around understanding:

  • Is this transition primarily to make the ERC20 standard more modular and importable?

I appreciate any insights or explanations you can provide. Thank you beforehand.

Indeed, the purpose of our library is to provide the building blocks for people to build their own contracts, and Cairo smart contracts are not extensible. You can read more about how we design our components in here. We also have (very few) smart contracts that we call presets but they're super basic and, as explained, not extensible.

I recommend you check out the Wizard for Cairo to get a sense on how to use and combine different components to build custom contracts.

1 Like