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
- User transfers a kitty to the token contract
- 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.
Description
rescueLostKitty exists to restore ownership of kitties accidentally transferred to the token contract itself. This can be replaced by a simple check on
transferthat prevents this happening in the first place.Scenario
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 thetransferfunction.