From ce7697515b8c48d4d1aae09d45711d4143d5c33b Mon Sep 17 00:00:00 2001 From: Timepunk <45543880+0xTimepunk@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:41:40 +0000 Subject: [PATCH] fix: blacklisting of facet added to script --- .../Abstract.Deploy.Single.s.sol | 7 +- .../blacklistedFacets/AcrossFacetPackedV3.sol | 75 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 script/forge-scripts/misc/blacklistedFacets/AcrossFacetPackedV3.sol diff --git a/script/forge-scripts/Abstract.Deploy.Single.s.sol b/script/forge-scripts/Abstract.Deploy.Single.s.sol index 950d5d591..280d1deae 100644 --- a/script/forge-scripts/Abstract.Deploy.Single.s.sol +++ b/script/forge-scripts/Abstract.Deploy.Single.s.sol @@ -46,6 +46,7 @@ import { PayMaster } from "src/payments/PayMaster.sol"; import { EmergencyQueue } from "src/EmergencyQueue.sol"; import { VaultClaimer } from "src/VaultClaimer.sol"; import { AcrossFacetPacked } from "./misc/blacklistedFacets/AcrossFacetPacked.sol"; +import { AcrossFacetPackedV3 } from "./misc/blacklistedFacets/AcrossFacetPackedV3.sol"; import { AmarokFacetPacked } from "./misc/blacklistedFacets/AmarokFacetPacked.sol"; import { RewardsDistributor } from "src/RewardsDistributor.sol"; import "forge-std/console.sol"; @@ -607,7 +608,7 @@ abstract contract AbstractDeploySingle is BatchScript { vars.lifiValidator = address(new LiFiValidator{ salt: salt }(vars.superRegistry)); vars.lv = LiFiValidator(vars.lifiValidator); - vars.selectorsToBlacklist = new bytes4[](8); + vars.selectorsToBlacklist = new bytes4[](12); /// @dev add selectors that need to be blacklisted post LiFiValidator deployment here vars.selectorsToBlacklist[0] = AcrossFacetPacked.startBridgeTokensViaAcrossNativePacked.selector; @@ -618,6 +619,10 @@ abstract contract AbstractDeploySingle is BatchScript { vars.selectorsToBlacklist[5] = AmarokFacetPacked.startBridgeTokensViaAmarokERC20PackedPayFeeWithNative.selector; vars.selectorsToBlacklist[6] = AmarokFacetPacked.startBridgeTokensViaAmarokERC20MinPayFeeWithAsset.selector; vars.selectorsToBlacklist[7] = AmarokFacetPacked.startBridgeTokensViaAmarokERC20MinPayFeeWithNative.selector; + vars.selectorsToBlacklist[8] = AcrossFacetPackedV3.startBridgeTokensViaAcrossV3NativePacked.selector; + vars.selectorsToBlacklist[9] = AcrossFacetPackedV3.startBridgeTokensViaAcrossV3NativeMin.selector; + vars.selectorsToBlacklist[10] = AcrossFacetPackedV3.startBridgeTokensViaAcrossV3ERC20Packed.selector; + vars.selectorsToBlacklist[11] = AcrossFacetPackedV3.startBridgeTokensViaAcrossV3ERC20Min.selector; for (uint256 j = 0; j < vars.selectorsToBlacklist.length; ++j) { vars.lv.addToBlacklist(vars.selectorsToBlacklist[j]); diff --git a/script/forge-scripts/misc/blacklistedFacets/AcrossFacetPackedV3.sol b/script/forge-scripts/misc/blacklistedFacets/AcrossFacetPackedV3.sol new file mode 100644 index 000000000..d59def5d5 --- /dev/null +++ b/script/forge-scripts/misc/blacklistedFacets/AcrossFacetPackedV3.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +/// @title AcrossFacetPackedV3 +/// @author LI.FI (https://li.fi) +/// @notice Provides functionality for bridging through Across in a gas-optimized way +/// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs +/// @notice !WARNING ALREADY BLACKLISTED +/// @custom:version 1.0.0 +contract AcrossFacetPackedV3 { + /// Constructor /// + + /// External Methods /// + + /// @notice Bridges native tokens via Across (packed implementation) + /// No params, all data will be extracted from manually encoded callData + function startBridgeTokensViaAcrossV3NativePacked() external payable { } + + /// @notice Bridges native tokens via Across (minimal implementation) + /// @param transactionId Custom transaction ID for tracking + /// @param receiver Receiving wallet address + /// @param destinationChainId Receiving chain + /// @param receivingAssetId The address of the token to be received at destination chain + /// @param outputAmount The amount to be received at destination chain (after fees) + /// @param quoteTimestamp The timestamp of the Across quote that was used for this transaction + /// @param fillDeadline The destination chain timestamp until which the order can be filled + /// @param message Arbitrary data that can be used to pass additional information to the recipient along with the + /// tokens + function startBridgeTokensViaAcrossV3NativeMin( + bytes32 transactionId, + address receiver, + uint256 destinationChainId, + address receivingAssetId, + uint256 outputAmount, + uint32 quoteTimestamp, + uint32 fillDeadline, + bytes calldata message + ) + external + payable + { } + + /// @notice Bridges ERC20 tokens via Across (packed implementation) + /// No params, all data will be extracted from manually encoded callData + function startBridgeTokensViaAcrossV3ERC20Packed() external { } + + /// @notice Bridges ERC20 tokens via Across (minimal implementation) + /// @param transactionId Custom transaction ID for tracking + /// @param sendingAssetId The address of the asset/token to be bridged + /// @param inputAmount The amount to be bridged (including fees) + /// @param receiver Receiving wallet address + /// @param destinationChainId Receiving chain + /// @param receivingAssetId The address of the token to be received at destination chain + /// @param outputAmount The amount to be received at destination chain (after fees) + /// @param quoteTimestamp The timestamp of the Across quote that was used for this transaction + /// @param fillDeadline The destination chain timestamp until which the order can be filled + /// @param message Arbitrary data that can be used to pass additional information to the recipient along with the + /// tokens + function startBridgeTokensViaAcrossV3ERC20Min( + bytes32 transactionId, + address sendingAssetId, + uint256 inputAmount, + address receiver, + uint64 destinationChainId, + address receivingAssetId, + uint256 outputAmount, + uint32 quoteTimestamp, + uint32 fillDeadline, + bytes calldata message + ) + external + { + // Deposit assets + } +}