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

interface for determining scw or eoa #615

Merged
merged 10 commits into from
Apr 10, 2024
Merged

interface for determining scw or eoa #615

merged 10 commits into from
Apr 10, 2024

Conversation

insipx
Copy link
Contributor

@insipx insipx commented Apr 4, 2024

There is no fool-proof way to determine whether an address is a SCW or EOA. The best we have is to check the code-size on-chain. If the smart contract wallet has not yet been deployed, then there is no way of knowing just from the address whether an account is a SCW or an EOA.

This just adds a very simple trait, WalletIdentity for SDKs to implement in order to indicate whether an identity is a Smart Wallet or not.

I couldn't decide whether this should live on InboxOwner or not. It seems to make sense for it to live on that trait, but I also didn't want to prematurely add a change into xmtp_mls that inbox's would have to implement w/o Identity being ready as a whole yet.

I also found some unused dependencies, will have to look closer for those in reviews

closes #599

@insipx insipx changed the title interface for determining smart contract wallet interface for determining scw or eoa Apr 4, 2024
@insipx insipx marked this pull request as ready for review April 9, 2024 21:02
@insipx insipx requested a review from a team as a code owner April 9, 2024 21:02
Copy link
Contributor

@neekolas neekolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this works great as a standalone utility we can offer devs. Especially since it's not clear how much we'll be using LocalWallet in a world with Signature Requests

@insipx insipx merged commit 19d2601 into main Apr 10, 2024
7 checks passed
@insipx insipx deleted the insipx/scw-or-eoa branch April 10, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interface for detecting whether a Signer is a regular wallet or a smart wallet
3 participants