Skip to content

Commit

Permalink
feat: working on DIP721
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Nov 7, 2023
1 parent 95b6982 commit 1c4a30f
Showing 1 changed file with 140 additions and 0 deletions.
140 changes: 140 additions & 0 deletions src/sell-contract/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ mod storage;

use candid::Principal;
use configuration::Configuration;
use dip721::{
Dip721, GenericValue, Metadata, NftError, Stats, SupportedInterface, TokenIdentifier,
TokenMetadata, TxEvent,
};

use self::storage::TxHistory;

#[derive(Default)]
/// Sell contract canister API
Expand All @@ -19,3 +25,137 @@ impl SellContract {
Configuration::is_custodian(caller)
}
}

impl Dip721 for SellContract {
fn metadata() -> Metadata {
todo!()
}

fn stats() -> Stats {
todo!()
}

fn logo() -> Option<String> {
todo!()
}

fn set_logo(logo: String) {
todo!()
}

fn name() -> Option<String> {
todo!()
}

fn set_name(name: String) {
todo!()
}

fn symbol() -> Option<String> {
todo!()
}

fn custodians() -> Vec<Principal> {
todo!()
}

fn set_custodians(custodians: Vec<Principal>) {
todo!()
}

fn cycles() -> candid::Nat {
todo!()
}

fn total_unique_holders() -> candid::Nat {
todo!()
}

fn token_metadata(token_identifier: TokenIdentifier) -> Result<TokenMetadata, NftError> {
todo!()
}

fn balance_of(owner: Principal) -> Result<candid::Nat, NftError> {
todo!()
}

fn owner_of(token_identifier: TokenIdentifier) -> Result<Principal, NftError> {
todo!()
}

fn owner_token_identifiers(owner: Principal) -> Result<Vec<TokenIdentifier>, NftError> {
todo!()
}

fn owner_token_metadata(owner: Principal) -> Result<Vec<TokenMetadata>, NftError> {
todo!()
}

fn operator_of(token_identifier: TokenIdentifier) -> Result<Principal, NftError> {
todo!()
}

fn operator_token_identifiers(operator: Principal) -> Result<Vec<TokenIdentifier>, NftError> {
todo!()
}

fn operator_token_metadata(operator: Principal) -> Result<Vec<TokenMetadata>, NftError> {
todo!()
}

fn supported_interfaces() -> Vec<SupportedInterface> {
vec![
SupportedInterface::Approval,
SupportedInterface::Burn,
SupportedInterface::Mint,
SupportedInterface::TransactionHistory,
]
}

fn total_supply() -> candid::Nat {
todo!()
}

fn approve(
operator: Principal,
token_identifier: TokenIdentifier,
) -> Result<candid::Nat, NftError> {
todo!()
}

fn set_approval_for_all(operator: Principal, approved: bool) -> Result<candid::Nat, NftError> {
todo!()
}

fn is_approved_for_all(owner: Principal, operator: Principal) -> Result<bool, NftError> {
todo!()
}

fn transfer_from(
owner: Principal,
to: Principal,
token_identifier: TokenIdentifier,
) -> Result<candid::Nat, NftError> {
todo!()
}

fn mint(
to: Principal,
token_identifier: TokenIdentifier,
properties: Vec<(String, GenericValue)>,
) -> Result<candid::Nat, NftError> {
todo!()
}

fn burn(token_identifier: TokenIdentifier) -> Result<candid::Nat, NftError> {
todo!()
}

fn transaction(tx_id: candid::Nat) -> Result<Vec<TxEvent>, NftError> {
todo!()
}

fn total_transactions() -> candid::Nat {
TxHistory::count().into()
}
}

0 comments on commit 1c4a30f

Please sign in to comment.