Applying AI To Smart Contracts For Dynamic Restaking Strategy Optimization In DeFi