Open code423n4 opened 2 years ago
While the original EIP makes it optional, I do believe that it is reasonable to build a system that only works with the extended standard. An extended interface might make this more obvious but would not be a high priority.
In practice, one always expects decimals()
to be there. Making this a non-critical as it is best practices recommendation
Handle
hrkrshnn
Vulnerability details
Requiring a decimals method for ERC-20 tokens is non-standard
The ERC-20 token standard specifies that
However, there are several instances where this is required. Some of the instances (non-exhaustive) are given below:
In particular, according to the standard the revert comment "Payment currency is not ERC20" is incorrect. It is recommended to change this comment. It may also be more pedantic to use a second interface
ExtendedERC20
which has the functiondecimals()
and replace the above uses with that.