Add a relay mechanism in the governor (#2926)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -347,6 +347,20 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor {
|
||||
return weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor
|
||||
* is some contract other than the governor itself, like when using a timelock, this function can be invoked
|
||||
* in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.
|
||||
* Note that if the executor is simply the governor itself, use of `relay` is redundant.
|
||||
*/
|
||||
function relay(
|
||||
address target,
|
||||
uint256 value,
|
||||
bytes calldata data
|
||||
) external onlyGovernance {
|
||||
Address.functionCallWithValue(target, data, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Address through which the governor executes action. Will be overloaded by module that execute actions
|
||||
* through another contract such as a timelock.
|
||||
|
||||
Reference in New Issue
Block a user