@towns-protocol/contracts 0.0.359 → 0.0.360

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.359",
3
+ "version": "0.0.360",
4
4
  "packageManager": "yarn@3.8.0",
5
5
  "scripts": {
6
6
  "build-types": "bash scripts/build-contract-types.sh",
@@ -23,10 +23,10 @@
23
23
  "@openzeppelin/contracts-upgradeable": "^5.4.0",
24
24
  "@prb/math": "^4.1.0",
25
25
  "@towns-protocol/diamond": "^0.6.3",
26
- "@uniswap/permit2": "https://github.com/towns-protocol/permit2/archive/refs/tags/v1.0.0.tar.gz",
27
- "account-abstraction": "https://github.com/eth-infinitism/account-abstraction/archive/refs/tags/v0.7.0.tar.gz",
28
- "crypto-lib": "https://github.com/towns-protocol/crypto-lib/archive/refs/tags/v1.0.0.tar.gz",
29
- "modular-account": "https://github.com/towns-protocol/modular-account/archive/refs/tags/v1.0.0.tar.gz",
26
+ "@uniswap/permit2": "github:towns-protocol/permit2#v1.0.0",
27
+ "account-abstraction": "github:eth-infinitism/account-abstraction#v0.7.0",
28
+ "crypto-lib": "github:towns-protocol/crypto-lib#v1.0.1",
29
+ "modular-account": "github:towns-protocol/modular-account#v1.0.0",
30
30
  "solady": "^0.1.24"
31
31
  },
32
32
  "devDependencies": {
@@ -35,15 +35,15 @@
35
35
  "@layerzerolabs/oapp-evm": "^0.3.2",
36
36
  "@openzeppelin/merkle-tree": "^1.0.8",
37
37
  "@prb/test": "^0.6.4",
38
- "@towns-protocol/prettier-config": "^0.0.359",
39
- "@typechain/ethers-v5": "^10.1.1",
38
+ "@towns-protocol/prettier-config": "^0.0.360",
39
+ "@typechain/ethers-v5": "^11.1.2",
40
40
  "@wagmi/cli": "^2.2.0",
41
41
  "forge-std": "github:foundry-rs/forge-std#v1.10.0",
42
42
  "prettier": "^3.5.3",
43
43
  "prettier-plugin-solidity": "^1.4.2",
44
44
  "solhint": "^5.0.5",
45
45
  "solidity-bytes-utils": "^0.8.4",
46
- "typechain": "^8.1.1"
46
+ "typechain": "^8.3.2"
47
47
  },
48
48
  "files": [
49
49
  "docs/**/*",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "eaa0db40087afae546708c9a8846d9e5b35cda9a"
60
+ "gitHead": "a2731ca73b07a9b9e1588e655902f537364f56f5"
61
61
  }
@@ -49,7 +49,8 @@ interface ISubscriptionModuleBase {
49
49
  uint32 indexed entityId,
50
50
  address indexed space,
51
51
  uint256 tokenId,
52
- uint64 nextRenewalTime
52
+ uint64 nextRenewalTime,
53
+ uint256 expiresAt
53
54
  );
54
55
 
55
56
  event SubscriptionDeactivated(address indexed account, uint32 indexed entityId);
@@ -66,7 +67,10 @@ interface ISubscriptionModuleBase {
66
67
  event SubscriptionRenewed(
67
68
  address indexed account,
68
69
  uint32 indexed entityId,
69
- uint256 nextRenewalTime
70
+ address indexed space,
71
+ uint256 tokenId,
72
+ uint256 nextRenewalTime,
73
+ uint256 expiresAt
70
74
  );
71
75
 
72
76
  /// @notice Emitted when a subscription's next renewal time is synced to on-chain expiration
@@ -95,7 +95,14 @@ contract SubscriptionModuleFacet is
95
95
  sub.installTime = uint40(block.timestamp);
96
96
  sub.nextRenewalTime = _calculateNextRenewalTime(expiresAt, sub.installTime);
97
97
 
98
- emit SubscriptionConfigured(msg.sender, entityId, space, tokenId, sub.nextRenewalTime);
98
+ emit SubscriptionConfigured(
99
+ msg.sender,
100
+ entityId,
101
+ space,
102
+ tokenId,
103
+ sub.nextRenewalTime,
104
+ expiresAt
105
+ );
99
106
  }
100
107
 
101
108
  /// @inheritdoc IModule
@@ -385,7 +392,15 @@ contract SubscriptionModuleFacet is
385
392
  sub.lastRenewalTime = uint40(block.timestamp);
386
393
  sub.spent += actualRenewalPrice;
387
394
 
388
- emit SubscriptionRenewed(params.account, params.entityId, sub.nextRenewalTime);
395
+ emit SubscriptionRenewed(
396
+ params.account,
397
+ params.entityId,
398
+ sub.space,
399
+ sub.tokenId,
400
+ sub.nextRenewalTime,
401
+ newExpiresAt
402
+ );
403
+ emit SubscriptionSpent(params.account, params.entityId, actualRenewalPrice, sub.spent);
389
404
  }
390
405
 
391
406
  /// @dev Determines the appropriate renewal buffer time based on original membership duration