Skip to content

Commit e61b6ae

Browse files
committed
uint to address conversion fixed for compiler version 0.8.0, IERC20 used for transfers. FxERC20 safe transfer to be implemented. Not done.
1 parent 82a17f7 commit e61b6ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

contracts/examples/erc20-transfer/FxERC20RootTunnel.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pragma solidity ^0.8.0;
44
import { ERC20 } from "../../lib/ERC20.sol";
55
import { Create2 } from "../../lib/Create2.sol";
66
import { FxBaseRootTunnel } from "../../tunnel/FxBaseRootTunnel.sol";
7-
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
7+
import {SafeERC20,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
88

99
/**
1010
* @title FxERC20RootTunnel
1111
*/
1212
contract FxERC20RootTunnel is FxBaseRootTunnel, Create2 {
13-
using SafeERC20 for ERC20;
13+
using SafeERC20 for IERC20;
1414
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
1515
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
1616
bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN");
@@ -59,7 +59,7 @@ contract FxERC20RootTunnel is FxBaseRootTunnel, Create2 {
5959
}
6060

6161
// transfer from depositor to this contract
62-
ERC20(rootToken).safeTransferFrom(
62+
IERC20(rootToken).safeTransferFrom(
6363
msg.sender, // depositor
6464
address(this), // manager contract
6565
amount
@@ -77,7 +77,7 @@ contract FxERC20RootTunnel is FxBaseRootTunnel, Create2 {
7777
require(rootToChildTokens[rootToken] == childToken, "FxERC20RootTunnel: INVALID_MAPPING_ON_EXIT");
7878

7979
// transfer from tokens to
80-
ERC20(rootToken).safeTransfer(
80+
IERC20(rootToken).safeTransfer(
8181
to,
8282
amount
8383
);

contracts/lib/RLPReader.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ library RLPReader {
185185
// 1 byte for the length prefix
186186
require(item.len == 21);
187187

188-
return address(toUint(item));
188+
return address(uint160(toUint(item)));
189189
}
190190

191191
function toUint(RLPItem memory item) internal pure returns (uint) {

0 commit comments

Comments
 (0)