Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
revert changes to the governor
  • Loading branch information
Amxx committed Jun 14, 2023
commit f14767367a1fe0c456a522f7df246366a7e255ca
42 changes: 38 additions & 4 deletions contracts/governance/Governor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

pragma solidity ^0.8.0;

import "../token/ERC721/utils/ERC721Holder.sol";
import "../token/ERC1155/utils/ERC1155Holder.sol";
import "../token/ERC721/IERC721Receiver.sol";
import "../token/ERC1155/IERC1155Receiver.sol";
import "../utils/cryptography/ECDSA.sol";
import "../utils/cryptography/EIP712.sol";
import "../utils/introspection/ERC165.sol";
Expand All @@ -25,7 +25,7 @@ import "./IGovernor.sol";
*
* _Available since v4.3._
*/
abstract contract Governor is Context, ERC165, EIP712, ERC721Holder, ERC1155Holder, IGovernor {
abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receiver, IERC1155Receiver {
using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;

bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,uint8 support)");
Expand Down Expand Up @@ -95,7 +95,7 @@ abstract contract Governor is Context, ERC165, EIP712, ERC721Holder, ERC1155Hold
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165, ERC1155Receiver) returns (bool) {
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
bytes4 governorCancelId = this.cancel.selector ^ this.proposalProposer.selector;

bytes4 governorParamsId = this.castVoteWithReasonAndParams.selector ^
Expand All @@ -117,6 +117,7 @@ abstract contract Governor is Context, ERC165, EIP712, ERC721Holder, ERC1155Hold
interfaceId == governor43Id ||
interfaceId == governor46Id ||
interfaceId == governorCancelId ||
interfaceId == type(IERC1155Receiver).interfaceId ||
super.supportsInterface(interfaceId);
}

Expand Down Expand Up @@ -600,4 +601,37 @@ abstract contract Governor is Context, ERC165, EIP712, ERC721Holder, ERC1155Hold
function _executor() internal view virtual returns (address) {
return address(this);
}

/**
* @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;
}
}