Skip to content

Commit

Permalink
Add function locked(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDaub committed Jul 26, 2022
1 parent 6bdb1dd commit f6b0b57
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions EIPS/eip-5192.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,21 @@ The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SH

Upon minting a token implementing this EIP, it must be permanently inseparable from the receiving account. All [EIP-721](./eip-721.md) functions of the contract that transfer the token from one account to another must throw.

To aid recognition that an [EIP-721](./eip-721.md) token implements soulbinding via this EIP upon calling [EIP-721](./eip-721.md)'s `function supportsInterface(bytes4 interfaceID) external view returns (bool)` with EIP-5192's `SOULBOUND_VALUE=0x9e7d7f8` as `bytes4 interfaceID`, a contract implementing this EIP must return `true`.

We compute `SOULBOUND_VALUE` by running the string "soulbound" through `keccak256` and casting it to a `bytes4`:

```solidity
bytes4 constant SOULBOUND_VALUE = bytes4(keccak256("soulbound")); // 0x9e7ed7f8;
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
interface IERC5192 {
/// @notice Returns the locking status of an Soulbound Token
/// @dev SBTs assigned to zero address are considered invalid, and querie
/// about them do throw.
/// @param tokenId The identifier for an SBT.
function locked(uint256 tokenId) external view returns (bool);
}
```

To aid recognition that an [EIP-721](./eip-721.md) token implements soulbinding via this EIP upon calling [EIP-721](./eip-721.md)'s `function supportsInterface(bytes4 interfaceID) external view returns (bool)` with `interfaceID=0xb45a3c0e`, a contract implementing this EIP must return `true`.

## Rationale

The above model is the simplest possible path towards a canonical interface for Soulbound tokens. It reflects upon the numerous Soulbound token implementations that simply revert upon transfers.
Expand Down

0 comments on commit f6b0b57

Please sign in to comment.