Skip to content

Commit 1078ecb

Browse files
gonzaotcAmxxarr00
authored
Update OZ solhint custom rules (#5794)
Co-authored-by: Hadrien Croubois <[email protected]> Co-authored-by: Arr00 <[email protected]>
1 parent 0a00486 commit 1078ecb

File tree

15 files changed

+99
-105
lines changed

15 files changed

+99
-105
lines changed

contracts/governance/Governor.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
653653
* in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.
654654
* Note that if the executor is simply the governor itself, use of `relay` is redundant.
655655
*/
656-
function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {
656+
function relay(address target, uint256 value, bytes calldata data) public payable virtual onlyGovernance {
657657
(bool success, bytes memory returndata) = target.call{value: value}(data);
658658
Address.verifyCallResult(success, returndata);
659659
}

contracts/governance/TimelockController.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
2626
bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");
2727
bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");
2828
bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");
29-
uint256 internal constant _DONE_TIMESTAMP = uint256(1);
29+
uint256 internal constant DONE_TIMESTAMP = uint256(1);
3030

3131
mapping(bytes32 id => uint256) private _timestamps;
3232
uint256 private _minDelay;
@@ -207,7 +207,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
207207
uint256 timestamp = getTimestamp(id);
208208
if (timestamp == 0) {
209209
return OperationState.Unset;
210-
} else if (timestamp == _DONE_TIMESTAMP) {
210+
} else if (timestamp == DONE_TIMESTAMP) {
211211
return OperationState.Done;
212212
} else if (timestamp > block.timestamp) {
213213
return OperationState.Waiting;
@@ -432,7 +432,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
432432
if (!isOperationReady(id)) {
433433
revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready));
434434
}
435-
_timestamps[id] = _DONE_TIMESTAMP;
435+
_timestamps[id] = DONE_TIMESTAMP;
436436
}
437437

438438
/**
@@ -445,7 +445,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
445445
* - the caller must be the timelock itself. This can only be achieved by scheduling and later executing
446446
* an operation where the timelock is the target and the data is the ABI-encoded call to this function.
447447
*/
448-
function updateDelay(uint256 newDelay) external virtual {
448+
function updateDelay(uint256 newDelay) public virtual {
449449
address sender = _msgSender();
450450
if (sender != address(this)) {
451451
revert TimelockUnauthorizedCaller(sender);

contracts/governance/extensions/GovernorTimelockCompound.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ abstract contract GovernorTimelockCompound is Governor {
136136
/**
137137
* @dev Accept admin right over the timelock.
138138
*/
139-
// solhint-disable-next-line private-vars-leading-underscore
139+
// solhint-disable-next-line openzeppelin/leading-underscore
140140
function __acceptAdmin() public {
141141
_timelock.acceptAdmin();
142142
}
@@ -154,7 +154,7 @@ abstract contract GovernorTimelockCompound is Governor {
154154
155155
* CAUTION: It is not recommended to change the timelock while there are other queued governance proposals.
156156
*/
157-
function updateTimelock(ICompoundTimelock newTimelock) external virtual onlyGovernance {
157+
function updateTimelock(ICompoundTimelock newTimelock) public virtual onlyGovernance {
158158
_updateTimelock(newTimelock);
159159
}
160160

contracts/governance/extensions/GovernorTimelockControl.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ abstract contract GovernorTimelockControl is Governor {
146146
*
147147
* CAUTION: It is not recommended to change the timelock while there are other queued governance proposals.
148148
*/
149-
function updateTimelock(TimelockController newTimelock) external virtual onlyGovernance {
149+
function updateTimelock(TimelockController newTimelock) public virtual onlyGovernance {
150150
_updateTimelock(newTimelock);
151151
}
152152

contracts/governance/extensions/GovernorVotesQuorumFraction.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ abstract contract GovernorVotesQuorumFraction is GovernorVotes {
7373
* - Must be called through a governance proposal.
7474
* - New numerator must be smaller or equal to the denominator.
7575
*/
76-
function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {
76+
function updateQuorumNumerator(uint256 newQuorumNumerator) public virtual onlyGovernance {
7777
_updateQuorumNumerator(newQuorumNumerator);
7878
}
7979

contracts/metatx/ERC2771Forwarder.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ contract ERC2771Forwarder is EIP712, Nonces {
6161
bytes signature;
6262
}
6363

64-
bytes32 internal constant _FORWARD_REQUEST_TYPEHASH =
64+
bytes32 internal constant FORWARD_REQUEST_TYPEHASH =
6565
keccak256(
6666
"ForwardRequest(address from,address to,uint256 value,uint256 gas,uint256 nonce,uint48 deadline,bytes data)"
6767
);
@@ -222,7 +222,7 @@ contract ERC2771Forwarder is EIP712, Nonces {
222222
(address recovered, ECDSA.RecoverError err, ) = _hashTypedDataV4(
223223
keccak256(
224224
abi.encode(
225-
_FORWARD_REQUEST_TYPEHASH,
225+
FORWARD_REQUEST_TYPEHASH,
226226
request.from,
227227
request.to,
228228
request.value,

contracts/mocks/proxy/UUPSUpgradeableMock.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock {
2828
}
2929
}
3030

31-
contract UUPSUnsupportedProxiableUUID is UUPSUpgradeableMock {
32-
function proxiableUUID() external pure override returns (bytes32) {
31+
contract UUPSUnsupportedProxiableUUIDMock is NonUpgradeableMock {
32+
function proxiableUUID() external pure returns (bytes32) {
3333
return keccak256("invalid UUID");
3434
}
3535
}

contracts/proxy/utils/UUPSUpgradeable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable {
7171
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
7272
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
7373
*/
74-
function proxiableUUID() external view virtual notDelegated returns (bytes32) {
74+
function proxiableUUID() external view notDelegated returns (bytes32) {
7575
return ERC1967Utils.IMPLEMENTATION_SLOT;
7676
}
7777

contracts/token/ERC20/extensions/ERC20Permit.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces {
7171

7272
/// @inheritdoc IERC20Permit
7373
// solhint-disable-next-line func-name-mixedcase
74-
function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
74+
function DOMAIN_SEPARATOR() external view returns (bytes32) {
7575
return _domainSeparatorV4();
7676
}
7777
}

contracts/utils/Multicall.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract contract Multicall is Context {
2323
* @dev Receives and executes a batch of function calls on this contract.
2424
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
2525
*/
26-
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
26+
function multicall(bytes[] calldata data) public virtual returns (bytes[] memory results) {
2727
bytes memory context = msg.sender == _msgSender()
2828
? new bytes(0)
2929
: msg.data[msg.data.length - _contextSuffixLength():];

0 commit comments

Comments
 (0)