smartcontract_log_parser.go
The function GetTxInItem processes transaction logs to extract and record transaction details into txInItem. However, there is a critical oversight in how asset decimals are handled during the conversion of transaction amounts. The function retrieves asset decimals and applies them as a label to the coin but fails to use these decimals in the actual amount conversion process. This mismanagement can lead to significant discrepancies in the recorded transaction amounts, potentially inflating or deflating the actual value, resulting in financial losses when tokens are incorrectly accounted for.
Code snippet:
Expected Behavior: The conversion of token amounts should incorporate the tokens decimal configuration to ensure that the recorded transaction values accurately reflect the intended economic activities. The adjusted amount should correctly represent the tokens smallest unit to prevent any financial discrepancies.
Expected Behavior code snippet:
Logic:
Actual Behavior: The function does not adjust the token amounts based on the assets decimal configuration during conversion, leading to potential misrepresentation of transaction values. This can result in significant financial errors, such as crediting or debiting incorrect amounts from user accounts.
Actual Behavior code snippet:
Logic:
