From 5e12b37a671b0dd6c38294bdc3c1418f759b3950 Mon Sep 17 00:00:00 2001 From: Till Date: Wed, 23 Nov 2022 16:10:30 +0000 Subject: [PATCH] View methods for the factory --- factory/src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/factory/src/lib.rs b/factory/src/lib.rs index a995ed5..dc2878e 100644 --- a/factory/src/lib.rs +++ b/factory/src/lib.rs @@ -126,6 +126,18 @@ impl MintbaseStoreFactory { &self.admin_public_key } + /// Retrieve the storage price per byte in yocotNEAR currently registered + /// with the factory. + pub fn get_storage_price_per_byte(&self) -> U128 { + self.storage_price_per_byte.into() + } + + /// Retrieve the store cost in yocotNEAR currently registered with the + /// factory. + pub fn get_store_cost(&self) -> U128 { + self.store_cost.into() + } + /// The Near Storage price per byte has changed in the past, and may change in /// the future. This method may never be used. #[payable] @@ -249,6 +261,11 @@ impl MintbaseStoreFactory { metadata: NFTContractMetadata, owner_id: AccountId, ) -> Promise { + // FIXME: the storage deposit is store size (compile time constant) + // * self.storage_price_per_byte + self.mintbase_fee = 5.5 NEAR + // further down this method, we forward self.store_cost to the factory + // and refund the user any additional NEAR + // TODO: figure out what the current store cost is self.assert_sufficient_attached_deposit(); self.assert_no_store_with_id(metadata.name.clone()); assert_ne!(&metadata.name, "market"); // marketplace lives here