-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(contracts): enforce msgType = 1 for vote messages at the contract…
… level
- Loading branch information
Showing
2 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ contract Poll is Params, Utilities, SnarkCommon, Ownable, EmptyBallotRoots, IPol | |
} | ||
|
||
/// @inheritdoc IPoll | ||
function publishMessage(Message calldata _message, PubKey calldata _encPubKey) public virtual isWithinVotingDeadline { | ||
function publishMessage(Message memory _message, PubKey calldata _encPubKey) public virtual isWithinVotingDeadline { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter Poll.publishMessage(DomainObjs.Message,DomainObjs.PubKey)._encPubKey is not in mixedCase
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter Poll.publishMessage(DomainObjs.Message,DomainObjs.PubKey)._message is not in mixedCase
|
||
// we check that we do not exceed the max number of messages | ||
if (numMessages == maxValues.maxMessages) revert TooManyMessages(); | ||
|
||
|
@@ -177,6 +177,10 @@ contract Poll is Params, Utilities, SnarkCommon, Ownable, EmptyBallotRoots, IPol | |
numMessages++; | ||
} | ||
|
||
// we enforce that msgType here is 1 so we don't need checks | ||
// at the circuit level | ||
_message.msgType = 1; | ||
|
||
uint256 messageLeaf = hashMessageAndEncPubKey(_message, _encPubKey); | ||
extContracts.messageAq.enqueue(messageLeaf); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters