Todas as lições · xUDT and tokens · Começa aqui · Glossário
Full-balance UDT burn is valid for SUDT and plain xUDTPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
Burning a UDT's entire balance is accepted by SUDT and xUDT without extensions, because those scripts allow output amount to be less than or equal to input amount. offckb removed a guard that rejected destroyAmount === totalBalance and now still emits a zero-balance type cell (16-byte zero amount), which is valid. Extension-enabled xUDT was not covered by this change.
Porque importa: A guard that rejects destroyAmount === totalBalance blocks a burn that sUDT and plain xUDT accept, so users cannot clear their full token balance and must leave at least one token behind.
Padrão
if (destroyAmount === totalBalance) { throw new Error('Destroying the entire UDT balance may be rejected by the UDT script...Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- ckb-devrel/offckb:
tests/sdk/ckb.udt.test.ts
- Conceitos
- Transaction building and fees, Capacity and cell size
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-08
- Última mudança
- 2026-10-08
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-10-08 · ckb-devrel/offckb · mais deste projeto
Mais sobre xUDT and tokens
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Full-balance UDT burn is valid for SUDT and plain xUDT", CKB lessons, https://pulse.lusocryptolabs.com/learned/xudt/full-balance-udt-burn-is-valid-for-sudt-and-plain-xudt, CC BY 4.0, last changed 2026-10-08.