DubheSuiContracts

Contracts

This section covers everything related to the on-chain Move layer of a Dubhe DApp:

TopicWhat it covers
SchemasDeclare on-chain data in dubhe.config.ts, generate typed Move modules with schemagen, and understand the storage model
Address SystemDerive caller identity correctly in system functions; namespace isolation rules
Storage FeesHow write fees are calculated, how to top up a DApp’s credit balance, and benchmark numbers
Access ControlDappKey namespace isolation, public(package) write restriction, version/pause/admin guards
DApp AdminUpdate metadata, two-step ownership transfer, emergency pause, credit top-up
TestingUnit test patterns, multi-caller scenarios, #[expected_failure], and testing deploy hooks
UpgradingAdd new resources, bump versions, block stale packages, and register upgrades on-chain

What is the on-chain layer?

A Dubhe DApp consists of two layers:

dubhe.config.ts  →  schemagen  →  sources/codegen/   ← data layer (auto-generated)
                                   sources/systems/   ← logic layer (you write this)


                               Dubhe Framework (on-chain, already deployed)

You only write code in two places:

  • dubhe.config.ts — declare what data your contract has (resources, enums, errors)
  • sources/systems/ — write your game rules or business logic using the generated APIs

Everything else — storage, events, fee metering, versioning — is handled by the Framework automatically.