fix(multicall): resolve critical multicall parsing corruption issues

- Added comprehensive bounds checking to prevent buffer overruns in multicall parsing
- Implemented graduated validation system (Strict/Moderate/Permissive) to reduce false positives
- Added LRU caching system for address validation with 10-minute TTL
- Enhanced ABI decoder with missing Universal Router and Arbitrum-specific DEX signatures
- Fixed duplicate function declarations and import conflicts across multiple files
- Added error recovery mechanisms with multiple fallback strategies
- Updated tests to handle new validation behavior for suspicious addresses
- Fixed parser test expectations for improved validation system
- Applied gofmt formatting fixes to ensure code style compliance
- Fixed mutex copying issues in monitoring package by introducing MetricsSnapshot
- Resolved critical security vulnerabilities in heuristic address extraction
- Progress: Updated TODO audit from 10% to 35% complete

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Krypto Kajun
2025-10-17 00:12:55 -05:00
parent f358f49aa9
commit 850223a953
8621 changed files with 79808 additions and 7340 deletions

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x69bad4eca82a4e139aad810777dc72faf5414e338b0a1b648e8472cd4904f93e",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bbd00000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a482cf40000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x69aaa929dace9feee6e1579f4b0fae055868fd56bb7fbd653a02ebd787e348f3",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc000000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a48f10c0000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0xf6431652d3e4e9de83d259de062488064ead35e5f112d13ae110b24b8782e242",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc300000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a49b5240000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "TraderJoeRouter",
"from": "0x3855808a7f42dbaebacf07291e0ae0a7ed692ecb",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xaf6228fcef1fa34dafd4e8d6e359b845e052a1a6597c88c1c2c94045c6140f9f",
"input_data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000002d407c9f880c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344f59c48eb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000098d7803aea152ff1009f000000000000000000000000000000000000000000000000000000000000000012f0569e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031a27787e450000000000000000000000000000000000000000000000000002d407c9f880c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000003855808a7f42dbaebacf07291e0ae0a7ed692ecb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ff00000000000000000000000000000000000001000000000000000000000000de967676db7b1ccdba2bd94b01b5b19de4b563e4000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x87d66368cd08a7ca42252f5ab44b2fb6d1fb8d15",
"value": "796079871787200"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x725db13de678e9da4590bf4fe40051f397ff4c8625ef5f1e343a39905151fa7b",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc600000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a4a793c0000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "",
"from": "0xe0beeedbb7d392e6958741c8f9f4bc2e45231e4c",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xe821c9a0ec256c0fd38f6e57eab070bf79b0048d2104989c2cd4c666d46657aa",
"input_data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124c04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e0beeedbb7d392e6958741c8f9f4bc2e45231e4c0000000000000000000000000000000000000000000000000000000068fa3aac00000000000000000000000000000000000000000000000506a66f2e4143c000000000000000000000000000000000000000000000000000000000000586e04600000000000000000000000000000000000000000000000000000000000000285d3a1ff2b6bab83b63cd9ad0787074081a52ef34af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x1f721e2e82f6676fce4ea07a5958cf098d339e18",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0xe5e58921dfa6602792e3f5624e91d291c01dc135",
"function": "decreaseLiquidity",
"function_sig": "0x0c49ccbe",
"hash": "0x5992966aa1cc733367aa0a00e2b3098b6d0d6b88835affbc43e02e1101ac4b8b",
"input_data": "0x0c49ccbe00000000000000000000000000000000000000000000000000000000004c1f2c00000000000000000000000000000000000000000000000000000001e20e0177000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ed105b",
"protocol": "UniswapV3",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "TraderJoeRouter",
"from": "0xcdd200769654f3c986fe6e48584585705a7941f6",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xca9f939fa7f27921ce356dbd103c7613b464dba7356c6a5ce522619c21f14fbb",
"input_data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000247489ec235815d3beeae78016c1c0a784c92f5411014e58dd317dbe6562f2140c65f61ece00000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x87d66368cd08a7ca42252f5ab44b2fb6d1fb8d15",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV2Router02",
"from": "0xba7a224852693f9a1695334105c2e63159eb2311",
"function": "swapExactTokensForTokens",
"function_sig": "0x38ed1739",
"hash": "0xee2af12f5e40c87e7452f70ef439bcf22663a726cc1bdf9f0def2e0f33f72320",
"input_data": "0x38ed17390000000000000000000000000000000000000000000000053220a269ab55c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ba7a224852693f9a1695334105c2e63159eb23110000000000000000000000000000000000000000000000000000000068ed12b5000000000000000000000000000000000000000000000000000000000000000200000000000000000000000003f6921f6e948016631ce796331294d5a863a9ee000000000000000000000000dcc9691793633176acf5cfdc1a658cb3b982e2fb",
"protocol": "UniswapV2",
"to": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "",
"from": "0x3b0795a13dad67005c629cf02afd8ed515643655",
"function": "swapExactTokensForTokens",
"function_sig": "0x38ed1739",
"hash": "0x3a4869a8dcc5d309eaf3687ec47bfa220f21029375863d3e2e4f3a797e096497",
"input_data": "0x38ed173900000000000000000000000000000000000000000000000246ddf97976680000000000000000000000000000000000000000000000000000000000000b0baa4900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003b0795a13dad67005c629cf02afd8ed5156436550000000000000000000000000000000000000000000000000000000068ed102400000000000000000000000000000000000000000000000000000000000000020000000000000000000000001009c5c11cdd44bffeac3c70db7eb143df2faad1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
"protocol": "UniswapV2",
"to": "0x82dfd2b94222bdb603aa6b34a8d37311ab3db800",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0xe5e58921dfa6602792e3f5624e91d291c01dc135",
"function": "collect",
"function_sig": "0xfc6f7865",
"hash": "0x2b55abd5ee9bc902e5370824e8f618cde32c1fdfd0307e433fb3aabb22e6a86a",
"input_data": "0xfc6f786500000000000000000000000000000000000000000000000000000000004c1f2c000000000000000000000000e5e58921dfa6602792e3f5624e91d291c01dc13500000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff",
"protocol": "UniswapV3",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0x9e47fbb2a2a27b3b02e4a63b3ef5a3dc863c0223",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xa467b01f88098a11878e4c4e43956c943f6d7766139825bb7cbf2bb8efe69578",
"input_data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000a40c49ccbe00000000000000000000000000000000000000000000000000000000004c1daa000000000000000000000000000000000000000000000000004c4269abc13855000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ed12a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084fc6f786500000000000000000000000000000000000000000000000000000000004c1daa000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000225dcd56988ae70000000000000000000000009e47fbb2a2a27b3b02e4a63b3ef5a3dc863c0223000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064df2ab5bb000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000000000000000000000000000000000000002637ba50000000000000000000000009e47fbb2a2a27b3b02e4a63b3ef5a3dc863c022300000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x71b76f0e28627051c8e349f4a5af835fb716f39549b50532eb5d8261e9780d2a",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bd300000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a4adb480000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x196beae17c9577256a4c20d72a3c01cae5d00e9e",
"function": "exactInputSingle",
"function_sig": "0x414bf389",
"hash": "0xd39c510f44355cca3b7ee947b9697ef95df8921c8a90b3639572382092afe90c",
"input_data": "0x414bf38900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000440017a1b021006d556d7fc06a54c32e42eb745b0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000196beae17c9577256a4c20d72a3c01cae5d00e9e0000000000000000000000000000000000000000000000000000000068ed0e0e0000000000000000000000000000000000000000000000000024a689f2b2e3f0000000000000000000000000000000000000000000000011470476b682d78b380000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}