Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit: erc165 compliancy #209

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion src/execution-strategies/TimelockExecutionStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MetaTransaction, Proposal, ProposalStatus } from "../types.sol";
import { Enum } from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import { IERC1155Receiver } from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol";
import { IERC721Receiver } from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import { IERC165 } from "@openzeppelin/contracts/interfaces/IERC165.sol";

/// @title Timelock Execution Strategy
/// @notice Used to execute proposal transactions according to a timelock delay.
Expand Down Expand Up @@ -216,6 +217,9 @@ contract TimelockExecutionStrategy is SimpleQuorumExecutionStrategy, IERC1155Rec

/// @notice IERC165 interface support
function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
return interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC1155Receiver).interfaceId;
return
interfaceId == type(IERC721Receiver).interfaceId ||
interfaceId == type(IERC1155Receiver).interfaceId ||
interfaceId == type(IERC165).interfaceId;
}
}
2 changes: 2 additions & 0 deletions test/TimelockExecutionStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { TestERC1155 } from "./mocks/TestERC1155.sol";
import { TestERC721 } from "./mocks/TestERC721.sol";
import { IERC1155Receiver } from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol";
import { IERC721Receiver } from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import { IERC165 } from "@openzeppelin/contracts/interfaces/IERC165.sol";

abstract contract TimelockExecutionStrategyTest is SpaceTest {
error InvalidSpace();
Expand Down Expand Up @@ -476,6 +477,7 @@ abstract contract TimelockExecutionStrategyTest is SpaceTest {
function testCheckViewFunctions() public {
assertTrue(timelockExecutionStrategy.supportsInterface(type(IERC721Receiver).interfaceId));
assertTrue(timelockExecutionStrategy.supportsInterface(type(IERC1155Receiver).interfaceId));
assertTrue(timelockExecutionStrategy.supportsInterface(type(IERC165).interfaceId));
assertEq(timelockExecutionStrategy.getStrategyType(), "SimpleQuorumTimelock");
}

Expand Down