Skip to content

IOFT.sol doesn't include .decimals() function #191

@jaycoolslm

Description

@jaycoolslm

Why doesn't the IOFT.sol interface (https://github.com/LayerZero-Labs/LayerZero-v2/blob/main/packages/layerzero-v2/evm/oapp/contracts/oft/interfaces/IOFT.sol) include the standard ERC-20 .decimals() function?

This means when using something like hardhat and trying to query the decimals of an OFT, the following error throws:

TypeError: dstOftContract.decimals is not a function

A solution is to take the OFT address and use the standard ERC20 interface to find out the decimals e.g.

const erc20 = new Contract(dstOftContract.address, ERC20_DECIMALS_ABI, dstOftContract.provider)
localDecimals = await erc20.decimals()

However it would be nicer IMO if poss to call dstOftContract.decimals()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions