Contract 06e7fdbf6d8028c5c8129c7a1a2f519d91cf81b2b4c2f6a87b3f530cf02f84ca

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
home_domain rgstry.xyz
rssdk_spec_shaking 2
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.97.0
source_repo github:stellar-registry/oz-combined-wasms

Interface

fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, token_id: u32)
fn mint(env: soroban_sdk::Env, to: soroban_sdk::Address) -> u32
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn paused(env: soroban_sdk::Env) -> bool
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn approve(
    env: soroban_sdk::Env,
    approver: soroban_sdk::Address,
    approved: soroban_sdk::Address,
    token_id: u32,
    live_until_ledger: u32,
)
fn balance(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> u32
fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)

Delegates voting power from account to delegatee.

To reclaim voting power (i.e. "undelegate"), call this with delegatee set to account (self-delegation). There is no separate undelegate operation.

Arguments

  • e - Access to the Soroban environment.
  • account - The account delegating its voting power.
  • delegatee - The account receiving the delegated voting power.

Events

  • topics - ["delegate_changed", delegator: Address]

  • data - [from_delegate: Option<Address>, to_delegate: Address]

  • topics - ["delegate_votes_changed", delegate: Address]

  • data - [previous_votes: u128, new_votes: u128]

Notes

Authorization for account is required.

fn delegate(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
    delegatee: soroban_sdk::Address,
)
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)
fn burn_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    token_id: u32,
)

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

Returns the current voting power (delegated votes) of an account.

Returns 0 if the account has no delegated voting power or does not exist in the contract.

Arguments

  • e - Access to the Soroban environment.
  • account - The address to query voting power for.
fn get_votes(env: soroban_sdk::Env, account: soroban_sdk::Address) -> u128
fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option

Returns the current delegate for an account.

Arguments

  • e - Access to the Soroban environment.
  • account - The address to query the delegate for.

Returns

  • Some(Address) - The delegate address (may be the account itself if self-delegated).
  • None - If the account has never delegated. An account whose delegate is None has no active voting power; it must call [Votes::delegate] (even to itself) before its votes are counted.
fn get_delegate(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
) -> Option
fn __constructor(
    env: soroban_sdk::Env,
    uri: soroban_sdk::String,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    owner: soroban_sdk::Address,
)
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)
fn approve_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: 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)

Returns the current total supply of voting units.

This tracks all voting units in circulation (regardless of delegation status), not just delegated votes.

Returns 0 if no voting units exist.

Arguments

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

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)

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,
)
fn is_approved_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> bool

Returns the voting power (delegated votes) of an account at a specific past ledger sequence number.

Returns 0 if the account had no delegated voting power at the given ledger or does not exist in the contract.

Arguments

  • e - Access to the Soroban environment.
  • account - The address to query voting power for.
  • ledger - The ledger sequence number to query (must be in the past).

Errors

  • [VotesError::FutureLookup] - If ledger >= current ledger sequence number.
fn get_votes_at_checkpoint(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
    ledger: u32,
) -> u128

Returns the total supply of voting units at a specific past ledger sequence number.

This tracks all voting units in circulation (regardless of delegation status), not just delegated votes.

Returns 0 if there were no voting units at the given ledger.

Arguments

  • e - Access to the Soroban environment.
  • ledger - The ledger sequence number to query (must be in the past).

Errors

  • [VotesError::FutureLookup] - If ledger >= current ledger sequence number.
fn get_total_supply_at_checkpoint(env: soroban_sdk::Env, ledger: u32) -> u128

Imports

WebAssembly Text (WAT) ▶