-
Notifications
You must be signed in to change notification settings - Fork 13
feat: add support for ERC-3009 #214
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7a62763
feat: add ERC-3009 support, modify DepositRecorded to support various…
pali101 8970f8d
refactor: generalize error to SignerMustBeMsgSender for self-recipien…
pali101 a8a76ef
refactor: replace PermitRecipientMustBeMsgSender check with SignerMus…
pali101 eb19764
feat: add ERC-3009 support to Mock ERC-20
pali101 16c0567
refactor: updated error selector for PermitRecipient
pali101 1a0733a
test: add tests for deposit with authorization
pali101 272a083
feat: add depositWithAuthorizationAndApproveOperator and depositWithA…
pali101 19cf5ba
test: add tests for deposit with authorization + operator operations
pali101 a15dc32
feat(erc3009): switch to receiveWithAuthorization
pali101 4b1f3dd
fix: removed hardcoded hashed name, _chainID() and explicitly importe…
pali101 96724de
fix: modified tests to reflect updated MockERC20
pali101 58ad21c
fix: updated DepositRecorded event to remove auth type and nonce
pali101 10c77a7
feat: allow relayer to perform deposit with authorization on behalf o…
pali101 8418eb0
test: add test to simulate different signer and relayer
pali101 b1704e5
test: add tests checking only to address can call deposit and operato…
pali101 d775697
refactor: moved IERC3009 to separate file
pali101 b7f573a
style: fix formatting
pali101 c6c443a
fix: use parameter type IERC3009 instead of explicit casting
pali101 e7773ed
refactor: MockERC20 inherit ERC20 explicitly and add IERC3009 interfa…
pali101 6b025a9
fix: shifted to SignerMustBeMsgSender custom error for newer tests af…
pali101 5d30d18
style: fix formatting
pali101 61e7c24
fix: passed IERC3009 token instead of just address in depositWithAuth…
pali101 588e3ba
refactor: update _increaseOperatorApproval to use IERC20 interface
pali101 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 OR MIT | ||
| pragma solidity ^0.8.27; | ||
|
|
||
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
|
||
| interface IERC3009 is IERC20 { | ||
| /** | ||
| * @notice Receive a transfer with a signed authorization from the payer | ||
| * @dev This has an additional check to ensure that the payee's address matches | ||
| * the caller of this function to prevent front-running attacks. | ||
| * @param from Payer's address (Authorizer) | ||
| * @param to Payee's address | ||
| * @param value Amount to be transferred | ||
| * @param validAfter The time after which this is valid (unix time) | ||
| * @param validBefore The time before which this is valid (unix time) | ||
| * @param nonce Unique nonce | ||
| * @param v v of the signature | ||
| * @param r r of the signature | ||
| * @param s s of the signature | ||
| */ | ||
| function receiveWithAuthorization( | ||
| address from, | ||
| address to, | ||
| uint256 value, | ||
| uint256 validAfter, | ||
| uint256 validBefore, | ||
| bytes32 nonce, | ||
| uint8 v, | ||
| bytes32 r, | ||
| bytes32 s | ||
| ) external; | ||
|
|
||
| function authorizationState(address user, bytes32 nonce) external view returns (bool used); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.