A Sui Move package for fixed-supply currency issuance, designed for representing equity-like ownership stakes.
share::share::initialize mints exactly 10,000,000.000000 tokens (6 decimals) and makes the supply immutable. It enforces a set of structural invariants at initialization to guarantee the resulting token is well-formed, tamper-proof, and freeze-proof:
- The type parameter must be
<address>::share::Share - The currency's
MetadataCapmust already be deleted (metadata is frozen) - The treasury cap must be the canonical cap recorded on the currency at creation — this also rejects legacy-migrated currencies
- Decimals must equal 6
- Existing supply must be zero
- The currency must not be regulated — a regulated currency carries a
DenyCapV2whose holder could deny-list or globally pause share holders forever, so the deny authority must never exist over a share currency
Pin to a full commit SHA (never a branch):
[dependencies]
share = { git = "https://github.com/misofm/share.git", rev = "<commit-sha>" }- Create a package with a
sharemodule containing aSharetype (a plainkeyobject, e.g.public struct Share has key { id: UID }— NOT a one-time witness; the name must be exactlySharein a module namedshare). - Create a currency with
sui::coin_registry::new_currency. - Set any desired metadata (name, symbol, icon, description), then call
finalize_and_delete_metadata_capto freeze it. - Call
share::share::initializewith the currency and its canonical treasury cap (the one created together with the currency). - Distribute the returned
Balance<Share>to shareholders.
| Dependency | Source |
|---|---|
| Sui Framework | Sui standard libraries |
sui move buildsui move testIssues and pull requests are welcome. By contributing you agree that your contributions are licensed under the project's Apache 2.0 license.
Apache 2.0 © Miso Labs, Inc.