fn attest(
env: soroban_sdk::Env,
verifier: soroban_sdk::Address,
subject: soroban_sdk::Address,
jurisdiction: u32,
expires_at: u64,
metadata: soroban_sdk::Bytes,
)
Verifier can revoke their own attestation
fn revoke(
env: soroban_sdk::Env,
verifier: soroban_sdk::Address,
subject: soroban_sdk::Address,
)
Replace this contract's Wasm in place. Instance and persistent storage are preserved. Authorised by the stored DAO address.
fn upgrade(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
)
fn is_frozen(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
dao: soroban_sdk::Address,
)
fn is_us_or_eu(env: soroban_sdk::Env, code: u32) -> bool
Simple yes/no: is this address allowed to use the protocol right now? Equivalent to status==Verified && not expired && not in a blocked jurisdiction.
fn is_verified(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool
fn is_verifier(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool
Authorise an additional KYC provider address so users can choose it
to complete their KYC (multiple providers can be active at once;
use set_verifier if you only want a single canonical provider).
fn add_verifier(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
verifier: soroban_sdk::Address,
)
The current canonical KYC provider address, if one has been set via
set_verifier.
fn get_verifier(env: soroban_sdk::Env) -> Option
Set/replace the single canonical KYC provider address (e.g. the
signing address used by Persona or another provider). This both
authorises the new address and revokes the previous one, so a
rotated/compromised provider key stops working immediately.
Does not affect any OTHER providers already authorised via
add_verifier — this only manages the "canonical" single-provider
slot for integrations that want one default provider.
fn set_verifier(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
verifier: soroban_sdk::Address,
)
Returns all KYC provider addresses that have attested the given subject. Use this to check whether the user has attestations from multiple approved providers (e.g. both Sumsub AND Persona).
fn get_providers(
env: soroban_sdk::Env,
subject: soroban_sdk::Address,
) -> soroban_sdk::Vec
fn set_whitelist(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
contract: soroban_sdk::Address,
whitelisted: bool,
)
fn freeze_account(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
account: soroban_sdk::Address,
reason: soroban_sdk::Symbol,
)
fn get_asset_rule(
env: soroban_sdk::Env,
asset: soroban_sdk::Symbol,
) -> Option
Returns every authorised KYC provider address (Sumsub, Persona, Veriff, …) so a dApp can present the full list of providers the user may choose from to complete KYC. Off-chain metadata (display name, logo, hosted-flow URL) is intentionally not stored on-chain — the backend/webapp map each address to that metadata.
fn list_verifiers(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn set_asset_rule(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
asset: soroban_sdk::Symbol,
blocked_juris: soroban_sdk::Vec,
daily_limit: i128,
travel_rule: bool,
)
Re-apply the default US + EU jurisdiction block. Useful if the DAO wants to restore the default posture after selectively unblocking some codes.
fn block_us_and_eu(env: soroban_sdk::Env, dao: soroban_sdk::Address)
Register a signing key for an authorised provider. The signing key
is used to verify provider signatures on attestation submissions
(see submit_attestation). This enables the scalable model where
the provider signs a message off-chain and the user submits it —
the provider never pays gas.
Only an already-authorised verifier (added via add_verifier) may
register their own signing key.
fn register_signer(
env: soroban_sdk::Env,
provider: soroban_sdk::Address,
signer: soroban_sdk::Address,
)
fn remove_verifier(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
verifier: soroban_sdk::Address,
)
Suspend an address — temporarily prevents protocol usage without destroying the KYC attestation. The user's provider data is preserved; when unsuspended the user resumes as verified. For regulatory reviews, investigations, or temporary risk-management holds.
fn suspend_account(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
account: soroban_sdk::Address,
reason: soroban_sdk::Symbol,
)
fn get_daily_volume(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> i128
Permanently sanction (block) an address — OFAC / sanctions-list
level action. This is NOT reversible through the contract (requires
a new DAO proposal + admin action to overwrite). Differs from
freeze_account in that a freeze may be temporary (regulatory
order), while a sanction is a permanent status change.
fn sanction_account(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
account: soroban_sdk::Address,
reason: soroban_sdk::Symbol,
)
fn unfreeze_account(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
account: soroban_sdk::Address,
)
Read-only version of assert_user_compliant (never panics).
fn is_user_compliant(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool
Un-suspend an address — restores Verified status. Only callable by admin.
fn unsuspend_account(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
account: soroban_sdk::Address,
)
fn block_jurisdiction(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
country_code: u32,
)
Returns the number of distinct providers that have attested this address. Can be used to require N-of-M attestations for high-value operations.
fn get_provider_count(env: soroban_sdk::Env, subject: soroban_sdk::Address) -> u32
Is user's on-file jurisdiction currently allowed? Never reveals
which jurisdiction it is — just whether it's currently blocked.
Returns false if the user has never been attested.
fn is_jurisdiction_ok(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool
Submit a provider-signed attestation. This is the scalable flow:
Benefits:
For now, the signature verification is done via provider.require_auth()
on the provider address — in a full implementation, this would use
Ed25519 signature verification against the registered signer key.
The signer argument identifies WHICH provider is attesting.
fn submit_attestation(
env: soroban_sdk::Env,
subject: soroban_sdk::Address,
signer: soroban_sdk::Address,
jurisdiction: u32,
expires_at: u64,
)
Read-only compliance check (doesn't update volumes)
fn is_transfer_allowed(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
asset: soroban_sdk::Symbol,
amount: i128,
) -> bool
fn unblock_jurisdiction(
env: soroban_sdk::Env,
dao: soroban_sdk::Address,
country_code: u32,
)
Panics with a descriptive reason if user may not use the protocol.
caller is the contract requesting the check; it is only ever used
for the narrow system-to-system bypass (see comment below) — never
to exempt a real end user.
fn assert_user_compliant(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
user: soroban_sdk::Address,
) -> bool
Returns a privacy-preserving view of the ComplianceRecord for an
address (or a default Unknown view if never attested). The raw
jurisdiction/country is NEVER returned — only whether it is
currently allowed (jurisdiction_allowed), computed live against
the DAO's current blocklist so it stays accurate even if the DAO
blocks/unblocks a jurisdiction after the user was attested.
fn get_compliance_status(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
) -> ComplianceView
fn get_travel_rule_count(env: soroban_sdk::Env) -> u64
fn is_sanctioned_country(env: soroban_sdk::Env, code: u32) -> bool
Main entry: called before any transfer/mint/burn. Returns true if allowed, panics with reason if not.
fn assert_transfer_allowed(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
asset: soroban_sdk::Symbol,
amount: i128,
) -> bool
Look up which provider a signing key belongs to.
fn get_provider_for_signer(
env: soroban_sdk::Env,
signer: soroban_sdk::Address,
) -> Option
fn is_jurisdiction_blocked(env: soroban_sdk::Env, code: u32) -> bool
Re-apply the default OFAC/high-risk sanctioned-country block (Cuba, Iran, North Korea, Syria, Russia, Belarus, Myanmar, Venezuela, Sudan, South Sudan). Useful if the DAO wants to restore the default posture after selectively unblocking some codes.
fn block_sanctioned_countries(env: soroban_sdk::Env, dao: soroban_sdk::Address)