Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup #60

Open
wants to merge 2 commits into
base: xc-wampl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
contract: true,
expect: true,
Promise: true,
web3: true,
hre: true,
},
plugins: ['prettier', 'spellcheck', 'chai-friendly'],
rules: {
Expand Down Expand Up @@ -86,13 +86,15 @@ module.exports = {
'initializer',
'nomiclabs',
'upgradable',
'upgradeability',
'ethersproject',
'hexlify',
'utf8',
'Utf8Bytes',
'keccak256',
'Sighash',
'ecsign',
'rollup',

// shorthand
'args',
Expand All @@ -109,6 +111,9 @@ module.exports = {
'perc',
'opcode',
'aprox',
'impl',
'param',
'desc',

// project-specific
'rebase',
Expand Down Expand Up @@ -159,6 +164,12 @@ module.exports = {
'dev3',
'avax',
'arbitrum',
'mumbai',
'maticjs',
'maticnetwork',
'passphrase',
'erc721',
'batcher',

// names
'nithin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Importing uFragments contract dependencies to be compiled for integration tests
pragma solidity 0.7.6;

import "uFragments/contracts/Orchestrator.sol";
import "ampleforth-contracts/contracts/Orchestrator.sol";
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Importing uFragments contract dependencies to be compiled for integration tests
pragma solidity 0.7.6;

import "uFragments/contracts/UFragments.sol";
import "ampleforth-contracts/contracts/UFragments.sol";
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Importing uFragments contract dependencies to be compiled for integration tests
pragma solidity 0.7.6;

import "uFragments/contracts/UFragmentsPolicy.sol";
import "ampleforth-contracts/contracts/UFragmentsPolicy.sol";
2 changes: 1 addition & 1 deletion contracts/_interfaces/IXCAmple.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import "uFragments/contracts/interfaces/IAMPL.sol";
import "ampleforth-contracts/contracts/interfaces/IAMPL.sol";

interface IXCAmple is IAMPL {
function globalAMPLSupply() external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/_mocks/MockERC20.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-contracts-3.4.1/contracts/token/ERC20/ERC20.sol";

contract MockERC20 is ERC20 {
constructor(string memory name, string memory symbol) public ERC20(name, symbol) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/_test/UFragmentsTestnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Importing uFragments contract dependencies to be compiled for integration tests
pragma solidity 0.7.6;

import {UFragments} from "uFragments/contracts/UFragments.sol";
import {UFragments} from "ampleforth-contracts/contracts/UFragments.sol";

contract UFragmentsTestnet is UFragments {
event Result(bool result, bytes reason);
Expand Down
4 changes: 2 additions & 2 deletions contracts/_utilities/BatchTxExecutor.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";
import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol";

/**
* @title BatchTxExecutor
Expand Down
8 changes: 4 additions & 4 deletions contracts/base-chain/TokenVault.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";
import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/SafeERC20.sol";

/**
* @title TokenVault
Expand Down
10 changes: 5 additions & 5 deletions contracts/base-chain/bridge-gateways/AMPLArbitrumGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Initializable} from "@openzeppelin/contracts/proxy/Initializable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";
import {Initializable} from "openzeppelin-contracts-3.4.1/contracts/proxy/Initializable.sol";
// solhint-disable-next-line max-line-length
import {GatewayMessageHandler} from "arb-bridge-peripherals/contracts/tokenbridge/libraries/gateway/GatewayMessageHandler.sol";
import {L1ArbitrumMessenger} from "arb-bridge-peripherals/contracts/tokenbridge/ethereum/L1ArbitrumMessenger.sol";

// solhint-disable-next-line max-line-length
import {IArbitrumBCRebaseGateway, IArbitrumBCTransferGateway, IArbitrumSCRebaseGateway, IArbitrumSCTransferGateway} from "../../_interfaces/bridge-gateways/IArbitrumGateway.sol";
import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol";
import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/SafeERC20.sol";
import {ITokenVault} from "../../_interfaces/ITokenVault.sol";

/// @dev Abstract l2 gateway contarct implementation to define function selectors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";

// solhint-disable-next-line max-line-length
import {IChainBridgeBCRebaseGateway, IChainBridgeBCTransferGateway} from "../../_interfaces/bridge-gateways/IChainBridgeGateway.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol";
import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol";
import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol";
import {ITokenVault} from "../../_interfaces/ITokenVault.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity 0.7.3;
import {FxBaseRootTunnel} from "fx-portal/contracts/tunnel/FxBaseRootTunnel.sol";

import {IMaticBCRebaseGateway} from "../../_interfaces/bridge-gateways/IMaticGateway.sol";
import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol";
import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol";

/**
* @title AMPLMaticRebaseGateway: AMPL-Matic Rebase Gateway Contract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";

import {FxBaseRootTunnel} from "fx-portal/contracts/tunnel/FxBaseRootTunnel.sol";

import {IMaticTransferGateway} from "../../_interfaces/bridge-gateways/IMaticGateway.sol";
import {ITokenVault} from "../../_interfaces/ITokenVault.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol";

/**
* @title AMPLMaticTransferGateway: AMPL-Matic Transfer Gateway Contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Initializable} from "@openzeppelin/contracts/proxy/Initializable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";
import {Initializable} from "openzeppelin-contracts-3.4.1/contracts/proxy/Initializable.sol";

// solhint-disable-next-line max-line-length
import {GatewayMessageHandler} from "arb-bridge-peripherals/contracts/tokenbridge/libraries/gateway/GatewayMessageHandler.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";

// solhint-disable-next-line max-line-length
import {IChainBridgeSCRebaseGateway, IChainBridgeSCTransferGateway} from "../../_interfaces/bridge-gateways/IChainBridgeGateway.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol";

import {FxBaseChildTunnel} from "fx-portal/contracts/tunnel/FxBaseChildTunnel.sol";

Expand Down
6 changes: 3 additions & 3 deletions contracts/satellite-chain/xc-ampleforth/XCAmple.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {SafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SafeMathUpgradeable.sol";
import {IERC20Upgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/token/ERC20/IERC20Upgradeable.sol";
import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/access/OwnableUpgradeable.sol";

/**
* @title XC(cross-chain)Ample ERC20 token
Expand Down
7 changes: 4 additions & 3 deletions contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.3;

import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import {SignedSafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {SafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SafeMathUpgradeable.sol";
// solhint-disable-next-line max-line-length
import {SignedSafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SignedSafeMathUpgradeable.sol";
import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/access/OwnableUpgradeable.sol";

import {UInt256Lib} from "./UInt256Lib.sol";
import {IXCAmple} from "../../_interfaces/IXCAmple.sol";
Expand Down
Loading