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 and tamper-proof:
- The type parameter must be
<address>::share::Share - The currency's
MetadataCapmust already be deleted (metadata is frozen) - Decimals must equal 6
- Existing supply must be zero
- Create a package with a
sharemodule containing aShareone-time witness type. - 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 treasury cap. - Distribute the returned
Balance<Share>to shareholders.
A convenience function is provided for constructing Walrus-hosted icon URLs:
let icon_url = share::share::construct_icon_url(blob_id);
// => "walrus://<base64url-encoded blob ID>"| Dependency | Source |
|---|---|
| codec | sui-potatoes/app (base64url encoding) |
| Sui Framework | Sui standard libraries |
sui move buildsui move test