84532). Solidity version: ^0.8.28.
Deployment addresses
ABIs are exported from
@hyperauth/contracts:
DIDRegistry
Ownable.
DidDocument struct
State variables
Functions
register
msg.sender is set as the controller.
Reverts if the DID is already registered, the controller already has a DID,
aliasHash is zero, or the alias is already claimed.
Emits: DIDRegistered, AliasRegistered.
update
msg.sender is not the controller, or if the DID is deactivated.
Emits: DIDUpdated.
deactivate
active = false. Removes controllerToDid, aliases, and didToAlias entries.
Emits: DIDDeactivated.
resolve
DidDocument for the given DID hash.
resolveAlias
DidDocument if the alias is not registered. Used by the frontend to check alias availability.
Events
HyperAuthAccount
ERC-4337 smart account. InheritsBaseAccount from @account-abstraction/contracts. Uses P-256 (secp256r1) signature verification via the LibP256 library.
State variables
Constructor
Functions
getOwner
_validateSignature
BaseAccount._validateSignature.
Expects userOp.signature to be exactly 64 bytes: ABI-encoded (uint256 r, uint256 s). Verifies using LibP256.verifySignature against the stored public key.
Returns 0 (success) or SIG_VALIDATION_FAILED.
entryPoint
IEntryPoint(ENTRY_POINT). Overrides BaseAccount.entryPoint.
receive
HyperAuthFactory
DeploysHyperAuthAccount contracts deterministically via CREATE2. The predicted address depends on the P-256 public key coordinates and an optional salt.
State variables
Constructor
HyperAuthAccount(entryPoint_, 0, 0) and stores it as ACCOUNT_IMPLEMENTATION.
Functions
createAccount
HyperAuthAccount via CREATE2. If the account already exists at the predicted address, returns the existing address without deploying.
The
CREATE2 salt is keccak256(abi.encodePacked(pubKeyX, pubKeyY, salt)).
Reverts with "Create2 failed" if deployment fails.
Emits: AccountCreated.
getAddress
Events
AccountHelper
HyperAuthAccount and DIDRegistry state into a single eth_call. Deploy once, never upgrade.
State variables
AccountState struct
Functions
getAccountState
isActive = false) if the account has no deployed code.
Steps performed:
- Checks
account.code.length > 0to setisActive. - Calls
HyperAuthAccount.getNonce()for the nonce. - Calls
HyperAuthAccount.getOwner()for the public key coordinates. - Calls
DIDRegistry.controllerToDid(account)for the DID hash.
SessionSBT
"HyperAuth Session", symbol: "HYS". Inherits ERC721, Ownable.
State variables
Functions
mintSession
Returns the token ID of the minted token.
revokeSession
isRevoked[tokenId] = true.
isRevoked (mapping)
true for a given token ID if that session has been revoked.
Soulbound behavior
ERC721._update. Allows minting (from == address(0)) and burning (to == address(0)), but reverts with "SessionSBT: Token is Soulbound" for any transfer between non-zero addresses.
LibP256
HyperAuthAccount._validateSignature. Not deployed standalone.