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

feat: fix IModularAccount to return address of the account for native functions #208

Conversation

jaypaik
Copy link
Collaborator

@jaypaik jaypaik commented Nov 26, 2024

The reference implementation currently returns address(this) which is the address of the account for ExecutionDataView's module field. However, the standard currently contradicts this by saying we should return address(0) for native functions.

The better design seems to be to return the address of the account since the zero address would also be returned for nonexistent selectors, and it would be difficult to differentiate in those cases.

The client should have the address of the account handy so it'd be easy to compare it against what is returned to check if it's a native function or not.

Thanks @0xrubes for bringing this up!

Copy link
Collaborator Author

jaypaik commented Nov 26, 2024

@jaypaik jaypaik marked this pull request as ready for review November 26, 2024 19:29
Copy link

@0xrubes 0xrubes left a comment

Choose a reason for hiding this comment

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

I agree that this is the better design. Let's do it!

Copy link
Collaborator Author

jaypaik commented Nov 27, 2024

Merge activity

  • Nov 27, 10:35 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Nov 27, 10:37 AM EST: Graphite rebased this pull request as part of a merge.
  • Nov 27, 10:38 AM EST: A user merged this pull request with Graphite.

@jaypaik jaypaik changed the base branch from 11-22-feat_update_validationdataview_with_validationflags to graphite-base/208 November 27, 2024 15:35
@jaypaik jaypaik changed the base branch from graphite-base/208 to develop November 27, 2024 15:35
@jaypaik jaypaik force-pushed the 11-26-feat_fix_imodularaccount_to_return_address_of_the_account_for_native_functions branch from 05058df to 81abe15 Compare November 27, 2024 15:36
Copy link

Summary by Octane

New Contracts

No new contracts were added in this PR.

Updated Contracts

  • IModularAccountView.sol: The smart contract now requires the address of the account for native functions instead of address(0).

🔗 Commit Hash: 81abe15

@jaypaik jaypaik merged commit bfe5d75 into develop Nov 27, 2024
5 checks passed
@jaypaik jaypaik deleted the 11-26-feat_fix_imodularaccount_to_return_address_of_the_account_for_native_functions branch November 27, 2024 15:38
Copy link

Overview

Octane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉


🔗 Commit Hash: 81abe15

jaypaik added a commit that referenced this pull request Nov 27, 2024
… functions (#208)

The reference implementation currently returns `address(this)` which is the address of the account for `ExecutionDataView`'s `module` field. However, the standard currently contradicts this by saying we should return `address(0)` for native functions.

The better design seems to be to return the address of the account since the zero address would also be returned for nonexistent selectors, and it would be difficult to differentiate in those cases.

The client should have the address of the account handy so it'd be easy to compare it against what is returned to check if it's a native function or not.

Thanks @0xrubes for bringing this up!
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.

2 participants