Closed sherlock-admin closed 8 months ago
kgothatso
medium
AvailBridge ::
emit events after transaction failed
emit events after transaction failed should not be allowed
incorrect logs for debugging
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L228
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L256
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L289
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L346
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L408
Manual Review
check if a transaction is successful before emit an event
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid because {invalid: if anything goes wrong in the mint function; the entire transaction will revert}
kgothatso
medium
Contract
AvailBridge ::
can emit events after has transaction failedSummary
emit events after transaction failed
Vulnerability Detail
emit events after transaction failed should not be allowed
Impact
incorrect logs for debugging
Code Snippet
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L228
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L256
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L289
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L346
https://github.com/sherlock-audit/2023-12-avail/blob/main/contracts/src/AvailBridge.sol#L408
Tool used
Manual Review
Recommendation
check if a transaction is successful before emit an event