Submitted by cmichel
The locks implement three different approval types, see onlyKeyManagerOrApproved for an overview:
The MixinTransfer.transferFrom requires any of the three approval types in the onlyKeyManagerOrApproved modifier on the tokenId to authenticate transfers from from.
Notice that if the to address previously had a key but it expired only the _setKeyManagerOf call is performed, which does not clear approved if the key manager was already set to 0:
Its possible to sell someone a key and then claim it back as the approvals are not always cleared.
The _setKeyManagerOf function should not handle clearing approvals of single-token approvals (approved) as these are two separate approval types.
The transferFrom function should always call _clearApproval in the (previousExpiration <= block.timestamp) case.
julien51 (Unlock Protocol) confirmed and commented:
