According to the BEP20 specification, the name method is optional:
OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
However, when creating a synth or pool, the name method of the given token is assumed to be implemented. Thus, BEP20 tokens not implementing the name method cannot be used to create a synth or a pool since the creation of the contracts always reverts.
Handle cases where the name method of the given token is not implemented. For example, check if the call to name reverts. If so, uses an empty string as the name instead.
Handle
shw
Vulnerability details
Impact
According to the BEP20 specification, the
name
method is optional:However, when creating a synth or pool, the
name
method of the given token is assumed to be implemented. Thus, BEP20 tokens not implementing thename
method cannot be used to create a synth or a pool since the creation of the contracts always reverts.Proof of Concept
Referenced code: Synth.sol#L41 Pool.sol#L48
Recommended Mitigation Steps
Handle cases where the
name
method of the given token is not implemented. For example, check if the call toname
reverts. If so, uses an empty string as the name instead.