Harden OKT audit findings and expand test coverage#1
Open
naftalimurgor wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.