1
1
// SPDX-License-Identifier: BUSL-1.1
2
2
pragma solidity ^ 0.8.0 ;
3
3
4
- import "./SpokePool .sol " ;
4
+ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20 .sol " ;
5
5
import { CircleCCTPAdapter, CircleDomainIds, ITokenMessenger } from "./libraries/CircleCCTPAdapter.sol " ;
6
6
import { CrossDomainAddressUtils } from "./libraries/CrossDomainAddressUtils.sol " ;
7
+ import "./SpokePool.sol " ;
7
8
8
9
// https://github.com/matter-labs/era-contracts/blob/6391c0d7bf6184d7f6718060e3991ba6f0efe4a7/zksync/contracts/bridge/L2ERC20Bridge.sol#L104
9
10
interface ZkBridgeLike {
@@ -24,6 +25,8 @@ interface IL2ETH {
24
25
* @custom:security-contact [email protected]
25
26
*/
26
27
contract ZkSync_SpokePool is SpokePool , CircleCCTPAdapter {
28
+ using SafeERC20 for IERC20 ;
29
+
27
30
// On Ethereum, avoiding constructor parameters and putting them into constants reduces some of the gas cost
28
31
// upon contract deployment. On zkSync the opposite is true: deploying the same bytecode for contracts,
29
32
// while changing only constructor parameters can lead to substantial fee savings. So, the following params
@@ -152,6 +155,7 @@ contract ZkSync_SpokePool is SpokePool, CircleCCTPAdapter {
152
155
_transferUsdc (withdrawalRecipient, amountToReturn);
153
156
} else {
154
157
// Matter Labs custom USDC bridge for Circle Bridged (upgradable) USDC.
158
+ IERC20 (l2TokenAddress).forceApprove (address (zkUSDCBridge), amountToReturn);
155
159
zkUSDCBridge.withdraw (withdrawalRecipient, l2TokenAddress, amountToReturn);
156
160
}
157
161
} else {
0 commit comments