Skip to content

Commit 047283e

Browse files
committed
[N-05] Insufficient Documentation
Signed-off-by: Matt Rice <[email protected]>
1 parent b84dbfa commit 047283e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

contracts/SpokePoolPeriphery.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ contract SpokePoolPeriphery is SpokePoolPeripheryInterface, Lockable, MultiCalle
222222

223223
/**
224224
* @inheritdoc SpokePoolPeripheryInterface
225+
* @dev Does not support native tokens as swap output. Only ERC20 tokens can be deposited via this function.
225226
*/
226227
function swapAndBridge(SwapAndDepositData calldata swapAndDepositData) external payable override nonReentrant {
227228
// If a user performs a swapAndBridge with the swap token as the native token, wrap the value and treat the rest of transaction
@@ -245,6 +246,7 @@ contract SpokePoolPeriphery is SpokePoolPeripheryInterface, Lockable, MultiCalle
245246

246247
/**
247248
* @inheritdoc SpokePoolPeripheryInterface
249+
* @dev Does not support native tokens as swap output. Only ERC20 tokens can be deposited via this function.
248250
*/
249251
function swapAndBridgeWithPermit(
250252
address signatureOwner,
@@ -278,6 +280,7 @@ contract SpokePoolPeriphery is SpokePoolPeripheryInterface, Lockable, MultiCalle
278280

279281
/**
280282
* @inheritdoc SpokePoolPeripheryInterface
283+
* @dev Does not support native tokens as swap output. Only ERC20 tokens can be deposited via this function.
281284
*/
282285
function swapAndBridgeWithPermit2(
283286
address signatureOwner,
@@ -310,6 +313,7 @@ contract SpokePoolPeriphery is SpokePoolPeripheryInterface, Lockable, MultiCalle
310313

311314
/**
312315
* @inheritdoc SpokePoolPeripheryInterface
316+
* @dev Does not support native tokens as swap output. Only ERC20 tokens can be deposited via this function.
313317
*/
314318
function swapAndBridgeWithAuthorization(
315319
address signatureOwner,

contracts/handlers/MulticallHandler.sol

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ contract MulticallHandler is AcrossMessageHandler, ReentrancyGuard {
4848
error ReplacementCallFailed(bytes calldData);
4949
error CalldataTooShort(uint256 callDataLength, uint256 offset);
5050

51-
5251
modifier onlySelf() {
5352
_requireSelf();
5453
_;
@@ -120,7 +119,22 @@ contract MulticallHandler is AcrossMessageHandler, ReentrancyGuard {
120119
}
121120
}
122121

123-
function makeCallWithBalance(address target, bytes memory callData, uint256 value, Replacement[] memory replacement) external onlySelf {
122+
/**
123+
* @notice Executes a call while replacing specified calldata offsets with current token/native balances.
124+
* @dev Modifies calldata in-place using OR operations. Target calldata positions must be zeroed out.
125+
* Cannot handle negative balances, making it incompatible with DEXs requiring negative input amounts.
126+
* For native balance (token = address(0)), the entire balance is used as call value.
127+
* @param target The contract address to call
128+
* @param callData The calldata to execute, with zero values at replacement positions
129+
* @param value The native token value to send (ignored if native balance replacement is used)
130+
* @param replacement Array of Replacement structs specifying token addresses and byte offsets for balance injection
131+
*/
132+
function makeCallWithBalance(
133+
address target,
134+
bytes memory callData,
135+
uint256 value,
136+
Replacement[] memory replacement
137+
) external onlySelf {
124138
for (uint256 i = 0; i < replacement.length; i++) {
125139
uint256 bal = 0;
126140
if (replacement[i].token != address(0)) {

0 commit comments

Comments
 (0)