-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
eip: 7558 | ||
title: Minimal Lockable Range NFTs | ||
description: A minimal interface for soulbinding multiple ERC-721 NFTs | ||
author: Hans Bergren (@0xCLARITY) | ||
discussions-to: https://ethereum-magicians.org/t/erc-7558-minimal-lockable-range-nfts/16668 | ||
status: Draft | ||
type: Standards Track | ||
category: ERC | ||
created: 2023-11-15 | ||
requires: 165, 721 | ||
--- | ||
|
||
## Abstract | ||
|
||
This proposal extends [ERC-721](./eip-721.md). It proposes a minimal interface to make both individual tokens and a contiguous range of tokenIds soulbound (locked). | ||
|
||
## Motivation | ||
|
||
Other existing soulbound / lockable standards emit events that only include a single `tokenId`. This makes it gas-prohibitive to lock or unlock all of the tokens in any contiguous range, including potentially locking/unlocking the entire 721 contract. | ||
|
||
This proposal captures the use-cases covered by existing proposals, yet also allows for range operations around soulbinding/locking tokens. | ||
|
||
## Specification | ||
|
||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. | ||
|
||
### Contract Interface | ||
|
||
The interface is defined as follows: | ||
|
||
```solidity | ||
// ERC165 interfaceId 0x75587558 | ||
interface IERC7558 is IERC5192 { | ||
/// @notice Emitted when the locking status for a range of tokens is changed to locked. | ||
event RangeLocked(uint256 _fromTokenId, uint256 _toTokenId); | ||
/// @notice Emitted when the locking status for a range of tokens is changed to unlocked. | ||
event RangeUnlocked(uint256 _fromTokenId, uint256 _toTokenId); | ||
} | ||
``` | ||
|
||
The Locked/Unlocked or RangeLocked/RangeUnlocked event MUST be emitted when the locking status of a token, or a consecutive range of tokens, is changed. | ||
|
||
It is assumed that all tokens start out unlocked, and no event emission is necessary to indicate that. | ||
|
||
NOTE: This inherits the `Locked(uint256)` and `Unlocked(uint256)` events , and the `locked(uint256) returns(bool)` function defined on [ERC-5192](./eip-5192.md). | ||
|
||
The [ERC-165](./eip-165.md) interfaceId is `0x75587558`. | ||
|
||
> NOTE: The ERC-165 identifier doesn't strictly follow ERC-165 calculations, but there is prior art to assigning a custom identifier to avoid conflict or for ERCs that do not include any functions, like [ERC-4906](./eip-4906.md) | ||
## Rationale | ||
|
||
This standard optimizes gas consumption for bulk token operations in soulbound contracts. | ||
|
||
Using the `locked` function facilitates interoperability with other soulbound/lockable proposals. | ||
|
||
## Backwards Compatibility | ||
|
||
This proposal is fully backward compatible with [ERC-721](./eip-721.md). | ||
|
||
## Security Considerations | ||
|
||
There are no security considerations related directly to the implementation of this standard. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](../LICENSE.md). |