BSC-20 protocol

Concept

  • Create BSC-20 with the deploy function

  • Mint an amount of BSC-20's with the mint function

  • Transfer an amount of BSC-20's with the transfer function

BSC-20 balance state can be found by aggregating all of these function's activity together.

Notes

  • The first deployment of a ticker is the only one that has claim to the ticker. Tickers are not case sensitive (BNB = bnb).

  • If two events occur in the same block, prioritization is assigned via order they were confirmed in the block. (first to last).

  • The mint function and the second step of the transfer function are the only events that cause changes in balances.

  • The first mint to exceed the maximum supply will receive the fraction that is valid. (ex. 21,000,000 maximum supply, 20,999,242 circulating supply, and 1000 mint inscription = 758 balance state applied)

  • Standard limited to uint128

  • Maximum supply cannot exceed uint64_max

Operations

Deploy

Name
Required
Descrption

p

yes

protocol name, bsc20

op

yes

operation, deploy

tick

yes

tick name,bnbn

//deploy
{
    "p":"bsc20",
    "op":"deploy",
    "tick":"bnbn"
}

Mint

Name
Required
Descrption

p

yes

protocol name, bsc20

op

yes

operation, mint

tick

yes

tick name,bnbn

//Mint
{
    "p":"bsc20",
    "op":"mint",
    "tick":"bnbn"
}

Transfer

{ 
  "p": "bsc-20",
  "op": "transfer",
  "tick": "bnbn",
  "amt": "1"
}
Key
Required?
Description

p

Yes

Protocol: Helps other systems identify and process bsc-20 events

op

Yes

Operation: Type of event (Deploy, Mint, Transfer)

tick

Yes

Ticker: 4 letter identifier of the bsc-20

amt

Yes

Amount to transfer: States the amount of the bsc-20 to transfer.

Approve

{
    "op": "aprv",
    "amt": "1000000",
    "tick": "bnbn",
    "p": "bsc-20"
}
  • tx to_address: authorisation address

  • amt=0: cancellation of authorisation

  • amt>0: user's $bnbn will be frozen from the balance, and no other transfers can be made, or re-approved.

Proxy-trade

{
    "op": "ptrd",
    "tick": "bnbn",
    "amt": "583251",
    "p": "bsc-20",
    "f": "0x0ee1...3282",
    "s": "0xa3d4...68eb",
}
  • f: the seller wallet address

  • s: msg’s signature by seller

  • indexer

    • check if the signature is OK, indexer collects seller's pub_key in advance

    • check if ts is expired

    • check amt x price == tx number of coins (tBNBN in this case)

    • check amt quantity <=approve quantity

    • if all the above are OK, execute update the quantity of approve(decrease)

    • Execute transfer $bnbn to to_address

Last updated