Skip to content

Conversation

@ifelsedeveloper
Copy link

Change Summary

What does this PR change?
Adds Permit2Proxy contract - a non-witness version of Permit2WitnessProxy that uses permitTransferFrom instead of permitWitnessTransferFrom, enabling simpler Permit2 integrations without witness data.

Related Issue/Ticket:
https://1inch.atlassian.net/browse/PT1-347

Testing & Verification

How was this tested?

  • Unit tests
  • Integration tests
  • Manual testing (describe steps)
  • Verified on staging
yarn test test/ProxyExample.js

  ProxyExample
    ✔ permit2 example (without witness) (48ms)

  1 passing (802ms)

Risk Assessment

Risk Level:

  • Low - Minor changes, no operational impact
  • Medium - Moderate changes, limited impact, standard rollback available
  • High - Significant changes, potential operational impact, complex rollback

Risks & Impact

  • New contract addition only, no changes to existing contracts
  • No migration required
  • No breaking changes to existing functionality

Files Changed

  • contracts/extensions/Permit2Proxy.sol - New proxy contract without witness
  • contracts/interfaces/IPermit2TransferFrom.sol - New interface for permitTransferFrom
  • test/ProxyExample.js - Unit test for the new contract
  • scripts/selector_bruteforce.py - Utility script for finding function selectors

- Introduced Permit2Proxy contract for proxy transfer functionality using Permit2.
- Added IPermit2TransferFrom interface defining structures and methods for permit-based token transfers.
- Implemented a script for ABI selector extraction to facilitate selector management.
- Updated Permit2Proxy contract to use IPermit2TransferFrom interface and corrected function selectors.
- Removed obsolete abi_selectors.py script to streamline the codebase.
- Added a new selector bruteforce script for enhanced functionality.
- Introduced ProxyExample test to demonstrate permit2 usage without witness.
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.

1 participant