sherlock-audit / 2024-01-telcoin-judging

6 stars 5 forks source link

BAICE - `SafeGuard` contract is not inherited from pre-written `IGuard` interface, #176

Closed sherlock-admin closed 6 months ago

sherlock-admin commented 6 months ago

BAICE

medium

SafeGuard contract is not inherited from pre-written IGuard interface,

Summary

The SafeGuard contract is not inherited from IGuard contract .

Vulnerability Detail

The SafeGuard contract is inherited from BaseGuard and Ownable contract, and the BaseGuard is inherited from IERC165contract , so SafeGuard contract is no relation to IGuard contract . contract SafeGuard is BaseGuard, Ownable { abstract contract BaseGuard is IERC165 {

Impact

IGuard contract is useless , but BaseGuard write two IGuard methods . function checkTransaction( function checkAfterExecution(bytes32, bool) external view override {}

but checkAfterExecution function is not used here .

Code Snippet

https://github.com/sherlock-audit/2024-01-telcoin/blob/main/telcoin-audit/contracts/zodiac/core/SafeGuard.sol#L77-L78

  // not used
    function checkAfterExecution(bytes32, bool) external view override {}
    function checkAfterExecution(bytes32 txHash, bool success) external virtual;

Tool used

Manual Review, VSCode

Recommendation

The BaseGuard contract should implement IGuard interface, or , both SafeGuard and BaseGuard should delete unused checkAfterExecution function .

sherlock-admin2 commented 6 months ago

1 comment(s) were left on this issue during the judging contest.

takarez commented:

invalid because { more like a feature request ; invalid}

nevillehuang commented 6 months ago

Invalid, this is at most a gas optimization finding not valid based on sherlock rules