[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DPWSAP8DX50DDFHJR9YMKT":3,"skill-same:01M7DPWSAP8DX50DDFHJR9YMKT":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":46},"01M7DPWSAP8DX50DDFHJR9YMKT","assets",null,"Stellar Assets (classic) + trustlines + Stellar Asset Contract (SAC) bridge to smart contracts. Covers asset issuance, distribution, authorization flags, clawback, regulated assets, trustline management, and the SAC interop layer that exposes classic assets as SEP-41 contract tokens. Use when tokenizing real-world assets, issuing stablecoins, managing trustlines, or bridging classic assets to smart contracts.","ozioziel\u002FWorkville","ozioziel","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F201685456?v=4","01M7DPQ6XNF4MK3SRN0ADFTNHT","01M7DPQ6YAMRZ4S2NQPN9VQPH3",3,"MIT","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fassets\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: assets\ndescription: Stellar Assets (classic) + trustlines + Stellar Asset Contract (SAC) bridge to smart contracts. Covers asset issuance, distribution, authorization flags, clawback, regulated assets, trustline management, and the SAC interop layer that exposes classic assets as SEP-41 contract tokens. Use when tokenizing real-world assets, issuing stablecoins, managing trustlines, or bridging classic assets to smart contracts.\nuser-invocable: true\nargument-hint: \"[asset task]\"\n---\n\n# Stellar Assets, Trustlines, and SAC\n\nStellar's native token mechanism: classic asset issuance, trustlines, and the Stellar Asset Contract (SAC) bridge that makes classic assets usable from smart contracts. Default to classic assets over custom contract tokens unless you need custom logic.\n\n## When to use this skill\n- Issuing a new asset (stablecoin, security token, utility token)\n- Setting up trustlines from a client or contract\n- Managing issuer flags (auth required, auth revocable, clawback)\n- Bridging a classic asset into a smart contract via SAC\n- Building regulated-asset flows (compliance, KYC, freeze)\n\n## Related skills\n- Custom token contracts (when classic isn't enough) → `..\u002Fsmart-contracts\u002FSKILL.md`\n- UI flows for trustline creation and asset display → `..\u002Fdapp\u002FSKILL.md`\n- Looking up balances and trustline state → `..\u002Fdata\u002FSKILL.md`\n- Token-related SEPs (SEP-41, SEP-7, etc.) → `..\u002Fstandards\u002FSKILL.md`\n\n---\n\n\n## Overview\n\nStellar has two token mechanisms:\n\n1. **Stellar Assets (Classic)**: Built-in, highly efficient, full ecosystem support\n2. **Contract tokens (SEP-41)**: Custom contracts with flexible logic\n\n**Recommendation**: Prefer Stellar Assets unless you need custom token logic.\n\n## Stellar Assets (Classic)\n\n### Asset Types\n\n| Type | Description |\n|------|-------------|\n| Native (XLM) | Stellar's native currency, no trustline needed |\n| Credit | Issued by an account, requires trustline |\n| Liquidity Pool Shares | Represent LP positions |\n\n### Asset Identifiers\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n\u002F\u002F Native XLM\nconst xlm = StellarSdk.Asset.native();\n\n\u002F\u002F Credit asset (code + issuer)\nconst usdc = new StellarSdk.Asset(\n  \"USDC\",\n  \"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN\"\n);\n\n\u002F\u002F Asset code rules:\n\u002F\u002F - 1-4 chars: alphanumeric (credit_alphanum4)\n\u002F\u002F - 5-12 chars: alphanumeric (credit_alphanum12)\n```\n\n## Issuing Assets\n\n### Create Issuing Account\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst server = new StellarSdk.Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n\n\u002F\u002F 1. Create issuing account (should be separate from distribution)\nconst issuerKeypair = StellarSdk.Keypair.random();\nconst distributorKeypair = StellarSdk.Keypair.random();\n\n\u002F\u002F 2. Fund accounts (testnet)\nawait fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${issuerKeypair.publicKey()}`);\nawait fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${distributorKeypair.publicKey()}`);\n```\n\n### Issue Asset\n\n```typescript\nconst asset = new StellarSdk.Asset(\"MYTOKEN\", issuerKeypair.publicKey());\n\n\u002F\u002F 1. Distributor creates trustline to issuer\nconst distributorAccount = await server.loadAccount(distributorKeypair.publicKey());\n\nconst trustlineTx = new StellarSdk.TransactionBuilder(distributorAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.changeTrust({\n      asset: asset,\n      limit: \"1000000\", \u002F\u002F Max amount to hold\n    })\n  )\n  .setTimeout(180)\n  .build();\n\ntrustlineTx.sign(distributorKeypair);\nawait server.submitTransaction(trustlineTx);\n\n\u002F\u002F 2. Issuer sends tokens to distributor\nconst issuerAccount = await server.loadAccount(issuerKeypair.publicKey());\n\nconst issueTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.payment({\n      destination: distributorKeypair.publicKey(),\n      asset: asset,\n      amount: \"1000000\",\n    })\n  )\n  .setTimeout(180)\n  .build();\n\nissueTx.sign(issuerKeypair);\nawait server.submitTransaction(issueTx);\n```\n\n### Lock Issuing Account\n\nFor fixed-supply tokens, lock the issuer:\n\n```typescript\nconst lockTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setOptions({\n      masterWeight: 0, \u002F\u002F Disable master key\n    })\n  )\n  .setTimeout(180)\n  .build();\n\nlockTx.sign(issuerKeypair);\nawait server.submitTransaction(lockTx);\n\u002F\u002F Issuer can never issue more tokens\n```\n\n## Asset Flags\n\nConfigure issuer account flags for compliance:\n\n```typescript\nconst setFlagsTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setOptions({\n      setFlags:\n        StellarSdk.AuthRequiredFlag |    \u002F\u002F Trustlines require approval\n        StellarSdk.AuthRevocableFlag |   \u002F\u002F Can freeze trustlines\n        StellarSdk.AuthClawbackEnabledFlag, \u002F\u002F Can clawback tokens\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Flag Descriptions\n\n| Flag | Effect |\n|------|--------|\n| `AUTH_REQUIRED` | Users must get approval before receiving tokens |\n| `AUTH_REVOCABLE` | Issuer can freeze user balances |\n| `AUTH_IMMUTABLE` | Flags cannot be changed (permanent) |\n| `AUTH_CLAWBACK_ENABLED` | Issuer can clawback tokens from accounts |\n\n### Authorize Trustline\n\n```typescript\n\u002F\u002F When AUTH_REQUIRED is set, approve trustlines:\nconst authorizeTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setTrustLineFlags({\n      trustor: userPublicKey,\n      asset: asset,\n      flags: {\n        authorized: true,\n        \u002F\u002F authorizedToMaintainLiabilities: true, \u002F\u002F Partial auth\n      },\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Clawback Tokens\n\n```typescript\n\u002F\u002F Requires AUTH_CLAWBACK_ENABLED flag\nconst clawbackTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.clawback({\n      asset: asset,\n      from: targetAccountId,\n      amount: \"100\",\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n## Trustlines\n\n### Create Trustline\n\n```typescript\nconst changeTrustTx = new StellarSdk.TransactionBuilder(userAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.changeTrust({\n      asset: asset,\n      limit: \"10000\", \u002F\u002F 0 to remove trustline\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Check Trustline Status\n\n```typescript\nconst account = await server.loadAccount(userPublicKey);\nconst trustline = account.balances.find(\n  (b) =>\n    b.asset_type !== \"native\" &&\n    b.asset_code === \"USDC\" &&\n    b.asset_issuer === usdcIssuer\n);\n\nif (trustline) {\n  console.log(\"Balance:\", trustline.balance);\n  console.log(\"Limit:\", trustline.limit);\n  console.log(\"Authorized:\", trustline.is_authorized);\n}\n```\n\n## Stellar Asset Contract (SAC)\n\nSAC provides a smart-contract interface for Stellar Assets, enabling smart contract interactions.\n\n### Deploy SAC for Existing Asset\n\n```bash\n# Get the SAC address for an asset\nstellar contract asset deploy \\\n  --asset USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN \\\n  --source-account alice \\\n  --network testnet\n```\n\n### SAC Address Derivation\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst asset = new StellarSdk.Asset(\"USDC\", issuerPublicKey);\nconst contractId = asset.contractId(StellarSdk.Networks.TESTNET);\n\u002F\u002F Returns the deterministic SAC contract address\n```\n\n### Using SAC in Smart Contracts\n\n```rust\nuse soroban_sdk::{token::Client as TokenClient, Address, Env};\n\npub fn transfer_asset(\n    env: Env,\n    from: Address,\n    to: Address,\n    asset_contract: Address,\n    amount: i128,\n) {\n    from.require_auth();\n\n    \u002F\u002F Use standard token interface\n    let token = TokenClient::new(&env, &asset_contract);\n    token.transfer(&from, &to, &amount);\n}\n```\n\n### SAC vs Custom Token Interface\n\nSAC implements the standard SEP-41 token interface:\n- `balance(id: Address) -> i128`\n- `transfer(from: Address, to: Address, amount: i128)`\n- `approve(from: Address, spender: Address, amount: i128, expiration_ledger: u32)`\n- `allowance(from: Address, spender: Address) -> i128`\n- `decimals() -> u32`\n- `name() -> String`\n- `symbol() -> Symbol`\n\n## When to Use What\n\n### Use Stellar Assets When:\n- Standard fungible token (currency, stablecoin)\n- Need full ecosystem support (wallets, exchanges)\n- Regulatory compliance features (freeze, clawback)\n- Performance critical (classic operations are cheaper)\n- DEX integration via order book\n\n### Use Custom Contract Tokens When:\n- Complex transfer logic (royalties, fees, restrictions)\n- Custom authorization schemes\n- Non-standard token behaviors\n- Integration with custom DeFi contracts\n- NFTs or semi-fungible tokens\n\n> Reach for a fully custom token as a last resort. Many of the cases above\n> (royalties, fees, transfer restrictions) can be built with a regular\n> issued Stellar asset plus a thin \"SAC admin\" contract that drives the\n> SAC's `mint`, `burn`, and `clawback` functions. That keeps the ecosystem\n> compatibility of a normal asset (DEX, anchors, wallets, trustlines) while\n> still layering on custom logic. Prefer a custom contract token only when\n> you need token behavior the SAC genuinely cannot express.\n\n### Use SAC When:\n- Need a Stellar asset inside a smart contract\n- Building DeFi protocols with existing assets\n- Bridge between classic and smart contract operations\n\n## Querying Assets\n\n### Get Account Balances\n\n```typescript\nconst account = await server.loadAccount(publicKey);\n\nfor (const balance of account.balances) {\n  if (balance.asset_type === \"native\") {\n    console.log(\"XLM:\", balance.balance);\n  } else {\n    console.log(`${balance.asset_code}:`, balance.balance);\n  }\n}\n```\n\n### Find Assets\n\n```typescript\n\u002F\u002F Search for assets by code\nconst assets = await server\n  .assets()\n  .forCode(\"USDC\")\n  .call();\n\n\u002F\u002F Get specific asset details\nconst assetDetails = await server\n  .assets()\n  .forCode(\"USDC\")\n  .forIssuer(issuerPublicKey)\n  .call();\n```\n\n### Get Asset Statistics\n\n```typescript\nconst stats = await server\n  .assets()\n  .forCode(\"USDC\")\n  .forIssuer(issuerPublicKey)\n  .call();\n\n\u002F\u002F stats includes:\n\u002F\u002F - amount: total issued\n\u002F\u002F - num_accounts: trustline count\n\u002F\u002F - flags: issuer flags\n```\n\n## SEP Standards for Assets\n\n### SEP-0001 (stellar.toml)\n\nPublish asset metadata in your domain's `\u002F.well-known\u002Fstellar.toml`:\n\n```toml\n[[CURRENCIES]]\ncode = \"MYTOKEN\"\nissuer = \"GABC...\"\ndisplay_decimals = 2\nname = \"My Token\"\ndesc = \"A description of my token\"\nimage = \"https:\u002F\u002Fexample.com\u002Ftoken-logo.png\"\n```\n\n### SEP-0010 (Web Authentication)\n\nAuthenticate users with their Stellar accounts. Flow: the server generates a challenge transaction, the client signs it with their wallet, and the server verifies the signature. See [SEP-0010](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0010.md).\n\n### SEP-0024 (Hosted Deposit\u002FWithdrawal)\n\nFor fiat on\u002Foff ramps: an interactive webview flow where the anchor handles KYC and the fiat transfer. See [SEP-0024](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0024.md).\n\n### SEP-0045 (Web Auth for Contract Accounts)\n\nExtends SEP-10 to support contract accounts (`C...` addresses) for web authentication. Required for smart wallet \u002F passkey-based anchor integrations. Draft status; verify current status in [SEP-0045](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0045.md).\n\n### SEP-0050 (Non-Fungible Tokens)\n\nStandard contract interface for NFTs on Stellar. Reference implementations available in [OpenZeppelin Stellar Contracts](https:\u002F\u002Fgithub.com\u002FOpenZeppelin\u002Fstellar-contracts) with Base, Consecutive, and Enumerable variants. Draft status; verify current status in [SEP-0050](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0050.md).\n\n## Best Practices\n\n### Asset Issuance\n- Use separate issuing and distribution accounts\n- Lock issuer after initial distribution for fixed supply\n- Publish stellar.toml with asset metadata\n- Consider multisig for issuer account\n\n### Trustline Management\n- Check trustline exists before sending payments\n- Handle trustline creation in onboarding flow\n- Respect trustline limits\n- Monitor for frozen\u002Fdeauthorized status\n\n### Security\n- Validate asset issuer, not just code\n- Be cautious of assets with clawback enabled\n- Verify stellar.toml from authoritative source\n- Use well-known asset lists for common tokens\n","# Stellar Assets, Trustlines, and SAC\n\nStellar's native token mechanism: classic asset issuance, trustlines, and the Stellar Asset Contract (SAC) bridge that makes classic assets usable from smart contracts. Default to classic assets over custom contract tokens unless you need custom logic.\n\n## When to use this skill\n- Issuing a new asset (stablecoin, security token, utility token)\n- Setting up trustlines from a client or contract\n- Managing issuer flags (auth required, auth revocable, clawback)\n- Bridging a classic asset into a smart contract via SAC\n- Building regulated-asset flows (compliance, KYC, freeze)\n\n## Related skills\n- Custom token contracts (when classic isn't enough) → `..\u002Fsmart-contracts\u002FSKILL.md`\n- UI flows for trustline creation and asset display → `..\u002Fdapp\u002FSKILL.md`\n- Looking up balances and trustline state → `..\u002Fdata\u002FSKILL.md`\n- Token-related SEPs (SEP-41, SEP-7, etc.) → `..\u002Fstandards\u002FSKILL.md`\n\n---\n\n\n## Overview\n\nStellar has two token mechanisms:\n\n1. **Stellar Assets (Classic)**: Built-in, highly efficient, full ecosystem support\n2. **Contract tokens (SEP-41)**: Custom contracts with flexible logic\n\n**Recommendation**: Prefer Stellar Assets unless you need custom token logic.\n\n## Stellar Assets (Classic)\n\n### Asset Types\n\n| Type | Description |\n|------|-------------|\n| Native (XLM) | Stellar's native currency, no trustline needed |\n| Credit | Issued by an account, requires trustline |\n| Liquidity Pool Shares | Represent LP positions |\n\n### Asset Identifiers\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\n\u002F\u002F Native XLM\nconst xlm = StellarSdk.Asset.native();\n\n\u002F\u002F Credit asset (code + issuer)\nconst usdc = new StellarSdk.Asset(\n  \"USDC\",\n  \"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN\"\n);\n\n\u002F\u002F Asset code rules:\n\u002F\u002F - 1-4 chars: alphanumeric (credit_alphanum4)\n\u002F\u002F - 5-12 chars: alphanumeric (credit_alphanum12)\n```\n\n## Issuing Assets\n\n### Create Issuing Account\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst server = new StellarSdk.Horizon.Server(\"https:\u002F\u002Fhorizon-testnet.stellar.org\");\n\n\u002F\u002F 1. Create issuing account (should be separate from distribution)\nconst issuerKeypair = StellarSdk.Keypair.random();\nconst distributorKeypair = StellarSdk.Keypair.random();\n\n\u002F\u002F 2. Fund accounts (testnet)\nawait fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${issuerKeypair.publicKey()}`);\nawait fetch(`https:\u002F\u002Ffriendbot.stellar.org?addr=${distributorKeypair.publicKey()}`);\n```\n\n### Issue Asset\n\n```typescript\nconst asset = new StellarSdk.Asset(\"MYTOKEN\", issuerKeypair.publicKey());\n\n\u002F\u002F 1. Distributor creates trustline to issuer\nconst distributorAccount = await server.loadAccount(distributorKeypair.publicKey());\n\nconst trustlineTx = new StellarSdk.TransactionBuilder(distributorAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.changeTrust({\n      asset: asset,\n      limit: \"1000000\", \u002F\u002F Max amount to hold\n    })\n  )\n  .setTimeout(180)\n  .build();\n\ntrustlineTx.sign(distributorKeypair);\nawait server.submitTransaction(trustlineTx);\n\n\u002F\u002F 2. Issuer sends tokens to distributor\nconst issuerAccount = await server.loadAccount(issuerKeypair.publicKey());\n\nconst issueTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.payment({\n      destination: distributorKeypair.publicKey(),\n      asset: asset,\n      amount: \"1000000\",\n    })\n  )\n  .setTimeout(180)\n  .build();\n\nissueTx.sign(issuerKeypair);\nawait server.submitTransaction(issueTx);\n```\n\n### Lock Issuing Account\n\nFor fixed-supply tokens, lock the issuer:\n\n```typescript\nconst lockTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setOptions({\n      masterWeight: 0, \u002F\u002F Disable master key\n    })\n  )\n  .setTimeout(180)\n  .build();\n\nlockTx.sign(issuerKeypair);\nawait server.submitTransaction(lockTx);\n\u002F\u002F Issuer can never issue more tokens\n```\n\n## Asset Flags\n\nConfigure issuer account flags for compliance:\n\n```typescript\nconst setFlagsTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setOptions({\n      setFlags:\n        StellarSdk.AuthRequiredFlag |    \u002F\u002F Trustlines require approval\n        StellarSdk.AuthRevocableFlag |   \u002F\u002F Can freeze trustlines\n        StellarSdk.AuthClawbackEnabledFlag, \u002F\u002F Can clawback tokens\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Flag Descriptions\n\n| Flag | Effect |\n|------|--------|\n| `AUTH_REQUIRED` | Users must get approval before receiving tokens |\n| `AUTH_REVOCABLE` | Issuer can freeze user balances |\n| `AUTH_IMMUTABLE` | Flags cannot be changed (permanent) |\n| `AUTH_CLAWBACK_ENABLED` | Issuer can clawback tokens from accounts |\n\n### Authorize Trustline\n\n```typescript\n\u002F\u002F When AUTH_REQUIRED is set, approve trustlines:\nconst authorizeTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.setTrustLineFlags({\n      trustor: userPublicKey,\n      asset: asset,\n      flags: {\n        authorized: true,\n        \u002F\u002F authorizedToMaintainLiabilities: true, \u002F\u002F Partial auth\n      },\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Clawback Tokens\n\n```typescript\n\u002F\u002F Requires AUTH_CLAWBACK_ENABLED flag\nconst clawbackTx = new StellarSdk.TransactionBuilder(issuerAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.clawback({\n      asset: asset,\n      from: targetAccountId,\n      amount: \"100\",\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n## Trustlines\n\n### Create Trustline\n\n```typescript\nconst changeTrustTx = new StellarSdk.TransactionBuilder(userAccount, {\n  fee: StellarSdk.BASE_FEE,\n  networkPassphrase: StellarSdk.Networks.TESTNET,\n})\n  .addOperation(\n    StellarSdk.Operation.changeTrust({\n      asset: asset,\n      limit: \"10000\", \u002F\u002F 0 to remove trustline\n    })\n  )\n  .setTimeout(180)\n  .build();\n```\n\n### Check Trustline Status\n\n```typescript\nconst account = await server.loadAccount(userPublicKey);\nconst trustline = account.balances.find(\n  (b) =>\n    b.asset_type !== \"native\" &&\n    b.asset_code === \"USDC\" &&\n    b.asset_issuer === usdcIssuer\n);\n\nif (trustline) {\n  console.log(\"Balance:\", trustline.balance);\n  console.log(\"Limit:\", trustline.limit);\n  console.log(\"Authorized:\", trustline.is_authorized);\n}\n```\n\n## Stellar Asset Contract (SAC)\n\nSAC provides a smart-contract interface for Stellar Assets, enabling smart contract interactions.\n\n### Deploy SAC for Existing Asset\n\n```bash\n# Get the SAC address for an asset\nstellar contract asset deploy \\\n  --asset USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN \\\n  --source-account alice \\\n  --network testnet\n```\n\n### SAC Address Derivation\n\n```typescript\nimport * as StellarSdk from \"@stellar\u002Fstellar-sdk\";\n\nconst asset = new StellarSdk.Asset(\"USDC\", issuerPublicKey);\nconst contractId = asset.contractId(StellarSdk.Networks.TESTNET);\n\u002F\u002F Returns the deterministic SAC contract address\n```\n\n### Using SAC in Smart Contracts\n\n```rust\nuse soroban_sdk::{token::Client as TokenClient, Address, Env};\n\npub fn transfer_asset(\n    env: Env,\n    from: Address,\n    to: Address,\n    asset_contract: Address,\n    amount: i128,\n) {\n    from.require_auth();\n\n    \u002F\u002F Use standard token interface\n    let token = TokenClient::new(&env, &asset_contract);\n    token.transfer(&from, &to, &amount);\n}\n```\n\n### SAC vs Custom Token Interface\n\nSAC implements the standard SEP-41 token interface:\n- `balance(id: Address) -> i128`\n- `transfer(from: Address, to: Address, amount: i128)`\n- `approve(from: Address, spender: Address, amount: i128, expiration_ledger: u32)`\n- `allowance(from: Address, spender: Address) -> i128`\n- `decimals() -> u32`\n- `name() -> String`\n- `symbol() -> Symbol`\n\n## When to Use What\n\n### Use Stellar Assets When:\n- Standard fungible token (currency, stablecoin)\n- Need full ecosystem support (wallets, exchanges)\n- Regulatory compliance features (freeze, clawback)\n- Performance critical (classic operations are cheaper)\n- DEX integration via order book\n\n### Use Custom Contract Tokens When:\n- Complex transfer logic (royalties, fees, restrictions)\n- Custom authorization schemes\n- Non-standard token behaviors\n- Integration with custom DeFi contracts\n- NFTs or semi-fungible tokens\n\n> Reach for a fully custom token as a last resort. Many of the cases above\n> (royalties, fees, transfer restrictions) can be built with a regular\n> issued Stellar asset plus a thin \"SAC admin\" contract that drives the\n> SAC's `mint`, `burn`, and `clawback` functions. That keeps the ecosystem\n> compatibility of a normal asset (DEX, anchors, wallets, trustlines) while\n> still layering on custom logic. Prefer a custom contract token only when\n> you need token behavior the SAC genuinely cannot express.\n\n### Use SAC When:\n- Need a Stellar asset inside a smart contract\n- Building DeFi protocols with existing assets\n- Bridge between classic and smart contract operations\n\n## Querying Assets\n\n### Get Account Balances\n\n```typescript\nconst account = await server.loadAccount(publicKey);\n\nfor (const balance of account.balances) {\n  if (balance.asset_type === \"native\") {\n    console.log(\"XLM:\", balance.balance);\n  } else {\n    console.log(`${balance.asset_code}:`, balance.balance);\n  }\n}\n```\n\n### Find Assets\n\n```typescript\n\u002F\u002F Search for assets by code\nconst assets = await server\n  .assets()\n  .forCode(\"USDC\")\n  .call();\n\n\u002F\u002F Get specific asset details\nconst assetDetails = await server\n  .assets()\n  .forCode(\"USDC\")\n  .forIssuer(issuerPublicKey)\n  .call();\n```\n\n### Get Asset Statistics\n\n```typescript\nconst stats = await server\n  .assets()\n  .forCode(\"USDC\")\n  .forIssuer(issuerPublicKey)\n  .call();\n\n\u002F\u002F stats includes:\n\u002F\u002F - amount: total issued\n\u002F\u002F - num_accounts: trustline count\n\u002F\u002F - flags: issuer flags\n```\n\n## SEP Standards for Assets\n\n### SEP-0001 (stellar.toml)\n\nPublish asset metadata in your domain's `\u002F.well-known\u002Fstellar.toml`:\n\n```toml\n[[CURRENCIES]]\ncode = \"MYTOKEN\"\nissuer = \"GABC...\"\ndisplay_decimals = 2\nname = \"My Token\"\ndesc = \"A description of my token\"\nimage = \"https:\u002F\u002Fexample.com\u002Ftoken-logo.png\"\n```\n\n### SEP-0010 (Web Authentication)\n\nAuthenticate users with their Stellar accounts. Flow: the server generates a challenge transaction, the client signs it with their wallet, and the server verifies the signature. See [SEP-0010](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0010.md).\n\n### SEP-0024 (Hosted Deposit\u002FWithdrawal)\n\nFor fiat on\u002Foff ramps: an interactive webview flow where the anchor handles KYC and the fiat transfer. See [SEP-0024](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0024.md).\n\n### SEP-0045 (Web Auth for Contract Accounts)\n\nExtends SEP-10 to support contract accounts (`C...` addresses) for web authentication. Required for smart wallet \u002F passkey-based anchor integrations. Draft status; verify current status in [SEP-0045](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0045.md).\n\n### SEP-0050 (Non-Fungible Tokens)\n\nStandard contract interface for NFTs on Stellar. Reference implementations available in [OpenZeppelin Stellar Contracts](https:\u002F\u002Fgithub.com\u002FOpenZeppelin\u002Fstellar-contracts) with Base, Consecutive, and Enumerable variants. Draft status; verify current status in [SEP-0050](https:\u002F\u002Fgithub.com\u002Fstellar\u002Fstellar-protocol\u002Fblob\u002Fmaster\u002Fecosystem\u002Fsep-0050.md).\n\n## Best Practices\n\n### Asset Issuance\n- Use separate issuing and distribution accounts\n- Lock issuer after initial distribution for fixed supply\n- Publish stellar.toml with asset metadata\n- Consider multisig for issuer account\n\n### Trustline Management\n- Check trustline exists before sending payments\n- Handle trustline creation in onboarding flow\n- Respect trustline limits\n- Monitor for frozen\u002Fdeauthorized status\n\n### Security\n- Validate asset issuer, not just code\n- Be cautious of assets with clawback enabled\n- Verify stellar.toml from authoritative source\n- Use well-known asset lists for common tokens\n",{"name":5,"description":7,"argument-hint":23,"user-invocable":24},"[asset task]",true,"main","217c58ef684b467a1122bd3bac74141a90f974cd",".codex\u002Fskills\u002Fassets",0,"https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville","https:\u002F\u002Fmyworkville.com","https:\u002F\u002Fgithub.com\u002Fozioziel","Full Stack Developer | React · NestJS · Flutter · Python | AI & Cloud | Penguins 🐧\r\n","2026-11-11 03:39:50",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":24},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ozioziel\u002FWorkville --skill assets",{"tool":40,"command":41},"bunx","bunx skills add ozioziel\u002FWorkville --skill assets",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ozioziel\u002FWorkville --skill assets","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fassets\u002FSKILL.md",[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M7DQ1A5WKJHC1DSAAK9SJ5W8","zk-proofs","Zero-knowledge proofs and privacy patterns on Stellar. Covers Groth16 verification in smart contracts via BLS12-381 host functions (CAP-0059, available), the BN254 + Poseidon proposals (CAP-0074\u002F0075, status-sensitive), and concrete toolchain walkthroughs for Circom (on-chain verifiable today), Noir, and RISC Zero (attestation pattern until BN254 lands). Use when building privacy-preserving applications, ZK-verifier contracts, or wiring a proving toolchain to Stellar.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fzk-proofs\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7DQ171146QGP8BTPA4AQZX7","tyler-architect","System architect and technical design leader. Use when the user asks to talk to Tyler or requests the architect.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Ftyler-architect\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M7DQ120EG4KCSXJ8SBH7P7A8","stellar-help","Analyzes current state and user query to answer BMad questions or recommend the next skill(s) to use. Use when user asks for help, bmad help, what to do next, or what to start with in BMad.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstellar-help\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7DQ0P859R7J75ZC9G93YHF2","stellar-competitive-landscape","Map the competitive landscape for a Stellar project idea. Use when a user says \"who are my competitors on Stellar\", \"competitive analysis Stellar\", \"what already exists in this space on Stellar\", \"show me similar Stellar projects\", \"is anyone else building this on Stellar\", \"map the Stellar landscape for X\" — or the Spanish\u002Fmixed-language equivalents, e.g. \"cual es la competencia de X\", \"que tan saturado está este espacio\", \"que aspectos están menos explorados y la SDF\u002FSCF están dispuestos a fondear\", or \"analiza la competencia de estos bounties\". Also fires when a user (directly, or via a BMAD persona like justin-analyst) names a specific protocol\u002Fidea inline and asks about its competition, viability, or market whitespace — including \"should we integrate [external protocol]\" or \"does anything like this already exist on Stellar\" research, where the deliverable is the same landscape map applied to a build-vs-integrate decision. Queries the 728-project LumenLoop ecosystem database and Electric Capital developer activity to rank competitors by SCF funding history and repo activity.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstellar-competitive-landscape\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7DQ0DJ62TJJV7Z6N3149ZWJ","standards","Stellar standards, ecosystem, and reference. Covers SEPs (Stellar Ecosystem Proposals), CAPs (Core Advancement Proposals), and a quick map for picking the right standard for wallets, anchors, payments, deposits\u002Fwithdrawals, federation, deep links, and KYC. Also bundles ecosystem references (DeFi protocols, dev tools, wallets, infra, community projects), curated documentation links, and MCP servers (live tools such as Raven). Use when you need to know which SEP applies, or want a starting point for ecosystem integrations, official docs, or live MCP tooling.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fstandards\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7DQ0697WA5NA7C4XHCVK193","smart-contracts","Stellar smart contract development (Rust, soroban-sdk). Entry point with project setup, contract anatomy, and build\u002Fdeploy workflow, routing to three companion files in this directory — development.md (storage\u002FTTL, authorization, cross-contract calls, tokens, events, errors, upgrades, fees, troubleshooting), testing.md (unit, fuzz, property, fork, mutation, integration), and security.md (vulnerability classes, checklists, tooling, audits). Use when writing, testing, reviewing, securing, debugging, or shipping Stellar smart contracts, including anything the user calls \"Soroban\" — Soroban contracts, soroban-sdk, Soroban auth\u002Fstorage\u002FTTL errors, SEP-41 tokens, or SAC integration from contract code.","https:\u002F\u002Fgithub.com\u002Fozioziel\u002FWorkville\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fsmart-contracts\u002FSKILL.md",[],[]]