LayerZero-v2 icon indicating copy to clipboard operation
LayerZero-v2 copied to clipboard

`sharedDecimals` function is defined as `pure` making it too restrictive

Open Mattijah opened this issue 1 year ago • 0 comments

The sharedDecimals function is defined as pure, which makes overriding in a subclass impossible if the value returned is a locally defined constant (not pre-set in the contract with a literal). The tutorial or suggestion mentioning overriding of sharedDecimals using view is therefore also non-functional https://docs.layerzero.network/v2/developers/evm/oft/quickstart#token-supply-cap. The interface IOFTdefines the function with view as well, which should really be used: https://github.com/LayerZero-Labs/LayerZero-v2/blob/142846c3d6d51e3c2a0852c41b4c2b63fcda5a0a/oapp/contracts/oft/interfaces/IOFT.sol#L104

Mattijah avatar Mar 30 '24 18:03 Mattijah