Skip to content

Commit

Permalink
feat: modify GetTotalEffectiveListedNFTAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
Jecket1 committed Jul 18, 2024
1 parent ceda73b commit a343c02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contract/Forest/ForestContract_Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ private void PerformDeal(PerformDealInput performDealInput)
PurchaseAmount = performDealInput.PurchaseAmount
});
var collectionSymbol = TransferCollectionSymbol(performDealInput.NFTSymbol);
var collectionAllowance = State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTTo];
var collectionAllowance = State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTFrom];
if (collectionAllowance == null || collectionAllowance == "")
{
State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTTo] = "";
State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTFrom] = "";
}
else
{
var originQuantity = long.Parse(collectionAllowance);
var resultQuantity = originQuantity - performDealInput.NFTQuantity;
State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTTo] =
State.ListedNFTTotalAmountMap[collectionSymbol][performDealInput.NFTFrom] =
(resultQuantity >= 0 ? resultQuantity : 0).ToString();
}
}
Expand Down

0 comments on commit a343c02

Please sign in to comment.