Skip to content

Commit 585d7a6

Browse files
committed
solidity version 0.6.2 to 0.7.0
1 parent 1abe18c commit 585d7a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+161
-87
lines changed

contracts/FxChild.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
// IStateReceiver represents interface to receive state
55
interface IStateReceiver {

contracts/FxRoot.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44

55
interface IStateSender {
@@ -17,7 +17,7 @@ contract FxRoot is IFxStateSender {
1717
IStateSender public stateSender;
1818
address public fxChild;
1919

20-
constructor(address _stateSender) {
20+
constructor(address _stateSender) public {
2121
stateSender = IStateSender(_stateSender);
2222
}
2323

@@ -26,7 +26,7 @@ contract FxRoot is IFxStateSender {
2626
fxChild = _fxChild;
2727
}
2828

29-
function sendMessageToChild(address _receiver, bytes calldata _data) public override {
29+
function sendMessageToChild(address _receiver, bytes memory _data) public override {
3030
bytes memory data = abi.encode(msg.sender, _receiver, _data);
3131
stateSender.syncState(fxChild, data);
3232
}

contracts/examples/erc1155-transfer/FxERC1155ChildTunnel.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import {IFxERC1155} from "../../tokens/IFxERC1155.sol";
55
import {ERC1155Holder} from "../../lib/ERC1155Holder.sol" ;
@@ -19,7 +19,7 @@ contract FxERC1155ChildTunnel is FxBaseChildTunnel, Create2, ERC1155Holder {
1919
mapping(address => address) public rootToChildToken;
2020
address public tokenTemplate;
2121

22-
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) {
22+
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) public {
2323
tokenTemplate = _tokenTemplate;
2424
require(_isContract(_tokenTemplate), "Token template is not contract");
2525
}

contracts/examples/erc1155-transfer/FxERC1155RootTunnel.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import {ERC1155} from "../../lib/ERC1155.sol";
55
import {ERC1155Holder} from "../../lib/ERC1155Holder.sol" ;
@@ -18,7 +18,7 @@ contract FxERC1155RootTunnel is FxBaseRootTunnel, Create2, ERC1155Holder {
1818
mapping(address => address) public rootToChildTokens;
1919
bytes32 public childTokenTemplateCodeHash;
2020

21-
constructor(address _checkpointManager, address _fxRoot, address _fxERC1155Token) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
21+
constructor(address _checkpointManager, address _fxRoot, address _fxERC1155Token) FxBaseRootTunnel(_checkpointManager, _fxRoot) public {
2222
childTokenTemplateCodeHash = keccak256(minimalProxyCreationCode(_fxERC1155Token));
2323
}
2424

contracts/examples/erc20-transfer/FxERC20ChildTunnel.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol';
55
import { Create2 } from '../../lib/Create2.sol';
@@ -21,7 +21,7 @@ contract FxERC20ChildTunnel is FxBaseChildTunnel, Create2 {
2121
// token template
2222
address public tokenTemplate;
2323

24-
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) {
24+
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) public {
2525
tokenTemplate = _tokenTemplate;
2626
require(_isContract(_tokenTemplate), "Token template is not contract");
2727
}

contracts/examples/erc20-transfer/FxERC20RootTunnel.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { ERC20 } from "../../lib/ERC20.sol";
55
import { Create2 } from "../../lib/Create2.sol";
66
import { FxBaseRootTunnel } from "../../tunnel/FxBaseRootTunnel.sol";
7-
import {SafeERC20,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
7+
import {SafeERC20,IERC20} from "../../lib/SafeERC20.sol";
88

99
/**
1010
* @title FxERC20RootTunnel
@@ -20,7 +20,7 @@ contract FxERC20RootTunnel is FxBaseRootTunnel, Create2 {
2020
mapping(address => address) public rootToChildTokens;
2121
bytes32 public childTokenTemplateCodeHash;
2222

23-
constructor(address _checkpointManager, address _fxRoot, address _fxERC20Token) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
23+
constructor(address _checkpointManager, address _fxRoot, address _fxERC20Token) FxBaseRootTunnel(_checkpointManager, _fxRoot) public {
2424
// compute child token template code hash
2525
childTokenTemplateCodeHash = keccak256(minimalProxyCreationCode(_fxERC20Token));
2626
}

contracts/examples/erc721-transfer/FxERC721ChildTunnel.sol

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol';
55
import { Create2 } from '../../lib/Create2.sol';
@@ -22,18 +22,18 @@ contract FxERC721ChildTunnel is FxBaseChildTunnel, Create2, IERC721Receiver {
2222
// token template
2323
address public tokenTemplate;
2424

25-
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) {
25+
constructor(address _fxChild, address _tokenTemplate) FxBaseChildTunnel(_fxChild) public {
2626
tokenTemplate = _tokenTemplate;
2727
require(_isContract(_tokenTemplate), "Token template is not contract");
2828
}
2929

3030
function onERC721Received(
3131
address /* operator */, address /* from */, uint256 /* tokenId */, bytes calldata /* data */
32-
) external pure override returns (bytes4) {
32+
) external override returns (bytes4) {
3333
return this.onERC721Received.selector;
3434
}
3535

36-
function withdraw(address childToken, uint256 tokenId, bytes memory data) external {
36+
function withdraw(address childToken, uint256 tokenId, bytes calldata data) external {
3737
IFxERC721 childTokenContract = IFxERC721(childToken);
3838
// child token contract will have root token
3939
address rootToken = childTokenContract.connectedToken();

contracts/examples/erc721-transfer/FxERC721RootTunnel.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { ERC721 } from "../../lib/ERC721.sol";
55
import { Create2 } from "../../lib/Create2.sol";
@@ -20,14 +20,14 @@ contract FxERC721RootTunnel is FxBaseRootTunnel, Create2, IERC721Receiver {
2020
bytes32 public childTokenTemplateCodeHash;
2121

2222
constructor(address _checkpointManager, address _fxRoot, address _fxERC721Token)
23-
FxBaseRootTunnel(_checkpointManager, _fxRoot) {
23+
FxBaseRootTunnel(_checkpointManager, _fxRoot) public {
2424
// compute child token template code hash
2525
childTokenTemplateCodeHash = keccak256(minimalProxyCreationCode(_fxERC721Token));
2626
}
2727

2828
function onERC721Received(
2929
address /* operator */, address /* from */, uint256 /* tokenId */, bytes calldata /* data */
30-
) external pure override returns (bytes4) {
30+
) external override returns (bytes4) {
3131
return this.onERC721Received.selector;
3232
}
3333

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol';
55
import { Create2 } from '../../lib/Create2.sol';
@@ -24,7 +24,7 @@ contract FxMintableERC20ChildTunnel is Ownable, FxBaseChildTunnel, Create2 {
2424
// root token tempalte code hash
2525
bytes32 public rootTokenTemplateCodeHash;
2626

27-
constructor(address _fxChild, address _childTokenTemplate, address _rootTokenTemplate) FxBaseChildTunnel(_fxChild) {
27+
constructor(address _fxChild, address _childTokenTemplate, address _rootTokenTemplate) FxBaseChildTunnel(_fxChild) public {
2828
childTokenTemplate = _childTokenTemplate;
2929
require(_isContract(_childTokenTemplate), "Token template is not contract");
3030
// compute root token template code hash

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
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,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
8+
import {SafeERC20,IERC20} from "../../lib/SafeERC20.sol";
99

1010

1111
/**
@@ -23,7 +23,7 @@ contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
2323
address public rootTokenTemplate;
2424
bytes32 public childTokenTemplateCodeHash;
2525

26-
constructor(address _checkpointManager, address _fxRoot, address _rootTokenTemplate) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
26+
constructor(address _checkpointManager, address _fxRoot, address _rootTokenTemplate) FxBaseRootTunnel(_checkpointManager, _fxRoot) public {
2727
rootTokenTemplate = _rootTokenTemplate;
2828
}
2929

contracts/examples/state-transfer/FxStateChildTunnel.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol';
55

@@ -11,7 +11,7 @@ contract FxStateChildTunnel is FxBaseChildTunnel {
1111
address public latestRootMessageSender;
1212
bytes public latestData;
1313

14-
constructor(address _fxChild) FxBaseChildTunnel(_fxChild) {
14+
constructor(address _fxChild) FxBaseChildTunnel(_fxChild) public {
1515

1616
}
1717

contracts/examples/state-transfer/FxStateRootTunnel.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { FxBaseRootTunnel } from '../../tunnel/FxBaseRootTunnel.sol';
55

@@ -9,7 +9,7 @@ import { FxBaseRootTunnel } from '../../tunnel/FxBaseRootTunnel.sol';
99
contract FxStateRootTunnel is FxBaseRootTunnel {
1010
bytes public latestData;
1111

12-
constructor(address _checkpointManager, address _fxRoot) FxBaseRootTunnel(_checkpointManager, _fxRoot) {}
12+
constructor(address _checkpointManager, address _fxRoot) FxBaseRootTunnel(_checkpointManager, _fxRoot) public {}
1313

1414
function _processMessageFromChild(bytes memory data) internal override {
1515
latestData = data;

contracts/lib/Address.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
/**
66
* @dev Collection of functions related to the address type

contracts/lib/Context.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
/*
66
* @dev Provides information about the current execution context, including the
@@ -17,7 +17,7 @@ abstract contract Context {
1717
return msg.sender;
1818
}
1919

20-
function _msgData() internal view virtual returns (bytes calldata) {
20+
function _msgData() internal view virtual returns (bytes memory) {
2121
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
2222
return msg.data;
2323
}

contracts/lib/Create2.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44

55
// Create2 adds common methods for minimal proxy with create2

contracts/lib/ERC1155.sol

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC1155.sol";
66
import "./IERC1155Receiver.sol";
@@ -33,10 +33,9 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
3333
/**
3434
* @dev See {IERC165-supportsInterface}.
3535
*/
36+
bytes4 INTERFACE_ID = 0x01ffc9a7;
3637
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
37-
return interfaceId == type(IERC1155).interfaceId
38-
|| interfaceId == type(IERC1155MetadataURI).interfaceId
39-
|| super.supportsInterface(interfaceId);
38+
return interfaceId == INTERFACE_ID;
4039
}
4140

4241
/**

contracts/lib/ERC1155Holder.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./ERC1155Receiver.sol";
66

contracts/lib/ERC1155Receiver.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC1155Receiver.sol";
66
import "./ERC165.sol";
@@ -12,8 +12,8 @@ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
1212
/**
1313
* @dev See {IERC165-supportsInterface}.
1414
*/
15+
bytes4 INTERFACE_ID = 0x01ffc9a7;
1516
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
16-
return interfaceId == type(IERC1155Receiver).interfaceId
17-
|| super.supportsInterface(interfaceId);
17+
return interfaceId == INTERFACE_ID;
1818
}
1919
}

contracts/lib/ERC165.sol

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC165.sol";
66

@@ -22,7 +22,8 @@ abstract contract ERC165 is IERC165 {
2222
/**
2323
* @dev See {IERC165-supportsInterface}.
2424
*/
25+
bytes4 INTERFACE = 0x01ffc9a7;
2526
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
26-
return interfaceId == type(IERC165).interfaceId;
27+
return interfaceId == INTERFACE;
2728
}
2829
}

contracts/lib/ERC20.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
import { IERC20 } from './IERC20.sol';
55
import { SafeMath } from './SafeMath.sol';

contracts/lib/ERC721.sol

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC721.sol";
66
import "./IERC721Receiver.sol";
@@ -40,10 +40,9 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
4040
/**
4141
* @dev See {IERC165-supportsInterface}.
4242
*/
43+
bytes4 INTERFACE_ID = 0x01ffc9a7;
4344
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
44-
return interfaceId == type(IERC721).interfaceId
45-
|| interfaceId == type(IERC721Metadata).interfaceId
46-
|| super.supportsInterface(interfaceId);
45+
return interfaceId == INTERFACE_ID;
4746
}
4847

4948
/**

contracts/lib/IERC1155.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC165.sol";
66

contracts/lib/IERC1155MetadataURI.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC1155.sol";
66

contracts/lib/IERC1155Receiver.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC165.sol";
66

contracts/lib/IERC165.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
/**
66
* @dev Interface of the ERC165 standard, as defined in the

contracts/lib/IERC20.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity >=0.6.2<0.7.0;
33

44
/**
55
* @dev Interface of the ERC20 standard as defined in the EIP.

contracts/lib/IERC721.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity ^0.8.0;
3+
pragma solidity >=0.6.2<0.7.0;
44

55
import "./IERC165.sol";
66

0 commit comments

Comments
 (0)