Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #698

Open
code423n4 opened this issue Sep 15, 2022 · 1 comment
Open

QA Report #698

code423n4 opened this issue Sep 15, 2022 · 1 comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

code423n4 commented Sep 15, 2022

deadline comparison

There is castVoteBySig function in Governor contract. It accepts _deadline as a parameter and checks it is valid comparing to block.timestamp. Specifically, the function performs such checks.

// Ensure the deadline has not passed
if (block.timestamp > _deadline) revert EXPIRED_SIGNATURE();

There is another logic with non-strict comparison in different parts of the code:

Treasury.sol

/// @notice If a proposal is ready to execute (does not consider expiration)
/// @param _proposalId The proposal id
function isReady(bytes32 _proposalId) public view returns (bool) {
    return timestamps[_proposalId] != 0 && block.timestamp >= timestamps[_proposalId];
}

Auction.sol

// Ensure the auction is still active
if (block.timestamp >= _auction.endTime) revert AUCTION_OVER();

It is reasonable to have consistent logic in all places -- we propose to use non-strict comparison in castVoteBySig function.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Sep 15, 2022
code423n4 added a commit that referenced this issue Sep 15, 2022
code423n4 added a commit that referenced this issue Sep 15, 2022
@GalloDaSballo
Copy link
Collaborator

deadline comparison

R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

2 participants