I like this interface. I don’t like, however, when we — the development community — is forced to choose between similar interfaces. So, I would suggest a change.
If instead of
interface IERC5058 {
event Locked(address indexed operator, address indexed from, uint256 indexed tokenId, uint256 expired);
event Unlocked(address indexed operator, address indexed from, uint256 indexed tokenId);
event LockApproval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event LockApprovalForAll(address indexed owner, address indexed operator, bool approved);
function lockerOf(uint256 tokenId) external view returns (address locker);
function lock(uint256 tokenId, uint256 expired) external;
function unlock(uint256 tokenId) external;
function lockApprove(address to, uint256 tokenId) external;
function setLockApprovalForAll(address operator, bool approved) external;
function getLockApproved(uint256 tokenId) external view returns (address operator);
function isLockApprovedForAll(address owner, address operator) external view returns (bool);
function isLocked(uint256 tokenId) external view returns (bool);
function lockExpiredTime(uint256 tokenId) external view returns (uint256);
}
You extend ERC5192 — which is in the final stage and will most likely be used in standard contracts — and change the code as
interface IERC5192 {
event Locked(address indexed operator, address indexed from, uint256 indexed tokenId, uint256 expired);
event Unlocked(address indexed operator, address indexed from, uint256 indexed tokenId);
function locked(uint256 tokenId) external view returns (bool);
}
interface IERC5058 is IERC5192 {
event LockApproval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event LockApprovalForAll(address indexed owner, address indexed operator, bool approved);
function lockerOf(uint256 tokenId) external view returns (address locker);
function lock(uint256 tokenId, uint256 expired) external;
function unlock(uint256 tokenId) external;
function lockApprove(address to, uint256 tokenId) external;
function setLockApprovalForAll(address operator, bool approved) external;
function getLockApproved(uint256 tokenId) external view returns (address operator);
function isLockApprovedForAll(address owner, address operator) external view returns (bool);
function lockExpiredTime(uint256 tokenId) external view returns (uint256);
}
The only change is that the function isLocked
is renamed locked
. That will of course change the interfaceId, but since it is in a draft stage, it would make a lot of sense and would also facilitate the approval of EIP 5058.