From 268325b5b65c25f78b034cd97476bcd2fe3afe37 Mon Sep 17 00:00:00 2001 From: Vamsi Date: Thu, 12 Aug 2021 13:26:48 +0530 Subject: [PATCH] Solidity version 0.7.0 --- contracts/FxChild.sol | 2 +- contracts/FxRoot.sol | 2 +- .../erc1155-transfer/FxERC1155ChildTunnel.sol | 2 +- .../erc1155-transfer/FxERC1155RootTunnel.sol | 2 +- .../erc20-transfer/FxERC20ChildTunnel.sol | 2 +- .../erc20-transfer/FxERC20RootTunnel.sol | 4 +- .../erc721-transfer/FxERC721ChildTunnel.sol | 2 +- .../erc721-transfer/FxERC721RootTunnel.sol | 2 +- .../FxMintableERC20ChildTunnel.sol | 2 +- .../FxMintableERC20RootTunnel.sol | 4 +- .../state-transfer/FxStateChildTunnel.sol | 2 +- .../state-transfer/FxStateRootTunnel.sol | 2 +- contracts/lib/Address.sol | 2 +- contracts/lib/Context.sol | 2 +- contracts/lib/Create2.sol | 2 +- contracts/lib/ERC1155.sol | 2 +- contracts/lib/ERC1155Holder.sol | 2 +- contracts/lib/ERC1155Receiver.sol | 2 +- contracts/lib/ERC165.sol | 2 +- contracts/lib/ERC20.sol | 2 +- contracts/lib/ERC721.sol | 2 +- contracts/lib/IERC1155.sol | 2 +- contracts/lib/IERC1155MetadataURI.sol | 2 +- contracts/lib/IERC1155Receiver.sol | 2 +- contracts/lib/IERC165.sol | 2 +- contracts/lib/IERC20.sol | 2 +- contracts/lib/IERC721.sol | 2 +- contracts/lib/IERC721Metadata.sol | 2 +- contracts/lib/IERC721Receiver.sol | 2 +- contracts/lib/Merkle.sol | 2 +- contracts/lib/MerklePatriciaProof.sol | 2 +- contracts/lib/Ownable.sol | 2 +- contracts/lib/RLPReader.sol | 2 +- contracts/lib/SafeERC20.sol | 77 +++++++++++++++++++ contracts/lib/SafeMath.sol | 2 +- contracts/lib/Strings.sol | 2 +- contracts/tokens/FxERC1155.sol | 2 +- contracts/tokens/FxERC20.sol | 2 +- contracts/tokens/FxERC721.sol | 2 +- contracts/tokens/IFxERC1155.sol | 2 +- contracts/tokens/IFxERC20.sol | 2 +- contracts/tokens/IFxERC721.sol | 2 +- contracts/tunnel/FxBaseChildTunnel.sol | 2 +- contracts/tunnel/FxBaseRootTunnel.sol | 2 +- hardhat.config.js | 2 +- package-lock.json | 5 -- package.json | 4 +- 47 files changed, 124 insertions(+), 54 deletions(-) create mode 100644 contracts/lib/SafeERC20.sol diff --git a/contracts/FxChild.sol b/contracts/FxChild.sol index 595b250..e99155d 100644 --- a/contracts/FxChild.sol +++ b/contracts/FxChild.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; // IStateReceiver represents interface to receive state interface IStateReceiver { diff --git a/contracts/FxRoot.sol b/contracts/FxRoot.sol index 4e418e0..f01e6b1 100644 --- a/contracts/FxRoot.sol +++ b/contracts/FxRoot.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; interface IStateSender { diff --git a/contracts/examples/erc1155-transfer/FxERC1155ChildTunnel.sol b/contracts/examples/erc1155-transfer/FxERC1155ChildTunnel.sol index fe9924d..8e665ae 100644 --- a/contracts/examples/erc1155-transfer/FxERC1155ChildTunnel.sol +++ b/contracts/examples/erc1155-transfer/FxERC1155ChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import {IFxERC1155} from "../../tokens/IFxERC1155.sol"; import {ERC1155Holder} from "../../lib/ERC1155Holder.sol" ; diff --git a/contracts/examples/erc1155-transfer/FxERC1155RootTunnel.sol b/contracts/examples/erc1155-transfer/FxERC1155RootTunnel.sol index 07c27a9..72dc952 100644 --- a/contracts/examples/erc1155-transfer/FxERC1155RootTunnel.sol +++ b/contracts/examples/erc1155-transfer/FxERC1155RootTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import {ERC1155} from "../../lib/ERC1155.sol"; import {ERC1155Holder} from "../../lib/ERC1155Holder.sol" ; diff --git a/contracts/examples/erc20-transfer/FxERC20ChildTunnel.sol b/contracts/examples/erc20-transfer/FxERC20ChildTunnel.sol index a61db9b..1ad5ff9 100644 --- a/contracts/examples/erc20-transfer/FxERC20ChildTunnel.sol +++ b/contracts/examples/erc20-transfer/FxERC20ChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol'; import { Create2 } from '../../lib/Create2.sol'; diff --git a/contracts/examples/erc20-transfer/FxERC20RootTunnel.sol b/contracts/examples/erc20-transfer/FxERC20RootTunnel.sol index 55cb4e7..b74b2f9 100755 --- a/contracts/examples/erc20-transfer/FxERC20RootTunnel.sol +++ b/contracts/examples/erc20-transfer/FxERC20RootTunnel.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { ERC20 } from "../../lib/ERC20.sol"; import { Create2 } from "../../lib/Create2.sol"; import { FxBaseRootTunnel } from "../../tunnel/FxBaseRootTunnel.sol"; -import {SafeERC20,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import {SafeERC20,IERC20} from "../../lib/SafeERC20.sol"; /** * @title FxERC20RootTunnel diff --git a/contracts/examples/erc721-transfer/FxERC721ChildTunnel.sol b/contracts/examples/erc721-transfer/FxERC721ChildTunnel.sol index ac30b06..0fd0526 100755 --- a/contracts/examples/erc721-transfer/FxERC721ChildTunnel.sol +++ b/contracts/examples/erc721-transfer/FxERC721ChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol'; import { Create2 } from '../../lib/Create2.sol'; diff --git a/contracts/examples/erc721-transfer/FxERC721RootTunnel.sol b/contracts/examples/erc721-transfer/FxERC721RootTunnel.sol index 6205586..7e677b8 100755 --- a/contracts/examples/erc721-transfer/FxERC721RootTunnel.sol +++ b/contracts/examples/erc721-transfer/FxERC721RootTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { ERC721 } from "../../lib/ERC721.sol"; import { Create2 } from "../../lib/Create2.sol"; diff --git a/contracts/examples/mintable-erc20-transfer/FxMintableERC20ChildTunnel.sol b/contracts/examples/mintable-erc20-transfer/FxMintableERC20ChildTunnel.sol index 53f5ba4..48d0ea8 100755 --- a/contracts/examples/mintable-erc20-transfer/FxMintableERC20ChildTunnel.sol +++ b/contracts/examples/mintable-erc20-transfer/FxMintableERC20ChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol'; import { Create2 } from '../../lib/Create2.sol'; diff --git a/contracts/examples/mintable-erc20-transfer/FxMintableERC20RootTunnel.sol b/contracts/examples/mintable-erc20-transfer/FxMintableERC20RootTunnel.sol index a3a0444..5213bb1 100644 --- a/contracts/examples/mintable-erc20-transfer/FxMintableERC20RootTunnel.sol +++ b/contracts/examples/mintable-erc20-transfer/FxMintableERC20RootTunnel.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { Create2 } from "../../lib/Create2.sol"; import { SafeMath } from "../../lib/SafeMath.sol"; import { FxERC20 } from "../../tokens/FxERC20.sol"; import { FxBaseRootTunnel } from "../../tunnel/FxBaseRootTunnel.sol"; -import {SafeERC20,IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import {SafeERC20,IERC20} from "../../lib/SafeERC20.sol"; /** diff --git a/contracts/examples/state-transfer/FxStateChildTunnel.sol b/contracts/examples/state-transfer/FxStateChildTunnel.sol index a99c32f..1e3697d 100644 --- a/contracts/examples/state-transfer/FxStateChildTunnel.sol +++ b/contracts/examples/state-transfer/FxStateChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { FxBaseChildTunnel } from '../../tunnel/FxBaseChildTunnel.sol'; diff --git a/contracts/examples/state-transfer/FxStateRootTunnel.sol b/contracts/examples/state-transfer/FxStateRootTunnel.sol index a41d8e6..35bda27 100644 --- a/contracts/examples/state-transfer/FxStateRootTunnel.sol +++ b/contracts/examples/state-transfer/FxStateRootTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { FxBaseRootTunnel } from '../../tunnel/FxBaseRootTunnel.sol'; diff --git a/contracts/lib/Address.sol b/contracts/lib/Address.sol index bd9a5e0..cb03814 100755 --- a/contracts/lib/Address.sol +++ b/contracts/lib/Address.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev Collection of functions related to the address type diff --git a/contracts/lib/Context.sol b/contracts/lib/Context.sol index adb36f4..8475967 100755 --- a/contracts/lib/Context.sol +++ b/contracts/lib/Context.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /* * @dev Provides information about the current execution context, including the diff --git a/contracts/lib/Create2.sol b/contracts/lib/Create2.sol index bc4c0ef..901247b 100644 --- a/contracts/lib/Create2.sol +++ b/contracts/lib/Create2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; // Create2 adds common methods for minimal proxy with create2 diff --git a/contracts/lib/ERC1155.sol b/contracts/lib/ERC1155.sol index 750a870..89ef877 100644 --- a/contracts/lib/ERC1155.sol +++ b/contracts/lib/ERC1155.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; diff --git a/contracts/lib/ERC1155Holder.sol b/contracts/lib/ERC1155Holder.sol index 4468f65..fdced7a 100644 --- a/contracts/lib/ERC1155Holder.sol +++ b/contracts/lib/ERC1155Holder.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./ERC1155Receiver.sol"; diff --git a/contracts/lib/ERC1155Receiver.sol b/contracts/lib/ERC1155Receiver.sol index e30efcf..5fc11d5 100644 --- a/contracts/lib/ERC1155Receiver.sol +++ b/contracts/lib/ERC1155Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC1155Receiver.sol"; import "./ERC165.sol"; diff --git a/contracts/lib/ERC165.sol b/contracts/lib/ERC165.sol index fc9b52f..35c7838 100755 --- a/contracts/lib/ERC165.sol +++ b/contracts/lib/ERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC165.sol"; diff --git a/contracts/lib/ERC20.sol b/contracts/lib/ERC20.sol index b02f8dd..646681f 100644 --- a/contracts/lib/ERC20.sol +++ b/contracts/lib/ERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { IERC20 } from './IERC20.sol'; import { SafeMath } from './SafeMath.sol'; diff --git a/contracts/lib/ERC721.sol b/contracts/lib/ERC721.sol index be467c9..dce5d3a 100755 --- a/contracts/lib/ERC721.sol +++ b/contracts/lib/ERC721.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; diff --git a/contracts/lib/IERC1155.sol b/contracts/lib/IERC1155.sol index f37b6ff..9bac549 100644 --- a/contracts/lib/IERC1155.sol +++ b/contracts/lib/IERC1155.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC165.sol"; diff --git a/contracts/lib/IERC1155MetadataURI.sol b/contracts/lib/IERC1155MetadataURI.sol index f636cc2..86a4b05 100644 --- a/contracts/lib/IERC1155MetadataURI.sol +++ b/contracts/lib/IERC1155MetadataURI.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC1155.sol"; diff --git a/contracts/lib/IERC1155Receiver.sol b/contracts/lib/IERC1155Receiver.sol index e8653f6..fe61acc 100644 --- a/contracts/lib/IERC1155Receiver.sol +++ b/contracts/lib/IERC1155Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC165.sol"; diff --git a/contracts/lib/IERC165.sol b/contracts/lib/IERC165.sol index 01c9c08..a17d71a 100755 --- a/contracts/lib/IERC165.sol +++ b/contracts/lib/IERC165.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the diff --git a/contracts/lib/IERC20.sol b/contracts/lib/IERC20.sol index cdc179a..da15b54 100644 --- a/contracts/lib/IERC20.sol +++ b/contracts/lib/IERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. diff --git a/contracts/lib/IERC721.sol b/contracts/lib/IERC721.sol index cb2c519..14fe933 100755 --- a/contracts/lib/IERC721.sol +++ b/contracts/lib/IERC721.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC165.sol"; diff --git a/contracts/lib/IERC721Metadata.sol b/contracts/lib/IERC721Metadata.sol index 24f02f8..49b903b 100755 --- a/contracts/lib/IERC721Metadata.sol +++ b/contracts/lib/IERC721Metadata.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import "./IERC721.sol"; diff --git a/contracts/lib/IERC721Receiver.sol b/contracts/lib/IERC721Receiver.sol index 081f4ab..dbd858e 100755 --- a/contracts/lib/IERC721Receiver.sol +++ b/contracts/lib/IERC721Receiver.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @title ERC721 token receiver interface diff --git a/contracts/lib/Merkle.sol b/contracts/lib/Merkle.sol index a3bd280..50fedf4 100755 --- a/contracts/lib/Merkle.sol +++ b/contracts/lib/Merkle.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; library Merkle { function checkMembership( diff --git a/contracts/lib/MerklePatriciaProof.sol b/contracts/lib/MerklePatriciaProof.sol index bbe74e5..b22a170 100644 --- a/contracts/lib/MerklePatriciaProof.sol +++ b/contracts/lib/MerklePatriciaProof.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import {RLPReader} from "./RLPReader.sol"; diff --git a/contracts/lib/Ownable.sol b/contracts/lib/Ownable.sol index 29b7bff..2b20424 100644 --- a/contracts/lib/Ownable.sol +++ b/contracts/lib/Ownable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where diff --git a/contracts/lib/RLPReader.sol b/contracts/lib/RLPReader.sol index 7e635dc..28297a5 100644 --- a/contracts/lib/RLPReader.sol +++ b/contracts/lib/RLPReader.sol @@ -2,7 +2,7 @@ * @author Hamdi Allam hamdi.allam97@gmail.com * Please reach out with any questions or concerns */ -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; library RLPReader { uint8 constant STRING_SHORT_START = 0x80; diff --git a/contracts/lib/SafeERC20.sol b/contracts/lib/SafeERC20.sol new file mode 100644 index 0000000..70d24fd --- /dev/null +++ b/contracts/lib/SafeERC20.sol @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: MIT + +pragma solidity >=0.7.0<0.8.0; + +import "./IERC20.sol"; +import "./SafeMath.sol"; +import "./Address.sol"; + +/** + * @title SafeERC20 + * @dev Wrappers around ERC20 operations that throw on failure (when the token + * contract returns false). Tokens that return no value (and instead revert or + * throw on failure) are also supported, non-reverting calls are assumed to be + * successful. + * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, + * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. + */ +library SafeERC20 { + using SafeMath for uint256; + using Address for address; + + function safeTransfer(IERC20 token, address to, uint256 value) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); + } + + function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); + } + + function safeApprove(IERC20 token, address spender, uint256 value) internal { + // safeApprove should only be called when setting an initial allowance, + // or when resetting it to zero. To increase and decrease it, use + // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' + // solhint-disable-next-line max-line-length + require((value == 0) || (token.allowance(address(this), spender) == 0), + "SafeERC20: approve from non-zero to non-zero allowance" + ); + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); + } + + function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).add(value); + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must not be false). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + */ + function _callOptionalReturn(IERC20 token, bytes memory data) private { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. + + // A Solidity high level call has three parts: + // 1. The target address is checked to verify it contains contract code + // 2. The call itself is made, and success asserted + // 3. The return value is decoded, which in turn checks the size of the returned data. + // solhint-disable-next-line max-line-length + require(address(token).isContract(), "SafeERC20: call to non-contract"); + + // solhint-disable-next-line avoid-low-level-calls + (bool success, bytes memory returndata) = address(token).call(data); + require(success, "SafeERC20: low-level call failed"); + + if (returndata.length > 0) { // Return data is optional + // solhint-disable-next-line max-line-length + require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); + } + } +} \ No newline at end of file diff --git a/contracts/lib/SafeMath.sol b/contracts/lib/SafeMath.sol index 6f19bed..5d3aef1 100644 --- a/contracts/lib/SafeMath.sol +++ b/contracts/lib/SafeMath.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow diff --git a/contracts/lib/Strings.sol b/contracts/lib/Strings.sol index dac2f35..de41a2a 100755 --- a/contracts/lib/Strings.sol +++ b/contracts/lib/Strings.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; /** * @dev String operations. diff --git a/contracts/tokens/FxERC1155.sol b/contracts/tokens/FxERC1155.sol index c436da8..009a183 100644 --- a/contracts/tokens/FxERC1155.sol +++ b/contracts/tokens/FxERC1155.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import {ERC1155} from "../lib/ERC1155.sol"; import {IFxERC1155} from "./IFxERC1155.sol"; diff --git a/contracts/tokens/FxERC20.sol b/contracts/tokens/FxERC20.sol index 6e03846..bf18c78 100644 --- a/contracts/tokens/FxERC20.sol +++ b/contracts/tokens/FxERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { ERC20 } from "../lib/ERC20.sol"; import { IFxERC20 } from "./IFxERC20.sol"; diff --git a/contracts/tokens/FxERC721.sol b/contracts/tokens/FxERC721.sol index 8ddf05e..3d5d34a 100755 --- a/contracts/tokens/FxERC721.sol +++ b/contracts/tokens/FxERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import { ERC721 } from "../lib/ERC721.sol"; import { IFxERC721 } from "./IFxERC721.sol"; diff --git a/contracts/tokens/IFxERC1155.sol b/contracts/tokens/IFxERC1155.sol index a4a90ed..aeda8dd 100755 --- a/contracts/tokens/IFxERC1155.sol +++ b/contracts/tokens/IFxERC1155.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; interface IFxERC1155 { function fxManager() external returns(address); diff --git a/contracts/tokens/IFxERC20.sol b/contracts/tokens/IFxERC20.sol index f707e79..1b9d3bd 100644 --- a/contracts/tokens/IFxERC20.sol +++ b/contracts/tokens/IFxERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; interface IFxERC20 { function fxManager() external returns(address); diff --git a/contracts/tokens/IFxERC721.sol b/contracts/tokens/IFxERC721.sol index bcf1205..c139bbc 100755 --- a/contracts/tokens/IFxERC721.sol +++ b/contracts/tokens/IFxERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; interface IFxERC721 { function fxManager() external returns(address); diff --git a/contracts/tunnel/FxBaseChildTunnel.sol b/contracts/tunnel/FxBaseChildTunnel.sol index c711080..00e110f 100644 --- a/contracts/tunnel/FxBaseChildTunnel.sol +++ b/contracts/tunnel/FxBaseChildTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; // IFxMessageProcessor represents interface to process message interface IFxMessageProcessor { diff --git a/contracts/tunnel/FxBaseRootTunnel.sol b/contracts/tunnel/FxBaseRootTunnel.sol index 2a0903d..7b0ece4 100644 --- a/contracts/tunnel/FxBaseRootTunnel.sol +++ b/contracts/tunnel/FxBaseRootTunnel.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity >=0.7.0<0.8.0; import {RLPReader} from "../lib/RLPReader.sol"; diff --git a/hardhat.config.js b/hardhat.config.js index 9416e3c..ae516eb 100755 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -22,7 +22,7 @@ module.exports = { solidity: { compilers: [ { - version: "0.8.0" + version: "0.7.0" } ] } diff --git a/package-lock.json b/package-lock.json index 82036b6..4163479 100755 --- a/package-lock.json +++ b/package-lock.json @@ -845,11 +845,6 @@ "@types/web3": "1.0.19" } }, - "@openzeppelin/contracts": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-2.3.0.tgz", - "integrity": "sha512-lf8C3oULQAnsu3OTRP4tP5/ddfil6l65Lg3JQCwAIgc99vZ1jz5qeBoETGGGmczxt+bIyMI06WPP2apC74EZag==" - }, "@resolver-engine/core": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", diff --git a/package.json b/package.json index 7a6d294..5e2c656 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,5 @@ "ethers": "^5.0.24", "hardhat": "^2.0.7" }, - "dependencies": { - "@openzeppelin/contracts": "^4.2.0" - } + "dependencies": {} }