Skip to content

v0.8.0

Latest

Choose a tag to compare

@brozorec brozorec released this 20 Oct 16:58
ddc327e

What's New (summary)

  • Confidential Token (new crate stellar-confidential): SEP-41 tokens with private balances and transfers. Balances are Pedersen commitments on the Grumpkin curve, every operation that consumes private state carries an UltraHonk proof verified cross-contract, and auditors recover amounts through per-transfer ECDH. The crate ships the token, an auditor key registry, a verification key registry, and a compliance extension (freezing, SAC authorized() passthrough, external authorization policy, clawback). Noir circuits with pinned verification keys live in packages/confidential/circuits, and examples/confidential has a compliant token, an allowlist policy, and a factory.
  • Fungible and non-fungible contract types:
    • Compose<(...)> selects the contract type by listing the extensions a token is made of; invalid combinations fail to compile with a diagnostic naming the offending pair
    • total supply tracking is an opt-in TotalSupply extension
    • Capped is a contract type that enforces the cap on every mint path
    • Allowlist and Blocklist can be combined
    • non-fungible Votes works with Enumerable and Consecutive, and Consecutive works with Royalties
  • RWA:
    • seven compliance modules ported from T-REX: country allow, country restrict, initial lockup period, max balance, supply limit, time-windowed transfer limits, and transfer allow, each with an example under examples/rwa/
    • batch operations, muxed address support, and mint pause
    • recovery and identity registry fixes
  • Vault: deposits that mint zero shares and redemptions that return zero assets are rejected; the virtual supply is bounded and reported in max_deposit and max_mint.
  • Smart Accounts: the signed digest binds the smart account address; spending-limit history is capped at the reachable ledger entry limit; new smart account factory example.
  • Contract Utils: Grumpkin curve arithmetic; Wad gains ln, exp, powi and powf; I256 mul_div recovers from phantom overflow.
  • Fee Abstraction: Eager consumes the whole approval and requires a balance-conserving fee token.
  • Error codes are unique across all packages, and each package owns a disjoint range (see Architecture.md).

Breaking Changes

  • Smart Accounts: signers commit to sha256(AuthDigestPreimage { account, signature_payload, context_rule_ids }.to_xdr()), and Delegated signers authorize __check_auth with the preimage struct. Off-chain signing flows must be updated; see the migration guide in packages/accounts/README.md.
  • Total supply: fungible tokens track the total supply only with the TotalSupply extension (RWA, Vault and Capped require it), and the counter moved out of instance storage. Tokens upgraded from v0.7.x must migrate it with migrate_total_supply (see examples/upgradeable/v2).
  • Minting: mint through the selected contract type, <Self as FungibleToken>::ContractType::mint(...). Calling a primitive such as Base::mint directly still compiles but skips the contract type's bookkeeping (supply counter, cap, voting units, enumeration).
  • RWA compliance: the CanTransfer and CanCreate hooks are removed. Transferred, Created and Destroyed both enforce the rule (by panicking) and update module state, and module hooks receive AccountSnapshots.
  • Error codes: most #[contracterror] codes changed. Clients and tests that match on numeric codes must be updated.
  • Non-fungible: get_approved panics with NonExistentToken for a nonexistent token instead of returning None.

Security

  • Smart Accounts: a Delegated signer that is the contract of a context being authorized is rejected with DelegatedSignerIsContextContract, and a smart account can no longer be its own Delegated signer (SelfDelegatedSigner).

What's Changed (detailed)

New Contributors

Full Changelog: v0.7.1...v0.8.0