# Detecting Rug-Pull: Analyzing Smart Contract Backdoor Codes in Ethereum
## 2 Related Work  
### Ethereum Smart Contracts  
On the Ethereum network, anyone can deploy contract code known as a smart contract and execute the deployed smart contract using transactions. A smart contract is a code that automatically executes programmed contract conditions. When certain conditions are satisfied, the contract content is automatically executed, enhancing efficiency in the contract execution process. Additionally, it can be executed in a safe and transparent manner without the intervention of a central authority, as all nodes on the Ethereum network share and verify the same data [13].  
The process of using a smart contract on the Ethereum network involves two main steps: the developer's deployment of the smart contract and the user's interaction with it, as illustrated in Figure 1. First, when a developer deploys a smart contract, an address that identifies it is generated on the Ethereum blockchain. This address, consisting of 40 hexadecimal digits (e.g., 0 xdAC17F958D2 ee523a2206206994597C13D831 ec7), is associated with the Ethereum Virtual Machine (EVM) code--the smart contract code--the nonce, which indicates the order of transactions; the Ethereum balance; and the storage, where data are stored [14]. Then, a user locates the address to use this smart contract, creates a transaction, and sends it to an Ethereum node. This process can be challenging for general users, serving as an entry barrier to the use of smart contracts.  
DApp is an application designed to utilize these smart contracts more easily. It provides a user interface that allows users to access smart contracts through a web browser or mobile app, facilitating a more intuitive interaction with smart contracts [15; 16]. A typical example of a DApp is Uniswap [17; 18].  
Uniswap is a decentralized exchange operating on the Ethereum blockchain, allowing developers to list tokens and users to purchase the tokens they desire, as shown in Figure 2. To list Token B on Uniswap, Token A, which will support exchange with Token B, is required. The developer connects their wallet to Uniswap and generates a Liquidity Pool to exchange Token A and Token B, thereby listing Token B. A user who wants to purchase the listed Token B first connects their wallet to Uniswap. After inputting the amount of Token A to be exchanged, the Liquidity Pool automatically processes the transaction and exchanges it for Token B [19; 20]. Since Uniswap provides an open platform, anyone can become a developer who can list new tokens and a user who can purchase those tokens. This openness allows developers to introduce new projects and tokens to the market and enables users to invest more easily, generating mutual benefits.  
However, the open nature of Uniswap also increases the likelihood of malicious projects emerging, as new tokens can be listed without thorough investigation and verification. For example, a malicious project developer can insert backdoor code into the smart contract, enabling only themselves to sell the tokens while users can only purchase them [21; 22]. In such cases, users cannot sell the tokens they have purchased even if the price rises. The price of the listed token may increase as if it were an innovative project, enticing new users to purchase the token. Consequently, the project developer sells all the tokens after the price rises sufficiently to make a profit, causing users to suffer significant losses. These backdoor codes can be categorized into six types: the authority to generate tokens or destroy them arbitrarily, arbitrary transfer, funds manipulation, transfer fee,  
Figure 1: Example of Smart Contract Deployment and Use on the Ethereum Network.  
indirect control through a proxy contract, and transfer limitation, as illustrated in the example above.