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.

convex-dev의 다른 스킬

account
convex-dev
Convex 계정을 생성하거나 조회합니다. 사용자가 새 계정을 설정하거나, 계정 세부 정보를 확인하거나, 키를 관리하려 할 때 사용하세요.
account
convex-dev
Convex 계정을 생성하거나 조회합니다. 사용자가 새 계정을 설정하거나, 계정 세부 정보를 확인하거나, 키를 관리하려 할 때 사용하세요.
token
convex-dev
Convex에서 대체 가능한 토큰을 생성하고 관리합니다. 사용자가 새 토큰을 만들거나, 토큰 잔액을 확인하거나, 토큰 공급량을 관리하려 할 때 사용하세요.
build-convex
convex-dev
Convex 프로젝트를 소스에서 빌드합니다. 기여자가 Convex를 컴파일, 테스트 또는 패키징하려 할 때 사용합니다.
convex-db
convex-dev
Convex DB(래티스 기반 SQL 데이터베이스)를 사용하세요. 사용자가 쿼리 작성, JDBC 또는 PostgreSQL 클라이언트를 통한 연결, 테이블 생성, 데이터 삽입/조회 등을 도와야 할 때 사용합니다.
convex-lisp
convex-dev
Convex Lisp 언어 참조 — CVM 규칙, 라이브러리 코드 호출, 액터 정의, juice 및 오류 코드. CVM 소스를 작성하거나 디버깅할 때 사용합니다…
deploy
convex-dev
액터(스마트 계약)를 Convex 네트워크에 배포합니다. 사용자가 내보낸 함수를 가진 새로운 온체인 액터를 생성하려 할 때 사용하세요.
ecosystem
convex-dev
Convex 생태계에서의 방향 안내 — 어떤 리포지토리에 무엇이 있는지, 사양과 문서가 어디에 있는지, 그리고 어떤 클라이언트 라이브러리가 존재하는지. 컨텍스트가 필요할 때 사용하세요…