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

propose xip-fSBT.md #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

web3isthefuture
Copy link


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:

  • The following specifications use syntax from Solidity 0.4.17 (or above)
  • Callers MUST handle false from returns (bool success). Callers MUST NOT assume that false is never returned!

name

returns the name of the token as a string

function name() public view returns (string)

symbol

returns the symbol of the token as a string

function symbol() public view returns (string)

totalSupply

Returns the total token supply.

function totalSupply() external view returns (uint256)

balanceOf

Returns the account balance of another account with address owner.

function balanceOf(address owner) external view returns (uint256)

transferFrom

Transfers the ownership of a given token ID to another address.

function transferFrom(address from, address to, uint256 tokenId) public

approve

Approves another address to transfer the given token ID

function approve(address to, uint256 tokenId) public

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.

function limitedTransfer(address _from, address _to, uint256 _value) public returns (bool success)

batchRevoke

Revokes the specified tokens.

function batchRevoke(uint256[] memory _tokenIds) public returns (bool success)

batchAttest

Attests the specified tokens.

function batchAttest(uint256[] memory _tokenIds) public returns (bool success)

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 to 0x0 when tokens are created.

event Transfer(address indexed _from, address indexed _to, uint256 _value)

Approval

MUST trigger on any successful call to approve(address _spender, uint256 _value).

event Approval(address indexed _owner, address indexed _spender, uint256 _value)

Revoke

MUST trigger when tokens are revoked.

event Revoke(uint256 indexed _tokenId)

Attest

MUST trigger when tokens are attested.

event Attest(uint256 indexed _tokenId)

OwnershipTransferred

MUST trigger when token ownership is transferred.

event OwnershipTransferred(uint256 indexed _tokenId, address indexed _prevOwner, address indexed _newOwner)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant