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

add verifyingContract parameter to create permit2 signed message. #48

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 3 additions & 1 deletion uniswap_universal_router_decoder/router_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def create_permit2_signable_message(
nonce: int,
spender: ChecksumAddress,
deadline: int,
chain_id: int = 1) -> Tuple[Dict[str, Any], SignableMessage]:
chain_id: int = 1,
verifyingContract: str = "0x000000000022D473030F116dDEE9F6B43aC78BA3") -> Tuple[Dict[str, Any], SignableMessage]:
"""
Create a eth_account.messages.SignableMessage that will be sent to the UR/Permit2 contracts
to set token permissions through signature validation.
Expand Down Expand Up @@ -111,5 +112,6 @@ def create_permit2_signable_message(
}
structured_data = dict(_structured_data_permit)
structured_data["domain"]["chainId"] = chain_id
structured_data["domain"]["verifyingContract"] = verifyingContract
structured_data["message"] = permit_single
return permit_single, encode_structured_data(primitive=structured_data)
Loading