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:
@@ -1,14 +1,19 @@
|
||||
//go:build math_property
|
||||
// +build math_property
|
||||
|
||||
package property
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/fraktal/mev-beta/pkg/uniswap"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/fraktal/mev-beta/pkg/uniswap"
|
||||
)
|
||||
|
||||
// Property-based testing for Uniswap V3 pricing functions
|
||||
@@ -22,7 +27,7 @@ func init() {
|
||||
func generateRandomPrice() float64 {
|
||||
// Generate prices between 0.000001 and 1000000 (6 orders of magnitude)
|
||||
exponent := rand.Float64()*12 - 6 // -6 to 6
|
||||
return 10 * exponent
|
||||
return math.Pow(10, exponent)
|
||||
}
|
||||
|
||||
// generateRandomTick generates a random tick within valid bounds
|
||||
|
||||
Reference in New Issue
Block a user