Make ERC20Votes independent from ERC20Permit (#3816)

Co-authored-by: Francisco <frangio.1@gmail.com>
This commit is contained in:
JulissaDantes
2022-11-29 10:25:52 -04:00
committed by GitHub
parent bc8f442d00
commit e2d2ebc8fc
18 changed files with 231 additions and 343 deletions

View File

@ -68,6 +68,13 @@ library Checkpoints {
return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;
}
/**
* @dev Returns checkpoint at given position.
*/
function getAtPosition(History storage self, uint32 pos) internal view returns (Checkpoint memory) {
return self._checkpoints[pos];
}
/**
* @dev Pushes a value onto a History so that it is stored as the checkpoint for the current block.
*