Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 7 additions & 38 deletions contracts/governance/TimelockController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pragma solidity ^0.8.19;

import "../access/AccessControl.sol";
import "../token/ERC721/IERC721Receiver.sol";
import "../token/ERC1155/IERC1155Receiver.sol";
import "../token/ERC721/utils/ERC721Holder.sol";
import "../token/ERC1155/utils/ERC1155Holder.sol";

/**
* @dev Contract module which acts as a timelocked controller. When set as the
Expand All @@ -22,7 +22,7 @@ import "../token/ERC1155/IERC1155Receiver.sol";
*
* _Available since v3.3._
*/
contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver {
contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder {
bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE");
bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE");
bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE");
Expand Down Expand Up @@ -122,8 +122,10 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, AccessControl) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
function supportsInterface(
bytes4 interfaceId
) public view virtual override(AccessControl, ERC1155Receiver) returns (bool) {
return super.supportsInterface(interfaceId);
}

/**
Expand Down Expand Up @@ -380,37 +382,4 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
emit MinDelayChange(_minDelay, newDelay);
_minDelay = newDelay;
}

/**
* @dev See {IERC721Receiver-onERC721Received}.
*/
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}

/**
* @dev See {IERC1155Receiver-onERC1155Received}.
*/
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}

/**
* @dev See {IERC1155Receiver-onERC1155BatchReceived}.
*/
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}
2 changes: 1 addition & 1 deletion scripts/checks/inheritance-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ for (const artifact of artifacts) {
const linearized = [];

for (const source in solcOutput.contracts) {
if (source.includes('/mocks/')) {
if (['contracts-exposed/', 'contracts/mocks/'].some(pattern => source.startsWith(pattern))) {
continue;
}

Expand Down