sherlock-audit / 2023-12-avail-judging

4 stars 4 forks source link

kgothatso - Contract `AvailBridge :: ` can emit events after has transaction failed #59

Closed sherlock-admin closed 8 months ago

sherlock-admin commented 8 months ago

kgothatso

medium

Contract AvailBridge :: can emit events after has transaction failed

Summary

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

sherlock-admin commented 8 months ago

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}