Description:
In the approveTransaction(uint256 _txId)
function, a Transaction
struct is directly referenced in storage using:
Since all modifications to txn are reflected directly in storage, every update incurs high gas costs. Instead, copying the struct to memory, making the necessary modifications, and then writing it back to storage at the end can significantly reduce gas consumption.
Impact
Increased gas costs due to multiple writes to storage within the function.
Inefficient state modification leads to unnecessary on-chain storage operations.
Can be optimized to reduce execution costs, making transactions more affordable for users.
Recommended Mitigation
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.