Skip to content

chore: world, contracts and builder cleanup and updates#54

Open
fc-tezza wants to merge 5 commits into
mainfrom
chore/cleanup-and-updates
Open

chore: world, contracts and builder cleanup and updates#54
fc-tezza wants to merge 5 commits into
mainfrom
chore/cleanup-and-updates

Conversation

@fc-tezza
Copy link
Copy Markdown
Contributor

TL:DR, primary updates: unified assembly build flow, capability pattern, location reveal, new extension freeze, storage unit added functionality, and fixes.

Assembly build guides

  • Introduction: Added shared High-level Build Steps and Extension freeze (optional). Linked programmable assemblies to the extension pattern.
  • Gate / Storage Unit / Turret: Unified structure: Extension Integration → API overview → Extension API. Storage Unit: open inventory (deposit_to_open_inventory, withdraw_from_open_inventory) and freeze_extension_config. Gate/Turret: view lists include owner_cap_id, energy_source_id, is_extension_frozen. Turret: BCS defined.

Smart Character

  • New section Transferring OwnerCaps to another account (limits when transferred to an address; full use via managed shared object + hot-potato receipt). Note that OwnerCap<Character> cannot be transferred to an address (enforced in access_control.move). Warning not to transfer PlayerProfile.

Move patterns & ownership

  • New Capability pattern section. Links to Move book for shared object, hot potato, derived objects.
  • Ownership model: "capability-based" links to Capability pattern; "programmable transactions" links to Sui docs; added access_control deep-dive link.

EVE Frontier world explainer

  • OwnerCap + typed witness clarified. Location: hashed-by-default + Optional: Public location reveal (reveal_location, LocationRegistry). Primitives: added deep-dive links.

Misc

  • Minor fixes in environment-setup, network-node, object-model, introduction-to-smart-contracts; README wording for gate, storage-unit, turret.

@fc-tezza fc-tezza changed the title Chore/cleanup and updates chore: world, contracts and builder cleanup and updates Mar 11, 2026

