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(CoSigner): implementing contract-call and native-token-transfer permissions check #809

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented Oct 11, 2024

Description

This PR introduces the draft testing implementation for the following permissions check during the CoSign process:

  • contract-call permission:
    Extracting the contract call address from the bundler's execution operation and comparing it to the permissions allowed for the address call.

  • native-token-transfer permission:
    Extracted values from the bundler's execution batch are summarized and checked with the allowance.

Currently missing:

  • Check for the period, start, and expiration,
  • Tracking the already spent amount.

How Has This Been Tested?

  • Manual testing only, integration tests will be added before merging.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this Oct 11, 2024
@geekbrother geekbrother marked this pull request as draft October 11, 2024 22:01
@geekbrother geekbrother changed the title feat: implementing contract call check feat(CoSigner): implementing contract-call and native-token-transfer permissions check Oct 11, 2024
@geekbrother geekbrother force-pushed the fix/co_signer_fixes branch 2 times, most recently from d218df8 to df4af03 Compare October 11, 2024 22:25
@geekbrother geekbrother marked this pull request as ready for review October 11, 2024 22:47
Copy link

@nopestack nopestack left a comment

Choose a reason for hiding this comment

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

1st pass, looks good though some tests so we can verify what it does would be appreciated

src/utils/sessions.rs Outdated Show resolved Hide resolved
src/utils/sessions.rs Outdated Show resolved Hide resolved
Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

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

LGTM

@geekbrother geekbrother merged commit 051a9b7 into master Oct 15, 2024
14 checks passed
@geekbrother geekbrother deleted the fix/co_signer_fixes branch October 15, 2024 23:21
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.

3 participants