Contract Map
ERC-8004 IdentityRegistry (ag0 — external) provides
ownerOf(agentId) used by all contracts below:| Contract | Role |
|---|---|
| Agether4337Factory | Deploys Safe-based agent accounts with ERC-7579 modules |
| Agether8004ValidationModule | ERC-7579 validator — ownership + KYA gate + module lock |
| AgetherHookMultiplexer | ERC-7579 hook — admin-managed chain of sub-hooks |
| Agether8004Scorer | Oracle-based credit score store + ERC-8004 reputation bridge |
| Agether7579Bootstrap | Initializer called during Safe.setup to install all modules |
| Morpho Blue | External immutable lending protocol |
Architecture
execTransaction directly). ALL execution goes through ERC-4337 EntryPoint → Safe7579 → our validator. This ensures every operation is validated by the Agether8004ValidationModule.
Agether4337Factory
The factory deploys one Safe proxy per registered ERC-8004 agent, pre-configured with the Agether ERC-7579 module stack. Each deployed Safe account is configured with:- Safe7579 adapter — enables ERC-7579 module support + ERC-4337
- Agether8004ValidationModule — ownership, KYA gate, module lock
- AgetherHookMultiplexer — admin-managed hooks
- Sentinel owner — disables direct
execTransaction(4337-only)
| Function | Description |
|---|---|
createAccount(agentId, identityRegistry) | Deploy a Safe proxy for the agent. Caller must own the ERC-8004 NFT. |
getAccount(agentId) | Returns the Safe account address for an agent. |
predictAddress(agentId) | Compute the deterministic address before deployment (Create2). |
getAllAgentIds() | Array of all agent IDs with deployed accounts. |
The factory is owned by a TimelockController. The validator and hook addresses can be updated for NEW accounts, but existing accounts keep their modules locked.
Agether8004ValidationModule
The single mandatory ERC-7579 validator for all agent Safe accounts. Combines three responsibilities:1. Ownership
Validates that the UserOp signer is the current holder of the agent’s ERC-8004 NFT. Ownership is read live from the registry (not cached), so NFT transfers instantly change who can control the Safe.
2. KYA Gate
Checks that the agent’s code is approved in the ValidationRegistry before allowing execution. When the registry is set to
address(0), the gate is disabled (all agents pass). Currently disabled on production.3. Module Lock
Blocks all
installModule / uninstallModule calls in UserOps. Modules are set at creation time and cannot be changed by agents. Prevents removing the validator, hook, or installing rogue executors.EIP-1271 Signatures
Smart wallet signature validation — required for x402 payments via EIP-3009
transferWithAuthorization.onUninstall() reverts unconditionally. Combined with the module lock, agents cannot escape the validation rules.
AgetherHookMultiplexer
A singleton ERC-7579 hook installed on every agent Safe. It chains multiple sub-hooks that apply to ALL accounts.- Owner: TimelockController (protocol admin)
- Current sub-hooks: None (v1 placeholder)
- Future sub-hooks: SpendLimitHook, TokenAllowlistHook, RateLimitHook
- Non-removable:
onUninstall()reverts — the ValidationModule blocks all uninstall attempts
preCheck / postCheck on this multiplexer, which iterates over all registered sub-hooks.
Agether8004Scorer
Oracle-based credit score store + ERC-8004 Reputation Registry bridge. Replaces the previousAgentReputation contract.
Score submission flow:
ML oracle computes score (300-1000)
The backend ML model analyzes onchain agent behavior and computes a credit score.
Oracle signs attestation
Signs
keccak256(agentId, score, timestamp, chainId, contractAddr) with the oracle private key.Submit to Agether8004Scorer contract
Calls
submitScore(agentId, score, timestamp, signature) onchain.Onchain validation
The contract verifies:
- ECDSA signature matches the authorized oracle
- Score is in range
[300, 1000] - Timestamp is fresh (less than 24h old)
- Timestamp is newer than the previous attestation
- Signature includes
chainId+contractAddress→ prevents replay across chains and contracts - Attestations expire after 24 hours (
MAX_ORACLE_AGE) - Only strict monotonically newer timestamps accepted
- UUPS upgradeable with
AccessControl
Agether7579Bootstrap
A helper contractdelegatecalled during Safe.setup(). It installs all ERC-7579 modules (validator, hook) on the Safe in a single atomic initialization step. Not called directly by users.
Upgrade Governance
All upgrades are protected by a TimelockController:- Factory updates (validator/hook for new accounts) — owner is TimelockController
Agether8004Scorer— UUPS upgradeable, requiresDEFAULT_ADMIN_ROLEAgether8004ValidationModule—setValidationRegistry()isonlyOwner(TimelockController)- Existing Safe accounts — modules are locked and cannot be changed by users or admin
Security Summary
| Layer | Protection |
|---|---|
| Agether4337Factory | onlyOwner (Timelock), Create2 determinism |
| Safe Account | Sentinel owner (no execTransaction), 4337-only execution |
| Agether8004ValidationModule | Live NFT ownership check, KYA gate, module lock, EIP-1271 |
| AgetherHookMultiplexer | Admin-only sub-hook management, non-removable |
| Agether8004Scorer | ECDSA attestation, 24h expiry, replay prevention, UUPS + AccessControl |

