zavodil / pluminite-ui

13 stars 11 forks source link

Changed nft contracts according nft standards #41

Open Buckram123 opened 2 years ago

Buckram123 commented 2 years ago
  1. Approval_id's arguments changed from U64 to Option.
  2. Fixed most of method signatures.
  3. Moved methods to corresponding traits.
  4. Added some missing required by the standard interfaces.
zavodil commented 2 years ago

This repo doesn't have contract folder, could you check contract-standard folder?

Buckram123 commented 2 years ago

trait NonFungibleTokenCore shouldn't contain those methods:

    fn nft_payout(&self, token_id: String, balance: U128, max_len_payout: u32) -> Payout;
    fn nft_transfer_payout(
        &mut self,
        receiver_id: ValidAccountId,
        token_id: TokenId,
        approval_id: u64,
        memo: String,
        balance: U128,
        max_len_payout: u32,
    ) -> Payout;

// those should be in trait NonFungibleTokenApproval
    fn nft_approve(&mut self, token_id: TokenId, account_id: ValidAccountId, msg: Option<String>);
    fn nft_is_approved(
        &self,
        token_id: TokenId,
        approved_account_id: AccountId,
        approval_id: Option<u64>,
    ) -> bool;
    fn nft_revoke(&mut self, token_id: TokenId, account_id: ValidAccountId);
    fn nft_revoke_all(&mut self, token_id: TokenId);

// those should be in trait NonFungibleTokenEnumeration
    fn nft_total_supply(&self) -> U128;
    fn nft_token(&self, token_id: TokenId) -> Option<JsonToken>;