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

Validate signature for contract-based accounts using ERC-1271 #84

Open
wants to merge 1 commit into
base: master
from

Conversation

@miguelmota
Copy link

commented Sep 17, 2019

This pull request checks adds code to check if the signer address is a contract, and if it is, then use the the is-valid-signature library by @cwhinfrey to validate the signature using the ERC-1271 method. ERC-1271 is adopted by 0x and recently kickback to check signatures are valid for contract-based-accounts.

example/src/App.tsx Outdated Show resolved Hide resolved
@miguelmota miguelmota force-pushed the authereum:erc1271 branch from 0813500 to 4d4540b Sep 24, 2019
@miguelmota

This comment has been minimized.

Copy link
Author

commented Sep 24, 2019

Btw the hard coded gas limit of 21000 in the example won't work for contract-based. MetaMask has the same problem. Suggestion is to estimate gas or add additional gas it the sender is a contract.

@pedrouid

This comment has been minimized.

Copy link
Member

commented Sep 27, 2019

Hi @miguelmota, I've added a separate PR for estimating gas limit but we need to parse the data payload for contract-based wallets, currently hard coded to 0x. Could you take a look at #89 to suggest how we handle that for Authereum for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.