Research Article
VdaBSC: A Novel Vulnerability Detection Approach for Blockchain Smart Contract by Dynamic Analysis
Algorithm 2
Data Preprocessing Algorithm using RFDA and RRBN.
Require: Dataset (bytecode) | Ensure: Preprocessed dataset | 1: functionRANDOMFLIPPING() | 2: Generate a binary mask with randomly selected flipped bits | 3: Apply bitwise XOR | 4: return | 5: end function | 6: functionREALTIMEBATCHNORMALIZATION() | 7: Calculate the mean and standard deviation of the execution data | 8: Apply normalization | 9: return | 10: end function | 11: Load dataset | 12: Initiate the GRU memory model. | 13: Preprocessing Phase: | 14: for each contract in the dataset do | 15: Extract bytecode from contract | 16: Apply RandomFlipping function using eqn (1) to : | 17: Extract execution data from contract | 18: Apply RealTimeBatchNormalization function using eqn (2) to : | 19: Replace the original bytecode and execution data in contract with and | 20: end for | 21: Return Preprocessed dataset |
|