For extension development and integration follow the [high-level build steps](../introduction#high-level-build-steps).

### Smart Gate API overview
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt Smart Gate Extension API and Smart Gate API overview the same ? also this information might a duplicate of what is in https://docs.evefrontier.com/smart-assemblies/gate#linking-gates that it needs to be owned by the same person.
and default and custom behaviour is also in https://docs.evefrontier.com/smart-assemblies/gate
and I dont think the View functions and anchor function information is useful here.

Its mostly for the game and builders wont really need it

might be a good idea to remove this section

Copy link
Copy Markdown
Contributor Author

@fc-tezza fc-tezza Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though it may be useful for builders to have a context of ALL of the API endpoints in an assembly contract for interaction not just the extendable functions.

When you integrate with an assembly as a builder, your extension logic has access to all public functionality as well as the extendable API. and it is useful to generally know what public functionality is available I think.

Those other descriptions are non-technical and behavioral... I think is useful to have technical reference to the actual functions in code for builder context. Currently we don't really have a place for that.

Hence the reasoning for API vs Extension API, Extension API defines explicitly the extendable endpoints. The General API section is supposed to give technical context (not just behavioral description) to everything accessible on the assembly that could be used or is useful for extension integration.

But if it is not useful then I can remove it.

Comment thread smart-assemblies/introduction.md Outdated
Comment thread smart-assemblies/introduction.md Outdated
Comment thread smart-assemblies/introduction.md Outdated
Comment thread smart-assemblies/introduction.md Outdated
The [world storage unit module](https://github.com/evefrontier/world-contracts/blob/main/contracts/world/sources/assemblies/storage_unit.move) exposes:

Custom contracts use the **typed witness pattern**: define a witness struct (`Auth`) and register it on the storage unit.
- **Lifecycle & ownership:** Owner-cap–guarded `online` / `offline`, metadata updates, and admin flows (anchor, unanchor, energy source). View functions: `status`, `location`, `owner_cap_id`, `energy_source_id`, `inventory`, `is_extension_frozen`, `has_open_storage`, etc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the Lifecycle & ownership alone ? introducing terms like anchor and view functions does not go with the build flow. It could go as a prerequisite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921668049

I think a rework is worth consideration rather than outright removal as per my comment here.. we can discuss and come to an alignment

Custom contracts use the **typed witness pattern**: define a witness struct (`Auth`) and register it on the storage unit.
- **Lifecycle & ownership:** Owner-cap–guarded `online` / `offline`, metadata updates, and admin flows (anchor, unanchor, energy source). View functions: `status`, `location`, `owner_cap_id`, `energy_source_id`, `inventory`, `is_extension_frozen`, `has_open_storage`, etc.

- **Inventories:** Storage units have multiple inventory slots keyed by ID:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is great and good enough

Copy link
Copy Markdown
Contributor Author

@fc-tezza fc-tezza Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I should rework the API outline section to be more like this for all build flows.. is your suggestion that we just don't need the Lifecycle and Ownership section for context?

The issue I see is that we have a "description" section where we generally talk about behavior and game related usage.

And we have a very strict build section that focuses only on the extendable API endpoints themselves.

But we don't have a place to talk about the module functionality overall (from a technical perspective) which I think gives good context to builders who are going to build extension use-cases on top of it.

So basically, that was the goal of including the more general API and lifecycle etc sections... to give builder technical context more generally than just the explicit extension endpoints.

```

**Extension: deposit / withdraw** (main inventory; your extension calls these with your `Auth` witness):
**Freeze extension config (optional, irreversible):** Owner can call this after authorizing an extension so the extension cannot be changed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the freeze extension from the happy path here ?
its already available in the introduction section so it should be good enough.

Copy link
Copy Markdown
Contributor Author

@fc-tezza fc-tezza Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the introduction section only describes freezing.. I thought we should have a code reference on how to freeze.. but I didn't feel like that belonged in the introduction

The [world turret module](https://github.com/evefrontier/world-contracts/blob/main/contracts/world/sources/assemblies/turret.move) exposes:

Custom contracts use the **typed witness pattern**: define a witness struct (`Auth`) and register it on the turret.
- **Lifecycle & ownership:** Owner-cap–guarded `online` / `offline`, metadata updates, and admin flows (anchor, unanchor, energy source). View functions: `status`, `location`, `is_online`, `owner_cap_id`, `energy_source_id`, `extension_type`, `is_extension_configured`, `is_extension_frozen`, etc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, lifecycle section can be removed as it does not much help in the build section

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## Extension Integration

1. **Define a witness struct** (e.g. `public struct TurretAuth has drop {}`) in your Move package.
2. **Implement `get_target_priority_list`** with the same signature as the [world turret module](https://github.com/evefrontier/world-contracts/blob/main/contracts/world/sources/assemblies/turret.move):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of deleting this can we add BCS link to this . I dont see why 2 & 3 needs to be replaced with Turret API overview where it duplicates the same information https://docs.evefrontier.com/smart-assemblies/turret#behaviours

Custom contracts use the **typed witness pattern**: define a witness struct (`Auth`) and register it on the turret.
- **Lifecycle & ownership:** Owner-cap–guarded `online` / `offline`, metadata updates, and admin flows (anchor, unanchor, energy source). View functions: `status`, `location`, `is_online`, `owner_cap_id`, `energy_source_id`, `extension_type`, `is_extension_configured`, `is_extension_frozen`, etc.

- **Target priority:** The game calls `get_target_priority_list` whenever target behaviour changes (e.g. ship enters range, starts or stops attacking). Without an extension, the world module uses default rules. With an extension, the game resolves the package ID from the authorised type and calls **your** package’s `get_target_priority_list` with the same signature — you return a **BCS** ([Binary Canonical Serialization](https://sdk.mystenlabs.com/sui/bcs); Sui’s standard encoding format for on-chain data) encoded `vector<ReturnTargetPriorityList>` (target_item_id, priority_weight). The game shoots the highest-priority target; ties are resolved by list order.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this information is mostly duplicate from : https://docs.evefrontier.com/smart-assemblies/turret#behaviours

For extension development and integration follow the [high-level build steps](../introduction#high-level-build-steps).

After authorization, the game **resolves the package ID** from the authorised type and calls `get_target_priority_list` in your extension package whenever it evaluates targets for that turret.
### Turret API overview
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need this huge refactoring for turret build. the existing API section seems to have all the same information without duplicates form the https://docs.evefrontier.com/smart-assemblies/turret

Copy link
Copy Markdown
Contributor Author

@fc-tezza fc-tezza Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the goal here was to make the reader flow for all of the build sections (Storage, Gate, Turret) consistent and standardized

same sections and flow for all build documents

so the rework here is to add relevant general contract technical reference information on top of the more general behavioral descriptions in https://docs.evefrontier.com/smart-assemblies/turret

Comment thread smart-assemblies/smart-character.md Outdated
Comment thread smart-contracts/eve-frontier-world-explainer.md
Copy link
Copy Markdown
Contributor

@0xxlegolas 0xxlegolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • smart contracts and quick start sections looks good
  • for smart assemblies especially, except for adding open inventory api I dont see the value of major refactoring the sections.

@fc-tezza
Copy link
Copy Markdown
Contributor Author

fc-tezza commented Mar 12, 2026

#54 (review)

for smart assemblies especially, except for adding open inventory api I dont see the value of major refactoring the sections.

As per my replies here -

https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921668049
https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921836853
https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921846011
https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921824014
https://github.com/evefrontier/builder-documentation/pull/54/changes/BASE..0e734af2821b459953412e73449a232b7131f4d4#r2921826558

The primary gap I see is that we have two sections for assemblies..

  1. a non-technical behavioral description section for describing what the assembly does and its interaction with regards to the game.
  2. a technical build section that is strictly scoped to interaction with the extendable endpoints of an assembly only

We have no good place for general relevant technical information about the assembly contract as a whole which is useful for extension integration (not just the extendable endpoints). So this re-work was an attempt to bring that context and information into the build docs for assemblies.

Instead we could embed this information in the assembly README.md with the non-technical behavioral descriptions, but it feels more relevant to builders in the build.md

So the current iteration puts this information before the direct extendable builder flow as technical context for builders much like the pre-requisites, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants