Skip to content

rescueLostKitty can be replaced with a check #5

@Arachnid

Description

@Arachnid

Description

rescueLostKitty exists to restore ownership of kitties accidentally transferred to the token contract itself. This can be replaced by a simple check on transfer that prevents this happening in the first place.

Scenario

  1. User transfers a kitty to the token contract
  2. rescueLostKitty is called.

Impact

Some inconvenience for the user and for the maintainers of the contract.

Reproduction

See Scenario.

Fix

Add a check require(to != address(this)) in the transfer function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions