Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
xip: 10
title: Introduce Future SBT
description: fSBT (Future Soul Bound Token) is a type of token that has a limit on the number of transfers that can be made with it, and can be issued in advance or by a user's account to strengthen its SBT- or NFT-like characteristics, with the owner able to restrict its functions or burn it.
author: Erick You [email protected]
discussions-to: https://www.xdc.dev/web3isthefuture/wip-xip-proposal-introduce-future-sbt-3g1m
status: Draft
type: Standards Track
category (*only required for Standards Track): XRC
created: 2023-01-10
requires (*optional): 10
Abstract
fSBT (Future Soul Bound Token) is a type of token that has a limit on the number of transfers that can be made with it, and can be issued in advance or by a user's account to strengthen its SBT- or NFT-like characteristics, with the owner able to restrict its functions or burn it.
Motivation
A standard interface allows any tokens on XDC Network to be re-used by other applications: from wallets to decentralized exchanges.
Specification
Methods
NOTES:
0.4.17
(or above)false
fromreturns (bool success)
. Callers MUST NOT assume thatfalse
is never returned!name
returns the name of the token as a string
symbol
returns the symbol of the token as a string
totalSupply
Returns the total token supply.
balanceOf
Returns the account balance of another account with address
owner
.transferFrom
Transfers the ownership of a given token ID to another address.
approve
Approves another address to transfer the given token ID
limitedTransfer
Transfers _value amount of tokens from address _from to address _to, and MUST fire the Transfer event.
The limitedTransfer method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. The function SHOULD throw unless the _from account has deliberately authorized the sender of the message via some mechanism.
Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.
batchRevoke
Revokes the specified tokens.
batchAttest
Attests the specified tokens.
Events
Transfer
MUST trigger when tokens are transferred, including zero value transfers.
A token contract which creates new tokens SHOULD trigger a Transfer event with the
_from
address set to0x0
when tokens are created.Approval
MUST trigger on any successful call to
approve(address _spender, uint256 _value)
.Revoke
MUST trigger when tokens are revoked.
Attest
MUST trigger when tokens are attested.
OwnershipTransferred
MUST trigger when token ownership is transferred.
Rationale
This document was derived heavily from BNB Chain's BEP-179 and the interface is fully compatible with BNB Chain's fSBT. This makes it easy to reuse code and tools from the Ethereum ecosystem.
Reference Implementation
Examples of future SBTs can be used as a reference implementation, which are available at
Copyright
Copyright and related rights waived via CC0.