There are a lot of popular discussions about non-transferable tokens, with a good proposal at EIP-4973 - Account-bound Tokens
I have been working recently on a subordinate NFT (ERC-721 Subordinate), and I realized that before everything else, we must address the problem that an exchange must know if a token is transferable or not.
Before going into so many details (like in the EIP-4973), it is necessary to solve this simple problem.
How can we avoid people spending gas trying to transfer or approve a non-transferable token?
I think we must define a minimalistic interface that tells a caller if a token is not-transferable.
This way, a marketplace can check if an NFT supports the transferability interface.
If not, the caller assumes it is a standard ERC721 token, and it is transferable.
If it supports the interface, the caller executes
function transferable(uint tokenId) external view returns (bool);
to verify if that token is transferable or not. The function is helpful because a token can be locally transferable or transferable under certain circumstances. In a game that can depend of other assets, of the status of the gamer, on other related contracts.
Since a soulbound token is a sub-case of a more general case, an account-bound token like in EIP-4973 can just implement this simple interface and start from that.
It is hard to find a short name to define it in a way that can be applied to token that are always non-transferable and tokens for which the transferability can depend on the context.
I would suggest something like
interface IERCxxxx {
function transferable(uint256 tokenId) external view returns (bool);
}
Sometimes the most obvious name is the best.
ADD-ON
January 20th
As you can see in the discussion below, there are cases where the transferability of a token can be affected by the context, i.e., by its current owner or the possible recipient, but adding all those parameters in the equation over-complicates this proposal.
If a token may be non-transferable because of any internal reason, the function isTransferable
should return false. This interface must be consumed by external entities (marketplaces, exchanges, pools, etc.), and for them knowing the internal logic that makes a token potentially non-transferable is irrelevant.
ADD-ON
February 9th
With @stoicdev0 and other people, we proposed a new interface at
Initially, I had doubts about calling the function isNotTransferable
, but the naming makes sense because by default an ERC721 is transferrable, so, this interface focus on the case when an NFT may be not transferrable, and the function names follows that. (Still, I like simplicity and I would prefer to call the function isTransferable
)