From 4c8a78bd58181aaf5260d6e31bc160e48cc73c16 Mon Sep 17 00:00:00 2001 From: SmartFlow Developer Date: Sat, 10 Jan 2026 20:44:59 +0100 Subject: [PATCH 1/2] style: fix code formatting to pass CI Apply forge fmt to fix formatting issues in source and test files: - src/AuthCaptureEscrow.sol - src/collectors/ERC3009PaymentCollector.sol - src/collectors/Permit2PaymentCollector.sol - src/interfaces/IMulticall3.sol - test/base/AuthCaptureEscrowBase.sol - test/base/AuthCaptureEscrowSmartWalletBase.sol - test/src/PaymentEscrow/authorize.t.sol - test/src/collectors/SpendPermissionPaymentCollector.t.sol This ensures 'forge fmt --check' passes in CI workflows. --- src/AuthCaptureEscrow.sol | 7 ++----- src/collectors/ERC3009PaymentCollector.sol | 19 ++++++++++--------- src/collectors/Permit2PaymentCollector.sol | 4 +++- src/interfaces/IMulticall3.sol | 5 +---- test/base/AuthCaptureEscrowBase.sol | 5 +++-- .../base/AuthCaptureEscrowSmartWalletBase.sol | 6 +----- test/src/PaymentEscrow/authorize.t.sol | 4 +--- .../SpendPermissionPaymentCollector.t.sol | 12 +++--------- 8 files changed, 24 insertions(+), 38 deletions(-) diff --git a/src/AuthCaptureEscrow.sol b/src/AuthCaptureEscrow.sol index 9f374cf..7638e78 100644 --- a/src/AuthCaptureEscrow.sol +++ b/src/AuthCaptureEscrow.sol @@ -392,9 +392,7 @@ contract AuthCaptureEscrow is ReentrancyGuardTransient { /// @return The operator's token store address function getTokenStore(address operator) public view returns (address) { return LibClone.predictDeterministicAddress({ - implementation: tokenStoreImplementation, - salt: bytes32(bytes20(operator)), - deployer: address(this) + implementation: tokenStoreImplementation, salt: bytes32(bytes20(operator)), deployer: address(this) }); } @@ -440,8 +438,7 @@ contract AuthCaptureEscrow is ReentrancyGuardTransient { } else if (tokenStore.code.length == 0) { // Call failed from undeployed TokenStore, deploy and try again tokenStore = LibClone.cloneDeterministic({ - implementation: tokenStoreImplementation, - salt: bytes32(bytes20(operator)) + implementation: tokenStoreImplementation, salt: bytes32(bytes20(operator)) }); emit TokenStoreCreated(operator, tokenStore); TokenStore(tokenStore).sendTokens(token, recipient, amount); diff --git a/src/collectors/ERC3009PaymentCollector.sol b/src/collectors/ERC3009PaymentCollector.sol index f143868..6f3a48c 100644 --- a/src/collectors/ERC3009PaymentCollector.sol +++ b/src/collectors/ERC3009PaymentCollector.sol @@ -39,15 +39,16 @@ contract ERC3009PaymentCollector is TokenCollector, ERC6492SignatureHandler { uint256 maxAmount = paymentInfo.maxAmount; // Pull tokens into this contract - IERC3009(token).receiveWithAuthorization({ - from: payer, - to: address(this), - value: maxAmount, - validAfter: 0, - validBefore: paymentInfo.preApprovalExpiry, - nonce: _getHashPayerAgnostic(paymentInfo), - signature: _handleERC6492Signature(collectorData) - }); + IERC3009(token) + .receiveWithAuthorization({ + from: payer, + to: address(this), + value: maxAmount, + validAfter: 0, + validBefore: paymentInfo.preApprovalExpiry, + nonce: _getHashPayerAgnostic(paymentInfo), + signature: _handleERC6492Signature(collectorData) + }); // Return any excess tokens to payer if (maxAmount > amount) SafeERC20.safeTransfer(IERC20(token), payer, maxAmount - amount); diff --git a/src/collectors/Permit2PaymentCollector.sol b/src/collectors/Permit2PaymentCollector.sol index e4ced64..7cb604d 100644 --- a/src/collectors/Permit2PaymentCollector.sol +++ b/src/collectors/Permit2PaymentCollector.sol @@ -42,7 +42,9 @@ contract Permit2PaymentCollector is TokenCollector, ERC6492SignatureHandler { ) internal override { permit2.permitTransferFrom({ permit: ISignatureTransfer.PermitTransferFrom({ - permitted: ISignatureTransfer.TokenPermissions({token: paymentInfo.token, amount: paymentInfo.maxAmount}), + permitted: ISignatureTransfer.TokenPermissions({ + token: paymentInfo.token, amount: paymentInfo.maxAmount + }), nonce: uint256(_getHashPayerAgnostic(paymentInfo)), deadline: paymentInfo.preApprovalExpiry }), diff --git a/src/interfaces/IMulticall3.sol b/src/interfaces/IMulticall3.sol index 57a27ea..f232db1 100644 --- a/src/interfaces/IMulticall3.sol +++ b/src/interfaces/IMulticall3.sol @@ -26,10 +26,7 @@ interface IMulticall3 { bytes returnData; } - function aggregate(Call[] calldata calls) - external - payable - returns (uint256 blockNumber, bytes[] memory returnData); + function aggregate(Call[] calldata calls) external payable returns (uint256 blockNumber, bytes[] memory returnData); function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData); diff --git a/test/base/AuthCaptureEscrowBase.sol b/test/base/AuthCaptureEscrowBase.sol index 4d9c248..ee10380 100644 --- a/test/base/AuthCaptureEscrowBase.sol +++ b/test/base/AuthCaptureEscrowBase.sol @@ -161,8 +161,9 @@ contract AuthCaptureEscrowBase is Test, DeployPermit2 { uint256 validBefore, bytes32 nonce ) internal view returns (bytes32) { - bytes32 structHash = - keccak256(abi.encode(_RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce)); + bytes32 structHash = keccak256( + abi.encode(_RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce) + ); return keccak256(abi.encodePacked("\x19\x01", IERC3009(token).DOMAIN_SEPARATOR(), structHash)); } diff --git a/test/base/AuthCaptureEscrowSmartWalletBase.sol b/test/base/AuthCaptureEscrowSmartWalletBase.sol index 4da0435..ab9f00d 100644 --- a/test/base/AuthCaptureEscrowSmartWalletBase.sol +++ b/test/base/AuthCaptureEscrowSmartWalletBase.sol @@ -172,11 +172,7 @@ contract AuthCaptureEscrowSmartWalletBase is AuthCaptureEscrowBase { uint256 nonce = uint256(hashPortion); return MagicSpend.WithdrawRequest({ - asset: address(0), - amount: 0, - nonce: nonce, - expiry: type(uint48).max, - signature: new bytes(0) + asset: address(0), amount: 0, nonce: nonce, expiry: type(uint48).max, signature: new bytes(0) }); } diff --git a/test/src/PaymentEscrow/authorize.t.sol b/test/src/PaymentEscrow/authorize.t.sol index f24c56a..60cc1e6 100644 --- a/test/src/PaymentEscrow/authorize.t.sol +++ b/test/src/PaymentEscrow/authorize.t.sol @@ -321,9 +321,7 @@ contract AuthorizeTest is AuthCaptureEscrowSmartWalletBase { vm.assume(maxAmount >= amount && amount > 0); mockERC3009Token.mint(address(smartWalletDeployed), amount); AuthCaptureEscrow.PaymentInfo memory paymentInfo = _createPaymentInfo({ - payer: address(smartWalletDeployed), - maxAmount: maxAmount, - token: address(mockERC3009Token) + payer: address(smartWalletDeployed), maxAmount: maxAmount, token: address(mockERC3009Token) }); // Create and sign the spend permission diff --git a/test/src/collectors/SpendPermissionPaymentCollector.t.sol b/test/src/collectors/SpendPermissionPaymentCollector.t.sol index 81c6c5d..8a3c946 100644 --- a/test/src/collectors/SpendPermissionPaymentCollector.t.sol +++ b/test/src/collectors/SpendPermissionPaymentCollector.t.sol @@ -25,9 +25,7 @@ contract SpendPermissionPaymentCollectorTest is AuthCaptureEscrowSmartWalletBase MockERC3009Token(address(mockERC3009Token)).mint(address(smartWalletDeployed), amount); AuthCaptureEscrow.PaymentInfo memory paymentInfo = _createPaymentInfo({ - payer: address(smartWalletDeployed), - maxAmount: amount, - token: address(mockERC3009Token) + payer: address(smartWalletDeployed), maxAmount: amount, token: address(mockERC3009Token) }); address tokenStore = authCaptureEscrow.getTokenStore(paymentInfo.operator); @@ -47,9 +45,7 @@ contract SpendPermissionPaymentCollectorTest is AuthCaptureEscrowSmartWalletBase MockERC3009Token(address(mockERC3009Token)).mint(address(smartWalletDeployed), amount); AuthCaptureEscrow.PaymentInfo memory paymentInfo = _createPaymentInfo({ - payer: address(smartWalletDeployed), - maxAmount: amount, - token: address(mockERC3009Token) + payer: address(smartWalletDeployed), maxAmount: amount, token: address(mockERC3009Token) }); address tokenStore = authCaptureEscrow.getTokenStore(paymentInfo.operator); @@ -69,9 +65,7 @@ contract SpendPermissionPaymentCollectorTest is AuthCaptureEscrowSmartWalletBase mockERC3009Token.mint(address(magicSpend), amount); AuthCaptureEscrow.PaymentInfo memory paymentInfo = _createPaymentInfo({ - payer: address(smartWalletDeployed), - maxAmount: amount, - token: address(mockERC3009Token) + payer: address(smartWalletDeployed), maxAmount: amount, token: address(mockERC3009Token) }); address tokenStore = authCaptureEscrow.getTokenStore(paymentInfo.operator); From 2829feaa99cb2665cbeaf74e21d8aa3c366e4adb Mon Sep 17 00:00:00 2001 From: AdekunleBamz Date: Tue, 20 Jan 2026 17:28:20 +0100 Subject: [PATCH 2/2] fix: update Deploy.s.sol license to MIT for consistency --- script/Deploy.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 6e3f85b..9de9733 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0 +// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {Script} from "forge-std/Script.sol";