Governor should revert on ERC1155 and ERC721 receive hooks when it's not executor (original) (raw)
Description
Currently, the Governor implementation uses onERC1155Received
, onERC1155BatchReceived
, and onERC721Received
to acknowledge token receives. However, if the Governor is not the executor itself, it can't operate on those tokens except using the relay
function.
We consider that all of these receive hooks can also validate that the Governor is also the executor, as in the receive()
function:
/**
- @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract) */ receive() external payable virtual { if (_executor() != address(this)) { revert GovernorDepositDisabled(address(this)); } }