hats-finance / illuminex-0x0bb4aa1f58719707405c231fcdf0b405714799cf

0 stars 1 forks source link

`ringKeyUpdateInterval` is not checked during updating ring key #9

Open hats-bug-reporter[bot] opened 4 months ago

hats-bug-reporter[bot] commented 4 months ago

Github username: @MatinR1 Twitter username: MatinRezaii1 Submission hash (on-chain): 0x3b2aa3bee2a3228fb9ef73eb321f8e9d119d73836f88d54fbf9804093381e746 Severity: low

Description: Description\ The ringKeyUpdateInterval is set to be 1 day but not used inside the _updateRingKey() function. The function _updateRingKey() just sets the block timestamp to _lastRingKeyUpdate and not checking the ringKeyUpdateInterval. This would lead to not having a possible check inside the contracts that inherit from RotatingKeys like wallets.

    uint256 public ringKeyUpdateInterval = 1 days;

 ...

    function _updateRingKey(bytes32 _entropy) internal {
        bytes32 newKey = bytes32(Sapphire.randomBytes(32, abi.encodePacked(_entropy)));

        uint newIndex = _ringKeys.length;
        _ringKeys.push(newKey);

        _lastRingKeyUpdate = block.timestamp;

        emit ActualRingKeyRenewed(newIndex);
    }

As you can see there is no check for ringKeyUpdateInterval.

Attachments

  1. Revised Code File (Optional) Consider checking the ringKeyUpdateInterval inside the _updateRingKey()
party-for-illuminati commented 4 months ago

Informational