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
1db30378
Unverified
Commit
1db30378
authored
Jun 24, 2021
by
Hadrien Croubois
Committed by
GitHub
Jun 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix misleading comments (#2737)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
parent
6842518b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
AccessControl.sol
contracts/access/AccessControl.sol
+2
-2
ERC20Votes.sol
contracts/token/ERC20/extensions/ERC20Votes.sol
+2
-2
No files found.
contracts/access/AccessControl.sol
View file @
1db30378
...
...
@@ -102,7 +102,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{
20}) is missing role (0x[0-9a-f]{32
})$/
* /^AccessControl: account (0x[0-9a-f]{
40}) is missing role (0x[0-9a-f]{64
})$/
*
* _Available since v4.1._
*/
...
...
@@ -130,7 +130,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{
20}) is missing role (0x[0-9a-f]{32
})$/
* /^AccessControl: account (0x[0-9a-f]{
40}) is missing role (0x[0-9a-f]{64
})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
...
...
contracts/token/ERC20/extensions/ERC20Votes.sol
View file @
1db30378
...
...
@@ -107,10 +107,10 @@ abstract contract ERC20Votes is ERC20Permit {
function _checkpointsLookup(Checkpoint[] storage ckpts, uint256 blockNumber) private view returns (uint256) {
// We run a binary search to look for the earliest checkpoint taken after `blockNumber`.
//
// During the loop, the index of the wanted checkpoint remains in the range [low, high).
// During the loop, the index of the wanted checkpoint remains in the range [low
-1
, high).
// With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant.
// - If the middle checkpoint is after `blockNumber`, we look in [low, mid)
// - If the middle checkpoint is before `blockNumber`, we look in [mid+1, high)
// - If the middle checkpoint is before
or equal to
`blockNumber`, we look in [mid+1, high)
// Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not
// out of bounds (in which case we're looking too far in the past and the result is 0).
// Note that if the latest checkpoint available is exactly for `blockNumber`, we end up with an index that is
...
...
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