Overview
ERC-721 compliant contracts MAY implement this EIP to provide standard methods of locking and unlocking the token at its current owner address.
Token owner MAY lock
the token and assign locker
to some address
using lock(uint256 tokenId, address _locker)
function, this MUST set locker
to _locker
. Token owner or approved MAY lock
the token using lock(uint256 tokenId)
function, this MUST set locker
to msg.sender
. Token MAY be unlocked
by locker
using unlock
function. unlock
function MUST delete locker
mapping and default to address(0)
.
If the token is locked
, the lockerOf
function MUST return an address that is locker
and can unlock
the token. For tokens that are not locked
, the lockerOf
function MUST return address(0)
.
lock
function MUST revert if token is not already locked. unlock
function MUST revert if token is not locked. ERC-721 approve
function MUST revert if token is locked. ERC-721 _tansfer
function MUST revert if token is locked. ERC-721 _transfer
function MUST pass if token is locked and msg.sender
is approved
and locker
both. After ERC-721 _transfer
, values of locker
and approved
MUST be purged.
Token MAY be transferred and locked
, and OPTIONAL setup approval
to locker
using transferAndLock
function. This is RECOMMENDED for use-cases where Token transfer and subsequent revocation is REQUIRED.
INTERFACE
Last updated