Skip to content

Conversation

zimpha
Copy link
Member

@zimpha zimpha commented Oct 13, 2025

No description provided.

@zimpha zimpha requested a review from Thegaram October 13, 2025 10:11
Comment on lines +90 to +91
/// @notice The address of the `ScrollChain` contract.
address public immutable rollup;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to init in constructor.

Comment on lines +231 to +232
// @note callbackTo is the address of the target contract to call.
IScrollGatewayCallback(callbackTo).onScrollGatewayCallback(data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for example to support swaps, we'd need to deploy a "forwarder contract" that implements onScrollGatewayCallback, decodes the data, and makes the swap?

But how does it work with tokens, when tokens are transferred to to instead of callbackTo? Shouldn't we transfer tokens to callbackTo in this case?

/// @param amount The amount of tokens to withdraw.
/// @param messageHash The hash of the message, which is the corresponding withdraw message hash in L2.
/// @param signature The signature of the message from sequencer.
function claimFastWithdraw(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just have one function and call if data is non-empty?

One concern with 2 functions is: The user's intention might be to make a call on L2, which executes and re-deposits in an atomic step. But instead, the sequencer might call claimFastWithdraw so no call is executed.

}
}

// decode actual validium sender from message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I encode the recipient into data instead of always using the L3 sender as the withdraw recipient. Should we do that here?

Comment on lines +187 to +192
if (l1Token == weth) {
IWETH(weth).withdraw(amount);
AddressUpgradeable.sendValue(payable(sender), amount);
} else {
IERC20Upgradeable(l1Token).safeTransfer(sender, amount);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking was a bit different: If the message is never relayed to L2, the user can claim from L1ScrollMessenger, and not from the liquidity pool here (which might be empty). Is that doable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants