Skip to content

docs(contracts): full NatSpec sweep on AgentEscrow + surface two audit flags#3

Open
abhicris wants to merge 1 commit into
create-protocol:mainfrom
abhicris:feat/natspec-agent-escrow
Open

docs(contracts): full NatSpec sweep on AgentEscrow + surface two audit flags#3
abhicris wants to merge 1 commit into
create-protocol:mainfrom
abhicris:feat/natspec-agent-escrow

Conversation

@abhicris
Copy link
Copy Markdown
Member

@abhicris abhicris commented Jun 4, 2026

Summary

Cover every public/internal item in contracts/AgentEscrow.sol with @notice / @dev / @param / @return tags. No logic changes; ABI is identical to main.

What's in scope

  • 286 insertions / 43 deletions in contracts/AgentEscrow.sol
  • Every external + public function gets full NatSpec
  • Every event gets @notice + @param indexed documentation
  • Every storage variable gets a one-line @notice
  • Two audit observations surfaced as @dev notes (see below) — no behavior changes

Two audit flags surfaced (not fixed in this PR)

  1. registerAgent is permissionless. Any address can whitelist itself by calling registerAgent. The @dev tag warns integrators not to rely on registeredAgents as a trust anchor until an owner model is added. Tracked for a follow-up PR.

  2. AgentDeregistered is an orphaned event. It is declared but never emitted because no deregisterAgent function exists. The @dev tag marks it unreachable and defers either removal or a matching function to a follow-up.

What's NOT in scope

Test plan

  • forge build clean
  • forge test unchanged (no logic touched)
  • ABI diff vs main: empty
  • Solidity compiler version unchanged

Closes nothing on its own — pairs naturally with #1 (parse_wei case fix) and #2 (Foundry suite) as part of the contracts-quality sweep.

…t flags

Cover every public/internal item with @notice/@dev/@param/@return tags. Also
surface two issues discovered during the pass:

1. `registerAgent` is permissionless — any address can whitelist itself.
   Added a prominent WARNING in the @dev tag so integrators don't rely on
   `registeredAgents` as a trust anchor until an owner model is added.

2. `AgentDeregistered` is an orphaned event — it is declared but never
   emitted because no `deregisterAgent` function exists. The @dev tag
   marks it unreachable and defers it to a follow-up PR.

No logic changes; ABI is identical.
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