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
23eeb136
Commit
23eeb136
authored
Aug 13, 2021
by
github-actions
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transpile
391ecdc2
parent
583ca63a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
10 deletions
+33
-10
upgradeable.yml
.github/workflows/upgradeable.yml
+23
-0
GovernorUpgradeable.sol
contracts/governance/GovernorUpgradeable.sol
+2
-2
IGovernorUpgradeable.sol
contracts/governance/IGovernorUpgradeable.sol
+3
-3
GovernorCompatibilityBravoUpgradeable.sol
...e/compatibility/GovernorCompatibilityBravoUpgradeable.sol
+1
-1
GovernorCountingSimpleUpgradeable.sol
...vernance/extensions/GovernorCountingSimpleUpgradeable.sol
+1
-1
Governor.test.js
test/governance/Governor.test.js
+1
-1
GovernorCompatibilityBravo.test.js
...vernance/compatibility/GovernorCompatibilityBravo.test.js
+2
-2
No files found.
.github/workflows/upgradeable.yml
0 → 100644
View file @
23eeb136
name
:
Upgradeable Trigger
on
:
push
:
branches
:
-
master
-
release-v*
jobs
:
trigger
:
runs-on
:
ubuntu-latest
steps
:
-
id
:
app
uses
:
getsentry/action-github-app-token@v1
with
:
app_id
:
${{ secrets.UPGRADEABLE_APP_ID }}
private_key
:
${{ secrets.UPGRADEABLE_APP_PK }}
-
run
:
|
curl -X POST \
https://api.github.com/repos/OpenZeppelin/openzeppelin-contracts-upgradeable/dispatches \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: token ${{ steps.app.outputs.token }}' \
-d '{ "event_type": "Update", "client_payload": { "ref": "${{ github.ref }}" } }'
contracts/governance/GovernorUpgradeable.sol
View file @
23eeb136
...
@@ -146,7 +146,7 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
...
@@ -146,7 +146,7 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
}
}
/**
/**
* @dev Amount of votes already cast
ed
passes the threshold limit.
* @dev Amount of votes already cast passes the threshold limit.
*/
*/
function _quorumReached(uint256 proposalId) internal view virtual returns (bool);
function _quorumReached(uint256 proposalId) internal view virtual returns (bool);
...
@@ -314,7 +314,7 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
...
@@ -314,7 +314,7 @@ abstract contract GovernorUpgradeable is Initializable, ContextUpgradeable, ERC1
}
}
/**
/**
* @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast
ed
yet, retrieve
* @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve
* voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.
* voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.
*
*
* Emits a {IGovernor-VoteCast} event.
* Emits a {IGovernor-VoteCast} event.
...
...
contracts/governance/IGovernorUpgradeable.sol
View file @
23eeb136
...
@@ -54,7 +54,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
...
@@ -54,7 +54,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
event ProposalExecuted(uint256 proposalId);
event ProposalExecuted(uint256 proposalId);
/**
/**
* @dev Emitted when a vote is cast
ed
.
* @dev Emitted when a vote is cast.
*
*
* Note: `support` values should be seen as buckets. There interpretation depends on the voting module used.
* Note: `support` values should be seen as buckets. There interpretation depends on the voting module used.
*/
*/
...
@@ -138,7 +138,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
...
@@ -138,7 +138,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
/**
/**
* @notice module:user-config
* @notice module:user-config
* @dev Minimum number of cast
ed
voted requiered for a proposal to be successful.
* @dev Minimum number of cast voted requiered for a proposal to be successful.
*
*
* Note: The `blockNumber` parameter corresponds to the snaphot used for counting vote. This allows to scale the
* Note: The `blockNumber` parameter corresponds to the snaphot used for counting vote. This allows to scale the
* quroum depending on values such as the totalSupply of a token at this block (see {ERC20Votes}).
* quroum depending on values such as the totalSupply of a token at this block (see {ERC20Votes}).
...
@@ -156,7 +156,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
...
@@ -156,7 +156,7 @@ abstract contract IGovernorUpgradeable is Initializable, IERC165Upgradeable {
/**
/**
* @notice module:voting
* @notice module:voting
* @dev Returns weither `account` has cast
ed
a vote on `proposalId`.
* @dev Returns weither `account` has cast a vote on `proposalId`.
*/
*/
function hasVoted(uint256 proposalId, address account) public view virtual returns (bool);
function hasVoted(uint256 proposalId, address account) public view virtual returns (bool);
...
...
contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol
View file @
23eeb136
...
@@ -296,7 +296,7 @@ abstract contract GovernorCompatibilityBravoUpgradeable is
...
@@ -296,7 +296,7 @@ abstract contract GovernorCompatibilityBravoUpgradeable is
ProposalDetails storage details = _proposalDetails[proposalId];
ProposalDetails storage details = _proposalDetails[proposalId];
Receipt storage receipt = details.receipts[account];
Receipt storage receipt = details.receipts[account];
require(!receipt.hasVoted, "GovernorCompatibilityBravo: vote already cast
ed
");
require(!receipt.hasVoted, "GovernorCompatibilityBravo: vote already cast");
receipt.hasVoted = true;
receipt.hasVoted = true;
receipt.support = support;
receipt.support = support;
receipt.votes = SafeCastUpgradeable.toUint96(weight);
receipt.votes = SafeCastUpgradeable.toUint96(weight);
...
...
contracts/governance/extensions/GovernorCountingSimpleUpgradeable.sol
View file @
23eeb136
...
@@ -99,7 +99,7 @@ abstract contract GovernorCountingSimpleUpgradeable is Initializable, GovernorUp
...
@@ -99,7 +99,7 @@ abstract contract GovernorCountingSimpleUpgradeable is Initializable, GovernorUp
) internal virtual override {
) internal virtual override {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
ProposalVote storage proposalvote = _proposalVotes[proposalId];
require(!proposalvote.hasVoted[account], "GovernorVotingSimple: vote already cast
ed
");
require(!proposalvote.hasVoted[account], "GovernorVotingSimple: vote already cast");
proposalvote.hasVoted[account] = true;
proposalvote.hasVoted[account] = true;
if (support == uint8(VoteType.Against)) {
if (support == uint8(VoteType.Against)) {
...
...
test/governance/Governor.test.js
View file @
23eeb136
...
@@ -440,7 +440,7 @@ contract('Governor', function (accounts) {
...
@@ -440,7 +440,7 @@ contract('Governor', function (accounts) {
voter
:
voter1
,
voter
:
voter1
,
weight
:
web3
.
utils
.
toWei
(
'5'
),
weight
:
web3
.
utils
.
toWei
(
'5'
),
support
:
Enums
.
VoteType
.
For
,
support
:
Enums
.
VoteType
.
For
,
error
:
'GovernorVotingSimple: vote already cast
ed
'
,
error
:
'GovernorVotingSimple: vote already cast'
,
},
},
],
],
};
};
...
...
test/governance/compatibility/GovernorCompatibilityBravo.test.js
View file @
23eeb136
...
@@ -110,7 +110,7 @@ contract('GovernorCompatibilityBravo', function (accounts) {
...
@@ -110,7 +110,7 @@ contract('GovernorCompatibilityBravo', function (accounts) {
{
{
voter
:
voter1
,
voter
:
voter1
,
support
:
Enums
.
VoteType
.
For
,
support
:
Enums
.
VoteType
.
For
,
error
:
'GovernorCompatibilityBravo: vote already cast
ed
'
,
error
:
'GovernorCompatibilityBravo: vote already cast'
,
skip
:
true
,
skip
:
true
,
},
},
],
],
...
@@ -296,7 +296,7 @@ contract('GovernorCompatibilityBravo', function (accounts) {
...
@@ -296,7 +296,7 @@ contract('GovernorCompatibilityBravo', function (accounts) {
{
{
voter
:
voter1
,
voter
:
voter1
,
support
:
Enums
.
VoteType
.
For
,
support
:
Enums
.
VoteType
.
For
,
error
:
'GovernorCompatibilityBravo: vote already cast
ed
'
,
error
:
'GovernorCompatibilityBravo: vote already cast'
,
skip
:
true
,
skip
:
true
,
},
},
],
],
...
...
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