skills/sui-scanner/SKILL.md
Use when the user wants to audit Sui Move smart contracts, scan Sui-specific patterns including object ownership, shared objects, or dynamic fields, review Sui DeFi protocols for object model security issues, or analyze Sui-specific transaction and consensus patterns.
npx skillsauth add 0x-shashi/web3-audit-skills skills/sui-scannerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Specialized scanner for Sui Move smart contracts. Sui uses a unique object-centric model where state is organized as typed objects with ownership semantics, not as a global address-keyed storage. This fundamentally changes the security surface compared to both EVM and other Move chains (Aptos).
| Aspect | Sui Move | Aptos Move |
|---|---|---|
| State Model | Object-centric (owned/shared/immutable) | Global storage (move_to, borrow_global) |
| Parallelism | Owned objects processed in parallel, no consensus | All transactions sequenced |
| Transaction Input | Objects passed explicitly as params | Resources accessed via address |
| Upgrade | UpgradeCap object required | Module publisher authority |
| Init Pattern | One-Time Witness (init(otw: OTW, ctx: &mut TxContext)) | init_module(account: &signer) |
| Transfer | transfer::transfer / transfer::public_transfer | move_to(signer, resource) |
| Custom Types | Abilities: key, store, copy, drop | Same abilities, different usage |
┌─────────────────────────────────────────────────────────────┐
│ Sui Network │
│ │
│ ┌───────────────────┐ ┌───────────────────┐ │
│ │ Owned Objects │ │ Shared Objects │ │
│ │ (No consensus) │ │ (Consensus needed) │ │
│ │ │ │ │ │
│ │ ┌────────┐ │ │ ┌────────┐ │ │
│ │ │ Coin │ ←owner│ │ │ DEX │ ←shared│ │
│ │ └────────┘ │ │ │ Pool │ │ │
│ │ ┌────────┐ │ │ └────────┘ │ │
│ │ │ NFT │ ←owner│ │ ┌────────┐ │ │
│ │ └────────┘ │ │ │ Config │ ←shared│ │
│ └───────────────────┘ │ └────────┘ │ │
│ └───────────────────┘ │
│ ┌───────────────────┐ ┌───────────────────┐ │
│ │ Immutable Objects │ │ Wrapped Objects │ │
│ │ (Frozen forever) │ │ (Inside another) │ │
│ │ ┌────────┐ │ │ ┌────────────┐ │ │
│ │ │Package │ │ │ │ Parent Obj │ │ │
│ │ └────────┘ │ │ │ ┌───────┐ │ │ │
│ └───────────────────┘ │ │ │ Child │ │ │ │
│ │ │ └───────┘ │ │ │
│ │ └────────────┘ │ │
│ └───────────────────┘ │
└─────────────────────────────────────────────────────────────┘
TxContext::sender check: Privileged operations without caller validationtransfer::transfer instead of transfer::public_transfer for types with storeClock shared object| Incident | Vulnerability | Impact | |---|---|---| | Various DEX implementations | Shared object contention | Performance degradation, elevated fees | | NFT marketplace bugs | Transfer policy bypass | Royalty enforcement circumvented | | Early DeFi protocols | Missing sender checks on admin functions | Unauthorized parameter changes | | Bridge implementations | Object ownership not validated | Cross-chain message spoofing |
Sui-specific error codes and framework abort codes. Sui Move uses custom abort codes per module.
| Abort Code | Module | Meaning |
|-----------|--------|----------|
| ENotOwner | object / various | Caller does not own the object |
| EInvalidOwner | transfer | Invalid owner for transfer operation |
| ESharedObjectOperationNotAllowed | transfer | Cannot perform this operation on shared objects |
| EEmptyInventory | kiosk | Kiosk inventory is empty |
| EItemNotFound | kiosk | Item not found in kiosk |
| ENotEnough | balance | Insufficient balance for operation |
| ENonZero | balance | Balance is not zero (expected to be destroyed) |
| EDivisionByZero | math | Division by zero in math |
| EOverflow | math | Arithmetic overflow |
| EWrongInnerType | dynamic_field | Dynamic field type mismatch |
| EFieldDoesNotExist | dynamic_field | Dynamic field not found on object |
| EFieldAlreadyExists | dynamic_field | Dynamic field already exists |
| Abort Code | Module | Meaning |
|-----------|--------|----------|
| EBadWitness | coin | Invalid one-time witness type |
| ENotTreasury | coin | Caller does not hold TreasuryCap |
| EInsufficientBalance | coin | Coin value too low for operation |
| ECoinTypeMismatch | pay | Coins of different types in merge/split |
| Abort Code Pattern | Protocol Type | Meaning |
|-------------------|--------------|----------|
| ESlippageExceeded | AMM/DEX | Price moved beyond slippage tolerance |
| EInsufficientLiquidity | AMM/DEX | Pool has insufficient liquidity for swap |
| EPoolNotFound | AMM/DEX | Trading pool does not exist |
| ELockExpired / ELockNotExpired | Staking | Time-lock constraint violation |
| EInvalidPrice / EStalePrice | Oracle | Price feed invalid or outdated |
| Issue | Likely Cause | Solution |
|-------|-------------|----------|
| Object ownership vulnerabilities missed | Scanner doesn't model Sui object ownership types | Load resources/object-security.md; distinguish owned/shared/immutable/wrapped objects |
| Shared object contention not flagged | Scanner treats shared objects like owned | Analyze all functions taking &mut shared objects for ordering/MEV attacks |
| Dynamic field injection not detected | Scanner doesn't trace dynamic field access | Audit all dynamic_field::add/remove/borrow for unauthorized field manipulation |
| Flash loan patterns missed | Scanner doesn't recognize Sui Hot Potato pattern | Check for structs without drop/store abilities returned from functions (must be consumed) |
| One-time witness (OTW) bypass not caught | Scanner doesn't verify OTW pattern | Verify module's OTW struct has drop only, uppercase name matches module, used in init() |
| Capability token leaks not detected | Scanner trusts Move type system for safety | Trace all Cap types — verify no public functions return or expose capabilities |
development
Systematically hunt for every variant of a discovered vulnerability across the entire codebase. Use when a bug is found and all instances of the same root cause pattern must be identified, or when performing variant analysis during competitive audits on Code4rena or Sherlock.
testing
Use when the user wants to audit TON smart contracts for security vulnerabilities, scan FunC or Tact contracts for message chain replay, bounce handling, or gas issues, review TON DeFi protocols for actor-model concurrency flaws, or analyze asynchronous message passing security.
tools
Analyze ERC20/ERC721/ERC1155 token implementations for non-standard behavior, fee-on-transfer mechanics, rebasing logic, blacklists, pausability, and integration risks. Use when reviewing protocols that interact with external tokens or implementing token-related features.
tools
Integrate automated static analysis tools (Slither, Mythril, Aderyn, Semgrep) into the audit workflow to catch known vulnerability patterns before manual review. Use when starting an audit to establish a coverage baseline, or when configuring static analysis tooling for a project.