From b7f93c78dbf7057b8889a16a3227bc1a0588d687 Mon Sep 17 00:00:00 2001 From: "justin j. moses" Date: Sat, 10 Apr 2021 15:35:29 -0500 Subject: [PATCH] Re-running npm format across the codebase (#1194) --- .circleci/config.yml | 12 +-- README.md | 1 - contracts/AddressResolver.sol | 1 - contracts/AddressSetLib.sol | 1 - contracts/BaseDebtCache.sol | 6 +- contracts/BaseRewardEscrowV2.sol | 1 - contracts/BaseSynthetix.sol | 12 +-- contracts/BinaryOption.sol | 1 - contracts/BinaryOptionMarket.sol | 1 - contracts/BinaryOptionMarketData.sol | 18 ++--- contracts/BinaryOptionMarketFactory.sol | 1 - contracts/BinaryOptionMarketManager.sol | 28 +++---- contracts/Bytes32SetLib.sol | 1 - contracts/Collateral.sol | 36 ++++----- contracts/CollateralErc20.sol | 1 - contracts/CollateralEth.sol | 1 - contracts/CollateralManager.sol | 1 - contracts/CollateralManagerState.sol | 1 - contracts/CollateralShort.sol | 1 - contracts/CollateralState.sol | 1 - contracts/ContractStorage.sol | 7 +- contracts/DappMaintenance.sol | 1 - contracts/DebtCache.sol | 1 - contracts/DelegateApprovals.sol | 1 - contracts/Depot.sol | 1 - contracts/EmptyCollateralManager.sol | 1 - contracts/EmptyEtherCollateral.sol | 1 - contracts/EscrowChecker.sol | 2 - contracts/EternalStorage.sol | 1 - contracts/EtherCollateral.sol | 18 ++--- contracts/EtherCollateralsUSD.sol | 81 +++++++++---------- contracts/ExchangeRates.sol | 13 +-- contracts/ExchangeRatesWithoutInvPricing.sol | 1 - contracts/ExchangeState.sol | 1 - contracts/Exchanger.sol | 26 +++--- contracts/ExchangerWithVirtualSynth.sol | 1 - contracts/ExternStateToken.sol | 1 - contracts/FeePool.sol | 25 +++--- contracts/FeePoolEternalStorage.sol | 1 - contracts/FeePoolState.sol | 1 - contracts/FlexibleStorage.sol | 1 - contracts/ImportableRewardEscrowV2.sol | 1 - contracts/Issuer.sol | 23 +++--- contracts/IssuerWithoutLiquidations.sol | 1 - contracts/LimitedSetup.sol | 1 - contracts/Liquidations.sol | 1 - contracts/Math.sol | 1 - contracts/MintableSynthetix.sol | 1 - contracts/MixinResolver.sol | 7 +- contracts/MixinSystemSettings.sol | 1 - contracts/MultiCollateralSynth.sol | 1 - contracts/Owned.sol | 1 - contracts/Pausable.sol | 1 - contracts/Proxy.sol | 1 - contracts/ProxyERC20.sol | 1 - contracts/Proxyable.sol | 1 - contracts/PurgeableSynth.sol | 1 - contracts/ReadProxy.sol | 1 - contracts/RealtimeDebtCache.sol | 1 - contracts/RewardEscrow.sol | 1 - contracts/RewardEscrowV2.sol | 1 - contracts/RewardsDistribution.sol | 1 - contracts/RewardsDistributionRecipient.sol | 1 - contracts/SafeDecimalMath.sol | 1 - contracts/ShortingRewards.sol | 1 - contracts/StakingRewards.sol | 1 - contracts/State.sol | 1 - contracts/SupplySchedule.sol | 1 - contracts/Synth.sol | 1 - contracts/SynthUtil.sol | 1 - contracts/Synthetix.sol | 8 +- contracts/SynthetixBridgeToBase.sol | 1 - contracts/SynthetixBridgeToOptimism.sol | 14 ++-- contracts/SynthetixEscrow.sol | 1 - contracts/SynthetixState.sol | 1 - contracts/SynthetixStateWithLimitedSetup.sol | 1 - contracts/SystemSettings.sol | 1 - contracts/SystemStatus.sol | 1 - contracts/TokenState.sol | 1 - contracts/TradingRewards.sol | 1 - contracts/VirtualSynth.sol | 1 - contracts/interfaces/IAddressResolver.sol | 1 - contracts/interfaces/IBinaryOption.sol | 1 - contracts/interfaces/IBinaryOptionMarket.sol | 1 - .../interfaces/IBinaryOptionMarketManager.sol | 1 - contracts/interfaces/ICollateralErc20.sol | 1 - contracts/interfaces/ICollateralEth.sol | 1 - contracts/interfaces/ICollateralLoan.sol | 1 - contracts/interfaces/ICollateralManager.sol | 1 - contracts/interfaces/IDebtCache.sol | 1 - contracts/interfaces/IDelegateApprovals.sol | 1 - contracts/interfaces/IDepot.sol | 1 - contracts/interfaces/IERC20.sol | 1 - contracts/interfaces/IEtherCollateral.sol | 1 - contracts/interfaces/IEtherCollateralsUSD.sol | 1 - contracts/interfaces/IExchangeRates.sol | 1 - contracts/interfaces/IExchangeState.sol | 1 - contracts/interfaces/IExchanger.sol | 1 - contracts/interfaces/IFeePool.sol | 1 - contracts/interfaces/IFlexibleStorage.sol | 1 - contracts/interfaces/IHasBalance.sol | 1 - contracts/interfaces/IIssuer.sol | 1 - contracts/interfaces/ILiquidations.sol | 1 - contracts/interfaces/IRewardEscrow.sol | 1 - contracts/interfaces/IRewardEscrowV2.sol | 2 - contracts/interfaces/IRewardsDistribution.sol | 1 - contracts/interfaces/IShortingRewards.sol | 1 - contracts/interfaces/IStakingRewards.sol | 1 - contracts/interfaces/ISupplySchedule.sol | 1 - contracts/interfaces/ISynth.sol | 1 - contracts/interfaces/ISynthetix.sol | 1 - .../interfaces/ISynthetixBridgeToBase.sol | 1 - .../interfaces/ISynthetixBridgeToOptimism.sol | 1 - contracts/interfaces/ISynthetixState.sol | 1 - contracts/interfaces/ISystemSettings.sol | 1 - contracts/interfaces/ISystemStatus.sol | 1 - contracts/interfaces/ITradingRewards.sol | 1 - contracts/interfaces/IVirtualSynth.sol | 1 - contracts/test-helpers/FakeTradingRewards.sol | 1 - contracts/test-helpers/GenericMock.sol | 1 - contracts/test-helpers/MockAggregatorV2V3.sol | 2 - .../test-helpers/MockBinaryOptionMarket.sol | 1 - .../MockBinaryOptionMarketManager.sol | 1 - .../test-helpers/MockContractStorage.sol | 1 - .../test-helpers/MockEtherCollateral.sol | 1 - contracts/test-helpers/MockExchanger.sol | 1 - contracts/test-helpers/MockFlagsInterface.sol | 2 - .../test-helpers/MockMintableSynthetix.sol | 1 - contracts/test-helpers/MockMutator.sol | 1 - .../test-helpers/MockRewardsRecipient.sol | 1 - contracts/test-helpers/MockSynth.sol | 1 - contracts/test-helpers/MockToken.sol | 1 - contracts/test-helpers/OneWeekSetup.sol | 1 - contracts/test-helpers/PublicEST.sol | 1 - contracts/test-helpers/PublicEST8Decimals.sol | 1 - contracts/test-helpers/PublicMath.sol | 1 - .../test-helpers/PublicSafeDecimalMath.sol | 1 - .../test-helpers/SwapWithVirtualSynth.sol | 4 - contracts/test-helpers/TestableAddressSet.sol | 1 - .../TestableBinaryOptionMarket.sol | 1 - contracts/test-helpers/TestableBytes32Set.sol | 1 - contracts/test-helpers/TestableDebtCache.sol | 1 - .../test-helpers/TestableMixinResolver.sol | 1 - contracts/test-helpers/TestablePausable.sol | 1 - contracts/test-helpers/TestableState.sol | 1 - contracts/test-helpers/TokenExchanger.sol | 1 - contracts/test-helpers/UsingReadProxy.sol | 1 - package-lock.json | 32 +++++--- 148 files changed, 164 insertions(+), 340 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a18db5803..f7ce53d00e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,7 +90,7 @@ jobs: command: npx hardhat node background: true - cmd-wait-for-port: - port: 8545 + port: 8545 - run: node publish deploy --network local --fresh-deploy --yes --use-ovm --ignore-safety-checks --ignore-custom-parameters --deployment-path ./publish/deployed/local-ovm - run: npm run test:prod -- --no-compile --use-ovm --patch-fresh-deployment --deployment-path ./publish/deployed/local-ovm job-prod-diff-tests-local: @@ -109,7 +109,7 @@ jobs: command: npx hardhat node background: true - cmd-wait-for-port: - port: 8545 + port: 8545 - run: node publish deploy --network local --fresh-deploy --yes - run: npm run test:prod -- --patch-fresh-deployment job-prod-diff-tests: @@ -129,7 +129,7 @@ jobs: command: npx hardhat node --target-network mainnet background: true - cmd-wait-for-port: - port: 8545 + port: 8545 - run: node publish prepare-deploy --network mainnet - run: node publish deploy --ignore-safety-checks --add-new-synths --use-fork --yes --network mainnet - run: npm run test:prod:gas -- --target-network mainnet --patch-fresh-deployment @@ -159,9 +159,9 @@ jobs: cd optimism-integration ./up.sh - cmd-wait-for-port: - port: 8545 + port: 8545 - cmd-wait-for-port: - port: 9545 + port: 9545 - run: name: Deploy OVM Synthetix instances command: | @@ -185,7 +185,7 @@ jobs: command: npx hardhat node --target-network mainnet background: true - cmd-wait-for-port: - port: 8545 + port: 8545 - run: npm run test:prod:gas -- --target-network mainnet - run: npx codechecks codechecks.prod.yml - store_artifacts: diff --git a/README.md b/README.md index 9868ad9e0d..7949cfa021 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,6 @@ pragma solidity 0.5.16; import 'synthetix/contracts/interfaces/IAddressResolver.sol'; import 'synthetix/contracts/interfaces/ISynthetix.sol'; - contract MyContract { // This should be instantiated with our ReadProxyAddressResolver // it's a ReadProxy that won't change, so safe to code it here without a setter diff --git a/contracts/AddressResolver.sol b/contracts/AddressResolver.sol index 2025f7eceb..a69de222ef 100644 --- a/contracts/AddressResolver.sol +++ b/contracts/AddressResolver.sol @@ -8,7 +8,6 @@ import "./interfaces/IAddressResolver.sol"; import "./interfaces/IIssuer.sol"; import "./MixinResolver.sol"; - // https://docs.synthetix.io/contracts/source/contracts/addressresolver contract AddressResolver is Owned, IAddressResolver { mapping(bytes32 => address) public repository; diff --git a/contracts/AddressSetLib.sol b/contracts/AddressSetLib.sol index 4040ac411c..37a1593bf3 100644 --- a/contracts/AddressSetLib.sol +++ b/contracts/AddressSetLib.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - // https://docs.synthetix.io/contracts/source/libraries/addresssetlib/ library AddressSetLib { struct AddressSet { diff --git a/contracts/BaseDebtCache.sol b/contracts/BaseDebtCache.sol index 17e7727657..4542feecfc 100644 --- a/contracts/BaseDebtCache.sol +++ b/contracts/BaseDebtCache.sol @@ -19,7 +19,6 @@ import "./interfaces/IEtherCollateralsUSD.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/ICollateralManager.sol"; - // https://docs.synthetix.io/contracts/source/contracts/debtcache contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache { using SafeMath for uint; @@ -150,9 +149,8 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache { bool isSUSD = key == sUSD; if (isSUSD || key == sETH) { - IEtherCollateral etherCollateralContract = isSUSD - ? IEtherCollateral(address(etherCollateralsUSD())) - : etherCollateral(); + IEtherCollateral etherCollateralContract = + isSUSD ? IEtherCollateral(address(etherCollateralsUSD())) : etherCollateral(); uint etherCollateralSupply = etherCollateralContract.totalIssuedSynths(); supply = supply.sub(etherCollateralSupply); } diff --git a/contracts/BaseRewardEscrowV2.sol b/contracts/BaseRewardEscrowV2.sol index 129bab1de7..ac0faa8ac9 100644 --- a/contracts/BaseRewardEscrowV2.sol +++ b/contracts/BaseRewardEscrowV2.sol @@ -16,7 +16,6 @@ import "./interfaces/IFeePool.sol"; import "./interfaces/ISynthetix.sol"; import "./interfaces/IIssuer.sol"; - // https://docs.synthetix.io/contracts/RewardEscrow contract BaseRewardEscrowV2 is Owned, IRewardEscrowV2, LimitedSetup(8 weeks), MixinResolver { using SafeMath for uint; diff --git a/contracts/BaseSynthetix.sol b/contracts/BaseSynthetix.sol index 54435718bc..0f9ae2c262 100644 --- a/contracts/BaseSynthetix.sol +++ b/contracts/BaseSynthetix.sol @@ -16,7 +16,6 @@ import "./interfaces/IIssuer.sol"; import "./interfaces/IRewardsDistribution.sol"; import "./interfaces/IVirtualSynth.sol"; - contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix { // ========== STATE VARIABLES ========== @@ -151,10 +150,8 @@ contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix { (uint initialDebtOwnership, ) = synthetixState().issuanceData(account); if (initialDebtOwnership > 0) { - (uint transferable, bool anyRateIsInvalid) = issuer().transferableSynthetixAndAnyRateIsInvalid( - account, - tokenState.balanceOf(account) - ); + (uint transferable, bool anyRateIsInvalid) = + issuer().transferableSynthetixAndAnyRateIsInvalid(account, tokenState.balanceOf(account)); require(value <= transferable, "Cannot transfer staked or escrowed SNX"); require(!anyRateIsInvalid, "A synth or SNX rate is invalid"); } @@ -373,9 +370,8 @@ contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix { uint256 toAmount, address toAddress ); - bytes32 internal constant SYNTHEXCHANGE_SIG = keccak256( - "SynthExchange(address,bytes32,uint256,bytes32,uint256,address)" - ); + bytes32 internal constant SYNTHEXCHANGE_SIG = + keccak256("SynthExchange(address,bytes32,uint256,bytes32,uint256,address)"); function emitSynthExchange( address account, diff --git a/contracts/BinaryOption.sol b/contracts/BinaryOption.sol index a15c2366a7..54fe3f18ad 100644 --- a/contracts/BinaryOption.sol +++ b/contracts/BinaryOption.sol @@ -10,7 +10,6 @@ import "./SafeDecimalMath.sol"; // Internal references import "./BinaryOptionMarket.sol"; - // https://docs.synthetix.io/contracts/source/contracts/binaryoption contract BinaryOption is IERC20, IBinaryOption { /* ========== LIBRARIES ========== */ diff --git a/contracts/BinaryOptionMarket.sol b/contracts/BinaryOptionMarket.sol index 2a22d81035..06928f7f00 100644 --- a/contracts/BinaryOptionMarket.sol +++ b/contracts/BinaryOptionMarket.sol @@ -15,7 +15,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IFeePool.sol"; - // https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarket contract BinaryOptionMarket is Owned, MixinResolver, IBinaryOptionMarket { /* ========== LIBRARIES ========== */ diff --git a/contracts/BinaryOptionMarketData.sol b/contracts/BinaryOptionMarketData.sol index 165882883d..a1267f3a45 100644 --- a/contracts/BinaryOptionMarketData.sol +++ b/contracts/BinaryOptionMarketData.sol @@ -6,7 +6,6 @@ import "./BinaryOption.sol"; import "./BinaryOptionMarket.sol"; import "./BinaryOptionMarketManager.sol"; - // https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketdata contract BinaryOptionMarketData { struct OptionValues { @@ -63,14 +62,15 @@ contract BinaryOptionMarketData { (bytes32 key, uint strikePrice, uint finalPrice) = market.oracleDetails(); (uint poolFee, uint creatorFee, uint refundFee) = market.fees(); - MarketParameters memory data = MarketParameters( - market.creator(), - BinaryOptionMarket.Options(long, short), - BinaryOptionMarket.Times(biddingEndDate, maturityDate, expiryDate), - BinaryOptionMarket.OracleDetails(key, strikePrice, finalPrice), - BinaryOptionMarketManager.Fees(poolFee, creatorFee, refundFee), - BinaryOptionMarketManager.CreatorLimits(0, 0) - ); + MarketParameters memory data = + MarketParameters( + market.creator(), + BinaryOptionMarket.Options(long, short), + BinaryOptionMarket.Times(biddingEndDate, maturityDate, expiryDate), + BinaryOptionMarket.OracleDetails(key, strikePrice, finalPrice), + BinaryOptionMarketManager.Fees(poolFee, creatorFee, refundFee), + BinaryOptionMarketManager.CreatorLimits(0, 0) + ); // Stack too deep otherwise. (uint capitalRequirement, uint skewLimit) = market.creatorLimits(); diff --git a/contracts/BinaryOptionMarketFactory.sol b/contracts/BinaryOptionMarketFactory.sol index 3392007d1e..e86ce5e2cc 100644 --- a/contracts/BinaryOptionMarketFactory.sol +++ b/contracts/BinaryOptionMarketFactory.sol @@ -7,7 +7,6 @@ import "./MixinResolver.sol"; // Internal references import "./BinaryOptionMarket.sol"; - // https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketfactory contract BinaryOptionMarketFactory is Owned, MixinResolver { /* ========== STATE VARIABLES ========== */ diff --git a/contracts/BinaryOptionMarketManager.sol b/contracts/BinaryOptionMarketManager.sol index 56d2875f1c..d259bb8a27 100644 --- a/contracts/BinaryOptionMarketManager.sol +++ b/contracts/BinaryOptionMarketManager.sol @@ -18,7 +18,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/ISystemStatus.sol"; import "./interfaces/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketmanager contract BinaryOptionMarketManager is Owned, Pausable, MixinResolver, IBinaryOptionMarketManager { /* ========== LIBRARIES ========== */ @@ -262,16 +261,17 @@ contract BinaryOptionMarketManager is Owned, Pausable, MixinResolver, IBinaryOpt // Fees being in range are checked in the setters. // The market itself validates the capital and skew requirements. - BinaryOptionMarket market = _factory().createMarket( - msg.sender, - [creatorLimits.capitalRequirement, creatorLimits.skewLimit], - oracleKey, - strikePrice, - refundsEnabled, - [biddingEnd, maturity, expiry], - bids, - [fees.poolFee, fees.creatorFee, fees.refundFee] - ); + BinaryOptionMarket market = + _factory().createMarket( + msg.sender, + [creatorLimits.capitalRequirement, creatorLimits.skewLimit], + oracleKey, + strikePrice, + refundsEnabled, + [biddingEnd, maturity, expiry], + bids, + [fees.poolFee, fees.creatorFee, fees.refundFee] + ); market.rebuildCache(); _activeMarkets.add(address(market)); @@ -325,10 +325,8 @@ contract BinaryOptionMarketManager is Owned, Pausable, MixinResolver, IBinaryOpt if (!success) { // handle legacy markets that used an old cache rebuilding logic - bytes memory payloadForLegacyCache = abi.encodeWithSignature( - "setResolverAndSyncCache(address)", - address(resolver) - ); + bytes memory payloadForLegacyCache = + abi.encodeWithSignature("setResolverAndSyncCache(address)", address(resolver)); // solhint-disable avoid-low-level-calls (bool legacySuccess, ) = market.call(payloadForLegacyCache); diff --git a/contracts/Bytes32SetLib.sol b/contracts/Bytes32SetLib.sol index ee5f28b27c..567e8d5ccf 100644 --- a/contracts/Bytes32SetLib.sol +++ b/contracts/Bytes32SetLib.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - // https://docs.synthetix.io/contracts/source/libraries/bytes32setlib/ library Bytes32SetLib { struct Bytes32Set { diff --git a/contracts/Collateral.sol b/contracts/Collateral.sol index 9d0ddd9766..2517f2c4ce 100644 --- a/contracts/Collateral.sol +++ b/contracts/Collateral.sol @@ -21,7 +21,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/IExchanger.sol"; import "./interfaces/IShortingRewards.sol"; - contract Collateral is ICollateralLoan, Owned, MixinSystemSettings { /* ========== LIBRARIES ========== */ using SafeMath for uint; @@ -324,17 +323,18 @@ contract Collateral is ICollateralLoan, Owned, MixinSystemSettings { id = _manager().getNewLoanId(); // 10. Create the loan struct. - Loan memory loan = Loan({ - id: id, - account: msg.sender, - collateral: collateral, - currency: currency, - amount: amount, - short: short, - accruedInterest: 0, - interestIndex: 0, - lastInteraction: block.timestamp - }); + Loan memory loan = + Loan({ + id: id, + account: msg.sender, + collateral: collateral, + currency: currency, + amount: amount, + short: short, + accruedInterest: 0, + interestIndex: 0, + lastInteraction: block.timestamp + }); // 11. Accrue interest on the loan. loan = accrueInterest(loan); @@ -684,14 +684,14 @@ contract Collateral is ICollateralLoan, Owned, MixinSystemSettings { loanAfter = loan; // 1. Get the rates we need. - (uint entryRate, uint lastRate, uint lastUpdated, uint newIndex) = loan.short - ? _manager().getShortRatesAndTime(loan.currency, loan.interestIndex) - : _manager().getRatesAndTime(loan.interestIndex); + (uint entryRate, uint lastRate, uint lastUpdated, uint newIndex) = + loan.short + ? _manager().getShortRatesAndTime(loan.currency, loan.interestIndex) + : _manager().getRatesAndTime(loan.interestIndex); // 2. Get the instantaneous rate. - (uint rate, bool invalid) = loan.short - ? _manager().getShortRate(synthsByKey[loan.currency]) - : _manager().getBorrowRate(); + (uint rate, bool invalid) = + loan.short ? _manager().getShortRate(synthsByKey[loan.currency]) : _manager().getBorrowRate(); require(!invalid, "Rates are invalid"); diff --git a/contracts/CollateralErc20.sol b/contracts/CollateralErc20.sol index 3ad5de13d9..e50278a39e 100644 --- a/contracts/CollateralErc20.sol +++ b/contracts/CollateralErc20.sol @@ -10,7 +10,6 @@ import "./interfaces/ICollateralErc20.sol"; import "./CollateralState.sol"; import "./interfaces/IERC20.sol"; - // This contract handles the specific ERC20 implementation details of managing a loan. contract CollateralErc20 is ICollateralErc20, Collateral { // The underlying asset for this ERC20 collateral diff --git a/contracts/CollateralEth.sol b/contracts/CollateralEth.sol index a879bdb5bd..a4f0799f30 100644 --- a/contracts/CollateralEth.sol +++ b/contracts/CollateralEth.sol @@ -10,7 +10,6 @@ import "./interfaces/ICollateralEth.sol"; // Internal references import "./CollateralState.sol"; - // This contract handles the payable aspects of eth loans. contract CollateralEth is Collateral, ICollateralEth, ReentrancyGuard { mapping(address => uint) public pendingWithdrawals; diff --git a/contracts/CollateralManager.sol b/contracts/CollateralManager.sol index e1a77f20c9..b9b91290b1 100644 --- a/contracts/CollateralManager.sol +++ b/contracts/CollateralManager.sol @@ -18,7 +18,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/ISynth.sol"; - contract CollateralManager is ICollateralManager, Owned, Pausable, MixinResolver { /* ========== LIBRARIES ========== */ using SafeMath for uint; diff --git a/contracts/CollateralManagerState.sol b/contracts/CollateralManagerState.sol index 002ae6914f..769901a24e 100644 --- a/contracts/CollateralManagerState.sol +++ b/contracts/CollateralManagerState.sol @@ -9,7 +9,6 @@ import "./State.sol"; // Libraries import "./SafeDecimalMath.sol"; - contract CollateralManagerState is Owned, State { using SafeMath for uint; using SafeDecimalMath for uint; diff --git a/contracts/CollateralShort.sol b/contracts/CollateralShort.sol index dec45be6a1..c9622ac7cf 100644 --- a/contracts/CollateralShort.sol +++ b/contracts/CollateralShort.sol @@ -8,7 +8,6 @@ import "./Collateral.sol"; // Internal references import "./CollateralState.sol"; - contract CollateralShort is Collateral { constructor( CollateralState _state, diff --git a/contracts/CollateralState.sol b/contracts/CollateralState.sol index 25b2a2b8aa..cd85f90439 100644 --- a/contracts/CollateralState.sol +++ b/contracts/CollateralState.sol @@ -10,7 +10,6 @@ import "./interfaces/ICollateralLoan.sol"; // Libraries import "./SafeDecimalMath.sol"; - contract CollateralState is Owned, State, ICollateralLoan { using SafeMath for uint; using SafeDecimalMath for uint; diff --git a/contracts/ContractStorage.sol b/contracts/ContractStorage.sol index b3d29921db..f2a6692ef2 100644 --- a/contracts/ContractStorage.sol +++ b/contracts/ContractStorage.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Internal References import "./interfaces/IAddressResolver.sol"; - // https://docs.synthetix.io/contracts/source/contracts/contractstorage contract ContractStorage { IAddressResolver public resolverProxy; @@ -50,10 +49,8 @@ contract ContractStorage { /* ========== MODIFIERS ========== */ modifier onlyContract(bytes32 contractName) { - address callingContract = resolverProxy.requireAndGetAddress( - contractName, - "Cannot find contract in Address Resolver" - ); + address callingContract = + resolverProxy.requireAndGetAddress(contractName, "Cannot find contract in Address Resolver"); require(callingContract == msg.sender, "Can only be invoked by the configured contract"); _; } diff --git a/contracts/DappMaintenance.sol b/contracts/DappMaintenance.sol index 754a9e2140..f35f591f1b 100644 --- a/contracts/DappMaintenance.sol +++ b/contracts/DappMaintenance.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "./Owned.sol"; - // https://docs.synthetix.io/contracts/source/contracts/dappmaintenance /** diff --git a/contracts/DebtCache.sol b/contracts/DebtCache.sol index e9650a1678..4520eb43d7 100644 --- a/contracts/DebtCache.sol +++ b/contracts/DebtCache.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./BaseDebtCache.sol"; - // https://docs.synthetix.io/contracts/source/contracts/debtcache contract DebtCache is BaseDebtCache { constructor(address _owner, address _resolver) public BaseDebtCache(_owner, _resolver) {} diff --git a/contracts/DelegateApprovals.sol b/contracts/DelegateApprovals.sol index 01026eb9c5..e2c0d55f20 100644 --- a/contracts/DelegateApprovals.sol +++ b/contracts/DelegateApprovals.sol @@ -7,7 +7,6 @@ import "./interfaces/IDelegateApprovals.sol"; // Internal references import "./EternalStorage.sol"; - // https://docs.synthetix.io/contracts/source/contracts/delegateapprovals contract DelegateApprovals is Owned, IDelegateApprovals { bytes32 public constant BURN_FOR_ADDRESS = "BurnForAddress"; diff --git a/contracts/Depot.sol b/contracts/Depot.sol index cfaa58dbd4..c3bb6eb237 100644 --- a/contracts/Depot.sol +++ b/contracts/Depot.sol @@ -14,7 +14,6 @@ import "./SafeDecimalMath.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IExchangeRates.sol"; - // https://docs.synthetix.io/contracts/source/contracts/depot contract Depot is Owned, Pausable, ReentrancyGuard, MixinResolver, IDepot { using SafeMath for uint; diff --git a/contracts/EmptyCollateralManager.sol b/contracts/EmptyCollateralManager.sol index 2145cf533a..f5d5933bb4 100644 --- a/contracts/EmptyCollateralManager.sol +++ b/contracts/EmptyCollateralManager.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "./interfaces/ICollateralManager.sol"; - contract EmptyCollateralManager is ICollateralManager { // Manager information function hasCollateral(address) external view returns (bool) { diff --git a/contracts/EmptyEtherCollateral.sol b/contracts/EmptyEtherCollateral.sol index 894b982d8f..f271bb8bb2 100644 --- a/contracts/EmptyEtherCollateral.sol +++ b/contracts/EmptyEtherCollateral.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - // Empty contract for ether collateral placeholder for OVM // https://docs.synthetix.io/contracts/source/contracts/emptyethercollateral contract EmptyEtherCollateral { diff --git a/contracts/EscrowChecker.sol b/contracts/EscrowChecker.sol index c338d5e68a..317ae42e92 100644 --- a/contracts/EscrowChecker.sol +++ b/contracts/EscrowChecker.sol @@ -1,13 +1,11 @@ pragma solidity ^0.5.16; - interface ISynthetixEscrow { function numVestingEntries(address account) external view returns (uint); function getVestingScheduleEntry(address account, uint index) external view returns (uint[2] memory); } - // https://docs.synthetix.io/contracts/source/contracts/escrowchecker contract EscrowChecker { ISynthetixEscrow public synthetix_escrow; diff --git a/contracts/EternalStorage.sol b/contracts/EternalStorage.sol index 443da5b996..f813456e99 100644 --- a/contracts/EternalStorage.sol +++ b/contracts/EternalStorage.sol @@ -4,7 +4,6 @@ pragma solidity ^0.5.16; import "./Owned.sol"; import "./State.sol"; - // https://docs.synthetix.io/contracts/source/contracts/eternalstorage /** * @notice This contract is based on the code available from this blog diff --git a/contracts/EtherCollateral.sol b/contracts/EtherCollateral.sol index 7ae6fd89b8..1461160593 100644 --- a/contracts/EtherCollateral.sol +++ b/contracts/EtherCollateral.sol @@ -18,7 +18,6 @@ import "./interfaces/IERC20.sol"; import "./interfaces/IDepot.sol"; import "./interfaces/IExchangeRates.sol"; - // https://docs.synthetix.io/contracts/source/contracts/ethercollateral contract EtherCollateral is Owned, Pausable, ReentrancyGuard, MixinResolver, IEtherCollateral { using SafeMath for uint256; @@ -309,14 +308,15 @@ contract EtherCollateral is Owned, Pausable, ReentrancyGuard, MixinResolver, IEt loanID = _incrementTotalLoansCounter(); // Create Loan storage object - SynthLoanStruct memory synthLoan = SynthLoanStruct({ - account: msg.sender, - collateralAmount: msg.value, - loanAmount: loanAmount, - timeCreated: now, - loanID: loanID, - timeClosed: 0 - }); + SynthLoanStruct memory synthLoan = + SynthLoanStruct({ + account: msg.sender, + collateralAmount: msg.value, + loanAmount: loanAmount, + timeCreated: now, + loanID: loanID, + timeClosed: 0 + }); // Record loan in mapping to account in an array of the accounts open loans accountsSynthLoans[msg.sender].push(synthLoan); diff --git a/contracts/EtherCollateralsUSD.sol b/contracts/EtherCollateralsUSD.sol index cb9578b499..db16fa4bf6 100644 --- a/contracts/EtherCollateralsUSD.sol +++ b/contracts/EtherCollateralsUSD.sol @@ -17,7 +17,6 @@ import "./interfaces/ISynth.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IExchangeRates.sol"; - // ETH Collateral v0.3 (sUSD) // https://docs.synthetix.io/contracts/source/contracts/ethercollateralsusd contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, IEtherCollateralsUSD { @@ -241,10 +240,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, function currentInterestOnLoan(address _account, uint256 _loanID) external view returns (uint256) { // Get the loan from storage SynthLoanStruct memory synthLoan = _getLoanFromStorage(_account, _loanID); - uint256 currentInterest = accruedInterestOnLoan( - synthLoan.loanAmount.add(synthLoan.accruedInterest), - _timeSinceInterestAccrual(synthLoan) - ); + uint256 currentInterest = + accruedInterestOnLoan(synthLoan.loanAmount.add(synthLoan.accruedInterest), _timeSinceInterestAccrual(synthLoan)); return synthLoan.accruedInterest.add(currentInterest); } @@ -414,18 +411,19 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, loanID = _incrementTotalLoansCounter(); // Create Loan storage object - SynthLoanStruct memory synthLoan = SynthLoanStruct({ - account: msg.sender, - collateralAmount: msg.value, - loanAmount: _loanAmount, - mintingFee: mintingFee, - timeCreated: block.timestamp, - loanID: loanID, - timeClosed: 0, - loanInterestRate: interestRate, - accruedInterest: 0, - lastInterestAccrued: 0 - }); + SynthLoanStruct memory synthLoan = + SynthLoanStruct({ + account: msg.sender, + collateralAmount: msg.value, + loanAmount: _loanAmount, + mintingFee: mintingFee, + timeCreated: block.timestamp, + loanID: loanID, + timeClosed: 0, + loanInterestRate: interestRate, + accruedInterest: 0, + lastInterestAccrued: 0 + }); // Fee distribution. Mint the sUSD fees into the FeePool and record fees paid if (mintingFee > 0) { @@ -527,12 +525,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, // and repay principal loan amount with remaining amounts uint256 accruedInterest = synthLoan.accruedInterest.add(interestAmount); - ( - uint256 interestPaid, - uint256 loanAmountPaid, - uint256 accruedInterestAfter, - uint256 loanAmountAfter - ) = _splitInterestLoanPayment(_repayAmount, accruedInterest, synthLoan.loanAmount); + (uint256 interestPaid, uint256 loanAmountPaid, uint256 accruedInterestAfter, uint256 loanAmountAfter) = + _splitInterestLoanPayment(_repayAmount, accruedInterest, synthLoan.loanAmount); // burn sUSD from msg.sender for repaid amount synthsUSD().burn(msg.sender, _repayAmount); @@ -567,10 +561,11 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, require(collateralRatio < liquidationRatio, "Collateral ratio above liquidation ratio"); // calculate amount to liquidate to fix ratio including accrued interest - uint256 liquidationAmount = calculateAmountToLiquidate( - synthLoan.loanAmount.add(synthLoan.accruedInterest).add(interestAmount), - collateralValue - ); + uint256 liquidationAmount = + calculateAmountToLiquidate( + synthLoan.loanAmount.add(synthLoan.accruedInterest).add(interestAmount), + collateralValue + ); // cap debt to liquidate uint256 amountToLiquidate = liquidationAmount < _debtToCover ? liquidationAmount : _debtToCover; @@ -578,11 +573,12 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, // burn sUSD from msg.sender for amount to liquidate synthsUSD().burn(msg.sender, amountToLiquidate); - (uint256 interestPaid, uint256 loanAmountPaid, uint256 accruedInterestAfter, ) = _splitInterestLoanPayment( - amountToLiquidate, - synthLoan.accruedInterest.add(interestAmount), - synthLoan.loanAmount - ); + (uint256 interestPaid, uint256 loanAmountPaid, uint256 accruedInterestAfter, ) = + _splitInterestLoanPayment( + amountToLiquidate, + synthLoan.accruedInterest.add(interestAmount), + synthLoan.loanAmount + ); // Send interests paid to fee pool and record loan amount paid _processInterestAndLoanPayment(interestPaid, loanAmountPaid); @@ -591,9 +587,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, uint256 collateralRedeemed = exchangeRates().effectiveValue(sUSD, amountToLiquidate, COLLATERAL); // Add penalty - uint256 totalCollateralLiquidated = collateralRedeemed.multiplyDecimal( - SafeDecimalMath.unit().add(liquidationPenalty) - ); + uint256 totalCollateralLiquidated = + collateralRedeemed.multiplyDecimal(SafeDecimalMath.unit().add(liquidationPenalty)); // update remaining loanAmount less amount paid and update accrued interests less interest paid _updateLoan(synthLoan, synthLoan.loanAmount.sub(loanAmountPaid), accruedInterestAfter, block.timestamp); @@ -686,10 +681,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, // Calculate and deduct accrued interest (5%) for fee pool // Accrued interests (captured in loanAmount) + new interests - uint256 interestAmount = accruedInterestOnLoan( - synthLoan.loanAmount.add(synthLoan.accruedInterest), - _timeSinceInterestAccrual(synthLoan) - ); + uint256 interestAmount = + accruedInterestOnLoan(synthLoan.loanAmount.add(synthLoan.accruedInterest), _timeSinceInterestAccrual(synthLoan)); uint256 repayAmount = synthLoan.loanAmount.add(interestAmount); uint256 totalAccruedInterest = synthLoan.accruedInterest.add(interestAmount); @@ -720,9 +713,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, uint256 collateralRedeemed = exchangeRates().effectiveValue(sUSD, repayAmount, COLLATERAL); // add penalty - uint256 totalCollateralLiquidated = collateralRedeemed.multiplyDecimal( - SafeDecimalMath.unit().add(liquidationPenalty) - ); + uint256 totalCollateralLiquidated = + collateralRedeemed.multiplyDecimal(SafeDecimalMath.unit().add(liquidationPenalty)); // ensure remaining ETH collateral sufficient to cover collateral liquidated // will revert if the liquidated collateral + penalty is more than remaining collateral @@ -809,9 +801,8 @@ contract EtherCollateralsUSD is Owned, Pausable, ReentrancyGuard, MixinResolver, function _timeSinceInterestAccrual(SynthLoanStruct memory _synthLoan) private view returns (uint256 timeSinceAccrual) { // The last interest accrued timestamp for the loan // If lastInterestAccrued timestamp is not set (0), use loan timeCreated - uint256 lastInterestAccrual = _synthLoan.lastInterestAccrued > 0 - ? uint256(_synthLoan.lastInterestAccrued) - : _synthLoan.timeCreated; + uint256 lastInterestAccrual = + _synthLoan.lastInterestAccrued > 0 ? uint256(_synthLoan.lastInterestAccrued) : _synthLoan.timeCreated; // diff between last interested accrued and now // use loan's timeClosed if loan is closed diff --git a/contracts/ExchangeRates.sol b/contracts/ExchangeRates.sol index d09f01afcc..4a9603ab37 100644 --- a/contracts/ExchangeRates.sol +++ b/contracts/ExchangeRates.sol @@ -16,7 +16,6 @@ import "@chainlink/contracts-0.0.10/src/v0.5/interfaces/AggregatorV2V3Interface. import "@chainlink/contracts-0.0.10/src/v0.5/interfaces/FlagsInterface.sol"; import "./interfaces/IExchanger.sol"; - // https://docs.synthetix.io/contracts/source/contracts/exchangerates contract ExchangeRates is Owned, MixinSystemSettings, IExchangeRates { using SafeMath for uint; @@ -598,10 +597,8 @@ contract ExchangeRates is Owned, MixinSystemSettings, IExchangeRates { (bool success, bytes memory returnData) = address(aggregator).staticcall(payload); if (success) { - (uint80 roundId, int256 answer, , uint256 updatedAt, ) = abi.decode( - returnData, - (uint80, int256, uint256, uint256, uint80) - ); + (uint80 roundId, int256 answer, , uint256 updatedAt, ) = + abi.decode(returnData, (uint80, int256, uint256, uint256, uint80)); return RateAndUpdatedTime({ rate: uint216(_rateOrInverted(currencyKey, _formatAggregatorAnswer(currencyKey, answer), roundId)), @@ -637,10 +634,8 @@ contract ExchangeRates is Owned, MixinSystemSettings, IExchangeRates { (bool success, bytes memory returnData) = address(aggregator).staticcall(payload); if (success) { - (, int256 answer, , uint256 updatedAt, ) = abi.decode( - returnData, - (uint80, int256, uint256, uint256, uint80) - ); + (, int256 answer, , uint256 updatedAt, ) = + abi.decode(returnData, (uint80, int256, uint256, uint256, uint80)); return (_rateOrInverted(currencyKey, _formatAggregatorAnswer(currencyKey, answer), roundId), updatedAt); } } else { diff --git a/contracts/ExchangeRatesWithoutInvPricing.sol b/contracts/ExchangeRatesWithoutInvPricing.sol index 1b326773d2..ec0f3d2fae 100644 --- a/contracts/ExchangeRatesWithoutInvPricing.sol +++ b/contracts/ExchangeRatesWithoutInvPricing.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Internal references import "./ExchangeRates.sol"; - // https://docs.synthetix.io/contracts/source/contracts/exchangerateswithoutinvpricing contract ExchangeRatesWithoutInvPricing is ExchangeRates { constructor( diff --git a/contracts/ExchangeState.sol b/contracts/ExchangeState.sol index c5cd2c4bbd..2b3d0796c2 100644 --- a/contracts/ExchangeState.sol +++ b/contracts/ExchangeState.sol @@ -5,7 +5,6 @@ import "./Owned.sol"; import "./State.sol"; import "./interfaces/IExchangeState.sol"; - // https://docs.synthetix.io/contracts/source/contracts/exchangestate contract ExchangeState is Owned, State, IExchangeState { mapping(address => mapping(bytes32 => IExchangeState.ExchangeEntry[])) public exchanges; diff --git a/contracts/Exchanger.sol b/contracts/Exchanger.sol index c5e813ca99..236aa3584b 100644 --- a/contracts/Exchanger.sol +++ b/contracts/Exchanger.sol @@ -25,7 +25,6 @@ import "./Proxyable.sol"; // during the build (VirtualSynth has IERC20 from the OZ ERC20 implementation) import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol"; - // Used to have strongly-typed access to internal mutative functions in Synthetix interface ISynthetixInternal { function emitExchangeTracking( @@ -56,14 +55,12 @@ interface ISynthetixInternal { ) external; } - interface IExchangerInternalDebtCache { function updateCachedSynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external; function updateCachedSynthDebts(bytes32[] calldata currencyKeys) external; } - // https://docs.synthetix.io/contracts/source/contracts/exchanger contract Exchanger is Owned, MixinSystemSettings, IExchanger { using SafeMath for uint; @@ -208,13 +205,14 @@ contract Exchanger is Owned, MixinSystemSettings, IExchanger { (uint srcRoundIdAtPeriodEnd, uint destRoundIdAtPeriodEnd) = getRoundIdsAtPeriodEnd(exchangeEntry); // given these round ids, determine what effective value they should have received - uint destinationAmount = exchangeRates().effectiveValueAtRound( - exchangeEntry.src, - exchangeEntry.amount, - exchangeEntry.dest, - srcRoundIdAtPeriodEnd, - destRoundIdAtPeriodEnd - ); + uint destinationAmount = + exchangeRates().effectiveValueAtRound( + exchangeEntry.src, + exchangeEntry.amount, + exchangeEntry.dest, + srcRoundIdAtPeriodEnd, + destRoundIdAtPeriodEnd + ); // and deduct the fee from this amount using the exchangeFeeRate from storage uint amountShouldHaveReceived = _getAmountReceivedForExchange(destinationAmount, exchangeEntry.exchangeFeeRate); @@ -729,12 +727,8 @@ contract Exchanger is Owned, MixinSystemSettings, IExchanger { { require(maxSecsLeftInWaitingPeriod(from, currencyKey) == 0, "Cannot settle during waiting period"); - ( - uint reclaimAmount, - uint rebateAmount, - uint entries, - ExchangeEntrySettlement[] memory settlements - ) = _settlementOwing(from, currencyKey); + (uint reclaimAmount, uint rebateAmount, uint entries, ExchangeEntrySettlement[] memory settlements) = + _settlementOwing(from, currencyKey); if (reclaimAmount > rebateAmount) { reclaimed = reclaimAmount.sub(rebateAmount); diff --git a/contracts/ExchangerWithVirtualSynth.sol b/contracts/ExchangerWithVirtualSynth.sol index d8cd41c7e4..ccca1c6b25 100644 --- a/contracts/ExchangerWithVirtualSynth.sol +++ b/contracts/ExchangerWithVirtualSynth.sol @@ -7,7 +7,6 @@ import "./Exchanger.sol"; import "./interfaces/IVirtualSynth.sol"; import "./VirtualSynth.sol"; - // https://docs.synthetix.io/contracts/source/contracts/exchangerwithvirtualsynth contract ExchangerWithVirtualSynth is Exchanger { constructor(address _owner, address _resolver) public Exchanger(_owner, _resolver) {} diff --git a/contracts/ExternStateToken.sol b/contracts/ExternStateToken.sol index 3b3c3c3e5c..666c5ae690 100644 --- a/contracts/ExternStateToken.sol +++ b/contracts/ExternStateToken.sol @@ -10,7 +10,6 @@ import "./SafeDecimalMath.sol"; // Internal references import "./TokenState.sol"; - // https://docs.synthetix.io/contracts/source/contracts/externstatetoken contract ExternStateToken is Owned, Proxyable { using SafeMath for uint; diff --git a/contracts/FeePool.sol b/contracts/FeePool.sol index 20b16caa66..e8a0e40470 100644 --- a/contracts/FeePool.sol +++ b/contracts/FeePool.sol @@ -27,7 +27,6 @@ import "./interfaces/IRewardsDistribution.sol"; import "./interfaces/IEtherCollateralsUSD.sol"; import "./interfaces/ICollateralManager.sol"; - // https://docs.synthetix.io/contracts/source/contracts/feepool contract FeePool is Owned, Proxyable, LimitedSetup, MixinSystemSettings, IFeePool { using SafeMath for uint; @@ -424,9 +423,8 @@ contract FeePool is Owned, Proxyable, LimitedSetup, MixinSystemSettings, IFeePoo // until we've exhausted the amount. // The condition checks for overflow because we're going to 0 with an unsigned int. for (uint i = FEE_PERIOD_LENGTH - 1; i < FEE_PERIOD_LENGTH; i--) { - uint toDistribute = _recentFeePeriodsStorage(i).rewardsToDistribute.sub( - _recentFeePeriodsStorage(i).rewardsClaimed - ); + uint toDistribute = + _recentFeePeriodsStorage(i).rewardsToDistribute.sub(_recentFeePeriodsStorage(i).rewardsClaimed); if (toDistribute > 0) { // Take the smaller of the amount left to claim in the period and the amount we need to allocate @@ -649,9 +647,8 @@ contract FeePool is Owned, Proxyable, LimitedSetup, MixinSystemSettings, IFeePoo // This is a high precision integer. uint feesFromPeriod = _recentFeePeriodsStorage(period).feesToDistribute.multiplyDecimal(debtOwnershipForPeriod); - uint rewardsFromPeriod = _recentFeePeriodsStorage(period).rewardsToDistribute.multiplyDecimal( - debtOwnershipForPeriod - ); + uint rewardsFromPeriod = + _recentFeePeriodsStorage(period).rewardsToDistribute.multiplyDecimal(debtOwnershipForPeriod); return (feesFromPeriod.preciseDecimalToDecimal(), rewardsFromPeriod.preciseDecimalToDecimal()); } @@ -664,10 +661,11 @@ contract FeePool is Owned, Proxyable, LimitedSetup, MixinSystemSettings, IFeePoo // Figure out their global debt percentage delta at end of fee Period. // This is a high precision integer. ISynthetixState _synthetixState = synthetixState(); - uint feePeriodDebtOwnership = _synthetixState - .debtLedger(closingDebtIndex) - .divideDecimalRoundPrecise(_synthetixState.debtLedger(debtEntryIndex)) - .multiplyDecimalRoundPrecise(ownershipPercentage); + uint feePeriodDebtOwnership = + _synthetixState + .debtLedger(closingDebtIndex) + .divideDecimalRoundPrecise(_synthetixState.debtLedger(debtEntryIndex)) + .multiplyDecimalRoundPrecise(ownershipPercentage); return feePeriodDebtOwnership; } @@ -753,9 +751,8 @@ contract FeePool is Owned, Proxyable, LimitedSetup, MixinSystemSettings, IFeePoo uint debtEntryIndex, uint feePeriodStartingDebtIndex ); - bytes32 private constant ISSUANCEDEBTRATIOENTRY_SIG = keccak256( - "IssuanceDebtRatioEntry(address,uint256,uint256,uint256)" - ); + bytes32 private constant ISSUANCEDEBTRATIOENTRY_SIG = + keccak256("IssuanceDebtRatioEntry(address,uint256,uint256,uint256)"); function emitIssuanceDebtRatioEntry( address account, diff --git a/contracts/FeePoolEternalStorage.sol b/contracts/FeePoolEternalStorage.sol index 84161643cb..843ea8200b 100644 --- a/contracts/FeePoolEternalStorage.sol +++ b/contracts/FeePoolEternalStorage.sol @@ -4,7 +4,6 @@ pragma solidity ^0.5.16; import "./EternalStorage.sol"; import "./LimitedSetup.sol"; - // https://docs.synthetix.io/contracts/source/contracts/feepooleternalstorage contract FeePoolEternalStorage is EternalStorage, LimitedSetup { bytes32 internal constant LAST_FEE_WITHDRAWAL = "last_fee_withdrawal"; diff --git a/contracts/FeePoolState.sol b/contracts/FeePoolState.sol index 5e9e019104..93c1f03f99 100644 --- a/contracts/FeePoolState.sol +++ b/contracts/FeePoolState.sol @@ -10,7 +10,6 @@ import "./SafeDecimalMath.sol"; // Internal references import "./interfaces/IFeePool.sol"; - // https://docs.synthetix.io/contracts/source/contracts/feepoolstate contract FeePoolState is Owned, LimitedSetup { using SafeMath for uint; diff --git a/contracts/FlexibleStorage.sol b/contracts/FlexibleStorage.sol index d78a199683..cc9643bc37 100644 --- a/contracts/FlexibleStorage.sol +++ b/contracts/FlexibleStorage.sol @@ -7,7 +7,6 @@ import "./interfaces/IFlexibleStorage.sol"; // Internal References import "./interfaces/IAddressResolver.sol"; - // https://docs.synthetix.io/contracts/source/contracts/flexiblestorage contract FlexibleStorage is ContractStorage, IFlexibleStorage { mapping(bytes32 => mapping(bytes32 => uint)) internal uintStorage; diff --git a/contracts/ImportableRewardEscrowV2.sol b/contracts/ImportableRewardEscrowV2.sol index 881d1bf086..516d0b28cb 100644 --- a/contracts/ImportableRewardEscrowV2.sol +++ b/contracts/ImportableRewardEscrowV2.sol @@ -4,7 +4,6 @@ pragma experimental ABIEncoderV2; // Inheritance import "./BaseRewardEscrowV2.sol"; - // https://docs.synthetix.io/contracts/RewardEscrow contract ImportableRewardEscrowV2 is BaseRewardEscrowV2 { /* ========== ADDRESS RESOLVER CONFIGURATION ========== */ diff --git a/contracts/Issuer.sol b/contracts/Issuer.sol index 64318923b7..3e03ae472a 100644 --- a/contracts/Issuer.sol +++ b/contracts/Issuer.sol @@ -24,13 +24,11 @@ import "./interfaces/IERC20.sol"; import "./interfaces/ILiquidations.sol"; import "./interfaces/ICollateralManager.sol"; - interface IRewardEscrowV2 { // Views function balanceOf(address account) external view returns (uint); } - interface IIssuerInternalDebtCache { function updateCachedSynthDebtWithRate(bytes32 currencyKey, uint currencyRate) external; @@ -49,7 +47,6 @@ interface IIssuerInternalDebtCache { ); } - // https://docs.synthetix.io/contracts/source/contracts/issuer contract Issuer is Owned, MixinSystemSettings, IIssuer { using SafeMath for uint; @@ -238,15 +235,15 @@ contract Issuer is Owned, MixinSystemSettings, IIssuer { // Figure out the global debt percentage delta from when they entered the system. // This is a high precision integer of 27 (1e27) decimals. - uint currentDebtOwnership = state - .lastDebtLedgerEntry() - .divideDecimalRoundPrecise(state.debtLedger(debtEntryIndex)) - .multiplyDecimalRoundPrecise(initialDebtOwnership); + uint currentDebtOwnership = + state + .lastDebtLedgerEntry() + .divideDecimalRoundPrecise(state.debtLedger(debtEntryIndex)) + .multiplyDecimalRoundPrecise(initialDebtOwnership); // Their debt balance is their portion of the total system value. - uint highPrecisionBalance = totalSystemValue.decimalToPreciseDecimal().multiplyDecimalRoundPrecise( - currentDebtOwnership - ); + uint highPrecisionBalance = + totalSystemValue.decimalToPreciseDecimal().multiplyDecimalRoundPrecise(currentDebtOwnership); // Convert back into 18 decimals (1e18) debtBalance = highPrecisionBalance.preciseDecimalToDecimal(); @@ -587,10 +584,8 @@ contract Issuer is Owned, MixinSystemSettings, IIssuer { _requireRatesNotInvalid(anyRateIsInvalid || snxRateInvalid); uint collateralForAccount = _collateral(account); - uint amountToFixRatio = liquidations().calculateAmountToFixCollateral( - debtBalance, - _snxToUSD(collateralForAccount, snxRate) - ); + uint amountToFixRatio = + liquidations().calculateAmountToFixCollateral(debtBalance, _snxToUSD(collateralForAccount, snxRate)); // Cap amount to liquidate to repair collateral ratio based on issuance ratio amountToLiquidate = amountToFixRatio < susdAmount ? amountToFixRatio : susdAmount; diff --git a/contracts/IssuerWithoutLiquidations.sol b/contracts/IssuerWithoutLiquidations.sol index cb86eebf78..7953fea75b 100644 --- a/contracts/IssuerWithoutLiquidations.sol +++ b/contracts/IssuerWithoutLiquidations.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Internal references import "./Issuer.sol"; - // https://docs.synthetix.io/contracts/source/contracts/issuerwithoutliquidations contract IssuerWithoutLiquidations is Issuer { constructor(address _owner, address _resolver) public Issuer(_owner, _resolver) {} diff --git a/contracts/LimitedSetup.sol b/contracts/LimitedSetup.sol index a89f6a67d9..10f8a8f0aa 100644 --- a/contracts/LimitedSetup.sol +++ b/contracts/LimitedSetup.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - // https://docs.synthetix.io/contracts/source/contracts/limitedsetup contract LimitedSetup { uint public setupExpiryTime; diff --git a/contracts/Liquidations.sol b/contracts/Liquidations.sol index 9e284d8056..04bd1d9c77 100644 --- a/contracts/Liquidations.sol +++ b/contracts/Liquidations.sol @@ -16,7 +16,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/IIssuer.sol"; import "./interfaces/ISystemStatus.sol"; - // https://docs.synthetix.io/contracts/source/contracts/liquidations contract Liquidations is Owned, MixinSystemSettings, ILiquidations { using SafeMath for uint; diff --git a/contracts/Math.sol b/contracts/Math.sol index 9b87d1e43e..08379c62e4 100644 --- a/contracts/Math.sol +++ b/contracts/Math.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Libraries import "./SafeDecimalMath.sol"; - // https://docs.synthetix.io/contracts/source/libraries/math library Math { using SafeMath for uint; diff --git a/contracts/MintableSynthetix.sol b/contracts/MintableSynthetix.sol index 04f738eb6c..53cd2ba530 100644 --- a/contracts/MintableSynthetix.sol +++ b/contracts/MintableSynthetix.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./BaseSynthetix.sol"; - // https://docs.synthetix.io/contracts/source/contracts/mintablesynthetix contract MintableSynthetix is BaseSynthetix { bytes32 private constant CONTRACT_SYNTHETIX_BRIDGE = "SynthetixBridgeToBase"; diff --git a/contracts/MixinResolver.sol b/contracts/MixinResolver.sol index 3e262ad9d1..8cb2050267 100644 --- a/contracts/MixinResolver.sol +++ b/contracts/MixinResolver.sol @@ -7,7 +7,6 @@ import "./Owned.sol"; import "./AddressResolver.sol"; import "./ReadProxy.sol"; - // https://docs.synthetix.io/contracts/source/contracts/mixinresolver contract MixinResolver { AddressResolver public resolver; @@ -47,10 +46,8 @@ contract MixinResolver { for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // Note: can only be invoked once the resolver has all the targets needed added - address destination = resolver.requireAndGetAddress( - name, - string(abi.encodePacked("Resolver missing target: ", name)) - ); + address destination = + resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name))); addressCache[name] = destination; emit CacheUpdated(name, destination); } diff --git a/contracts/MixinSystemSettings.sol b/contracts/MixinSystemSettings.sol index a9d99e1e04..db8e17e0e7 100644 --- a/contracts/MixinSystemSettings.sol +++ b/contracts/MixinSystemSettings.sol @@ -5,7 +5,6 @@ import "./MixinResolver.sol"; // Internal references import "./interfaces/IFlexibleStorage.sol"; - // https://docs.synthetix.io/contracts/source/contracts/mixinsystemsettings contract MixinSystemSettings is MixinResolver { bytes32 internal constant SETTING_CONTRACT_NAME = "SystemSettings"; diff --git a/contracts/MultiCollateralSynth.sol b/contracts/MultiCollateralSynth.sol index c96097dcd3..2c642042a5 100644 --- a/contracts/MultiCollateralSynth.sol +++ b/contracts/MultiCollateralSynth.sol @@ -8,7 +8,6 @@ import "./interfaces/ICollateralManager.sol"; import "./interfaces/IEtherCollateralsUSD.sol"; import "./interfaces/IEtherCollateral.sol"; - // https://docs.synthetix.io/contracts/source/contracts/multicollateralsynth contract MultiCollateralSynth is Synth { /* ========== ADDRESS RESOLVER CONFIGURATION ========== */ diff --git a/contracts/Owned.sol b/contracts/Owned.sol index 74cb762356..a1656b797c 100644 --- a/contracts/Owned.sol +++ b/contracts/Owned.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - // https://docs.synthetix.io/contracts/source/contracts/owned contract Owned { address public owner; diff --git a/contracts/Pausable.sol b/contracts/Pausable.sol index bbaae88c8b..bb3e7992a0 100644 --- a/contracts/Pausable.sol +++ b/contracts/Pausable.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; - // https://docs.synthetix.io/contracts/source/contracts/pausable contract Pausable is Owned { uint public lastPauseTime; diff --git a/contracts/Proxy.sol b/contracts/Proxy.sol index 49c9dccdf5..58ca1ead8b 100644 --- a/contracts/Proxy.sol +++ b/contracts/Proxy.sol @@ -6,7 +6,6 @@ import "./Owned.sol"; // Internal references import "./Proxyable.sol"; - // https://docs.synthetix.io/contracts/source/contracts/proxy contract Proxy is Owned { Proxyable public target; diff --git a/contracts/ProxyERC20.sol b/contracts/ProxyERC20.sol index 5a96be682f..2e68454252 100644 --- a/contracts/ProxyERC20.sol +++ b/contracts/ProxyERC20.sol @@ -4,7 +4,6 @@ pragma solidity ^0.5.16; import "./Proxy.sol"; import "./interfaces/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/proxyerc20 contract ProxyERC20 is Proxy, IERC20 { constructor(address _owner) public Proxy(_owner) {} diff --git a/contracts/Proxyable.sol b/contracts/Proxyable.sol index fe948e334b..960ee462b8 100644 --- a/contracts/Proxyable.sol +++ b/contracts/Proxyable.sol @@ -6,7 +6,6 @@ import "./Owned.sol"; // Internal references import "./Proxy.sol"; - // https://docs.synthetix.io/contracts/source/contracts/proxyable contract Proxyable is Owned { // This contract should be treated like an abstract contract diff --git a/contracts/PurgeableSynth.sol b/contracts/PurgeableSynth.sol index 194cfad060..35aa1ba64f 100644 --- a/contracts/PurgeableSynth.sol +++ b/contracts/PurgeableSynth.sol @@ -9,7 +9,6 @@ import "./SafeDecimalMath.sol"; // Internal References import "./interfaces/IExchangeRates.sol"; - // https://docs.synthetix.io/contracts/source/contracts/purgeablesynth contract PurgeableSynth is Synth { using SafeDecimalMath for uint; diff --git a/contracts/ReadProxy.sol b/contracts/ReadProxy.sol index ea1f616869..1d746e32ab 100644 --- a/contracts/ReadProxy.sol +++ b/contracts/ReadProxy.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "./Owned.sol"; - // solhint-disable payable-fallback // https://docs.synthetix.io/contracts/source/contracts/readproxy diff --git a/contracts/RealtimeDebtCache.sol b/contracts/RealtimeDebtCache.sol index e523cc92f5..264c513ddc 100644 --- a/contracts/RealtimeDebtCache.sol +++ b/contracts/RealtimeDebtCache.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./BaseDebtCache.sol"; - // https://docs.synthetix.io/contracts/source/contracts/realtimedebtcache contract RealtimeDebtCache is BaseDebtCache { constructor(address _owner, address _resolver) public BaseDebtCache(_owner, _resolver) {} diff --git a/contracts/RewardEscrow.sol b/contracts/RewardEscrow.sol index c9bc5b957c..2d8d64affe 100644 --- a/contracts/RewardEscrow.sol +++ b/contracts/RewardEscrow.sol @@ -12,7 +12,6 @@ import "./interfaces/IERC20.sol"; import "./interfaces/IFeePool.sol"; import "./interfaces/ISynthetix.sol"; - // https://docs.synthetix.io/contracts/source/contracts/rewardescrow contract RewardEscrow is Owned, IRewardEscrow { using SafeMath for uint; diff --git a/contracts/RewardEscrowV2.sol b/contracts/RewardEscrowV2.sol index 96f1bd37d5..2278bae80b 100644 --- a/contracts/RewardEscrowV2.sol +++ b/contracts/RewardEscrowV2.sol @@ -8,7 +8,6 @@ import "./BaseRewardEscrowV2.sol"; import "./interfaces/IRewardEscrow.sol"; import "./interfaces/ISystemStatus.sol"; - // https://docs.synthetix.io/contracts/RewardEscrow contract RewardEscrowV2 is BaseRewardEscrowV2 { mapping(address => uint256) public totalBalancePendingMigration; diff --git a/contracts/RewardsDistribution.sol b/contracts/RewardsDistribution.sol index e07bb480c4..cf688eac5d 100644 --- a/contracts/RewardsDistribution.sol +++ b/contracts/RewardsDistribution.sol @@ -12,7 +12,6 @@ import "./interfaces/IERC20.sol"; import "./interfaces/IFeePool.sol"; import "./interfaces/IRewardsDistribution.sol"; - // https://docs.synthetix.io/contracts/source/contracts/rewardsdistribution contract RewardsDistribution is Owned, IRewardsDistribution { using SafeMath for uint; diff --git a/contracts/RewardsDistributionRecipient.sol b/contracts/RewardsDistributionRecipient.sol index 9bbbcb7a85..a1e51151ea 100644 --- a/contracts/RewardsDistributionRecipient.sol +++ b/contracts/RewardsDistributionRecipient.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; - // https://docs.synthetix.io/contracts/source/contracts/rewardsdistributionrecipient contract RewardsDistributionRecipient is Owned { address public rewardsDistribution; diff --git a/contracts/SafeDecimalMath.sol b/contracts/SafeDecimalMath.sol index 7f9f1e0210..c5ce8c5492 100644 --- a/contracts/SafeDecimalMath.sol +++ b/contracts/SafeDecimalMath.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Libraries import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; - // https://docs.synthetix.io/contracts/source/libraries/safedecimalmath library SafeDecimalMath { using SafeMath for uint; diff --git a/contracts/ShortingRewards.sol b/contracts/ShortingRewards.sol index 0e5fcb8c7a..1c10b57701 100644 --- a/contracts/ShortingRewards.sol +++ b/contracts/ShortingRewards.sol @@ -16,7 +16,6 @@ import "./MixinResolver.sol"; import "./interfaces/ICollateralErc20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/stakingrewards contract ShortingRewards is IShortingRewards, RewardsDistributionRecipient, ReentrancyGuard, Pausable, MixinResolver { using SafeMath for uint256; diff --git a/contracts/StakingRewards.sol b/contracts/StakingRewards.sol index 6450ed9ec2..7b81feec7d 100644 --- a/contracts/StakingRewards.sol +++ b/contracts/StakingRewards.sol @@ -11,7 +11,6 @@ import "./interfaces/IStakingRewards.sol"; import "./RewardsDistributionRecipient.sol"; import "./Pausable.sol"; - // https://docs.synthetix.io/contracts/source/contracts/stakingrewards contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, ReentrancyGuard, Pausable { using SafeMath for uint256; diff --git a/contracts/State.sol b/contracts/State.sol index 25d31e58b4..547e15a21b 100644 --- a/contracts/State.sol +++ b/contracts/State.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; - // https://docs.synthetix.io/contracts/source/contracts/state contract State is Owned { // the address of the contract that can modify variables diff --git a/contracts/SupplySchedule.sol b/contracts/SupplySchedule.sol index 51be060ecd..f50add0ea9 100644 --- a/contracts/SupplySchedule.sol +++ b/contracts/SupplySchedule.sol @@ -13,7 +13,6 @@ import "./Proxy.sol"; import "./interfaces/ISynthetix.sol"; import "./interfaces/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/supplyschedule contract SupplySchedule is Owned, ISupplySchedule { using SafeMath for uint; diff --git a/contracts/Synth.sol b/contracts/Synth.sol index 35010ef7b5..2a15dbb9cf 100644 --- a/contracts/Synth.sol +++ b/contracts/Synth.sol @@ -13,7 +13,6 @@ import "./interfaces/IFeePool.sol"; import "./interfaces/IExchanger.sol"; import "./interfaces/IIssuer.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synth contract Synth is Owned, IERC20, ExternStateToken, MixinResolver, ISynth { /* ========== STATE VARIABLES ========== */ diff --git a/contracts/SynthUtil.sol b/contracts/SynthUtil.sol index ec9c30fbc6..5acaa11d9a 100644 --- a/contracts/SynthUtil.sol +++ b/contracts/SynthUtil.sol @@ -7,7 +7,6 @@ import "./interfaces/IExchangeRates.sol"; import "./interfaces/IAddressResolver.sol"; import "./interfaces/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synthutil contract SynthUtil { IAddressResolver public addressResolverProxy; diff --git a/contracts/Synthetix.sol b/contracts/Synthetix.sol index 9bd174bcbc..93200327de 100644 --- a/contracts/Synthetix.sol +++ b/contracts/Synthetix.sol @@ -8,7 +8,6 @@ import "./interfaces/IRewardEscrow.sol"; import "./interfaces/IRewardEscrowV2.sol"; import "./interfaces/ISupplySchedule.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synthetix contract Synthetix is BaseSynthetix { // ========== ADDRESS RESOLVER CONFIGURATION ========== @@ -128,11 +127,8 @@ contract Synthetix is BaseSynthetix { optionalProxy returns (bool) { - (uint totalRedeemed, uint amountLiquidated) = issuer().liquidateDelinquentAccount( - account, - susdAmount, - messageSender - ); + (uint totalRedeemed, uint amountLiquidated) = + issuer().liquidateDelinquentAccount(account, susdAmount, messageSender); emitAccountLiquidated(account, totalRedeemed, amountLiquidated, messageSender); diff --git a/contracts/SynthetixBridgeToBase.sol b/contracts/SynthetixBridgeToBase.sol index d1028a217e..6443b78108 100644 --- a/contracts/SynthetixBridgeToBase.sol +++ b/contracts/SynthetixBridgeToBase.sol @@ -15,7 +15,6 @@ import "./interfaces/ISynthetixBridgeToOptimism.sol"; // solhint-disable indent import "@eth-optimism/contracts/build/contracts/iOVM/bridge/iOVM_BaseCrossDomainMessenger.sol"; - contract SynthetixBridgeToBase is Owned, MixinSystemSettings, ISynthetixBridgeToBase { /* ========== ADDRESS RESOLVER CONFIGURATION ========== */ bytes32 private constant CONTRACT_EXT_MESSENGER = "ext:Messenger"; diff --git a/contracts/SynthetixBridgeToOptimism.sol b/contracts/SynthetixBridgeToOptimism.sol index c400d3a239..2e8d4ba9ce 100644 --- a/contracts/SynthetixBridgeToOptimism.sol +++ b/contracts/SynthetixBridgeToOptimism.sol @@ -17,7 +17,6 @@ import "./interfaces/ISynthetixBridgeToBase.sol"; // solhint-disable indent import "@eth-optimism/contracts/build/contracts/iOVM/bridge/iOVM_BaseCrossDomainMessenger.sol"; - contract SynthetixBridgeToOptimism is Owned, MixinSystemSettings, ISynthetixBridgeToOptimism { /* ========== ADDRESS RESOLVER CONFIGURATION ========== */ bytes32 private constant CONTRACT_EXT_MESSENGER = "ext:Messenger"; @@ -218,12 +217,13 @@ contract SynthetixBridgeToOptimism is Owned, MixinSystemSettings, ISynthetixBrid if (escrowedAccountBalance > 0) { // create message payload for L2 ISynthetixBridgeToBase bridgeToBase; - bytes memory messageData = abi.encodeWithSelector( - bridgeToBase.completeEscrowMigration.selector, - msg.sender, - escrowedAccountBalance, - vestingEntries - ); + bytes memory messageData = + abi.encodeWithSelector( + bridgeToBase.completeEscrowMigration.selector, + msg.sender, + escrowedAccountBalance, + vestingEntries + ); // relay the message to this contract on L2 via L1 Messenger messenger().sendMessage( synthetixBridgeToBase(), diff --git a/contracts/SynthetixEscrow.sol b/contracts/SynthetixEscrow.sol index fc3af8a527..e5e2ca6f20 100644 --- a/contracts/SynthetixEscrow.sol +++ b/contracts/SynthetixEscrow.sol @@ -12,7 +12,6 @@ import "./SafeDecimalMath.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/ISynthetix.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synthetixescrow contract SynthetixEscrow is Owned, LimitedSetup(8 weeks), IHasBalance { using SafeMath for uint; diff --git a/contracts/SynthetixState.sol b/contracts/SynthetixState.sol index 73aa3fbe11..c57b6567b6 100644 --- a/contracts/SynthetixState.sol +++ b/contracts/SynthetixState.sol @@ -8,7 +8,6 @@ import "./interfaces/ISynthetixState.sol"; // Libraries import "./SafeDecimalMath.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synthetixstate contract SynthetixState is Owned, State, ISynthetixState { using SafeMath for uint; diff --git a/contracts/SynthetixStateWithLimitedSetup.sol b/contracts/SynthetixStateWithLimitedSetup.sol index 4bfe8d622a..e49ceda55d 100644 --- a/contracts/SynthetixStateWithLimitedSetup.sol +++ b/contracts/SynthetixStateWithLimitedSetup.sol @@ -7,7 +7,6 @@ import "./SynthetixState.sol"; // Internal References import "./interfaces/IFeePool.sol"; - // https://docs.synthetix.io/contracts/source/contracts/synthetixstate contract SynthetixStateWithLimitedSetup is SynthetixState, LimitedSetup { IFeePool public feePool; diff --git a/contracts/SystemSettings.sol b/contracts/SystemSettings.sol index 403eabbd53..2d25b1d8b0 100644 --- a/contracts/SystemSettings.sol +++ b/contracts/SystemSettings.sol @@ -9,7 +9,6 @@ import "./interfaces/ISystemSettings.sol"; // Libraries import "./SafeDecimalMath.sol"; - // https://docs.synthetix.io/contracts/source/contracts/systemsettings contract SystemSettings is Owned, MixinSystemSettings, ISystemSettings { using SafeMath for uint; diff --git a/contracts/SystemStatus.sol b/contracts/SystemStatus.sol index 0f0cca2a5f..a9c65d1253 100644 --- a/contracts/SystemStatus.sol +++ b/contracts/SystemStatus.sol @@ -4,7 +4,6 @@ pragma solidity ^0.5.16; import "./Owned.sol"; import "./interfaces/ISystemStatus.sol"; - // https://docs.synthetix.io/contracts/source/contracts/systemstatus contract SystemStatus is Owned, ISystemStatus { mapping(bytes32 => mapping(address => Status)) public accessControl; diff --git a/contracts/TokenState.sol b/contracts/TokenState.sol index 7635b2d697..ed70cce919 100644 --- a/contracts/TokenState.sol +++ b/contracts/TokenState.sol @@ -4,7 +4,6 @@ pragma solidity ^0.5.16; import "./Owned.sol"; import "./State.sol"; - // https://docs.synthetix.io/contracts/source/contracts/tokenstate contract TokenState is Owned, State { /* ERC20 fields. */ diff --git a/contracts/TradingRewards.sol b/contracts/TradingRewards.sol index 6ebd30f31e..3a304806af 100644 --- a/contracts/TradingRewards.sol +++ b/contracts/TradingRewards.sol @@ -17,7 +17,6 @@ import "./SafeDecimalMath.sol"; import "./interfaces/ITradingRewards.sol"; import "./interfaces/IExchanger.sol"; - // https://docs.synthetix.io/contracts/source/contracts/tradingrewards contract TradingRewards is ITradingRewards, ReentrancyGuard, Owned, Pausable, MixinResolver { using SafeMath for uint; diff --git a/contracts/VirtualSynth.sol b/contracts/VirtualSynth.sol index 884e918fa4..886cfffb92 100644 --- a/contracts/VirtualSynth.sol +++ b/contracts/VirtualSynth.sol @@ -15,7 +15,6 @@ import "./interfaces/IExchanger.sol"; // during the build import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/contracts/virtualsynth contract VirtualSynth is ERC20, IVirtualSynth { using SafeMath for uint; diff --git a/contracts/interfaces/IAddressResolver.sol b/contracts/interfaces/IAddressResolver.sol index 5788b25b03..ee28f36b5b 100644 --- a/contracts/interfaces/IAddressResolver.sol +++ b/contracts/interfaces/IAddressResolver.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver interface IAddressResolver { function getAddress(bytes32 name) external view returns (address); diff --git a/contracts/interfaces/IBinaryOption.sol b/contracts/interfaces/IBinaryOption.sol index 1b852fcbd4..13b3a99226 100644 --- a/contracts/interfaces/IBinaryOption.sol +++ b/contracts/interfaces/IBinaryOption.sol @@ -3,7 +3,6 @@ pragma solidity >=0.4.24; import "../interfaces/IBinaryOptionMarket.sol"; import "../interfaces/IERC20.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/ibinaryoption interface IBinaryOption { /* ========== VIEWS / VARIABLES ========== */ diff --git a/contracts/interfaces/IBinaryOptionMarket.sol b/contracts/interfaces/IBinaryOptionMarket.sol index 179fc7881e..bbab7ea9eb 100644 --- a/contracts/interfaces/IBinaryOptionMarket.sol +++ b/contracts/interfaces/IBinaryOptionMarket.sol @@ -3,7 +3,6 @@ pragma solidity >=0.4.24; import "../interfaces/IBinaryOptionMarketManager.sol"; import "../interfaces/IBinaryOption.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/ibinaryoptionmarket interface IBinaryOptionMarket { /* ========== TYPES ========== */ diff --git a/contracts/interfaces/IBinaryOptionMarketManager.sol b/contracts/interfaces/IBinaryOptionMarketManager.sol index e5167cce26..224ddd18a1 100644 --- a/contracts/interfaces/IBinaryOptionMarketManager.sol +++ b/contracts/interfaces/IBinaryOptionMarketManager.sol @@ -2,7 +2,6 @@ pragma solidity >=0.4.24; import "../interfaces/IBinaryOptionMarket.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/ibinaryoptionmarketmanager interface IBinaryOptionMarketManager { /* ========== VIEWS / VARIABLES ========== */ diff --git a/contracts/interfaces/ICollateralErc20.sol b/contracts/interfaces/ICollateralErc20.sol index 5762598a0e..127888d9c2 100644 --- a/contracts/interfaces/ICollateralErc20.sol +++ b/contracts/interfaces/ICollateralErc20.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - interface ICollateralErc20 { function open( uint collateral, diff --git a/contracts/interfaces/ICollateralEth.sol b/contracts/interfaces/ICollateralEth.sol index c042d9bf75..a9e14fff9b 100644 --- a/contracts/interfaces/ICollateralEth.sol +++ b/contracts/interfaces/ICollateralEth.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - interface ICollateralEth { function open(uint amount, bytes32 currency) external payable; diff --git a/contracts/interfaces/ICollateralLoan.sol b/contracts/interfaces/ICollateralLoan.sol index 3bdf845855..0d93894d37 100644 --- a/contracts/interfaces/ICollateralLoan.sol +++ b/contracts/interfaces/ICollateralLoan.sol @@ -2,7 +2,6 @@ pragma solidity >=0.4.24; pragma experimental ABIEncoderV2; - interface ICollateralLoan { struct Loan { // ID for the loan diff --git a/contracts/interfaces/ICollateralManager.sol b/contracts/interfaces/ICollateralManager.sol index b6cd3b316b..1c388b724e 100644 --- a/contracts/interfaces/ICollateralManager.sol +++ b/contracts/interfaces/ICollateralManager.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - interface ICollateralManager { // Manager information function hasCollateral(address collateral) external view returns (bool); diff --git a/contracts/interfaces/IDebtCache.sol b/contracts/interfaces/IDebtCache.sol index 1a3be9a6fa..192931d87a 100644 --- a/contracts/interfaces/IDebtCache.sol +++ b/contracts/interfaces/IDebtCache.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - interface IDebtCache { // Views diff --git a/contracts/interfaces/IDelegateApprovals.sol b/contracts/interfaces/IDelegateApprovals.sol index 85ffff900d..56bbf30081 100644 --- a/contracts/interfaces/IDelegateApprovals.sol +++ b/contracts/interfaces/IDelegateApprovals.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/idelegateapprovals interface IDelegateApprovals { // Views diff --git a/contracts/interfaces/IDepot.sol b/contracts/interfaces/IDepot.sol index e6fd06f533..2be2d57935 100644 --- a/contracts/interfaces/IDepot.sol +++ b/contracts/interfaces/IDepot.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/idepot interface IDepot { // Views diff --git a/contracts/interfaces/IERC20.sol b/contracts/interfaces/IERC20.sol index 66dc30032c..09605277eb 100644 --- a/contracts/interfaces/IERC20.sol +++ b/contracts/interfaces/IERC20.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/ierc20 interface IERC20 { // ERC20 Optional Views diff --git a/contracts/interfaces/IEtherCollateral.sol b/contracts/interfaces/IEtherCollateral.sol index ce8debfb0a..f83b57ac8a 100644 --- a/contracts/interfaces/IEtherCollateral.sol +++ b/contracts/interfaces/IEtherCollateral.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iethercollateral interface IEtherCollateral { // Views diff --git a/contracts/interfaces/IEtherCollateralsUSD.sol b/contracts/interfaces/IEtherCollateralsUSD.sol index 1fde43581d..d825709876 100644 --- a/contracts/interfaces/IEtherCollateralsUSD.sol +++ b/contracts/interfaces/IEtherCollateralsUSD.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iethercollateralsusd interface IEtherCollateralsUSD { // Views diff --git a/contracts/interfaces/IExchangeRates.sol b/contracts/interfaces/IExchangeRates.sol index 62e9c964d9..33cc69fe6e 100644 --- a/contracts/interfaces/IExchangeRates.sol +++ b/contracts/interfaces/IExchangeRates.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iexchangerates interface IExchangeRates { // Structs diff --git a/contracts/interfaces/IExchangeState.sol b/contracts/interfaces/IExchangeState.sol index 9fcde7abf6..58c4c71dee 100644 --- a/contracts/interfaces/IExchangeState.sol +++ b/contracts/interfaces/IExchangeState.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iexchangestate interface IExchangeState { // Views diff --git a/contracts/interfaces/IExchanger.sol b/contracts/interfaces/IExchanger.sol index 4531cfad77..d6f7d50e78 100644 --- a/contracts/interfaces/IExchanger.sol +++ b/contracts/interfaces/IExchanger.sol @@ -2,7 +2,6 @@ pragma solidity >=0.4.24; import "./IVirtualSynth.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/iexchanger interface IExchanger { // Views diff --git a/contracts/interfaces/IFeePool.sol b/contracts/interfaces/IFeePool.sol index 5827997946..809126e606 100644 --- a/contracts/interfaces/IFeePool.sol +++ b/contracts/interfaces/IFeePool.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/ifeepool interface IFeePool { // Views diff --git a/contracts/interfaces/IFlexibleStorage.sol b/contracts/interfaces/IFlexibleStorage.sol index 532b160e3a..4419f638be 100644 --- a/contracts/interfaces/IFlexibleStorage.sol +++ b/contracts/interfaces/IFlexibleStorage.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iflexiblestorage interface IFlexibleStorage { // Views diff --git a/contracts/interfaces/IHasBalance.sol b/contracts/interfaces/IHasBalance.sol index d41188a1d8..c9c3587bf3 100644 --- a/contracts/interfaces/IHasBalance.sol +++ b/contracts/interfaces/IHasBalance.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/ihasbalance interface IHasBalance { // Views diff --git a/contracts/interfaces/IIssuer.sol b/contracts/interfaces/IIssuer.sol index b0b41f5b13..43b3f258d1 100644 --- a/contracts/interfaces/IIssuer.sol +++ b/contracts/interfaces/IIssuer.sol @@ -2,7 +2,6 @@ pragma solidity >=0.4.24; import "../interfaces/ISynth.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/iissuer interface IIssuer { // Views diff --git a/contracts/interfaces/ILiquidations.sol b/contracts/interfaces/ILiquidations.sol index ef54cab5a5..3f8ce332da 100644 --- a/contracts/interfaces/ILiquidations.sol +++ b/contracts/interfaces/ILiquidations.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/iliquidations interface ILiquidations { // Views diff --git a/contracts/interfaces/IRewardEscrow.sol b/contracts/interfaces/IRewardEscrow.sol index 4373eedc26..a1627d86a3 100644 --- a/contracts/interfaces/IRewardEscrow.sol +++ b/contracts/interfaces/IRewardEscrow.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/irewardescrow interface IRewardEscrow { // Views diff --git a/contracts/interfaces/IRewardEscrowV2.sol b/contracts/interfaces/IRewardEscrowV2.sol index 77f76f64aa..7596ea8480 100644 --- a/contracts/interfaces/IRewardEscrowV2.sol +++ b/contracts/interfaces/IRewardEscrowV2.sol @@ -1,7 +1,6 @@ pragma solidity >=0.4.24; pragma experimental ABIEncoderV2; - library VestingEntries { struct VestingEntry { uint64 endTime; @@ -14,7 +13,6 @@ library VestingEntries { } } - interface IRewardEscrowV2 { // Views function balanceOf(address account) external view returns (uint); diff --git a/contracts/interfaces/IRewardsDistribution.sol b/contracts/interfaces/IRewardsDistribution.sol index cc0fc30ed5..dfb41cafdf 100644 --- a/contracts/interfaces/IRewardsDistribution.sol +++ b/contracts/interfaces/IRewardsDistribution.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/irewardsdistribution interface IRewardsDistribution { // Structs diff --git a/contracts/interfaces/IShortingRewards.sol b/contracts/interfaces/IShortingRewards.sol index b41ad87bf2..8e77cd5cf0 100644 --- a/contracts/interfaces/IShortingRewards.sol +++ b/contracts/interfaces/IShortingRewards.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/istakingrewards interface IShortingRewards { // Views diff --git a/contracts/interfaces/IStakingRewards.sol b/contracts/interfaces/IStakingRewards.sol index 7f68eb9fb4..6275b4437b 100644 --- a/contracts/interfaces/IStakingRewards.sol +++ b/contracts/interfaces/IStakingRewards.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/istakingrewards interface IStakingRewards { // Views diff --git a/contracts/interfaces/ISupplySchedule.sol b/contracts/interfaces/ISupplySchedule.sol index 4f72f677dc..b277650bab 100644 --- a/contracts/interfaces/ISupplySchedule.sol +++ b/contracts/interfaces/ISupplySchedule.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/isupplyschedule interface ISupplySchedule { // Views diff --git a/contracts/interfaces/ISynth.sol b/contracts/interfaces/ISynth.sol index 8734168d93..60a4027fd4 100644 --- a/contracts/interfaces/ISynth.sol +++ b/contracts/interfaces/ISynth.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/isynth interface ISynth { // Views diff --git a/contracts/interfaces/ISynthetix.sol b/contracts/interfaces/ISynthetix.sol index 0a1ad97ab5..78298f745c 100644 --- a/contracts/interfaces/ISynthetix.sol +++ b/contracts/interfaces/ISynthetix.sol @@ -3,7 +3,6 @@ pragma solidity >=0.4.24; import "./ISynth.sol"; import "./IVirtualSynth.sol"; - // https://docs.synthetix.io/contracts/source/interfaces/isynthetix interface ISynthetix { // Views diff --git a/contracts/interfaces/ISynthetixBridgeToBase.sol b/contracts/interfaces/ISynthetixBridgeToBase.sol index 2d029669ea..3538b5b4fa 100644 --- a/contracts/interfaces/ISynthetixBridgeToBase.sol +++ b/contracts/interfaces/ISynthetixBridgeToBase.sol @@ -3,7 +3,6 @@ pragma experimental ABIEncoderV2; import "./IRewardEscrowV2.sol"; - interface ISynthetixBridgeToBase { // invoked by users on L2 function initiateWithdrawal(uint amount) external; diff --git a/contracts/interfaces/ISynthetixBridgeToOptimism.sol b/contracts/interfaces/ISynthetixBridgeToOptimism.sol index aad3e59bf0..e867cfb81f 100644 --- a/contracts/interfaces/ISynthetixBridgeToOptimism.sol +++ b/contracts/interfaces/ISynthetixBridgeToOptimism.sol @@ -1,7 +1,6 @@ pragma solidity >=0.4.24; pragma experimental ABIEncoderV2; - interface ISynthetixBridgeToOptimism { // Invoked by the relayer on L1 function completeWithdrawal(address account, uint amount) external; diff --git a/contracts/interfaces/ISynthetixState.sol b/contracts/interfaces/ISynthetixState.sol index f50eeb15a3..3070ea5f22 100644 --- a/contracts/interfaces/ISynthetixState.sol +++ b/contracts/interfaces/ISynthetixState.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/isynthetixstate interface ISynthetixState { // Views diff --git a/contracts/interfaces/ISystemSettings.sol b/contracts/interfaces/ISystemSettings.sol index a2263a4a16..42740aa2a2 100644 --- a/contracts/interfaces/ISystemSettings.sol +++ b/contracts/interfaces/ISystemSettings.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/isystemsettings interface ISystemSettings { // Views diff --git a/contracts/interfaces/ISystemStatus.sol b/contracts/interfaces/ISystemStatus.sol index ce3c90b8c3..737a19bcd2 100644 --- a/contracts/interfaces/ISystemStatus.sol +++ b/contracts/interfaces/ISystemStatus.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/isystemstatus interface ISystemStatus { struct Status { diff --git a/contracts/interfaces/ITradingRewards.sol b/contracts/interfaces/ITradingRewards.sol index ea5a147721..7bc8e6d71b 100644 --- a/contracts/interfaces/ITradingRewards.sol +++ b/contracts/interfaces/ITradingRewards.sol @@ -1,6 +1,5 @@ pragma solidity >=0.4.24; - // https://docs.synthetix.io/contracts/source/interfaces/itradingrewards interface ITradingRewards { /* ========== VIEWS ========== */ diff --git a/contracts/interfaces/IVirtualSynth.sol b/contracts/interfaces/IVirtualSynth.sol index 58a1fda4ac..ca6cb8b2b1 100644 --- a/contracts/interfaces/IVirtualSynth.sol +++ b/contracts/interfaces/IVirtualSynth.sol @@ -2,7 +2,6 @@ pragma solidity >=0.4.24; import "./ISynth.sol"; - interface IVirtualSynth { // Views function balanceOfUnderlying(address account) external view returns (uint); diff --git a/contracts/test-helpers/FakeTradingRewards.sol b/contracts/test-helpers/FakeTradingRewards.sol index 2f44a0eec1..6d346f28d5 100644 --- a/contracts/test-helpers/FakeTradingRewards.sol +++ b/contracts/test-helpers/FakeTradingRewards.sol @@ -6,7 +6,6 @@ import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/ERC20Detailed.sol"; import "../interfaces/IExchanger.sol"; - contract FakeTradingRewards is TradingRewards { IERC20 public _mockSynthetixToken; diff --git a/contracts/test-helpers/GenericMock.sol b/contracts/test-helpers/GenericMock.sol index 0306f1da98..4ac99df2f6 100644 --- a/contracts/test-helpers/GenericMock.sol +++ b/contracts/test-helpers/GenericMock.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; - contract GenericMock { mapping(bytes4 => bytes) public mockConfig; diff --git a/contracts/test-helpers/MockAggregatorV2V3.sol b/contracts/test-helpers/MockAggregatorV2V3.sol index d2011071eb..0ef1d22cbd 100644 --- a/contracts/test-helpers/MockAggregatorV2V3.sol +++ b/contracts/test-helpers/MockAggregatorV2V3.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - interface AggregatorV2V3Interface { function latestRound() external view returns (uint256); @@ -33,7 +32,6 @@ interface AggregatorV2V3Interface { ); } - contract MockAggregatorV2V3 is AggregatorV2V3Interface { uint80 public roundId = 0; uint8 public keyDecimals = 0; diff --git a/contracts/test-helpers/MockBinaryOptionMarket.sol b/contracts/test-helpers/MockBinaryOptionMarket.sol index 54c980875b..bcc5f25b67 100644 --- a/contracts/test-helpers/MockBinaryOptionMarket.sol +++ b/contracts/test-helpers/MockBinaryOptionMarket.sol @@ -4,7 +4,6 @@ import "../BinaryOption.sol"; import "../SafeDecimalMath.sol"; - contract MockBinaryOptionMarket { using SafeDecimalMath for uint; diff --git a/contracts/test-helpers/MockBinaryOptionMarketManager.sol b/contracts/test-helpers/MockBinaryOptionMarketManager.sol index 98a06bce25..cd3d562ea7 100644 --- a/contracts/test-helpers/MockBinaryOptionMarketManager.sol +++ b/contracts/test-helpers/MockBinaryOptionMarketManager.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../BinaryOptionMarket.sol"; import "../AddressResolver.sol"; - contract MockBinaryOptionMarketManager { BinaryOptionMarket public market; bool public paused = false; diff --git a/contracts/test-helpers/MockContractStorage.sol b/contracts/test-helpers/MockContractStorage.sol index 316cd17847..220aa9915f 100644 --- a/contracts/test-helpers/MockContractStorage.sol +++ b/contracts/test-helpers/MockContractStorage.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../ContractStorage.sol"; - contract MockContractStorage is ContractStorage { struct SomeEntry { uint value; diff --git a/contracts/test-helpers/MockEtherCollateral.sol b/contracts/test-helpers/MockEtherCollateral.sol index 733996210d..39faa0b6f4 100644 --- a/contracts/test-helpers/MockEtherCollateral.sol +++ b/contracts/test-helpers/MockEtherCollateral.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../SafeDecimalMath.sol"; - contract MockEtherCollateral { using SafeMath for uint; using SafeDecimalMath for uint; diff --git a/contracts/test-helpers/MockExchanger.sol b/contracts/test-helpers/MockExchanger.sol index 09525c876e..6f2bcdd286 100644 --- a/contracts/test-helpers/MockExchanger.sol +++ b/contracts/test-helpers/MockExchanger.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../interfaces/ISynthetix.sol"; - contract MockExchanger { uint256 private _mockReclaimAmount; uint256 private _mockRefundAmount; diff --git a/contracts/test-helpers/MockFlagsInterface.sol b/contracts/test-helpers/MockFlagsInterface.sol index 57318047fe..55f6f86bd9 100644 --- a/contracts/test-helpers/MockFlagsInterface.sol +++ b/contracts/test-helpers/MockFlagsInterface.sol @@ -1,13 +1,11 @@ pragma solidity ^0.5.16; - interface FlagsInterface { function getFlag(address) external view returns (bool); function getFlags(address[] calldata) external view returns (bool[] memory); } - contract MockFlagsInterface is FlagsInterface { mapping(address => bool) public flags; diff --git a/contracts/test-helpers/MockMintableSynthetix.sol b/contracts/test-helpers/MockMintableSynthetix.sol index 7fbd82c0d0..08ed289291 100644 --- a/contracts/test-helpers/MockMintableSynthetix.sol +++ b/contracts/test-helpers/MockMintableSynthetix.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - contract MockMintableSynthetix { address public mintSecondaryCallAccount; uint public mintSecondaryCallAmount; diff --git a/contracts/test-helpers/MockMutator.sol b/contracts/test-helpers/MockMutator.sol index 8a38bf22c8..6731b761a0 100644 --- a/contracts/test-helpers/MockMutator.sol +++ b/contracts/test-helpers/MockMutator.sol @@ -1,6 +1,5 @@ pragma solidity ^0.5.16; - contract MockMutator { uint256 public count; diff --git a/contracts/test-helpers/MockRewardsRecipient.sol b/contracts/test-helpers/MockRewardsRecipient.sol index e70246c65f..ba439d5784 100644 --- a/contracts/test-helpers/MockRewardsRecipient.sol +++ b/contracts/test-helpers/MockRewardsRecipient.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../RewardsDistributionRecipient.sol"; import "../Owned.sol"; - contract MockRewardsRecipient is RewardsDistributionRecipient { uint256 public rewardsAvailable; diff --git a/contracts/test-helpers/MockSynth.sol b/contracts/test-helpers/MockSynth.sol index 08d7b12054..67205b12b5 100644 --- a/contracts/test-helpers/MockSynth.sol +++ b/contracts/test-helpers/MockSynth.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../ExternStateToken.sol"; import "../interfaces/ISystemStatus.sol"; - // Mock synth that also adheres to system status contract MockSynth is ExternStateToken { diff --git a/contracts/test-helpers/MockToken.sol b/contracts/test-helpers/MockToken.sol index b53d5e1e0a..c2a8865d2b 100644 --- a/contracts/test-helpers/MockToken.sol +++ b/contracts/test-helpers/MockToken.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/ERC20Detailed.sol"; - contract MockToken is ERC20, ERC20Detailed { constructor( string memory name, diff --git a/contracts/test-helpers/OneWeekSetup.sol b/contracts/test-helpers/OneWeekSetup.sol index 741defb41f..0ca86e323c 100644 --- a/contracts/test-helpers/OneWeekSetup.sol +++ b/contracts/test-helpers/OneWeekSetup.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../LimitedSetup.sol"; - contract OneWeekSetup is LimitedSetup(1 weeks) { function testFunc() public view onlyDuringSetup returns (bool) { return true; diff --git a/contracts/test-helpers/PublicEST.sol b/contracts/test-helpers/PublicEST.sol index d9ae5acb90..8ccdf23fa4 100644 --- a/contracts/test-helpers/PublicEST.sol +++ b/contracts/test-helpers/PublicEST.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../ExternStateToken.sol"; - contract PublicEST is ExternStateToken { uint8 public constant DECIMALS = 18; diff --git a/contracts/test-helpers/PublicEST8Decimals.sol b/contracts/test-helpers/PublicEST8Decimals.sol index 200a755be7..a1018db3b3 100644 --- a/contracts/test-helpers/PublicEST8Decimals.sol +++ b/contracts/test-helpers/PublicEST8Decimals.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../ExternStateToken.sol"; - contract PublicEST8Decimals is ExternStateToken { uint8 public constant DECIMALS = 8; diff --git a/contracts/test-helpers/PublicMath.sol b/contracts/test-helpers/PublicMath.sol index 4350663f57..16ce63c952 100644 --- a/contracts/test-helpers/PublicMath.sol +++ b/contracts/test-helpers/PublicMath.sol @@ -5,7 +5,6 @@ pragma solidity ^0.5.16; import "../Math.sol"; - contract PublicMath { using Math for uint; diff --git a/contracts/test-helpers/PublicSafeDecimalMath.sol b/contracts/test-helpers/PublicSafeDecimalMath.sol index c8de4479f3..cfee49aeb9 100644 --- a/contracts/test-helpers/PublicSafeDecimalMath.sol +++ b/contracts/test-helpers/PublicSafeDecimalMath.sol @@ -5,7 +5,6 @@ pragma solidity ^0.5.16; import "../SafeDecimalMath.sol"; - contract PublicSafeDecimalMath { using SafeDecimalMath for uint; diff --git a/contracts/test-helpers/SwapWithVirtualSynth.sol b/contracts/test-helpers/SwapWithVirtualSynth.sol index d0eab35312..f3d8ae2b8a 100644 --- a/contracts/test-helpers/SwapWithVirtualSynth.sol +++ b/contracts/test-helpers/SwapWithVirtualSynth.sol @@ -12,7 +12,6 @@ import "../interfaces/IAddressResolver.sol"; import "../interfaces/IVirtualSynth.sol"; import "../interfaces/IExchanger.sol"; - interface IERC20Detailed { // ERC20 Optional Views function name() external view returns (string memory); @@ -45,7 +44,6 @@ interface IERC20Detailed { event Approval(address indexed owner, address indexed spender, uint value); } - interface ICurvePool { function exchange( int128 i, @@ -55,7 +53,6 @@ interface ICurvePool { ) external; } - contract VirtualToken is ERC20 { using SafeMath for uint; using SafeDecimalMath for uint; @@ -144,7 +141,6 @@ contract VirtualToken is ERC20 { event Settled(uint totalSupply, uint amountAfterSettled); } - contract SwapWithVirtualSynth { ICurvePool public incomingPool = ICurvePool(0xA5407eAE9Ba41422680e2e00537571bcC53efBfD); // Curve: sUSD v2 Swap ICurvePool public outgoingPool = ICurvePool(0x7fC77b5c7614E1533320Ea6DDc2Eb61fa00A9714); // Curve: sBTC Swap diff --git a/contracts/test-helpers/TestableAddressSet.sol b/contracts/test-helpers/TestableAddressSet.sol index f29f216d5d..4037d3b665 100644 --- a/contracts/test-helpers/TestableAddressSet.sol +++ b/contracts/test-helpers/TestableAddressSet.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../AddressSetLib.sol"; - contract TestableAddressSet { using AddressSetLib for AddressSetLib.AddressSet; diff --git a/contracts/test-helpers/TestableBinaryOptionMarket.sol b/contracts/test-helpers/TestableBinaryOptionMarket.sol index 809d4ab96f..8edde3d0eb 100644 --- a/contracts/test-helpers/TestableBinaryOptionMarket.sol +++ b/contracts/test-helpers/TestableBinaryOptionMarket.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../BinaryOptionMarket.sol"; - contract TestableBinaryOptionMarket is BinaryOptionMarket { constructor( address _owner, diff --git a/contracts/test-helpers/TestableBytes32Set.sol b/contracts/test-helpers/TestableBytes32Set.sol index 754ca7269a..1a2c75b6f2 100644 --- a/contracts/test-helpers/TestableBytes32Set.sol +++ b/contracts/test-helpers/TestableBytes32Set.sol @@ -2,7 +2,6 @@ pragma solidity ^0.5.16; import "../Bytes32SetLib.sol"; - contract TestableBytes32Set { using Bytes32SetLib for Bytes32SetLib.Bytes32Set; diff --git a/contracts/test-helpers/TestableDebtCache.sol b/contracts/test-helpers/TestableDebtCache.sol index 55ab26716c..6b01c61125 100644 --- a/contracts/test-helpers/TestableDebtCache.sol +++ b/contracts/test-helpers/TestableDebtCache.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; // Inheritance import "../DebtCache.sol"; - contract TestableDebtCache is DebtCache { constructor(address _owner, address _resolver) public DebtCache(_owner, _resolver) {} diff --git a/contracts/test-helpers/TestableMixinResolver.sol b/contracts/test-helpers/TestableMixinResolver.sol index d1d4413bfc..68406c2999 100644 --- a/contracts/test-helpers/TestableMixinResolver.sol +++ b/contracts/test-helpers/TestableMixinResolver.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../Owned.sol"; import "../MixinResolver.sol"; - contract TestableMixinResolver is Owned, MixinResolver { bytes32 private constant CONTRACT_EXAMPLE_1 = "Example_1"; bytes32 private constant CONTRACT_EXAMPLE_2 = "Example_2"; diff --git a/contracts/test-helpers/TestablePausable.sol b/contracts/test-helpers/TestablePausable.sol index a6c97f86f5..3fd69ac2c9 100644 --- a/contracts/test-helpers/TestablePausable.sol +++ b/contracts/test-helpers/TestablePausable.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../Owned.sol"; import "../Pausable.sol"; - /** * @title An implementation of Pausable. Used to test the features of the Pausable contract that can only be tested by an implementation. */ diff --git a/contracts/test-helpers/TestableState.sol b/contracts/test-helpers/TestableState.sol index 9c0bfe4bac..55bc3ae0fa 100644 --- a/contracts/test-helpers/TestableState.sol +++ b/contracts/test-helpers/TestableState.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../Owned.sol"; import "../State.sol"; - contract TestableState is Owned, State { constructor(address _owner, address _associatedContract) public Owned(_owner) State(_associatedContract) {} diff --git a/contracts/test-helpers/TokenExchanger.sol b/contracts/test-helpers/TokenExchanger.sol index 7a83bbafc8..bab7c0ec30 100644 --- a/contracts/test-helpers/TokenExchanger.sol +++ b/contracts/test-helpers/TokenExchanger.sol @@ -8,7 +8,6 @@ import "../interfaces/ISynthetix.sol"; import "../interfaces/IFeePool.sol"; import "../interfaces/IERC20.sol"; - contract TokenExchanger is Owned { address public integrationProxy; address public synthetix; diff --git a/contracts/test-helpers/UsingReadProxy.sol b/contracts/test-helpers/UsingReadProxy.sol index 41f4625d7d..5df33a0691 100644 --- a/contracts/test-helpers/UsingReadProxy.sol +++ b/contracts/test-helpers/UsingReadProxy.sol @@ -3,7 +3,6 @@ pragma solidity ^0.5.16; import "../interfaces/IAddressResolver.sol"; import "../interfaces/IExchangeRates.sol"; - contract UsingReadProxy { IAddressResolver public resolver; diff --git a/package-lock.json b/package-lock.json index 0c1b95e7e1..8e7d295df8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26680,9 +26680,9 @@ } }, "node_modules/prettier-plugin-solidity": { - "version": "1.0.0-beta.6", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.6.tgz", - "integrity": "sha512-WymLqd22Hl93t5+HDNLk08TAWp4i4vZMhpihuVqkwOApjCT7mH1qwhLtvf3m+NdU//qj8vrPDmMoT+xc74skcg==", + "version": "1.0.0-beta.7", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.7.tgz", + "integrity": "sha512-WKvIlriIPj81szmmaP2WLq0Sgs0yKiYlSiBV9W7KCE59BBbwMndKB3ZIjdy/bpyGLUA1XQndXYapivA8LgJ+4A==", "dev": true, "dependencies": { "@solidity-parser/parser": "^0.12.0", @@ -26690,12 +26690,12 @@ "emoji-regex": "^9.2.1", "escape-string-regexp": "^4.0.0", "prettier": "^2.2.1", - "semver": "^7.3.4", + "semver": "^7.3.5", "solidity-comments-extractor": "^0.0.4", "string-width": "^4.2.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { @@ -34221,6 +34221,15 @@ "dependencies": { "default-require-extensions": "^3.0.0" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/yaml-validator/node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "extraneous": true, "engines": { "node": ">=8" } @@ -34326,7 +34335,7 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "extraneous": true, "engines": { - "node": ">=6" + "node": ">=4.0" } }, "node_modules/yaml-validator/node_modules/camelcase": { @@ -64123,14 +64132,13 @@ "to-regex": "^3.0.2" } }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "isexe": "^2.0.0" } } }