Skip to content

feat(wallet): add reentrancy guard & input validation; docs: add gas usage snapshot; test: add gas benches#5

Merged
hooftly merged 1 commit intomainfrom
develop
Sep 6, 2025
Merged

feat(wallet): add reentrancy guard & input validation; docs: add gas usage snapshot; test: add gas benches#5
hooftly merged 1 commit intomainfrom
develop

Conversation

@hooftly
Copy link
Member

@hooftly hooftly commented Sep 6, 2025

Summary

  • PQCWallet.sol
    • Add lightweight nonReentrant guard and apply to execute / executeBatch.
    • Validate inputs: reject zero owner at construction and zero target in calls.
    • Add slither suppression comments around controlled assembly/low-level calls.
  • Gas documentation & snapshots
    • New docs/dev/gas.md summarizing current gas costs (sourced from snapshot).
    • Add smart-contracts/.gas-snapshot with measured gas for core flows.
    • Add smart-contracts/.gitignore for lib/, out/, cache/.
  • Foundry config
    • Add smart-contracts/foundry.lock.
    • Update smart-contracts/foundry.toml (src = "contracts", optimizer settings unchanged).
  • Tests
    • Extend PQCWallet.t.sol with gas-focused tests:
      • test_gas_validateUserOp
      • test_gas_execute
      • test_gas_executeBatch

…usage snapshot; test: add gas benches

- PQCWallet.sol
  - Add lightweight nonReentrant guard and apply to `execute` / `executeBatch`.
  - Validate inputs: reject zero `owner` at construction and zero `target` in calls.
  - Add `slither` suppression comments around controlled assembly/low-level calls.
- Gas documentation & snapshots
  - New `docs/dev/gas.md` summarizing current gas costs (sourced from snapshot).
  - Add `smart-contracts/.gas-snapshot` with measured gas for core flows.
  - Add `smart-contracts/.gitignore` for `lib/`, `out/`, `cache/`.
- Foundry config
  - Add `smart-contracts/foundry.lock`.
  - Update `smart-contracts/foundry.toml` (`src = "contracts"`, optimizer settings unchanged).
- Tests
  - Extend `PQCWallet.t.sol` with gas-focused tests:
    - `test_gas_validateUserOp`
    - `test_gas_execute`
    - `test_gas_executeBatch`

Rationale:
Improves runtime safety (reentrancy & input checks) and establishes a reproducible gas baseline for ongoing optimization.
@hooftly hooftly merged commit 3c8c073 into main Sep 6, 2025
2 checks passed
@hooftly hooftly deleted the develop branch September 6, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant