Skip to main content
Agether contracts emit structured events at each key action. Use these for indexing, building dashboards, monitoring agent activity, and reacting to state changes.

Agether4337Factory Events

AccountCreated

Emitted when a new Safe-based agent account is deployed via createAccount().
FieldTypeDescription
agentIduint256ERC-8004 agent ID
safeAccountaddressDeployed Safe proxy address
owneraddressEOA that called createAccount()

ValidationModuleUpdated

Emitted when the factory’s validation module address is updated (affects new accounts only).
FieldTypeDescription
oldModuleaddressPrevious validation module
newModuleaddressNew validation module

HookMultiplexerUpdated

Emitted when the factory’s hook multiplexer address is updated (affects new accounts only).
FieldTypeDescription
oldHookaddressPrevious hook multiplexer
newHookaddressNew hook multiplexer

Agether8004ValidationModule Events

ModuleInstalled

Emitted when the validation module is installed on a Safe account (during creation).
FieldTypeDescription
accountaddressSafe account address
registryaddressERC-8004 identity registry
agentIduint256Agent ID bound to this account

ValidationRegistryUpdated

Emitted when the KYA ValidationRegistry address is changed by the owner.
FieldTypeDescription
oldRegistryaddressPrevious registry (or address(0) if was disabled)
newRegistryaddressNew registry (or address(0) to disable KYA gate)

AgetherHookMultiplexer Events

SubHookAdded

Emitted when a sub-hook is registered in the multiplexer.
FieldTypeDescription
hookaddressSub-hook contract address
totalHooksuint256Total number of registered sub-hooks

SubHookRemoved

Emitted when a sub-hook is removed from the multiplexer.
FieldTypeDescription
hookaddressSub-hook contract address
totalHooksuint256Remaining number of registered sub-hooks

Agether8004Scorer Events

ScoreSubmitted

Emitted when a credit score attestation is accepted and stored.
FieldTypeDescription
agentIduint256ERC-8004 agent ID
scoreuint256Credit score (300–1000)
timestampuint256Unix timestamp of attestation
signeraddressOracle address that signed the attestation

ScoreUpdated

Alias event emitted alongside ScoreSubmitted. The most important event for monitoring credit scores.
FieldTypeDescription
agentIduint256ERC-8004 agent ID
scoreuint256Credit score (300–1000)
timestampuint256Unix timestamp of attestation
signeraddressOracle address that signed the attestation
Example: Listen for score updates:
import { ethers } from 'ethers';

const scorer = new ethers.Contract(SCORER_ADDRESS, SCORER_ABI, provider);
scorer.on('ScoreUpdated', (agentId, score, timestamp, signer) => {
  console.log(`Agent ${agentId}: score ${score} at ${timestamp}`);
});

RegistryUpdated

Emitted when the ERC-8004 Reputation Registry address is updated.
FieldTypeDescription
oldRegistryaddressPrevious registry address
newRegistryaddressNew registry address

OracleSignerUpdated

Emitted when the oracle signer address is changed.
FieldTypeDescription
oldSigneraddressPrevious oracle signer
newSigneraddressNew oracle signer

ERC8004FeedbackFailed

Emitted when publishing feedback to the ERC-8004 Reputation Registry fails.
FieldTypeDescription
agentIduint256ERC-8004 agent ID
reasonstringFailure reason

ERC8004FeedbackPublished

Emitted when a score is successfully pushed to the ERC-8004 Reputation Registry.
FieldTypeDescription
agentIduint256ERC-8004 agent ID
valueint128Feedback value (mapped from credit score)
tag1stringFirst feedback tag
tag2stringSecond feedback tag

Morpho Blue Events (External)

These events are emitted by Morpho Blue and are useful for tracking agent positions:

SupplyCollateral

Emitted when collateral is deposited into a market.

Supply

Emitted when assets (USDC) are supplied to a market as a lender.

Borrow

Emitted when USDC is borrowed against collateral.

Repay

Emitted when borrowed USDC is repaid.

WithdrawCollateral

Emitted when collateral is withdrawn.

Withdraw

Emitted when supplied assets (USDC) are withdrawn by a lender.

Liquidate

Emitted when an undercollateralized position is liquidated.

Event Indexing Example

Using the Morpho GraphQL API to fetch agent events:
{
  transactions(
    where: { user: "0xYourSafeAccountAddress" }
    orderBy: Timestamp
    orderDirection: Desc
    first: 50
  ) {
    type
    timestamp
    data {
      ... on MarketTransferTransactionData {
        assetsAmount
        market { uniqueKey }
      }
    }
  }
}
Or subscribing to onchain events with viem:
import { createPublicClient, http, parseAbiItem } from 'viem';
import { base } from 'viem/chains';

const client = createPublicClient({ chain: base, transport: http() });

client.watchContractEvent({
  address: '0x56c7D35A976fac67b1993b66b861fCA32f59104F',
  abi: [parseAbiItem('event ScoreUpdated(uint256 indexed agentId, uint256 score, uint256 timestamp, address indexed signer)')],
  eventName: 'ScoreUpdated',
  onLogs: (logs) => console.log(logs),
});