From 8bcb3927ebab0780cb54ba6306f7ecca2a09ff55 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Fri, 29 Nov 2024 11:51:44 +0300 Subject: [PATCH] explicitly set orderAuthorityDst --- script/demoScripts/demoDLN.ts | 1 + src/Facets/DeBridgeDlnFacet.sol | 3 ++- test/solidity/Facets/DeBridgeDlnFacet.t.sol | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/script/demoScripts/demoDLN.ts b/script/demoScripts/demoDLN.ts index 1a327ec03..cb849f9b1 100644 --- a/script/demoScripts/demoDLN.ts +++ b/script/demoScripts/demoDLN.ts @@ -50,6 +50,7 @@ const main = async () => { const dlnData: DeBridgeDlnFacet.DeBridgeDlnDataStruct = { receivingAssetId: dstChainTokenOut.address, receiver: ethers.utils.solidityPack(['address'], [address]), + orderAuthorityDst: ethers.utils.solidityPack(['address'], [address]), minAmountOut: dstChainTokenOut.recommendedAmount, } diff --git a/src/Facets/DeBridgeDlnFacet.sol b/src/Facets/DeBridgeDlnFacet.sol index f37127d62..78ee1a7ca 100644 --- a/src/Facets/DeBridgeDlnFacet.sol +++ b/src/Facets/DeBridgeDlnFacet.sol @@ -33,6 +33,7 @@ contract DeBridgeDlnFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable { struct DeBridgeDlnData { bytes receivingAssetId; bytes receiver; + bytes orderAuthorityDst; uint256 minAmountOut; } @@ -191,7 +192,7 @@ contract DeBridgeDlnFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable { ), receiverDst: _deBridgeData.receiver, givePatchAuthoritySrc: msg.sender, - orderAuthorityAddressDst: _deBridgeData.receiver, + orderAuthorityAddressDst: _deBridgeData.orderAuthorityDst, allowedTakerDst: "", externalCall: "", allowedCancelBeneficiarySrc: abi.encodePacked(msg.sender) diff --git a/test/solidity/Facets/DeBridgeDlnFacet.t.sol b/test/solidity/Facets/DeBridgeDlnFacet.t.sol index 96693de0d..1443daa68 100644 --- a/test/solidity/Facets/DeBridgeDlnFacet.t.sol +++ b/test/solidity/Facets/DeBridgeDlnFacet.t.sol @@ -91,6 +91,7 @@ contract DeBridgeDlnFacetTest is TestBaseFacet { 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 ), // Polygon USDC receiver: abi.encodePacked(USER_RECEIVER), + orderAuthorityDst: abi.encodePacked(USER_RECEIVER), minAmountOut: (defaultUSDCAmount * 95) / 100 }); @@ -259,6 +260,8 @@ contract DeBridgeDlnFacetTest is TestBaseFacet { // This is just a random Solana Address for testing validDeBridgeDlnData .receiver = hex"e275bc4764effea023f35f3c60b2260c93248b74ec8d63ee215d40317e98b014"; // [pre-commit-checker: not a secret] + validDeBridgeDlnData + .orderAuthorityDst = hex"e275bc4764effea023f35f3c60b2260c93248b74ec8d63ee215d40317e98b014"; // [pre-commit-checker: not a secret] // SOL Token validDeBridgeDlnData .receivingAssetId = hex"0000000000000000000000000000000000000000000000000000000000000000"; // [pre-commit-checker: not a secret]