Skip to content

Commit 20c2b1f

Browse files
committed
Fixed FXERC20 safe transfer
1 parent e61b6ae commit 20c2b1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contracts/examples/mintable-erc20-transfer/FxMintableERC20RootTunnel.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { Create2 } from "../../lib/Create2.sol";
55
import { SafeMath } from "../../lib/SafeMath.sol";
66
import { FxERC20 } from "../../tokens/FxERC20.sol";
77
import { FxBaseRootTunnel } from "../../tunnel/FxBaseRootTunnel.sol";
8-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
8+
import {SafeERC20,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
99

1010

1111
/**
1212
* @title FxMintableERC20RootTunnel
1313
*/
1414
contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
1515
using SafeMath for uint256;
16-
using SafeERC20 for FxERC20;
16+
using SafeERC20 for IERC20;
1717

1818
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
1919
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
@@ -33,7 +33,7 @@ contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
3333
require(rootToChildTokens[rootToken] != address(0x0), "FxMintableERC20RootTunnel: NO_MAPPING_FOUND");
3434

3535
// transfer from depositor to this contract
36-
FxERC20(rootToken).safeTransferFrom(
36+
IERC20(rootToken).safeTransferFrom(
3737
msg.sender, // depositor
3838
address(this), // manager contract
3939
amount
@@ -71,7 +71,7 @@ contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
7171
tokenObj.approve(address(this), amount);
7272

7373
// transfer from tokens
74-
tokenObj.safeTransferFrom(
74+
IERC20(rootToken).safeTransferFrom(
7575
address(this),
7676
to,
7777
amount

0 commit comments

Comments
 (0)