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 support for EIP-1271 contract wallets #30
Conversation
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.
Looks good! Made a few minor comments @sbihel .
siwe/siwe.py
Outdated
@@ -221,7 +235,9 @@ def verify( | |||
domain: Optional[str] = None, | |||
nonce: Optional[str] = None, | |||
timestamp: Optional[datetime] = None, | |||
provider: Optional[HTTPProvider] = None, | |||
provider: HTTPProvider = HTTPProvider( | |||
endpoint_uri="https://cloudflare-eth.com" |
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.
IMO, this feels too opinionated.
siwe/siwe.py
Outdated
import rfc3987 | ||
import web3 |
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.
from web3.exceptions import BadFunctionCallOutput
siwe/siwe.py
Outdated
hash_ = _hash_eip191_message(message) | ||
try: | ||
response = contract.caller.isValidSignature(hash_, bytes.fromhex(signature[2:])) | ||
return response.hex() == "1626ba7e" |
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.
nit: add comment explaining what this magicvalue is (from eip: // bytes4(keccak256("isValidSignature(bytes32,bytes)")
)
78c4d5d
to
17e0ad9
Compare
Close #16
Close #17