The invention discloses an intelligent contract enhancement method and
system based on formalized
verification, and the method comprises the steps: carrying out the grammar analysis of a target intelligent contract code, extracting a contract function logic and a
state variable, automatically generating a formalized protocol corresponding to the contract function logic based on a predefined formalized protocol template, and carrying out the
verification of the formalized protocol. And verifying the logic consistency of the formal protocol and the target
smart contract code through a model detection tool to obtain a
verification result, when the verification result indicates that a logic conflict exists, dynamically generating a boundary condition
test case according to a conflict type, and feeding back the verification result and the
test case to a
smart contract development environment in real time. The
system comprises a protocol generation module, a verification engine, a dynamic test module and an interactive interface. Therefore, the formal protocol is automatically generated and the verification tool is integrated, the verification complexity and error are reduced, the leakproofness is ensured,
dynamic testing and real-time feedback are combined, an abnormal execution path is covered, vulnerabilities are quickly positioned, and the safety and the development efficiency are improved.