feat(launkr): add restricted SIP-010 token launcher + XYK AMM skill#1
Closed
julianariel wants to merge 3 commits into
Closed
feat(launkr): add restricted SIP-010 token launcher + XYK AMM skill#1julianariel wants to merge 3 commits into
julianariel wants to merge 3 commits into
Conversation
Adds the `launkr` skill (SKILL.md, AGENT.md, launkr.ts) for launching and
trading restricted SIP-010 tokens on the Launkr protected AMM, plus the
README and skills.json manifest entries.
Verified against the Launkr source (lp-singleton-v6 contract + /api/{launch,
protocol}): contract addresses, function/arg order, get-pool tuple fields,
fee schedule (bonding 1% / direct 5%), floors, and error codes.
Notable review fixes folded in:
- Network is single-sourced from the shared NETWORK env var (matching every
other skill and the wallet the tx is signed with). Removed the per-command
--network flag, which diverged from the broadcast network and from the fee
and explorer-URL network.
- swap-sell now broadcasts in Deny mode with a scoped fungible post-condition
on the token sold (asset name is the constant `strategy-token`, since every
token is a byte-identical copy of the template) instead of Allow mode.
- Dropped dead temp-file I/O in launch; reconciled SKILL.md / AGENT.md docs.
Follow-up (not in this PR): the /api/launch intent specifies clarityVersion 4
and the token template uses `contract-hash?` (Clarity 4), but the shared
deployContract helper cannot yet pass a clarity version.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Retargeting to upstream aibtcdev/skills (this repo is a fork; PRs belong on the parent). Reopening there with the same branch. |
makeContractDeploy is called without a clarity version, so deploys use the Stacks.js default. Add an optional `clarityVersion` to ContractDeployOptions and pass it through, so callers deploying a contract that needs a specific Clarity version (e.g. one using `contract-hash?`, a Clarity 4 primitive) can request it. Additive and backward-compatible — omitting it keeps the previous behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Pass the /api/launch intent's clarityVersion (4) through to the token deploy so the restricted-token template (which uses contract-hash?, a Clarity 4 primitive) deploys under the right version. - Validate mode-specific required args client-side before the API call (bonding needs --virtual-stx/--graduation-threshold; direct needs --stx-seed), so a bad invocation fails fast with a clear message. - Source the Hiro API host from the shared getApiBaseUrl(network) helper instead of a second hardcoded copy in NET_CONFIG. - Add author-agent frontmatter and inline launkr.io / ratherlabs.com links in SKILL.md; fix the skills.json author (rather-labs) to match the frontmatter and add authorAgent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Superseded by the upstream PR aibtcdev#413 — this repo is a fork, so the PR lives on the parent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
launkrskill — launch and trade restricted SIP-010 tokens on the Launkr protected AMM (Stacks): deploy a token, open a bonding or direct pool, quote, and swap STX for tokens via thelp-singleton-v6singleton. Works on mainnet and testnet.Files:
launkr/{SKILL.md,AGENT.md,launkr.ts}, plus theREADME.mdrow andskills.jsonmanifest entry.Verified against the Launkr source (
../launkr)Cross-checked
launkr.ts/SKILL.mdagainstlp-singleton-v1.clar,restricted-token-template.clar, andfront-end/api/{launch,protocol}.js:-v6suffix),create-pool-{direct,bonding}andswap-exact-{stx-for-tokens,tokens-for-stx}names + arg order.get-pooltuple field names, fee schedule (bonding 1%, direct 5%, 90% to fee-receiver), floors, and error codes.parseLaunkrArghandles every arg type the/api/launchintent emits; trait args encode as contract principals.Review fixes folded in
--networkflag. It resolved a local network for the singleton address / read-only calls, but the tx is signed & broadcast againstaccount.network(bound to theNETWORKenv var) and fee/explorer usedNETWORK— three sources that diverge if--networkdisagrees with the wallet. Now everything followsNETWORK(defaulttestnet), matching every other skill (e.g.jingswap).swap-sellpost-condition. WasPostConditionMode.Allowjustified by "asset name varies per token" — but the template hardcodes(define-fungible-token strategy-token), so the asset name is constant. NowDeny+ a scoped fungible post-condition (strategy-token,eq --tokens-in), mirroringswap-buy. The STX paid back is covered by the singleton's Clarity-4as-contract?allowance.launch; reconciled the SKILL.md/AGENT.md contradictions (theSome("")uri claim, the missingstrategy-tokenreference); documented--fee.Known follow-up (not in this PR)
The
/api/launchintent specifiesclarityVersion: 4and the token template usescontract-hash?(a Clarity 4 primitive), but the shareddeployContracthelper (src/lib/transactions/builder.ts) can't pass a clarity version, so the deploy currently uses the Stacks.js default. This touches shared infrastructure and needs a testnet deploy to verify — deliberately left out of this PR.Note on tooling
bunisn't available in the authoring environment, sobun run typecheck/validate/manifestwere not run locally. Call signatures, frontmatter fields, and the manifest entry were verified by hand against the generator; CI is the authoritative check for typecheck + manifest freshness.🤖 Generated with Claude Code