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

Multi-Fungible-Token #227

Open
marco-sundsk opened this issue Jun 30, 2021 · 5 comments
Open

Multi-Fungible-Token #227

marco-sundsk opened this issue Jun 30, 2021 · 5 comments

Comments

@marco-sundsk
Copy link
Contributor

Proposal for multi-fungible-token

In Ref Finance, we handle all swap pools in one contract, which means, when we release LP token for each pool, those tokens are exist in single contract, which can NOT be supported by current NEP-141 standard.

Now, based on NEP-141, actually we extended it to support multi-token in one contract, change some interfaces and leave the whole working process untouched.
Here is the way:
we change the following interface, add a heading 'm' to the name and, compare to the original one in NEP-141, token_id: String is added as first parameter of each interface:

  • mft_resolve_transfer in trait MFTTokenResolver
  • mft_on_transfer in trait MFTTokenReceiver
  • mft_transfer
  • mft_transfer_call
  • mft_metadata, return the same FungibleTokenMetadata structure in NEP-141
  • mft_register
  • mft_total_supply
  • mft_balance_of

When the value of this field equals to predecessor_id or the token contract id, the interface has the same behaviors with original one in NEP-141. Otherwise, the token_id stands for inner-index in the token contract.

For detailed implementation, please see here

In this way, this protocol can handle both FT token and MFT token.

@ilyar
Copy link

ilyar commented Jul 27, 2021

I use current standart for impliment it

mint supply_max/amount 10000
https://explorer.testnet.near.org/transactions/3JyXzQD4o2QLVnu7YAur1gjwfVBjFGmjVLw8MtHZXZ33
nft_transfer for 1 amount
https://explorer.testnet.near.org/transactions/AizxpxJC7cSeAv9RKB3rB4ZuHn8Yxezs2GFYwkJxBgGE

near view arterra.testnet nft_token '{"token_id":"QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq:arterrateam.testnet"}'
{
  token_id: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq:arterrateam.testnet',
  owner_id: 'arterrateam.testnet',
  supply: 9996,
  metadata: {
    title: "Programmer's lunch",
    description: 'A limited series of representations of what some programmers fill their life cells with',
    media: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq',
    copies: 10000,
    supply_max: 10000
  },
  approved_account_ids: null,
  metadata_id: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq'
}
near view arterra.testnet nft_token '{"token_id":"QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq:serhii-1205.testnet"}'
{
  token_id: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq:serhii-1205.testnet',
  owner_id: 'serhii-1205.testnet',
  supply: 1,
  metadata: {
    title: "Programmer's lunch",
    description: 'A limited series of representations of what some programmers fill their life cells with',
    media: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq',
    copies: 10000,
    supply_max: 10000
  },
  approved_account_ids: null,
  metadata_id: 'QmXnfHFhjnT19J2pfXjDydzhexpWvbuHaCr9a1X3mHsfZq'
}

@Lev-Stambler
Copy link

Where are we standing on this? I think its a great idea.

@sb-
Copy link

sb- commented Jan 18, 2022

@Lev-Stambler #245

@joshuajbouw
Copy link
Member

Is this going forward?

@frol
Copy link
Collaborator

frol commented Dec 20, 2022

@joshuajbouw The most recent update I am aware of is here: #246 (comment)

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

No branches or pull requests

6 participants