Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
b29ef5e1
Commit
b29ef5e1
authored
Sep 17, 2021
by
github-actions
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transpile
e05d978e
parent
6521c5c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
GovernorUpgradeable.sol
contracts/governance/GovernorUpgradeable.sol
+7
-0
GovernorTimelockCompoundUpgradeable.sol
...rnance/extensions/GovernorTimelockCompoundUpgradeable.sol
+2
-1
GovernorCompMockUpgradeable.sol
contracts/mocks/GovernorCompMockUpgradeable.sol
+0
-2
GovernorMockUpgradeable.sol
contracts/mocks/GovernorMockUpgradeable.sol
+0
-2
No files found.
contracts/governance/GovernorUpgradeable.sol
View file @
b29ef5e1
...
@@ -65,6 +65,13 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
...
@@ -65,6 +65,13 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
}
}
/**
/**
* @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));
}
/**
* @dev See {IERC165-supportsInterface}.
* @dev See {IERC165-supportsInterface}.
*/
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
...
...
contracts/governance/extensions/GovernorTimelockCompoundUpgradeable.sol
View file @
b29ef5e1
...
@@ -186,8 +186,9 @@ abstract contract GovernorTimelockCompoundUpgradeable is Initializable, IGoverno
...
@@ -186,8 +186,9 @@ abstract contract GovernorTimelockCompoundUpgradeable is Initializable, IGoverno
) internal virtual override {
) internal virtual override {
uint256 eta = proposalEta(proposalId);
uint256 eta = proposalEta(proposalId);
require(eta > 0, "GovernorTimelockCompound: proposal not yet queued");
require(eta > 0, "GovernorTimelockCompound: proposal not yet queued");
AddressUpgradeable.sendValue(payable(_timelock), msg.value);
for (uint256 i = 0; i < targets.length; ++i) {
for (uint256 i = 0; i < targets.length; ++i) {
_timelock.executeTransaction
{value: values[i]}
(targets[i], values[i], "", calldatas[i], eta);
_timelock.executeTransaction(targets[i], values[i], "", calldatas[i], eta);
}
}
}
}
...
...
contracts/mocks/GovernorCompMockUpgradeable.sol
View file @
b29ef5e1
...
@@ -37,8 +37,6 @@ contract GovernorCompMockUpgradeable is Initializable, GovernorUpgradeable, Gove
...
@@ -37,8 +37,6 @@ contract GovernorCompMockUpgradeable is Initializable, GovernorUpgradeable, Gove
_votingPeriod = votingPeriod_;
_votingPeriod = votingPeriod_;
}
}
receive() external payable {}
function votingDelay() public view override returns (uint256) {
function votingDelay() public view override returns (uint256) {
return _votingDelay;
return _votingDelay;
}
}
...
...
contracts/mocks/GovernorMockUpgradeable.sol
View file @
b29ef5e1
...
@@ -40,8 +40,6 @@ contract GovernorMockUpgradeable is Initializable, GovernorUpgradeable, Governor
...
@@ -40,8 +40,6 @@ contract GovernorMockUpgradeable is Initializable, GovernorUpgradeable, Governor
_votingPeriod = votingPeriod_;
_votingPeriod = votingPeriod_;
}
}
receive() external payable {}
function votingDelay() public view override returns (uint256) {
function votingDelay() public view override returns (uint256) {
return _votingDelay;
return _votingDelay;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment