Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP-6268: Untransferability Indicator for EIP-1155 #6268

Merged
merged 10 commits into from Feb 12, 2023
88 changes: 88 additions & 0 deletions EIPS/eip-6268.md
@@ -0,0 +1,88 @@
---
eip: 6268
title: Untransferability Indicator for EIP-1155
description: An extension of EIP-1155 for indicating the transferability of the token.
author: Yuki Aoki (@yuki-js)
discussions-to: https://ethereum-magicians.org/t/sbt-implemented-in-erc1155/12182
status: Draft
type: Standards Track
category: ERC
created: 2022-01-06
requires: 165, 1155
---

## Abstract

This EIP standardizes an interface indicating [EIP-1155](./eip-1155.md)-compatible token non-transferability using [EIP-165](./eip-165.md) feature detection.

## Motivation

Soulbound Tokens (SBT) are non-transferable tokens. While [EIP-5192](./eip-5192.md) standardizes non-fungible SBTs, a standard for Soulbound semi-fungible or fungible tokens does not yet exist. The introduction of a standard non-transferability indicator that is agnostic to fungibility promotes the usage of Souldbound semi-fungible or fungible 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.

Smart contracts implementing this standard MUST comform to the [EIP-1155](./eip-1155.md) specification.

Smart contracts implementing this standard MUST implement all of the functions in the `IERC6268` interface.

Smart contracts implementing this standard MUST implement the [EIP-165](./eip-165.md) supportsInterface function and MUST return the constant value true if `0xd87116f3` is passed through the interfaceID argument.

For the token identifier `_id` that is marked as `locked`, `locked(_id)` MUST return the constant value true and any functions that try transferring the token, including `safeTransferFrom` and `safeBatchTransferFrom` function MUST throw.

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IERC6268 {
/// @notice Either `LockedSingle` or `LockedBatch` MUST emit when the locking status is changed to locked.
/// @dev If a token is minted and the status is locked, this event should be emitted.
/// @param _id The identifier for a token.
event LockedSingle(uint256 _id);

/// @notice Either `LockedSingle` or `LockedBatch` MUST emit when the locking status is changed to locked.
/// @dev If a token is minted and the status is locked, this event should be emitted.
/// @param _ids The list of identifiers for tokens.
event LockedBatch(uint256[] _ids);

/// @notice Either `UnlockedSingle` or `UnlockedBatch` MUST emit when the locking status is changed to unlocked.
/// @dev If a token is minted and the status is unlocked, this event should be emitted.
/// @param _id The identifier for a token.
event UnlockedSingle(uint256 _id);

/// @notice Either `UnlockedSingle` or `UnlockedBatch` MUST emit when the locking status is changed to unlocked.
/// @dev If a token is minted and the status is unlocked, this event should be emitted.
/// @param _ids The list of identifiers for tokens.
event UnlockedBatch(uint256[] _ids);


/// @notice Returns the locking status of the token.
/// @dev SBTs assigned to zero address are considered invalid, and queries
/// about them do throw.
/// @param _id The identifier for a token.
function locked(uint256 _id) external view returns (bool);

/// @notice Returns the locking statuses of the multiple tokens.
/// @dev SBTs assigned to zero address are considered invalid, and queries
/// about them do throw.
/// @param _ids The list of identifiers for tokens
function lockedBatch(uint256[] _ids) external view returns (bool);
}
```

## Rationale

Needs discussion.

## Backwards Compatibility

This proposal is fully backward compatible with [EIP-1155](./eip-1155.md).

## Security Considerations

Needs discussion.

## Copyright

Copyright and related rights waived via [CC0](../LICENSE.md).