From dabde2b4aed33c1f39f1da2e050e7e452bd25bbb Mon Sep 17 00:00:00 2001 From: Giuseppe Rodriguez <5714678+giuseppecrj@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:31:54 -0500 Subject: [PATCH 1/2] Update ERC20Votes clock to virtual so it can allow for timestamp based clock votes CLOCK_MODE() is virtual, we need clock() to be virtual as well otherwise there's an issue with using mode=timestamp while returning a block.number. --- src/tokens/ERC20Votes.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokens/ERC20Votes.sol b/src/tokens/ERC20Votes.sol index 4f4bb7ef11..8a3426a746 100644 --- a/src/tokens/ERC20Votes.sol +++ b/src/tokens/ERC20Votes.sol @@ -97,7 +97,7 @@ abstract contract ERC20Votes is ERC20 { } /// @dev Retusn the current clock. - function clock() public view returns (uint48 result) { + function clock() public view virtual returns (uint48 result) { /// @solidity memory-safe-assembly assembly { result := number() From 124c93d540cad5531940921241890e51993a3f53 Mon Sep 17 00:00:00 2001 From: Giuseppe Rodriguez <5714678+giuseppecrj@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:38:38 -0500 Subject: [PATCH 2/2] natspec comment nit --- src/tokens/ERC20Votes.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokens/ERC20Votes.sol b/src/tokens/ERC20Votes.sol index 8a3426a746..16855d7860 100644 --- a/src/tokens/ERC20Votes.sol +++ b/src/tokens/ERC20Votes.sol @@ -96,7 +96,7 @@ abstract contract ERC20Votes is ERC20 { return "mode=blocknumber&from=default"; } - /// @dev Retusn the current clock. + /// @dev Returns the current clock. function clock() public view virtual returns (uint48 result) { /// @solidity memory-safe-assembly assembly {