Skip to content

Harden OKT audit findings and expand test coverage#1

Open
naftalimurgor wants to merge 1 commit into
StashBitcoin-coder:masterfrom
Sevault:audit-and-fix-tests
Open

Harden OKT audit findings and expand test coverage#1
naftalimurgor wants to merge 1 commit into
StashBitcoin-coder:masterfrom
Sevault:audit-and-fix-tests

Conversation

@naftalimurgor

Copy link
Copy Markdown

Summary

  • Added comprehensive AUDIT.md covering technical review, security findings, remediations, deployment checklist, trust model, ERC20 compatibility decision, coverage, and Slither results.

  • Added MIN_SELL = 100 to prevent sell-fee rounding bypass from sub-100 sat sells.

  • Added cbBTC reserve validation requiring decimals() == 8 in the constructor.

  • Added ordinal registration guards to prevent duplicate ordinal assignment and registration of already-moved ordinals.

  • Added zero-value transfer rejection to prevent false VaultSwept events.

  • Updated sell-accounting comments to match the direct cbBTC payment implementation.

  • Pinned Foundry evm_version = "shanghai" for Solidity 0.8.20 and Slither compatibility.

  • Expanded unit tests for sell minimums, reserve decimals, ERC20 allowance non-exposure, duplicate ordinals, moved ordinals, and zero-transfer vault behavior.

  • Expanded invariant tests to cover vault inscriptions, oracle movement reports, vault sells, vault withdrawals, and vault transfers.

  • Cleaned compiler warnings in tests.

  • Verified with forge fmt, forge test -vvv, forge coverage, and Slither.

  • Test result: 76 passed, 0 failed, 0 skipped.

  • Coverage for src/OriginKeyToken.sol: 100% lines, 100% statements, 88.14% branches, 100% functions.

  • Slither result: no OKT-specific high/medium fund-flow issue; informational findings only.

Add sell minimums, reserve decimal validation, ordinal registration guards, and zero-transfer protection.

Expand unit and invariant coverage for vault/oracle flows, document remediation status, deployment checklist, coverage, and Slither results.
@naftalimurgor naftalimurgor reopened this May 26, 2026
@naftalimurgor naftalimurgor changed the title Harden OKT audit findings and expand security coverage Harden OKT audit findings and expand test coverage Jun 8, 2026
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.

1 participant