Reading _decimals from the IERC20 interface

I need to read the _decimals value from the IERC20 interface on the Zeppelin contract. The problem is that it’s a private value on the ERC20Detailed and is not included in the IERC20 interface. With Zeppelin contracts, is there a way to read the decimals value of an arbitrary erc20?

:computer: Environment

:memo:Details

:1234: Code to reproduce

1 Like

Hi @michaelcohen716,

Welcome to the community :wave:

Decimals isn’t part of IERC20. You could just use ERC20Detailed for a specific contract address. Whilst _decimals is private you can read the value using decimals()

Let me know if you have more questions.

1 Like