@towns-protocol/contracts 0.0.409 → 0.0.411
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-protocol/contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.411",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "forge clean",
|
|
6
6
|
"compile": "forge build",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@layerzerolabs/oapp-evm": "^0.3.2",
|
|
34
34
|
"@openzeppelin/merkle-tree": "^1.0.8",
|
|
35
35
|
"@prb/test": "^0.6.4",
|
|
36
|
-
"@towns-protocol/prettier-config": "^0.0.
|
|
36
|
+
"@towns-protocol/prettier-config": "^0.0.411",
|
|
37
37
|
"@wagmi/cli": "^2.2.0",
|
|
38
38
|
"forge-std": "github:foundry-rs/forge-std#v1.10.0",
|
|
39
39
|
"prettier": "^3.5.3",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "87399756a4f959f3b96a4161a5cea7fc9536775d"
|
|
57
57
|
}
|
|
@@ -190,11 +190,18 @@ abstract contract MembershipBase is IMembershipBase {
|
|
|
190
190
|
|
|
191
191
|
uint256 minFee = platform.getMembershipFee();
|
|
192
192
|
uint256 renewalPrice = $.renewalPriceByTokenId[tokenId];
|
|
193
|
+
uint256 currentPrice = _getMembershipPrice(totalSupply);
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
// If no stored renewal price, use current price
|
|
196
|
+
if (renewalPrice == 0) {
|
|
197
|
+
return FixedPointMathLib.max(currentPrice, minFee);
|
|
198
|
+
}
|
|
195
199
|
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
// Use the LOWER of stored renewal price or current price
|
|
201
|
+
// This ensures users benefit from price drops (including free transitions)
|
|
202
|
+
// while maintaining their locked-in rate if prices increase
|
|
203
|
+
uint256 effectivePrice = FixedPointMathLib.min(renewalPrice, currentPrice);
|
|
204
|
+
return FixedPointMathLib.max(effectivePrice, minFee);
|
|
198
205
|
}
|
|
199
206
|
|
|
200
207
|
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
|