Implement suggestions from audit of 4.9 (#4176)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-04-21 12:35:07 +01:00
committed by GitHub
parent 8d633cb7d1
commit 91df66c4a9
15 changed files with 97 additions and 76 deletions

View File

@ -50,7 +50,7 @@ abstract contract ERC20Votes is ERC20Permit, IERC5805 {
// solhint-disable-next-line func-name-mixedcase
function CLOCK_MODE() public view virtual override returns (string memory) {
// Check that the clock was not modified
require(clock() == block.number);
require(clock() == block.number, "ERC20Votes: broken clock mode");
return "mode=blocknumber&from=default";
}

View File

@ -34,6 +34,8 @@ abstract contract ERC721Votes is ERC721, Votes {
/**
* @dev Returns the balance of `account`.
*
* WARNING: Overriding this function will likely result in incorrect vote tracking.
*/
function _getVotingUnits(address account) internal view virtual override returns (uint256) {
return balanceOf(account);