###### Abstract  
In the modern era, the use of blockchain technology has been growing rapidly, where Ethereum smart contracts play an important role in securing decentralized application systems. However, these smart contracts are also susceptible to a large number of vulnerabilities, which pose significant threats to intelligent systems and IoT applications, leading to data breaches and financial losses. Traditional detection techniques, such as manual analysis and static automated tools, suffer from high false positives and undetected security vulnerabilities. To address these problems, this paper proposes an Artificial Intelligence (AI)-based security framework that integrates Generative Adversarial Network (GAN)-based feature selection and deep learning techniques to classify and detect malware attacks on smart contract execution in the blockchain decentralized network. After an exhaustive pre-processing phase yielding a dataset of 40,000 malware and benign samples, the proposed model is evaluated and compared with related studies on the basis of a number of performance metrics including training accuracy, training loss, and classification metrics (accuracy, precision, recall, and F1-score). Our combined approach achieved a remarkable accuracy of 97.6%, demonstrating its effectiveness in detecting malware and protecting blockchain systems. blockchain; artificial intelligence; smart contract; deep learning; security; IoT 23 April 202524 June 202524 June 202524 June 202524 July 2  
these benefits establish blockchain as a cutting-edge and revolutionary solution for safe, trustless systems in a variety of fields. The worldwide research community is drawn to its distinctive features, which include immutability, decentralization, transparency, and high reliability [8]. Among its key applications, smart contracts play a pivotal role in modernizing transactions, driving extensive research into their functionalities and potential vulnerabilities [9]. These self-executing contracts, offering key attributes that determine their importance in multiple decentralized applications, verify and authenticate data that must be stored in the blockchain network [10]. A key component of smart contracts is immutability, which guarantees that they cannot be changed once they are deployed. This necessitates rigorous testing before deployment in a bid to reverse the inflexibility inherent in traditional contracts [11]. Additionally, ownership mechanisms give transaction creators autonomy to establish rules for access and privacy, with immutable conditions in smart contracts optimizing system functionality [12; 13]. Beyond their structural advantages, smart contracts improve security by addressing blockchain constraints, imposing conditions, and limiting unrestricted access to network transactions [11]. They also enhance privacy by limiting access to contract contents solely to parties that require specific conditions [14]. However, security concerns of smart contracts and their functioning over the blockchain networks such as capacity, latency, and scalability are concerns regarding its widespread adoption [15]. This complexity has also led to the emergence of critical security vulnerabilities. On the other hand, solidity, the programming language of the smart contract, has design flaws that necessitate that the developers prioritize security and code integrity. Moreover, the immutable nature of blockchain means that once a vulnerable contract has been processed and deployed in the network, it may cause irreversible, disastrous losses. In this regard, vulnerabilities in smart contracts can be classified and determined by different forms of inputs, including source code, bytecode, opcodes, and even images [16; 17]. In the Ethereum platform, an opcode (operation code) is a primitive instruction that the Ethereum Virtual Machine (EVM) executes [18]. Each opcode is an individual operation, from arithmetic computation and stack manipulation to effective control flow handling.