Enable ERC-1271 signature checks in Governor castVoteBySig (#4418)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
Ernesto García
2023-07-05 07:11:29 -06:00
committed by GitHub
parent 90163661df
commit 63bfab1a0c
8 changed files with 215 additions and 139 deletions

View File

@ -91,16 +91,16 @@ class GovernorHelper {
return vote.signature
? // if signature, and either params or reason →
vote.params || vote.reason
? this.sign(vote).then(({ v, r, s }) =>
? this.sign(vote).then(signature =>
this.governor.castVoteWithReasonAndParamsBySig(
...concatOpts(
[proposal.id, vote.support, vote.voter, vote.reason || '', vote.params || '', v, r, s],
[proposal.id, vote.support, vote.voter, vote.reason || '', vote.params || '', signature],
opts,
),
),
)
: this.sign(vote).then(({ v, r, s }) =>
this.governor.castVoteBySig(...concatOpts([proposal.id, vote.support, vote.voter, v, r, s], opts)),
: this.sign(vote).then(signature =>
this.governor.castVoteBySig(...concatOpts([proposal.id, vote.support, vote.voter, signature], opts)),
)
: vote.params
? // otherwise if params