Skip to content

Commit b48a007

Browse files
fix: LZ refund address
1 parent 56e9824 commit b48a007

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

script/production/CustomScripts.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ contract BridgeEULToLabsMultisig is ScriptUtils, SafeMultisendBuilder {
7272
util.run(dstChainId, dstAddress, amount);
7373
} else {
7474
(address to, uint256 value, bytes memory rawCalldata) =
75-
util.getSendCalldata(dstChainId, dstAddress, amount, 1e4);
75+
util.getSendCalldata(safe, dstChainId, dstAddress, amount, 1e4);
7676
addMultisendItem(tokenAddresses.EUL, abi.encodeCall(IERC20.approve, (to, amount)));
7777
addMultisendItem(to, value, rawCalldata);
7878
}

script/utils/LayerZeroUtils.s.sol

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ contract LayerZeroSendEUL is ScriptUtils {
340340
{
341341
ERC20 eul = ERC20(tokenAddresses.EUL);
342342
(address oftAdapter, uint256 value, SendParam memory sendParam, MessagingFee memory fee, address refundAddress)
343-
= getSendInputs(dstChainId, dstAddress, amount, 0);
343+
= getSendInputs(getDeployer(), dstChainId, dstAddress, amount, 0);
344344

345345
startBroadcast();
346346
eul.approve(oftAdapter, amount);
@@ -351,7 +351,13 @@ contract LayerZeroSendEUL is ScriptUtils {
351351
return (receipt, oftReceipt);
352352
}
353353

354-
function getSendInputs(uint256 dstChainId, address dstAddress, uint256 amount, uint256 nativeFeeMultiplierBps)
354+
function getSendInputs(
355+
address srcAddress,
356+
uint256 dstChainId,
357+
address dstAddress,
358+
uint256 amount,
359+
uint256 nativeFeeMultiplierBps
360+
)
355361
public
356362
returns (address to, uint256 value, SendParam memory sendParam, MessagingFee memory fee, address refundAddress)
357363
{
@@ -367,19 +373,22 @@ contract LayerZeroSendEUL is ScriptUtils {
367373
fee = IOFT(bridgeAddresses.oftAdapter).quoteSend(sendParam, false);
368374
fee.nativeFee = fee.nativeFee * ((1e4 + nativeFeeMultiplierBps) / 1e4);
369375

370-
return (bridgeAddresses.oftAdapter, fee.nativeFee, sendParam, fee, dstAddress);
376+
return (bridgeAddresses.oftAdapter, fee.nativeFee, sendParam, fee, srcAddress);
371377
}
372378

373-
function getSendCalldata(uint256 dstChainId, address dstAddress, uint256 amount, uint256 nativeFeeMultiplierBps)
374-
public
375-
returns (address to, uint256 value, bytes memory rawCalldata)
376-
{
379+
function getSendCalldata(
380+
address srcAddress,
381+
uint256 dstChainId,
382+
address dstAddress,
383+
uint256 amount,
384+
uint256 nativeFeeMultiplierBps
385+
) public returns (address to, uint256 value, bytes memory rawCalldata) {
377386
SendParam memory sendParam;
378387
MessagingFee memory fee;
379388
address refundAddress;
380389

381390
(to, value, sendParam, fee, refundAddress) =
382-
getSendInputs(dstChainId, dstAddress, amount, nativeFeeMultiplierBps);
391+
getSendInputs(srcAddress, dstChainId, dstAddress, amount, nativeFeeMultiplierBps);
383392
rawCalldata = abi.encodeCall(IOFT.send, (sendParam, fee, refundAddress));
384393
}
385394
}

0 commit comments

Comments
 (0)