-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix: fix permit signer #91
Conversation
Somehow I don't have permissions to ask for a code review although my account is a member of the Pls review @gentlementlegen @whilefoo @0x4007 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rndquu Thanks a lot for looking into this. After this is deployed on NPM, we should update text-conversation-reward
package version and regenerate the permits then.
I will try to test this locally.
As far as I understand because of |
@rndquu It should indeed, we still need to rebuild it because we run a compiled version. |
@rndquu Somehow having a har time testing this, sorry for the delay. I followed the
I'll keep debugging but you might find out faster than me. |
I suppose since
Hard to say, you should use the format This test actually QAs this PR pretty much. All you have to check is that this signature was created by this owner. |
Resolves ubiquity/pay.ubq.fi#323
TLDR; This PR broke permit signature in this line.
Root cause
Check this buggy permit where permit owner is
0x9051eDa96dB419c967189F4Ac303a290F3327680
but recovered signer from signature is0x51afbf762cdedc2683afecc2ccdd93da6a071ff8
while the expected behavior for both of those values to be equal. The root cause is that heredomain.version
was added to the signed data while original permit2's EIP712 contract verifies only:domain.name
,domain.chainId
anddomain.verifyingContract
. Thus adding a new field to signed data made a signature created by theubiquity-os/permit-generation
package not matching the one actually verified.This PR:
domain.version
from signed data (and keeps onlydomain.name
,domain.chainId
anddomain.verifyingContract
originally produced by SignatureTransfer.getPermitData())The PR that broke permit signatures was introduced in
ubiquity-os/permit-generation v2.0.0
andubiquity-os-marketplace/text-conversation-rewards
started using that version inv1.5.1
on 12 October. So all permits generated since the 12 October are not claimable by contributors (and probably should be regenerated on demand once a new version ofubiquity-os/permit-generation
is released).P.S. The error could not be catched locally at
pay.ubq.fi
becausepay.ubq.fi
test helper script generates a permit signature without the help of theubiquity-os/permit-generation
plugin.