Skip to content

feat: [POST AUDIT] periphery contracts #1052

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4975ffc
feat(SpokePoolPeriphery): Support multiple exchanges (#777)
nicholaspai Mar 13, 2025
8ca7b70
feat: optionally adjust output amount by swap price improvement over …
mrice32 May 14, 2025
1e6a638
fix: add Nick's comment that was omitted in previous merge (#1001)
mrice32 May 14, 2025
1f0bbe0
feat: add balance injection to multicall handler calls (#1000)
mrice32 May 14, 2025
b84dbfa
fix: restructure periphery contracts to avoid frontrunning attacks (#…
mrice32 May 15, 2025
539204f
[H-01] Incorrect Nonce Passed to the Permit2.permit Function (#1013)
mrice32 Jun 24, 2025
405125a
[M-02] Replay Attacks on SpokePoolPeriphery Possible (#1015)
mrice32 Jun 24, 2025
00c2b71
[N-10] Remove unused code to improve clarity (#1025)
mrice32 Jun 24, 2025
91c54fd
[N-08] Typographical Errors (#1024)
mrice32 Jun 24, 2025
68d6ffb
[N-05] Insufficient Documentation (#1023)
mrice32 Jun 24, 2025
d0c9963
[L-05] Inflexible Fee Recipient Field Blocks Open Relaying (#1021)
mrice32 Jun 24, 2025
2f4464f
Rename deposit function to depositNative for clarity (#1019)
mrice32 Jun 24, 2025
2763834
[M-05] Incorrect EIP-712 Encoding (#1017)
mrice32 Jun 24, 2025
1cbe0f6
[N-12] Misleading Documentation (#1026)
mrice32 Jun 24, 2025
f212bd3
[M-03] DoS Attack on Swapping via Permit2 Possible (#1016)
mrice32 Jun 24, 2025
ee5649f
L-01 deposit Will Not Work for Non-EVM Target Chains (#1018)
mrice32 Jun 24, 2025
c807450
[L-03] Document integer overflow case in _swapAndBridge function (#1020)
mrice32 Jun 24, 2025
1429561
[N-03] Optimization Opportunities (#1022)
mrice32 Jun 25, 2025
8530839
Merge branch 'master' into may-14-audit
mrice32 Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
720 changes: 720 additions & 0 deletions contracts/SpokePoolPeriphery.sol

Large diffs are not rendered by default.

310 changes: 0 additions & 310 deletions contracts/SwapAndBridge.sol

This file was deleted.

35 changes: 35 additions & 0 deletions contracts/external/interfaces/IERC20Auth.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

/*
* @notice Minimal interface for an EIP-3009 compliant token.
* https://eips.ethereum.org/EIPS/eip-3009
*/
interface IERC20Auth {
/**
* @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. (See security
* considerations)
* @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;
}
19 changes: 19 additions & 0 deletions contracts/external/interfaces/IPermit2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
pragma solidity ^0.8.0;

interface IPermit2 {
struct PermitDetails {
address token;
uint160 amount;
uint48 expiration;
uint48 nonce;
}

struct PermitSingle {
PermitDetails details;
address spender;
uint256 sigDeadline;
}

struct TokenPermissions {
address token;
uint256 amount;
Expand All @@ -18,6 +31,12 @@ interface IPermit2 {
uint256 requestedAmount;
}

function permit(
address owner,
PermitSingle memory permitSingle,
bytes calldata signature
) external;

function permitWitnessTransferFrom(
PermitTransferFrom memory permit,
SignatureTransferDetails calldata transferDetails,
Expand Down
Loading
Loading