Skip to content

Commit c91d7ab

Browse files
Merge branch 'master' into audits/Polynomial-7
2 parents 5329e12 + 10f9295 commit c91d7ab

File tree

7 files changed

+405
-1
lines changed

7 files changed

+405
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<page
2+
clientName="Clanker"
3+
reportDate="October 20, 2025"
4+
auditTitle="Clanker A-6"
5+
auditVersion="1.0.0"
6+
layout="/library/audits/_layout.html"
7+
repoUrl="https://github.com/clanker-devco/contracts"
8+
repoCommitHash="39433fd4d75b5fce74a5a1f17af698e1d2841c1b"
9+
repoCommitHashFinal="5e19e9c243c9e0a04af5b2041daf60f97b395835"
10+
>
11+
12+
<content-for name="schedule">
13+
The security audit was performed by the Macro security team from October 13, 2025 to October 15, 2025.
14+
</content-for>
15+
16+
<content-for name="spec">
17+
<ul>
18+
<li>Discussions on Telegram with the Clanker team.</li>
19+
</ul>
20+
</content-for>
21+
22+
<content-for name="source-code">
23+
24+
<p>Specifically, we audited the following contracts within the repository with focus on the following changes:</p>
25+
26+
<template type="file-hashes">
27+
ce47f9e48983477cd1d75c90563da75bc3109a8eabd132b464a503f40790afbd src/extensions/ClankerPresaleAllowlist.sol
28+
6f510a2b3fbaa5c2799d3099426e6c09cb312fd99f3b8304164e0b860037fe03 src/extensions/ClankerPresaleEthToCreator.sol
29+
3cfac71c444f68aeb47d9e983e4a45a94d650004461cbcd9fd19cd9b6d66000f src/extensions/interfaces/IClankerPresaleAllowlist.sol
30+
c824d22538f0d8093e60ad3a645164532bc355ad0f349d74abe95ed5f86b2ee4 src/extensions/interfaces/IClankerPresaleEthToCreator.sol
31+
</template>
32+
</content-for>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<page
2+
clientName="Infinex"
3+
reportDate="October 20, 2025"
4+
auditTitle="Infinex A-18"
5+
auditVersion="1.0.0"
6+
repoUrl="https://github.com/infinex-xyz/infinex-contracts"
7+
layout="/library/audits/_layout.html"
8+
repoCommitHash="c7c7c003f776a4dc86da994617236fe5ed7d1043"
9+
customRepoInfo
10+
customReviewInfo
11+
>
12+
<content-for name="schedule">
13+
The security audit was performed by the Macro security team on October 17th 2025.
14+
</content-for>
15+
16+
<content-for name="repo-info">
17+
<ul>
18+
<li>
19+
<a href="{{page.repoUrl}}" target="_blank"> Repository </a>
20+
</li>
21+
22+
<li class="break-words break-all">
23+
<b>Commit Hash for Patron Vesting Cwg claim date feature:
24+
</b> </br>
25+
<b> This limits CWG claims prior to a specified date. No other tiers' claiming is impacted </b> </br>
26+
<b> by this change.</b> </br>
27+
<code>{{page.repoCommitHash}}</code>
28+
</li>
29+
30+
31+
32+
</ul>
33+
</content-for>
34+
35+
36+
<content-for name="spec">
37+
<ul>
38+
<li>Discussions with the {{page.clientName}} team.</li>
39+
<li>Available documentation in the repository.</li>
40+
</ul>
41+
42+
</content-for>
43+
44+
<content-for name="source-code">
45+
46+
<p>
47+
<br>
48+
Specifically, we audited the following contracts, where contracts not included had updated their formatting with no logic changes:
49+
</p>
50+
51+
<template type="file-hashes">
52+
13fc207d6eb0261c918057d6bb5339326bf1667ac2fa1f556a6e44c33a5e3bf3 src/patron/IPatronVesting.sol
53+
cc9fe4461693b3772231de58ef5bb31ca76d4994f074af87443d1ddfc1ce687a src/patron/PatronVesting.sol
54+
e0519fd830263b8c513690909b16129912f1b8b911f142edd9a42eeb022b491b src/patron/PatronVestingStorage.sol
55+
</template>
56+
</content-for>
57+
</page>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<page
2+
clientName="towns"
3+
reportDate="October 20, 2025"
4+
auditTitle="Towns A-12"
5+
auditVersion="1.0.0"
6+
repoUrl="https://github.com/towns-protocol/towns"
7+
repoCommitHash="571d65e38e62dbbe5c5af68bd9965716991ace44"
8+
layout="/library/audits/_layout.html"
9+
>
10+
11+
<content-for name="schedule">
12+
The security audit was performed by the Macro security team from October 7, 2025 to October 10, 2025.
13+
</content-for>
14+
15+
<content-for name="spec">
16+
<ul>
17+
<li>Discussions on Slack with the HNT team.</li>
18+
</ul>
19+
20+
<template type="audit-markdown">
21+
<h2 id="tmaar">Trust Model, Assumptions, and Accepted Risks (TMAAR)</h2>
22+
23+
The `SubscriptionModule` is a smart contract module designed to be installed on a user's Modular Account (ERC-6900), enabling automated, recurring payments for spaces NFT based memberships. The system relies on trusted operators to trigger renewals, but is designed to ensure the operator cannot act without the user's pre-approved consent as defined by the subscription parameters.
24+
25+
- Renewals are triggered by a trusted off-chain Operator, but executed with the user's own funds from their Modular Account.
26+
- The module validates that the user still owns the membership NFT before processing a renewal.
27+
- The module checks that the renewal is within the expected time window (after `nextRenewalTime` but before `GRACE_PERIOD` ends) to prevent spamming and premature renewals.
28+
- The renewal process is routed through the user's Modular Account using `executeWithRuntimeValidation`, ensuring the user's account, not the operator, is the `msg.sender` for the final `renewMembership` call.
29+
- The core parameters of the renewal, the target `space` contract and the `tokenId`, are immutable after the subscription is installed.
30+
31+
## Actors
32+
33+
### **Protocol Owner**
34+
35+
The Protocol Owner is the entity that deployed and controls the `SubscriptionModule` diamond contract itself. This is a highly trusted role responsible for maintaining and upgrading the module's logic and the diamonds facets.
36+
37+
- Is trusted to maintain and upgrade the module's logic securely. As the owner of the diamond, this role has the absolute power to change any part of the module's implementation at any time by performing a diamond cut (adding, replacing, or removing facets). Users trust that the owner will not introduce malicious code that could steal funds, modify subscription parameters without consent, or otherwise compromise the security of their accounts.
38+
- Is trusted to manage the operator whitelist responsibly. The Protocol Owner controls which addresses are designated as operators and are authorized to call `batchProcessRenewals`.
39+
- Cannot directly access user funds or change individual subscription parameters. The owner's power is over the contract's logic, not its state. Any malicious action would require deploying new, malicious code to the diamond first.
40+
- If compromised, a malicious Protocol Owner could replace the entire `SubscriptionModule` logic with a contract that drains funds from all subscribed users on the next renewal cycle. The primary mitigation is the security of the protocol's multisig process itself which governs the owner account.
41+
42+
### **Operator (`operator` role)**
43+
44+
The Operator is a trusted, whitelisted off-chain entity responsible for monitoring all active subscriptions and triggering the on-chain renewal process. The contract is designed to limit its power, making it a transaction facilitator rather than a decision-maker.
45+
46+
- Can trigger the `batchProcessRenewals` function for any subscription that is due.
47+
- Cannot renew a subscription that is not due, is paused, or for which the user is no longer the owner of the membership NFT.
48+
- Cannot alter the terms of a subscription (e.g., change the price or duration).
49+
- Cannot access or spend user funds directly; it can only initiate a transaction that the user's own account must validate and execute.
50+
- If compromised, an attacker could temporarily disrupt the service by failing to process renewals. However, they cannot steal funds or renew subscriptions against the rules of the contract. The primary mitigation is that any other authorized operator can process the due renewals and its role can be modified by the protocol owner.
51+
52+
### **Space Contract**
53+
54+
The `space` is the target contract that manages the actual membership. It is trusted by the `SubscriptionModule` to provide accurate information about the membership's status and terms.
55+
56+
- Can define the price and duration of a membership renewal.
57+
- Can verify ownership and execute the `renewMembership` function.
58+
- The `SubscriptionModule` checks for the `space` to be a legitimate contract.
59+
- The `SubscriptionModule` includes internal logic to handle changes in membership terms. If the `space` modifies the price or duration, the module will automatically pause renewals and emit appropriate events to notify the user.
60+
61+
### **End User (`ModularAccount` owner)**
62+
63+
The User is the owner of the Modular Account and the ultimate principal in the system. They are trusted to make their own financial decisions by installing and configuring the module.
64+
65+
- Can install the `SubscriptionModule` for a specific NFT membership, defining the `entityId`.
66+
- Can pause, resume, and uninstall the module at any time, giving them full control over their automated payments.
67+
- Cannot be forced into a subscription; installation is a voluntary, user-initiated action.
68+
- The primary risk for the user is a loss of funds through multiple renewals due to misconfiguration. The primary risk for the user is a loss of funds through multiple renewals due to misconfiguration. The module's internal checks protect against interacting with a malicious `space` contract or unexpected changes in the membership's terms (price/duration), serving as the primary mitigation against operator error.
69+
</template>
70+
</content-for>
71+
72+
<content-for name="source-code">
73+
74+
<p>Specifically, we audited the following contracts within <i>contracts/src/apps/modules</i> repository directory:</p>
75+
76+
<template type="file-hashes">
77+
a880a4de3839ab8f6ab31671459e7368cd0199129e9ffde81f9b6064edb59f27 /subscription/ISubscriptionModule.sol
78+
7a09015e00f310b007cf829d6f063ce6faf07fe445679062abc54ed74c1a12bd /subscription/SubscriptionModuleFacet.sol
79+
fcac773dcfdf83cbb8b05f205437a6db0be983f98c4c841aab17e1c53b5e1abc /subscription/SubscriptionModuleStorage.sol
80+
</template>
81+
82+
</content-for>
83+

