Return the contract owner.
fn owner(env: soroban_sdk::Env) -> soroban_sdk::Address
Replace the registry's WASM bytecode in place. Only the owner may call this. The contract address and all storage (owner, attesters, policies, spent UUIDs) are preserved; only the executable code changes.
new_wasm_hash is the SHA-256 hash of an already-uploaded contract WASM
(see stellar contract upload).
fn upgrade(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), RegistryError>
Initialize the registry with an owner address.
owner - Address with administrative privileges. Can register and
deregister attesters, and propose a new owner via the two-step
transfer_ownership / accept_ownership flow.fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address)
Get the policy ID for a client address.
fn get_policy_id(
env: soroban_sdk::Env,
client: soroban_sdk::Address,
) -> soroban_sdk::String
Return the pending owner, if any.
fn pending_owner(env: soroban_sdk::Env) -> Option
Set the policy ID for the calling address.
fn set_policy_id(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
policy_id: soroban_sdk::String,
)
Compute SHA-256 hash of a statement for attester signing. This is the "hashStatementWithExpiry" equivalent — attesters sign this hash.
fn hash_statement(
env: soroban_sdk::Env,
statement: Statement,
network: soroban_sdk::String,
) -> soroban_sdk::BytesN<32>
Accept a pending ownership transfer. Only the pending owner may call this.
fn accept_ownership(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
) -> Result<(), RegistryError>
Register a new attester. Only the contract owner may call this.
fn register_attester(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
attester: soroban_sdk::BytesN<32>,
) -> Result<(), RegistryError>
Propose a new owner. Only the current owner may call this.
The new owner must call accept_ownership to finalize the transfer.
This two-step pattern mirrors EVM's Ownable2StepUpgradeable, preventing
accidental transfers to wrong addresses.
fn transfer_ownership(
env: soroban_sdk::Env,
current_owner: soroban_sdk::Address,
new_owner: soroban_sdk::Address,
) -> Result<(), RegistryError>
Deregister an attester using swap-and-pop. Only the contract owner may call this.
fn deregister_attester(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
attester: soroban_sdk::BytesN<32>,
) -> Result<(), RegistryError>
Validate an attestation against a statement.
The caller parameter implements the hashStatementSafe pattern:
it replaces statement.target with the actual caller address before
verifying the signature, preventing cross-contract replay attacks.
In Soroban, the calling contract should pass e.current_contract_address().
fn validate_attestation(
env: soroban_sdk::Env,
statement: Statement,
attestation: Attestation,
network: soroban_sdk::String,
caller: soroban_sdk::Address,
) -> Result
Check whether an attester is currently registered.
fn is_attester_registered(
env: soroban_sdk::Env,
attester: soroban_sdk::BytesN<32>,
) -> bool
Return all registered attesters.
fn get_registered_attesters(
env: soroban_sdk::Env,
) -> soroban_sdk::Vec>