Supercharge Your Innovation With Domain-Expert AI Agents!

Abstract syntax tree-based EOS intelligent contract language conversion method

An abstract syntax tree and smart contract technology, which is applied in the field of computer language code translation, can solve the problems of Ethereum smart contract AMR high-risk transactions and translation solutions without mature solutions, etc., to achieve strong adaptability, strong scalability, code Clearly Structured Effects

Active Publication Date: 2020-05-08
成都互诚在线科技有限公司 +1
View PDF8 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

On the afternoon of July 8, 2018, the dimensionality reduction security laboratory monitored that there were high-risk transactions in the Ethereum smart contract AMR
When formalizing the EOS smart contract, it is necessary to implement a reasonable analysis and translation of the unique grammatical features of C++. Among them, the customized EOS smart contract translation solution based on the abstract syntax tree has not yet matured in the industry.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Abstract syntax tree-based EOS intelligent contract language conversion method
  • Abstract syntax tree-based EOS intelligent contract language conversion method
  • Abstract syntax tree-based EOS intelligent contract language conversion method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0053] An abstract syntax tree-based EOS smart contract language conversion method, combining figure 1 , figure 2 , image 3 shown, including the following steps:

[0054] Step S1. Carry out lexical unit division on the EOS smart contract source program; the specific lexical unit division method includes the following steps:

[0055] Step S1.1. Define the regular expression R for morpheme recognition; the morpheme includes a specific morpheme type, and only the basic morpheme type that requires regular matching in morpheme matching;

[0056] Step S1.2. For a specific morpheme type, define a pattern-action matching structure in the lexical analyzer for morpheme matching and syntax analysis;

[0057] Step S1.3. Define the matching string S corresponding to the regular expression R. Based on the regular expression R and the corresponding string S, define the following matching rules:

[0058]

[0059] in is a regular expression that is common and can match multiple stri...

Embodiment 2

[0089] The present invention is based on the above-mentioned embodiment 1, in order to better realize the present invention, further, the matching rules are written based on the following matching order rules:

[0090] (1) Matching sequence rules: define the complete set of morpheme matching patterns as U R , if the string S n Not only can regular expressions can be matched by the regular expression R n match, then when the morpheme matches, the regular expression Rn is listed in the regular expression Before, make Sn match according to the regular expression Rn; the specific matching order satisfies the following algorithm:

[0091]

[0092] (2) Matching order modification rules: After the source code library of the EOS smart contract source code is updated, the updated newly encapsulated morpheme S is added p , delete the old lexeme S q , the matching order modification satisfies the following algorithm:

[0093]

[0094] Working principle: Due to the longest m...

Embodiment 3

[0097] On the basis of any one of the above-mentioned embodiments 1-2, in order to better realize the present invention, the present invention is further based on a formal verification interpreter; using a formal verification interpreter to formalize the translated code verify.

[0098] Working principle: Through the formal verification of the interpreter, it is possible to prove or verify mathematically whether the implementation scheme of the program has indeed realized the functions described in the program design, which makes the scheme of the present invention more reasonable and rigorous, and further ensures the safety of translation reliability.

[0099] Other parts of this embodiment are the same as those of any one of the foregoing embodiments 1-2, so details are not repeated here.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses an abstract syntax tree-based EOS intelligent contract language conversion method. According to the method, all nodes of an abstract syntax tree are stored through a child brother representation method (binary linked list tree); an EOS intelligent contract source code can be converted into a formalized verification language with equivalent functions for self-defined grammarconstruction; translation actions are jointly achieved by adding a symbol table; and a customizable translation process is achieved. The EOS smart contract code translated by the translation method has the characteristics of clear structure, reproducibility, strong expansibility and strong adaptability, and therefore, the problem that a formal verification method cannot verify the EOS smart contract source code is solved. The method has high expandability and very good practical application performance, and provides an effective thought and technology for the intelligent contract translationof block chains.

Description

technical field [0001] The invention belongs to the field of computer language code translation, and in particular relates to an abstract syntax tree-based EOS smart contract language conversion method. Background technique [0002] With the continuous development of blockchain technology, many security issues in this field have gradually become prominent. Smart contract is the key technology to realize blockchain application. Since smart contracts are released in the form of software, defects in code functions or logic can lead to serious consequences. On the afternoon of June 17, 2016, the TheDAO smart contract running on the Ethereum public chain was attacked. The public funds raised by the contract were continuously transferred to its sub-contracts by recursive calls of a function, involving a total of more than 3 million ethers. On the afternoon of July 8, 2018, the dimensionality reduction security laboratory monitored that there were high-risk transactions in the Et...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/41
CPCG06F8/42
Inventor 李昂晏昃晖曾惟如杨拯唐琴钱伟中
Owner 成都互诚在线科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More