content/collections/private

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<item>
2+
<field name="topic">Spec</field>
3+
<field name="impact">low</field>
4+
<field name="status">fixed</field>
5+
<field name="commit">5e0e14699aa6d327df1ec9419c4ab38993eea2c9</field>
6+
<field name="content">
7+
## [Q-1] Inconsistent ordering of event parameters
8+
9+
In the `ClankerPresaleEthToCreator` contract, `ClankerFeeRecipientUpdated` event has inconsistent order parameters compared to the other events across the codebase.
10+
11+
```solidity
12+
event ClankerFeeRecipientUpdated(address recipient, address oldRecipient);
13+
```
14+
15+
While convention is for the first parameter to represent old value and second new value, in the case of `ClankerFeeRecipientUpdated` it is reversed.
16+
17+
Consider changing event declaration and corresponding usage to be according to the established convention.
18+
</field>
19+
</item>
20+
21+
<item>
22+
<field name="topic">Gas optimization</field>
23+
<field name="impact">low</field>
24+
<field name="status">fixed</field>
25+
<field name="commit">5e0e14699aa6d327df1ec9419c4ab38993eea2c9</field>
26+
<field name="content">
27+
## [G-1] Unnecessary recalculation
28+
29+
The `endPresale()` implementation in `ClankerPresaleEthToCreator` contract, contains calculation that can be avoided. Consider using just calculated `lockupEndTime` instead of recalculating it.
30+
31+
```solidity
32+
// record lockup and vesting end times
33+
presale.lockupEndTime = block.timestamp + presale.lockupDuration;
34+
presale.vestingEndTime = **block.timestamp + presale.lockupDuration** + presale.vestingDuration;
35+
```
36+
</field>
37+
</item>
38+

content/collections/public/infinex-18-issues.html

Whitespace-only changes.

0 commit comments

Comments
 (0)