Omniscia Gravita Protocol Audit

Timelock Code Style Findings

Timelock Code Style Findings

TKC-01C: Inefficient Application of Access Control

TypeSeverityLocation
Code StyleTimelock.sol:L113-L115

Description:

The referenced statements replicate the behaviour of the Timelock::adminOnly modifier.

Example:

contracts/Timelock.sol
106function queueTransaction(
107 address target,
108 uint value,
109 string memory signature,
110 bytes memory data,
111 uint eta
112) public returns (bytes32) {
113 if (msg.sender != admin) {
114 revert Timelock__AdminOnly();
115 }

Recommendation:

We advise the modifier to be utilized by the Timelock::queueTransaction function and the manual access control statements to be omitted.

Alleviation:

The Timelock::adminOnly modifier is utilized in place of the manual check in the Timelock::queueTransaction as advised.

TKC-02C: Redundant Function Implementation

TypeSeverityLocation
Gas OptimizationTimelock.sol:L179-L181

Description:

The Timelock::getBlockTimestamp function implementation is redundant as it yields a statement literal (block.timestamp).

Example:

contracts/Timelock.sol
179function getBlockTimestamp() internal view returns (uint) {
180 return block.timestamp;
181}

Recommendation:

We advise all its invocations to be replaced by the block.timestamp statement directly, optimizing their gas cost.

Alleviation:

The redundant Timelock::getBlockTimestamp function has been safely omitted from the codebase as advised.