token

โดย convex-dev

สร้างและจัดการโทเค็นที่ใช้แทนกันได้บน Convex ใช้เมื่อผู้ใช้ต้องการสร้างโทเค็นใหม่ ตรวจสอบยอดคงเหลือของโทเค็น หรือจัดการปริมาณโทเค็น

npx skills add https://github.com/convex-dev/convex --skill token

Fungible Tokens on Convex

Fungible tokens use the @convex.fungible standard library (convex-core/src/main/cvx/convex/asset/fungible.cvx). See the convex-lisp skill for CVM conventions, and transact for how transactions are signed.

Create a New Token

Fixed supply — no further tokens can ever be minted:

(deploy (@convex.fungible/build-token {:supply 1000000}))

Mintablebuild-token alone provides no mint or burn capability. To allow minting you must compose add-mint into the same deployment:

(deploy [(@convex.fungible/build-token {:supply 1000000})
         (@convex.fungible/add-mint {:minter *address* :max-supply 1000000000})])

Decide which the user wants before deploying — the choice is permanent, and a token deployed without add-mint fails on any later mint attempt.

build-token config: :supply (defaults to 0), :initial-holder (defaults to *address*), :decimals. add-mint config: :minter (any trust monitor, defaults to *address*) and :max-supply (from protocol v1, defaults to unlimited).

Always set :max-supply explicitly. Before v1 activates, omitting it defaults the cap to 0 — and because 0 is truthy in CVM, that installs a zero cap which blocks all minting, silently producing a mintable-looking token that can never mint (#528). Setting it explicitly is correct under both genesis and v1. See the protocol-versions skill.

deploy returns the token's actor address.

Operations

TaskSource
Check balance(@convex.fungible/balance #TOKEN #HOLDER)
Total supply(@convex.fungible/total-supply #TOKEN)
Decimals(@convex.fungible/decimals #TOKEN)
Transfer(@convex.fungible/transfer #TOKEN #DEST AMOUNT)
Mint(@convex.fungible/mint #TOKEN AMOUNT)
Burn(@convex.fungible/burn #TOKEN AMOUNT)

There is no quantity function — it returns :UNDECLARED. Total supply is total-supply.

balance, total-supply and decimals are reads: use a query, not a transaction. transfer, mint and burn change state and must be transactions.

If a Convex MCP server is configured, its getBalance and transfer tools also accept a token parameter.

Authorisation

Minting requires the caller to satisfy the token's :minter trust monitor; anything else fails with :TRUST. :minter takes any trust monitor, not just an address — see the trust skill for composing them (a mint window, a multi-party whitelist, delegated revocation). Creating, transferring, minting and burning are all transactions, so they need a key the user has supplied — see the transact skill. Without one you can prepare the source but not execute it.

Skills เพิ่มเติมจาก convex-dev

account
convex-dev
สร้างหรือตรวจสอบบัญชี Convex ใช้เมื่อผู้ใช้ต้องการตั้งค่าบัญชีใหม่ ตรวจสอบรายละเอียดบัญชี หรือจัดการคีย์
account
convex-dev
สร้างหรือตรวจสอบบัญชี Convex ใช้เมื่อผู้ใช้ต้องการตั้งค่าบัญชีใหม่ ตรวจสอบรายละเอียดบัญชี หรือจัดการคีย์
token
convex-dev
สร้างและจัดการโทเค็นที่สามารถใช้แทนกันได้บน Convex ใช้เมื่อผู้ใช้ต้องการสร้างโทเค็นใหม่ ตรวจสอบยอดคงเหลือของโทเค็น หรือจัดการอุปทานของโทเค็น
build-convex
convex-dev
Build โปรเจกต์ Convex จากซอร์ส ใช้เมื่อผู้มีส่วนร่วมต้องการ compile, test หรือ package Convex
convex-db
convex-dev
ใช้ Convex DB — ฐานข้อมูล SQL ที่มี lattice เป็นโครงสร้างพื้นฐาน ใช้เมื่อช่วยผู้ใช้เขียนคิวรี เชื่อมต่อผ่านไคลเอนต์ JDBC หรือ PostgreSQL สร้างตาราง แทรก/คิวรีข้อมูล,…
convex-lisp
convex-dev
เอกสารอ้างอิงภาษา Convex Lisp — ข้อกำหนด CVM, การเรียกใช้โค้ดไลบรารี, นิยามแอ็กเตอร์, juice และรหัสข้อผิดพลาด ใช้เมื่อเขียนหรือดีบักซอร์ส CVM สำหรับ…
deploy
convex-dev
ปรับใช้ actor (สมาร์ทคอนแทรกต์) ไปยังเครือข่าย Convex ใช้เมื่อผู้ใช้ต้องการสร้าง actor บนเชนใหม่ที่มีฟังก์ชันที่ส่งออก
ecosystem
convex-dev
การปฐมนิเทศในระบบนิเวศ Convex — อะไรอยู่ใน repository ใด, เอกสาร spec และ docs อยู่ที่ไหน, และมี client libraries ใดบ้าง ใช้เมื่อคุณต้องการบริบท...