Method for detecting inconsistent behaviors in Ethereum token transaction
A detection method and technology of Ethereum, applied in the field of detection of inconsistent behavior in Ethereum token transactions, can solve the problems of inconsistent contract code implementation, inconsistent semantics, and easy to generate false positives, so as to avoid insufficient effective information and coverage. high effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0060] The vast majority of ERC20 tokens on Ethereum use the mapping structure to store token holders and holding balances. This structure establishes a one-to-one mapping relationship between the address of an account and the token balance it holds. Such as figure 2 As shown in , it illustrates how to use the corresponding mapping code to read the balance of an account address from the database. In addition, there are corresponding solidity source codes (ie "amount=balances[addr];") and corresponding EVM instructions (Ethereum virtual machine instructions). This type of structure first uses the SHA3 instruction of the EVM to perform a hash operation on the account address and the mapped code to obtain a new address value. Then, through the command SLOAD of the EVM, according to the obtained new address value, read the content stored in the location from the Ethereum database, which is the balance of the account address. Similarly, if you want to write a new balance, use ...
Embodiment 2
[0136] Some ERC20 tokens on Ethereum use the mapping structure to store token holders and holding balances. This mapping structure establishes a one-to-one correspondence between the account address and a structure, which contains the token holdings of the account and some other information. image 3 It shows how to use this type of mapping code to read the balance of an account address from the database, its corresponding solidity source code (ie "amount=balances[addr].amount;") and the corresponding EVM instruction. First, the account address and mapping code are hashed to obtain a new address value, and the corresponding EVM instruction is SHA3. Then, according to the relative position of the variable representing the token balance in the structure, an offset is obtained, and then the new address is added to the offset by the EVM instruction ADD, and the address of the balance is obtained value. Finally, according to the address where the calculated balance is located, t...
Embodiment 3
[0219] Some ERC20 tokens on Ethereum use the mapping structure of to store token holders and holding balances. This structure establishes a corresponding relationship between the account address and a structure array. The structure array records all the historical balances of the account. Each element of the array contains the balance of the account at a certain time node, and the last item of the array records Contains the latest token holdings of the account. Figure 4Shows how to use this type of mapping code to read the balance of an account address from the database, and its corresponding solidity source code (ie "amount=balances[addr][balances[addr].length-1].amount ;") and the corresponding EVM instructions. First, the account address and mapping code are hashed to obtain the address code of the structure array, and the corresponding EVM instruction is SHA3. In the second step, use the SLOAD command to read the current length of the structure array from the location ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com