Skip to content

Confusing Usage of payable #184

@alex-ppg

Description

@alex-ppg

Description

The payable modifier appears to be enforced by the interfaces of @solidstate's IERC721, however, the actual SolidStateERC721 implementation contains a dedicated hook system to prohibit non-zero msg.value transactions.

Recommendation

The payable modifier should either be removed from the interface definition or the internal hook system should be removed (i.e. _handleApproveMessageValue) to actually take advantage of the gas optimization provided by payable.

Rationale

Currently, the system simply imposes additional checks on itself significantly increasing the gas cost of the contract whilst retaining the same behaviour as if payable was never defined. A little bit more background as to why payable is specified in the interface would greatly help in judging the correct action.

To note, removing payable is still compliant with the EIP-721 standard. For more background, consult first bullet point in: https://eips.ethereum.org/EIPS/eip-721#caveats

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