Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit dba768f

Browse files
committed
Cleaning mintbase-deps
1 parent 2f533eb commit dba768f

File tree

11 files changed

+1
-221
lines changed

11 files changed

+1
-221
lines changed

mintbase-deps/src/asserts.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ macro_rules! near_assert_ne {
5454
};
5555
}
5656

57-
// TODO: near_assert_range
58-
5957
// ------------- specific asserts for mintbase smart contracts -------------- //
6058

6159
// Theoretically a duplicate for `near_sdk::assert_one_yocto`, but this version

mintbase-deps/src/common.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ pub mod token_listing;
1313
pub mod token_metadata;
1414
pub mod token_offer;
1515

16-
// pub use loan::Loan;
17-
// pub use owner::Owner;
1816
pub use payouts::{
1917
OwnershipFractions,
2018
Payout,
@@ -29,10 +27,6 @@ pub use safe_fraction::{
2927
SafeFraction,
3028
};
3129
pub use sale_args::SaleArgs;
32-
// pub use storage::{
33-
// StorageCosts,
34-
// StorageCostsMarket,
35-
// };
3630
pub use store_init_args::StoreInitArgs;
3731
pub use store_metadata::{
3832
NFTContractMetadata,
@@ -42,15 +36,10 @@ pub use time::{
4236
NearTime,
4337
TimeUnit,
4438
};
45-
// pub use token::{
46-
// Token,
47-
// TokenCompliant,
48-
// };
4939
pub use token_key::TokenKey;
5040
pub use token_listing::TokenListing;
5141
pub use token_metadata::{
5242
TokenMetadata,
5343
TokenMetadataCompliant,
5444
};
5545
pub use token_offer::TokenOffer;
56-
// pub use store_metadata::{};

mintbase-deps/src/common/token_metadata.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,6 @@ pub struct TokenMetadata {
4040
pub reference_hash: Option<Base64VecU8>,
4141
}
4242

43-
// impl TokenMetadata {
44-
// /// Get the metadata and its size in bytes.
45-
// pub fn from_with_size(
46-
// mut metadata: TokenMetadata,
47-
// copies: u64,
48-
// ) -> (Self, u64) {
49-
// // if args.media.is_some() {
50-
// // crate::near_assert!(
51-
// // args.media_hash.is_some(),
52-
// // "Cannot specificy metadata.media without metadata.media_hash"
53-
// // );
54-
// // }
55-
56-
// // if args.reference.is_some() {
57-
// // crate::near_assert!(
58-
// // args.reference_hash.is_some(),
59-
// // "Cannot specificy metadata.reference without metadata.reference_hash"
60-
// // );
61-
// // }
62-
63-
// // If `metadata.copies` isn't supplied, use computed copies
64-
// metadata.copies.or(Some(copies));
65-
// let size = borsh::to_vec(&metadata).unwrap().len();
66-
67-
// (metadata, size as u64)
68-
// }
69-
// }
70-
7143
// NON-COMPLIANT https://github.com/near/NEPs/blob/master/specs/Standards/NonFungibleToken/Metadata.md
7244
/// ref:
7345
/// https://github.com/near/NEPs/blob/master/specs/Standards/NonFungibleToken/Metadata.md

mintbase-deps/src/constants.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub mod gas {
3535
pub const PAYOUT_RESOLVE: Gas = tgas(30);
3636

3737
/// Gas requirements for transferring an NFT and obtaining the payout.
38-
// TODO: Check back with Amber for requirements
3938
pub const NFT_TRANSFER_PAYOUT: Gas = tgas(15);
4039

4140
/// Gas requirements for creating a store.
@@ -187,5 +186,3 @@ impl StorageCostsMarket {
187186
}
188187
}
189188
}
190-
191-
// TODO: StorageCosts for Factory?

mintbase-deps/src/lib.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,3 @@ pub use near_sdk::{
1212
serde,
1313
serde_json,
1414
};
15-
16-
// // TODO: move module resolution to indexer
17-
// #[cfg(feature = "all")]
18-
// pub use crate::logging::{
19-
// NearJsonEvent,
20-
// // Nep171Event,
21-
// // Nep171EventLog,
22-
// NftApproveLog,
23-
// NftBurnLog,
24-
// NftComposeLog,
25-
// NftListLog,
26-
// NftLoanSetLog,
27-
// NftMakeOfferLog,
28-
// NftMintLog,
29-
// NftMintLogMemo,
30-
// NftOptionStringLog,
31-
// NftRevokeLog,
32-
// NftSaleData,
33-
// NftSetSplitOwnerLog,
34-
// NftStoreCreateLog,
35-
// NftStringLog,
36-
// NftTransferLog,
37-
// NftUpdateListLog,
38-
// NftUpdateOfferData,
39-
// UpdateAllowlistData,
40-
// UpdateBanlistData,
41-
// };

mintbase-deps/src/logging.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
use near_sdk::serde::{
2-
Deserialize,
3-
Serialize,
4-
};
5-
61
mod market;
72
mod mb_store_settings;
83
mod nft_approvals;
@@ -13,29 +8,3 @@ pub use mb_store_settings::*;
138
pub use nft_approvals::*;
149
pub use nft_core::*;
1510
pub use nft_payouts::*;
16-
17-
// TODO: probably unused -> deprecate?
18-
mod nft_composition;
19-
mod nft_loan;
20-
mod nft_move;
21-
pub use nft_composition::*;
22-
pub use nft_loan::*;
23-
pub use nft_move::*;
24-
25-
// ------------------ general event according to standard ------------------- //
26-
27-
// TODO: deprecate this abomination
28-
#[derive(Clone, Debug, Deserialize, Serialize)]
29-
pub struct NearJsonEvent {
30-
pub standard: String,
31-
pub version: String,
32-
pub event: String,
33-
pub data: String,
34-
}
35-
36-
impl NearJsonEvent {
37-
pub fn near_json_event(&self) -> String {
38-
let json = serde_json::to_string(&self).unwrap();
39-
format!("EVENT_JSON: {}", &json)
40-
}
41-
}

mintbase-deps/src/logging/mb_store_settings.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ pub fn log_transfer_store(account_id: &AccountId) {
6969
}
7070

7171
pub fn log_set_icon_base64(base64: &Option<String>) {
72-
// this will not take care of icon deletion -> no accessible via UI
73-
// TODO: document for coders that deletion will happen e.g. by inserting
74-
// empty icon
7572
env::log_str(
7673
&MbStoreChangeSettingData {
7774
new_icon_base64: base64.clone(),
@@ -80,14 +77,3 @@ pub fn log_set_icon_base64(base64: &Option<String>) {
8077
.serialize_event(),
8178
);
8279
}
83-
84-
pub fn log_set_base_uri(base_uri: &str) {
85-
// TODO: disallow this setting anyhow -> configurable on deploy only
86-
env::log_str(
87-
&MbStoreChangeSettingData {
88-
new_base_uri: Some(base_uri.to_string()),
89-
..MbStoreChangeSettingData::empty()
90-
}
91-
.serialize_event(),
92-
);
93-
}

mintbase-deps/src/logging/nft_loan.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

mintbase-deps/src/logging/nft_move.rs

Lines changed: 0 additions & 54 deletions
This file was deleted.

mintbase-deps/src/utils.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,3 @@ pub const fn ntot(near_amount: Gas) -> Gas {
1818
pub const fn ntoy(near_amount: Balance) -> Balance {
1919
near_amount * 10u128.pow(24)
2020
}
21-
22-
// // TODO: unused, deprecated?
23-
// pub fn to_yocto(value: &str) -> u128 {
24-
// let vals: Vec<_> = value.split('.').collect();
25-
// let part1 = vals[0].parse::<u128>().unwrap() * 10u128.pow(24);
26-
// if vals.len() > 1 {
27-
// let power = vals[1].len() as u32;
28-
// let part2 = vals[1].parse::<u128>().unwrap() * 10u128.pow(24 - power);
29-
// part1 + part2
30-
// } else {
31-
// part1
32-
// }
33-
// }
34-
35-
// // TODO: unused, deprecated?
36-
// pub fn to_near(n: u128) -> u128 {
37-
// n * 10u128.pow(24)
38-
// }

0 commit comments

Comments
 (0)