Some checks are pending
CI — CoM Config Validation / Validate JSON Configs (push) Waiting to run
CI — CoM Config Validation / Validate YAML Configs (push) Waiting to run
CI — CoM Config Validation / Lint Shell Scripts (push) Waiting to run
CI — CoM Config Validation / Secret Detection (push) Waiting to run
CI — CoM Config Validation / Lint Markdown (push) Waiting to run
CI — CoM Config Validation / Validate CODEOWNERS (push) Waiting to run
Public, sanitized mirror of an AI orchestration command center: agents, skills, MCP servers, slash-command workflows. All infrastructure identifiers, hostnames, mesh IPs/subnets, repo paths, maintainer identity, and hardware fleet specifics scrubbed to <placeholders>; session debug logs and host-specific memory removed. No live credentials. Verified clean by automated leak sweep. See SANITIZATION.md. churchofmalware.org . authorized research only
3.5 KiB
3.5 KiB
Move Entry Point Detection (Sui)
Entry Point Identification (State-Changing Only)
In Move, public functions can be invoked from programmable transaction blocks (Sui) or transaction scripts (Aptos) and typically modify state. In addition, private entry functions are entrypoints. Package-protected (public(package) fun) and private (fun) functions should be excluded.
// Public functions
public fun compute(obj: &mut Object): u64 { }
// Entry functions in Sui
public entry fun transfer(ctx: &mut TxContext) { }
Visibility Rules
| Visibility | Include? | Notes |
|---|---|---|
public entry fun |
Yes | Callable from transactions and modules |
public fun |
Yes | Callable from transactions and modules |
entry fun |
Yes | Callable from transactions, but not other modules |
fun (private) |
No | Not externally callable |
public(package) fun |
No | Only callable by other modules in the same package |
Access Control Patterns
// Object types have the key ability
public struct MyObject has key { id: ID, ... }
// Capability objects typically have names that end with "Cap"
public struct AdminCap has key { id: ID, ... }
// Shared objects are created via `public_share
public struct Pool has key { id: ID, ... }
// Object ownership provides access control
public fun use_owned_object(obj: &mut MyObject) {
// Only owner of obj can call this
}
// Shared object - anyone can access
public fun use_shared(pool: &mut Pool) { }
// Shared Pool object gated by capability - only owner of AdminCap can call
public fun capability_gate(_cap: &AdminCap, pool: &mut Pool) {}
Access Control Classification
| Pattern | Classification |
|---|---|
| Owned object parameter | Owner of object |
| Shared object | Public (Unrestricted) |
Contract-Only Detection
Package-protected Functions
// Only callable by other modules in the same Move package
public(protected) fun internal_fun() { }
Extraction Strategy
- Parse all
.movefiles - Find
moduledeclarations - Extract
public,public entry, andentryfunctions - Extract object type declarations (
struct's that have thekeyability) - Determine whether each object type is owned (passed as parameter to
transferorpublic_transferfunctions) or shared (passed as parameter toshareorpublic_sharefunctions) - Analyze parameters:
- Owned object type with "XCap" in name -> X role (e.g., AdminCap = Admin role, GuardianCap = Guardian role)
- Owned object type without "Cap" in name -> Owner role
- Shared object type -> Public
Move-Specific Considerations
- Object Model: Access control typically through object ownership (rather than runtime assertions)
- Capabilities:
Capsuffix typically indicates capability pattern - Generic Types: Type parameters may carry capability constraints
- Package Visibility:
public(pacakge)limits callers to modules in the same package
Common Gotchas
- Module Initializers:
initfunctions often create singletone shared objects and initial capabilities - Object Wrapping: Wrapped objects transfer ownership
- Shared vs Owned: Shared objects can be accessed by anyone, owned objects only by a transaction sent by the owner
- Package Upgrades: Upgrades can introduce new types and functions and change old ones in type-compatible ways
- Phantom Types: Type parameters with
phantomdon't affect runtime