@@ -43,15 +43,15 @@ impl Contract {
4343 //we need to enforce that the user has enough storage for 1 EXTRA sale.
4444
4545 //get the storage for a sale
46- let storage_amount = self . storage_minimum_balance ( ) ;
46+ let storage_amount = self . storage_minimum_balance ( ) . 0 ;
4747 //get the total storage paid by the owner
4848 let owner_paid_storage = self . storage_deposits . get ( & owner_id) . unwrap_or ( ZERO_NEAR ) ;
4949 //get the storage required which is simply the storage for the number of sales they have + 1
5050 let signer_storage_required = storage_amount. saturating_mul ( ( self . get_supply_by_owner_id ( owner_id. clone ( ) ) . 0 + 1 ) . into ( ) ) ;
5151
5252 //make sure that the total paid is >= the required storage
5353 assert ! (
54- owner_paid_storage. ge( & signer_storage_required) ,
54+ owner_paid_storage. ge( & NearToken :: from_yoctonear ( signer_storage_required) ) ,
5555 "Insufficient storage paid: {}, for {} sales at {} rate of per sale" ,
5656 owner_paid_storage, signer_storage_required. saturating_div( storage_per_sale( ) . as_yoctonear( ) ) , storage_per_sale( )
5757 ) ;
@@ -92,7 +92,7 @@ impl Contract {
9292 & mut self ,
9393 nft_contract_id : AccountId ,
9494 token_id : String ,
95- price : NearToken ,
95+ price : U128 ,
9696 ) {
9797 //assert that the user has attached exactly 1 yoctoNEAR (for security reasons)
9898 assert_one_yocto ( ) ;
@@ -112,7 +112,7 @@ impl Contract {
112112 ) ;
113113
114114 //set the sale conditions equal to the passed in price
115- sale. sale_conditions = price;
115+ sale. sale_conditions = NearToken :: from_yoctonear ( price. 0 ) ;
116116 //insert the sale back into the map for the unique sale ID
117117 self . sales . insert ( & contract_and_token_id, & sale) ;
118118 }
@@ -226,7 +226,7 @@ impl Contract {
226226 //loop through the payout and subtract the values from the remainder.
227227 for & value in payout_object. payout . values ( ) {
228228 //checked sub checks for overflow or any errors and returns None if there are problems
229- remainder = remainder. checked_sub ( value. as_yoctonear ( ) ) ?;
229+ remainder = remainder. checked_sub ( value. 0 ) ?;
230230 }
231231 //Check to see if the NFT contract sent back a faulty payout that requires us to pay more or too little.
232232 //The remainder will be 0 if the payout summed to the total price. The remainder will be 1 if the royalties
@@ -254,7 +254,7 @@ impl Contract {
254254
255255 // NEAR payouts
256256 for ( receiver_id, amount) in payout {
257- Promise :: new ( receiver_id) . transfer ( amount) ;
257+ Promise :: new ( receiver_id) . transfer ( NearToken :: from_yoctonear ( amount. 0 ) ) ;
258258 }
259259
260260 //return the price payout out
0 commit comments