Skip to content

Commit

Permalink
fix: upstream oz fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Sep 17, 2021
1 parent 29255bb commit 5553d27
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions contracts/governance/DopeDAO.sol
Expand Up @@ -63,9 +63,14 @@ contract DopeDAO is Governor, GovernorCompatibilityBravo, GovernorVotesComp, Gov
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
bytes32 /*descriptionHash*/
) internal override(Governor, GovernorTimelockCompound) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
uint256 eta = proposalEta(proposalId);
require(eta > 0, "GovernorTimelockCompound: proposal not yet queued");
Address.sendValue(payable(timelock()), msg.value);
for (uint256 i = 0; i < targets.length; ++i) {
ICompoundTimelock(payable(timelock())).executeTransaction(targets[i], values[i], "", calldatas[i], eta);
}
}

function _cancel(
Expand All @@ -89,4 +94,11 @@ contract DopeDAO is Governor, GovernorCompatibilityBravo, GovernorVotesComp, Gov
{
return super.supportsInterface(interfaceId);
}

/**
* @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)
*/
receive() external payable virtual {
require(_executor() == address(this));
}
}

0 comments on commit 5553d27

Please sign in to comment.