Contract f25af88f3e26f603a6569b2554b3f85ccc8af9a88f3b904fba873637c64eb2ab

← Back to Index 📥 Download WASM

Meta

Description 8004 Identity Registry
Version 0.1.0
cliver 25.2.0#
rssdk_spec_shaking 2
rssdkver 25.3.0#dcbea44513feb7734af6b6c4aced2c4a7a2715d0
rsver 1.91.0-nightly

Instances

  • CBGPDCJIHQ32G42BE7F2CIT3YW6XRN5ED6GQJHCRZSNAYH6TGMCL6X35

Interface

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
)
fn register(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> u32
fn register_with_uri(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_uri: soroban_sdk::String,
) -> u32
fn register_full(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_uri: soroban_sdk::String,
    metadata: soroban_sdk::Vec,
) -> u32
fn set_agent_uri(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_id: u32,
    new_uri: soroban_sdk::String,
) -> Result<(), IdentityError>
fn agent_uri(
    env: soroban_sdk::Env,
    agent_id: u32,
) -> Result
fn set_metadata(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_id: u32,
    key: soroban_sdk::String,
    value: soroban_sdk::Bytes,
) -> Result<(), IdentityError>

Routes agentWallet key to the dedicated wallet storage slot.

fn get_metadata(
    env: soroban_sdk::Env,
    agent_id: u32,
    key: soroban_sdk::String,
) -> Option
fn set_agent_wallet(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_id: u32,
    new_wallet: soroban_sdk::Address,
) -> Result<(), IdentityError>
fn get_agent_wallet(
    env: soroban_sdk::Env,
    agent_id: u32,
) -> Option
fn unset_agent_wallet(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    agent_id: u32,
) -> Result<(), IdentityError>
fn extend_ttl(env: soroban_sdk::Env, agent_id: u32)
fn propose_upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), IdentityError>
fn cancel_upgrade(env: soroban_sdk::Env) -> Result<(), IdentityError>
fn execute_upgrade(env: soroban_sdk::Env) -> Result<(), IdentityError>
fn pending_upgrade(env: soroban_sdk::Env) -> Option
fn version(env: soroban_sdk::Env) -> soroban_sdk::String

Non-panicking owner_of (safe for cross-contract calls).

fn find_owner(env: soroban_sdk::Env, agent_id: u32) -> Option
fn agent_exists(env: soroban_sdk::Env, agent_id: u32) -> bool

Returns true if spender is owner or approved. False if agent missing.

fn is_authorized_or_owner(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    agent_id: u32,
) -> bool
fn total_agents(env: soroban_sdk::Env) -> u32

Returns the number of tokens owned by account.

Arguments

  • e - Access to the Soroban environment.
  • account - The address for which the balance is being queried.
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> u32

Returns the owner of the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address

Transfers the token with token_id from from to to.

WARNING: Confirmation that the recipient is capable of receiving the Non-Fungible is the caller's responsibility; otherwise the NFT may be permanently lost.

Arguments

  • e - Access to the Soroban environment.
  • from - Account of the sender.
  • to - Account of the recipient.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.
  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [token_id: u32]
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)

Transfers the token with token_id from from to to by using spenders approval.

Unlike transfer(), which is used when the token owner initiates the transfer, transfer_from() allows an approved third party (spender) to transfer the token on behalf of the owner. This function verifies that spender has the necessary approval.

WARNING: Confirmation that the recipient is capable of receiving the Non-Fungible is the caller's responsibility; otherwise the NFT may be permanently lost.

Arguments

  • e - Access to the Soroban environment.
  • spender - The address authorizing the transfer.
  • from - Account of the sender.
  • to - Account of the recipient.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.
  • [NonFungibleTokenError::InsufficientApproval] - If the spender does not have a valid approval.
  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.

Events

fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)

Gives permission to approved to transfer the token with token_id to another account. The approval is cleared when the token is transferred.

Only a single account can be approved at a time for a token_id. To remove an approval, the approver can approve their own address, effectively removing the previous approved address. Alternatively, setting the live_until_ledger to 0 will also revoke the approval.

Arguments

  • e - Access to Soroban environment.
  • approver - The address of the approver (should be owner or operator).
  • approved - The address receiving the approval.
  • token_id - Token ID as a number.
  • live_until_ledger - The ledger number at which the allowance expires. If live_until_ledger is 0, the approval is revoked.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
  • [NonFungibleTokenError::InvalidApprover] - If the owner address is not the actual owner of the token.
  • [NonFungibleTokenError::InvalidLiveUntilLedger] - If the ledge
fn approve(
    env: soroban_sdk::Env,
    approver: soroban_sdk::Address,
    approved: soroban_sdk::Address,
    token_id: u32,
    live_until_ledger: u32,
)

Approve or remove operator as an operator for the owner.

Operators can call transfer_from() for any token held by owner, and call approve() on behalf of owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • operator - Account to add to the set of authorized operators.
  • live_until_ledger - The ledger number at which the allowance expires. If live_until_ledger is 0, the approval is revoked.

Errors

  • [NonFungibleTokenError::InvalidLiveUntilLedger] - If the ledger number is less than the current ledger number.

Events

  • topics - ["approve_for_all", from: Address]
  • data - [operator: Address, live_until_ledger: u32]
fn approve_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
    live_until_ledger: u32,
)

Returns the account approved for the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option

Returns whether the operator is allowed to manage all the assets of owner.

Arguments

  • e - Access to the Soroban environment.
  • owner - Account of the token's owner.
  • operator - Account to be checked.
fn is_approved_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> bool

Returns the token collection name.

Arguments

  • e - Access to the Soroban environment.
fn name(env: soroban_sdk::Env) -> soroban_sdk::String

Returns the token collection symbol.

Arguments

  • e - Access to the Soroban environment.
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String

Returns the Uniform Resource Identifier (URI) for the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Notes

If the token does not exist, this function is expected to panic.

fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