Skip to content

propose xip-fSBT.md - #13

Open
web3isthefuture wants to merge 1 commit into
XDC-Community:mainfrom
catze-labs:main
Open

propose xip-fSBT.md#13
web3isthefuture wants to merge 1 commit into
XDC-Community:mainfrom
catze-labs:main

Conversation

@web3isthefuture

Copy link
Copy Markdown

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 erick@catze.xyz
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

functionname()publicviewreturns(string)

symbol

returns the symbol of the token as a string

functionsymbol()publicviewreturns(string)

totalSupply

Returns the total token supply.

functiontotalSupply()externalviewreturns(uint256)

balanceOf

Returns the account balance of another account with address owner.

functionbalanceOf(addressowner)externalviewreturns(uint256)

transferFrom

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

functiontransferFrom(addressfrom,addressto,uint256tokenId)public

approve

Approves another address to transfer the given token ID

functionapprove(addressto,uint256tokenId)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.

functionlimitedTransfer(address_from,address_to,uint256_value)publicreturns(boolsuccess)

batchRevoke

Revokes the specified tokens.

functionbatchRevoke(uint256[]memory_tokenIds)publicreturns(boolsuccess)

batchAttest

Attests the specified tokens.

functionbatchAttest(uint256[]memory_tokenIds)publicreturns(boolsuccess)

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.

eventTransfer(addressindexed_from,addressindexed_to,uint256_value)

Approval

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

eventApproval(addressindexed_owner,addressindexed_spender,uint256_value)

Revoke

MUST trigger when tokens are revoked.

eventRevoke(uint256indexed_tokenId)

Attest

MUST trigger when tokens are attested.

eventAttest(uint256indexed_tokenId)

OwnershipTransferred

MUST trigger when token ownership is transferred.

eventOwnershipTransferred(uint256indexed_tokenId,addressindexed_prevOwner,addressindexed_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 freeto 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

@web3isthefuture