Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/ZkSync_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ contract ZkSync_SpokePool is SpokePool {
function _bridgeTokensToHubPool(RelayerRefundLeaf memory relayerRefundLeaf) internal override {
// SpokePool is expected to receive ETH from the L1 HubPool and currently, withdrawing ETH directly
// over the ERC20 Bridge is blocked at the contract level. Therefore, we need to unwrap it before withdrawing.
emit ZkSyncTokensBridged(relayerRefundLeaf.l2TokenAddress, hubPool, relayerRefundLeaf.amountToReturn);
if (relayerRefundLeaf.l2TokenAddress == address(wrappedNativeToken)) {
WETH9Interface(relayerRefundLeaf.l2TokenAddress).withdraw(relayerRefundLeaf.amountToReturn); // Unwrap into ETH.
// To withdraw tokens, we actually call 'withdraw' on the L2 eth token itself.
IL2ETH(l2Eth).withdraw{ value: relayerRefundLeaf.amountToReturn }(hubPool);
} else {
zkErc20Bridge.withdraw(hubPool, relayerRefundLeaf.l2TokenAddress, relayerRefundLeaf.amountToReturn);
}
emit ZkSyncTokensBridged(relayerRefundLeaf.l2TokenAddress, hubPool, relayerRefundLeaf.amountToReturn);
}

function _setZkBridge(ZkBridgeLike _zkErc20Bridge) internal {
Expand Down