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

Opti equality with FALSE rather than TRUE #225

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .forge-snapshots/ProposeSigComp.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
148834
148832
2 changes: 1 addition & 1 deletion .forge-snapshots/VoteSigComp.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
50277
50313
2 changes: 1 addition & 1 deletion .forge-snapshots/VoteSigCompMetadata.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51827
51856
2 changes: 1 addition & 1 deletion .forge-snapshots/VoteTxComp.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
43824
43883
2 changes: 1 addition & 1 deletion .forge-snapshots/VoteTxCompMetadata.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
45415
45467
4 changes: 2 additions & 2 deletions src/Space.sol
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ contract Space is ISpace, Initializable, IERC4824, UUPSUpgradeable, OwnableUpgra

/// @dev Gates access to whitelisted authenticators only.
modifier onlyAuthenticator() {
if (authenticators[msg.sender] != TRUE) revert AuthenticatorNotWhitelisted();
if (authenticators[msg.sender] == FALSE) revert AuthenticatorNotWhitelisted();
_;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ contract Space is ISpace, Initializable, IERC4824, UUPSUpgradeable, OwnableUpgra
if (block.number >= proposal.maxEndBlockNumber) revert VotingPeriodHasEnded();
if (block.number < proposal.startBlockNumber) revert VotingPeriodHasNotStarted();
if (proposal.finalizationStatus != FinalizationStatus.Pending) revert ProposalFinalized();
if (voteRegistry[proposalId][voter] == TRUE) revert UserAlreadyVoted();
if (voteRegistry[proposalId][voter] != FALSE) revert UserAlreadyVoted();

voteRegistry[proposalId][voter] = TRUE;

Expand Down
4 changes: 2 additions & 2 deletions src/utils/SignatureVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ abstract contract SignatureVerifier is EIP712 {
bytes memory userProposalValidationParams
) = abi.decode(data, (address, string, Strategy, bytes));

if (usedSalts[author][salt] == TRUE) revert SaltAlreadyUsed();
if (usedSalts[author][salt] != FALSE) revert SaltAlreadyUsed();

address recoveredAddress = ECDSA.recover(
_hashTypedDataV4(
Expand Down Expand Up @@ -129,7 +129,7 @@ abstract contract SignatureVerifier is EIP712 {
(address, uint256, Strategy, string)
);

if (usedSalts[author][salt] == TRUE) revert SaltAlreadyUsed();
if (usedSalts[author][salt] != FALSE) revert SaltAlreadyUsed();

address recoveredAddress = ECDSA.recover(
_hashTypedDataV4(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SpaceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract SpaceManager is OwnableUpgradeable {
/// @notice Enable a space.
/// @param space Address of the space.
function enableSpace(address space) external onlyOwner {
if (space == address(0) || (spaces[space] == TRUE)) revert InvalidSpace();
if (space == address(0) || (spaces[space] != FALSE)) revert InvalidSpace();
spaces[space] = TRUE;
emit SpaceEnabled(space);
}
Expand Down