All skills
Skillintermediate
Move Entry Point Detection (Aptos)
In Move, `public` functions can be invoked from transaction scripts (Aptos) and typically modify state. In addition, all `entry` functions are entrypoints. Package-protected (`public package`) and friend (`friend` or `public friend`) functions should be excluded.
Claude Code Knowledge Pack7/10/2026
Overview
Move Entry Point Detection (Aptos)
Entry Point Identification (State-Changing Only)
In Move, public functions can be invoked from transaction scripts (Aptos) and typically modify state. In addition, all entry functions are entrypoints. Package-protected (public package) and friend (friend or public friend) functions should be excluded.
Aptos Move
// Public entry functions are entry points
public entry fun transfer(from: &signer, to: address, amount: u64) { }
// Public functions callable by other modules
public fun helper(): u64 { }
// Entry-only functions (can't be called by other modules)
entry fun private_entry(account: &signer) { }
Visibility Rules
| Visibility | Include? | Notes |
|---|---|---|
public entry fun | Yes | Transaction entry point (state-changing) |
entry fun | Yes | Transaction-only entry point |
public fun | No | Module-callable only, not direct entry |
fun (private) | No | Not externally callable |
public(friend) fun | No | Friend modules only |
Access Control Patterns
Signer-Based Control (Aptos)
// Admin check via signer
public entry fun admin_action(admin: &signer) {
assert!(signer::address_of(admin) == @admin_address, E_NOT_ADMIN);
}
// Owner check via resource
public entry fun owner_action(owner: &signer) acquires Config {
let config = borrow_global(@module_addr);
assert!(signer::address_of(owner) == config.owner, E_NOT_OWNER);
}
Capability Pattern (Aptos)
// Capability resource
struct AdminCap has key, store {}
// Requires capability
public entry fun admin_action(admin: &signer) acquires AdminCap {
assert!(exists(signer::address_of(admin)), E_NO_CAP);
}
Access Control Classification
| Pattern | Classification |
|---|---|
signer::address_of(s) == @admin | Admin |
signer::address_of(s) == config.owner | Owner |
exists(addr) | Admin (capability) |
exists(addr) | Governance |
exists(addr) | Guardian |
&signer with no checks | Review Required |
Contract-Only Detection
Friend Functions
// Only callable by friend modules
public(friend) fun internal_callback() { }
// Friend declaration
friend other_module;
Module-to-Module Patterns
// Functions designed for other modules
public fun on_transfer_hook(amount: u64): bool {
// Called by token module
}
Extraction Strategy
Aptos
- Parse all
.movefiles - Find
moduledeclarations - Extract functions with
public entryorentryvisibility - Check function body for:
signer::address_ofcomparisons → Role-basedexists<*Cap>checks → Capability-based- No access checks → Public (Unrestricted)
Move-Specific Considerations
- Resource Model: Access control often through resource ownership
- Capabilities:
Capsuffix typically indicates capability pattern - Acquires:
acquires Resourceshows what global resources are accessed - Generic Types: Type parameters may carry capability constraints
- Friend Visibility:
public(friend)limits callers to declared friends
Common Gotchas
- Init Functions:
initorinitializeoften create initial capabilities - Module Upgrades: Check upgrade capability ownership
- Phantom Types: Type parameters with
phantomdon't affect runtime