Skip to content

Commit e9b0ea9

Browse files
Merge pull request #219 from Sam-Rytech/test/require-auth-sweep
test: require_auth coverage sweep across contracts
2 parents b4eeb63 + 6e310ad commit e9b0ea9

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

SECURITY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,22 @@ Before any mainnet deployment:
165165
---
166166

167167
**Note**: This checklist should be reviewed and updated regularly as new security patterns emerge and the codebase evolves.
168+
169+
## require_auth() Audit (Issue #160)
170+
171+
All privileged entrypoints across `vault`, `revenue_pool`, and `settlement` contracts
172+
have been audited for `require_auth()` coverage as part of Issue #160.
173+
174+
### Findings
175+
- All privileged functions call `require_auth()` on the caller before executing. ✅
176+
- Negative tests added to each crate's `test.rs` confirming unauthenticated calls are rejected.
177+
178+
### Intentional Exceptions
179+
| Contract | Function | Reason |
180+
|------------|------------------|--------|
181+
| settlement | `init()` | One-time initializer guarded by already-initialized panic; no auth required by design. |
182+
| vault | `require_owner()`| Internal helper using `assert!` for address equality. All public callers invoke `caller.require_auth()` before calling this helper, so host-level auth is enforced transitively. Documented gap: `require_owner` itself does not call `require_auth()`. |
183+
184+
### Cross-reference
185+
- Audit branch: `test/require-auth-sweep`
186+
- Tests: `contracts/vault/src/test.rs`, `contracts/revenue_pool/src/test.rs`, `contracts/settlement/src/test.rs`

contracts/settlement/src/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod settlement_tests {
1717
let addr = env.register(CalloraSettlement, ());
1818
let client = CalloraSettlementClient::new(&env, &addr);
1919
client.init(&admin, &vault);
20+
let third_party = Address::generate(&env);
2021
(env, addr, admin, vault, third_party)
2122
}
2223

0 commit comments

Comments
 (0)