diff --git a/contract/Forest/ForestContractConstants.cs b/contract/Forest/ForestContractConstants.cs index 2887118..c92dc0b 100644 --- a/contract/Forest/ForestContractConstants.cs +++ b/contract/Forest/ForestContractConstants.cs @@ -27,6 +27,7 @@ public partial class ForestContract public const string CollectionSymbolSuffix = "0"; public const string SymbolSeparator = "-"; public const long DefaultApproveAllowance = 10000; - public const long MaxApproveAllowance = 9223372036854775000; - + public const long MaxApproveAllowance = 9223372036854770000; + + } \ No newline at end of file diff --git a/contract/Forest/ForestContract_Sellers.cs b/contract/Forest/ForestContract_Sellers.cs index bf58488..3e5cd01 100644 --- a/contract/Forest/ForestContract_Sellers.cs +++ b/contract/Forest/ForestContract_Sellers.cs @@ -126,12 +126,12 @@ public override Empty ListWithFixedPrice(ListWithFixedPriceInput input) var collectionAllowance = State.ListedNFTTotalAmountMap[collectionSymbol][Context.Sender]; if (collectionAllowance == null || collectionAllowance == "") { - var listedNFTTotalAmount = (allowance == MaxApproveAllowance) ? input.Quantity : Math.Max(allowance, input.Quantity); + var listedNFTTotalAmount = (allowance >= MaxApproveAllowance) ? input.Quantity : Math.Max(allowance, input.Quantity); State.ListedNFTTotalAmountMap[collectionSymbol][Context.Sender] = listedNFTTotalAmount.ToString(); } else { - var originQuantity = (long.Parse(collectionAllowance) == MaxApproveAllowance) + var originQuantity = (long.Parse(collectionAllowance) >= MaxApproveAllowance) ? DefaultApproveAllowance : long.Parse(collectionAllowance); State.ListedNFTTotalAmountMap[collectionSymbol][Context.Sender] = diff --git a/contract/Forest/ForestContract_Views.cs b/contract/Forest/ForestContract_Views.cs index 02a474b..31a6089 100644 --- a/contract/Forest/ForestContract_Views.cs +++ b/contract/Forest/ForestContract_Views.cs @@ -129,7 +129,7 @@ public override GetTotalEffectiveListedNFTAmountOutput GetTotalEffectiveListedNF { Symbol = input.Symbol, Allowance = allowance, - TotalAmount = (allowance == MaxApproveAllowance) ? totalAmount : Math.Max(allowance,totalAmount) + TotalAmount = (allowance >= MaxApproveAllowance) ? totalAmount : Math.Max(allowance,totalAmount) }; } @@ -137,7 +137,7 @@ public override GetTotalEffectiveListedNFTAmountOutput GetTotalEffectiveListedNF { Symbol = input.Symbol, Allowance = allowance, - TotalAmount = (long.Parse(collectionAllowance) == MaxApproveAllowance) ? DefaultApproveAllowance : long.Parse(collectionAllowance) + TotalAmount = (long.Parse(collectionAllowance) >= MaxApproveAllowance) ? DefaultApproveAllowance : long.Parse(collectionAllowance) }; return getTotalEffectiveListedNftAmountOutput;