Skip to main content
Agether’s onchain layer uses Safe + Safe7579 as the smart wallet foundation, with custom ERC-7579 modules for agent identity, code validation, and credit scoring. All execution goes through ERC-4337 (account abstraction).

Contract Map

ERC-8004 IdentityRegistry (ag0 — external) provides ownerOf(agentId) used by all contracts below:
ContractRole
Agether4337FactoryDeploys Safe-based agent accounts with ERC-7579 modules
Agether8004ValidationModuleERC-7579 validator — ownership + KYA gate + module lock
AgetherHookMultiplexerERC-7579 hook — admin-managed chain of sub-hooks
Agether8004ScorerOracle-based credit score store + ERC-8004 reputation bridge
Agether7579BootstrapInitializer called during Safe.setup to install all modules
Morpho BlueExternal immutable lending protocol

Architecture

EOA signs UserOp


┌──────────────┐     ┌───────────┐     ┌────────────────────────────────┐
│  EntryPoint   │────▶│  Safe7579  │────▶│  Agether8004ValidationModule  │
│  (ERC-4337)   │     │  adapter   │     │  1. Block module management    │
└──────────────┘     └───────────┘     │  2. Check KYA approval         │
                                        │  3. Verify ERC-8004 NFT owner  │
                                        └────────────────────────────────┘

                                        ┌─────────────▼──────────────┐
                                        │  AgetherHookMultiplexer     │
                                        │  (chains sub-hooks)         │
                                        └─────────────┬──────────────┘


                                               Morpho Blue
Key design decision: The Safe owner is set to a sentinel address (no one can call execTransaction directly). ALL execution goes through ERC-4337 EntryPointSafe7579 → 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)
Key functions:
FunctionDescription
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.
Non-removable: 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
On every execution, Safe7579 calls 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 previous AgentReputation contract. Score submission flow:
1

ML oracle computes score (300-1000)

The backend ML model analyzes onchain agent behavior and computes a credit score.
2

Oracle signs attestation

Signs keccak256(agentId, score, timestamp, chainId, contractAddr) with the oracle private key.
3

Submit to Agether8004Scorer contract

Calls submitScore(agentId, score, timestamp, signature) onchain.
4

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
5

Store and publish

Stores the attestation onchain and publishes feedback to the ERC-8004 Reputation Registry.
Security:
  • 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 contract delegatecalled 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, requires DEFAULT_ADMIN_ROLE
  • Agether8004ValidationModulesetValidationRegistry() is onlyOwner (TimelockController)
  • Existing Safe accounts — modules are locked and cannot be changed by users or admin

Security Summary

LayerProtection
Agether4337FactoryonlyOwner (Timelock), Create2 determinism
Safe AccountSentinel owner (no execTransaction), 4337-only execution
Agether8004ValidationModuleLive NFT ownership check, KYA gate, module lock, EIP-1271
AgetherHookMultiplexerAdmin-only sub-hook management, non-removable
Agether8004ScorerECDSA attestation, 24h expiry, replay prevention, UUPS + AccessControl