Abstract:The study proposes a smart contract vulnerability detection method based on MixStyle transfer, aiming to solve the problem of insufficient datasets and the inability to effectively detect unknown vulnerabilities when new vulnerabilities emerge in smart contracts. The method first extracts the abstract syntax tree from the smart contract source code and uses graph attention network to capture the dependencies and information flow between nodes; then, the Maximum Mean Discrepancy is used to achieve effective knowledge migration from old vulnerabilities to new ones, thus increasing the amount of data for deep learning model training; finally, the MixStyle technique is incorporated into the classifier to enhance the model"s generalization ability and improve the accuracy of identifying novel vulnerability types. The experimental results show that the method outperforms BLSTM-ATT, BiGAS, and Peculiar methods in F1, ACC, and MCC metrics for the detection of the four vulnerability types.