Skip to content

Commit

Permalink
explicitly set orderAuthorityDst
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Nov 29, 2024
1 parent 9f76e21 commit 8bcb392
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions script/demoScripts/demoDLN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
3 changes: 2 additions & 1 deletion src/Facets/DeBridgeDlnFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ contract DeBridgeDlnFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable {
struct DeBridgeDlnData {
bytes receivingAssetId;
bytes receiver;
bytes orderAuthorityDst;
uint256 minAmountOut;
}

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions test/solidity/Facets/DeBridgeDlnFacet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 8bcb392

Please sign in to comment.