Skip to content

Commit bd5a08b

Browse files
authored
feat: Support USDT by using safeTransfer in EthereumSpokePool (#211)
1 parent 5b386d5 commit bd5a08b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contracts/Ethereum_SpokePool.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ pragma solidity ^0.8.0;
33

44
import "./SpokePool.sol";
55
import "@openzeppelin/contracts/access/Ownable.sol";
6+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
7+
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
68

79
/**
810
* @notice Ethereum L1 specific SpokePool. Used on Ethereum L1 to facilitate L2->L1 transfers.
911
*/
1012
contract Ethereum_SpokePool is SpokePool, Ownable {
13+
using SafeERC20 for IERC20;
14+
1115
/**
1216
* @notice Construct the Ethereum SpokePool.
1317
* @param _hubPool Hub pool address to set. Can be changed by admin.
@@ -25,7 +29,7 @@ contract Ethereum_SpokePool is SpokePool, Ownable {
2529
**************************************/
2630

2731
function _bridgeTokensToHubPool(RelayerRefundLeaf memory relayerRefundLeaf) internal override {
28-
IERC20(relayerRefundLeaf.l2TokenAddress).transfer(hubPool, relayerRefundLeaf.amountToReturn);
32+
IERC20(relayerRefundLeaf.l2TokenAddress).safeTransfer(hubPool, relayerRefundLeaf.amountToReturn);
2933
}
3034

3135
// Admin is simply owner which should be same account that owns the HubPool deployed on this network. A core

0 commit comments

Comments
 (0)