This commit includes: ## Audit & Testing Infrastructure - scripts/audit.sh: 12-section comprehensive codebase audit - scripts/test.sh: 7 test types (unit, integration, race, bench, coverage, contracts, pkg) - scripts/check-compliance.sh: SPEC.md compliance validation - scripts/check-docs.sh: Documentation coverage checker - scripts/dev.sh: Unified development script with all commands ## Documentation - SPEC.md: Authoritative technical specification - docs/AUDIT_AND_TESTING.md: Complete testing guide (600+ lines) - docs/SCRIPTS_REFERENCE.md: All scripts documented (700+ lines) - docs/README.md: Documentation index and navigation - docs/DEVELOPMENT_SETUP.md: Environment setup guide - docs/REFACTORING_PLAN.md: Systematic refactoring plan ## Phase 1 Refactoring (Critical Fixes) - pkg/validation/helpers.go: Validation functions for addresses/amounts - pkg/sequencer/selector_registry.go: Thread-safe selector registry - pkg/sequencer/reader.go: Fixed race conditions with atomic metrics - pkg/sequencer/swap_filter.go: Fixed race conditions, added error logging - pkg/sequencer/decoder.go: Added address validation ## Changes Summary - Fixed race conditions on 13 metric counters (atomic operations) - Added validation at all ingress points - Eliminated silent error handling - Created selector registry for future ABI migration - Reduced SPEC.md violations from 7 to 5 Build Status: ✅ All packages compile Compliance: ✅ No race conditions, no silent failures Documentation: ✅ 1,700+ lines across 5 comprehensive guides 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
89 lines
3.5 KiB
JSON
89 lines
3.5 KiB
JSON
[
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{"internalType": "address", "name": "tokenIn", "type": "address"},
|
|
{"internalType": "address", "name": "tokenOut", "type": "address"},
|
|
{"internalType": "uint24", "name": "fee", "type": "uint24"},
|
|
{"internalType": "address", "name": "recipient", "type": "address"},
|
|
{"internalType": "uint256", "name": "deadline", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountIn", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountOutMinimum", "type": "uint256"},
|
|
{"internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160"}
|
|
],
|
|
"internalType": "struct ISwapRouter.ExactInputSingleParams",
|
|
"name": "params",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "exactInputSingle",
|
|
"outputs": [{"internalType": "uint256", "name": "amountOut", "type": "uint256"}],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{"internalType": "bytes", "name": "path", "type": "bytes"},
|
|
{"internalType": "address", "name": "recipient", "type": "address"},
|
|
{"internalType": "uint256", "name": "deadline", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountIn", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountOutMinimum", "type": "uint256"}
|
|
],
|
|
"internalType": "struct ISwapRouter.ExactInputParams",
|
|
"name": "params",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "exactInput",
|
|
"outputs": [{"internalType": "uint256", "name": "amountOut", "type": "uint256"}],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{"internalType": "address", "name": "tokenIn", "type": "address"},
|
|
{"internalType": "address", "name": "tokenOut", "type": "address"},
|
|
{"internalType": "uint24", "name": "fee", "type": "uint24"},
|
|
{"internalType": "address", "name": "recipient", "type": "address"},
|
|
{"internalType": "uint256", "name": "deadline", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountOut", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountInMaximum", "type": "uint256"},
|
|
{"internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160"}
|
|
],
|
|
"internalType": "struct ISwapRouter.ExactOutputSingleParams",
|
|
"name": "params",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "exactOutputSingle",
|
|
"outputs": [{"internalType": "uint256", "name": "amountIn", "type": "uint256"}],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{"internalType": "bytes", "name": "path", "type": "bytes"},
|
|
{"internalType": "address", "name": "recipient", "type": "address"},
|
|
{"internalType": "uint256", "name": "deadline", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountOut", "type": "uint256"},
|
|
{"internalType": "uint256", "name": "amountInMaximum", "type": "uint256"}
|
|
],
|
|
"internalType": "struct ISwapRouter.ExactOutputParams",
|
|
"name": "params",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "exactOutput",
|
|
"outputs": [{"internalType": "uint256", "name": "amountIn", "type": "uint256"}],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
}
|
|
]
|