Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Clean lint warnings #1712

Merged
merged 9 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion markets/legacy-market/contracts/LegacyMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract LegacyMarket is ILegacyMarket, Ownable, UUPSImplementation, IMarket {
bool public pauseMigration;

// used by _migrate to temporarily set reportedDebt to another value before
uint256 tmpLockedDebt;
uint256 internal tmpLockedDebt;

IAddressResolver public v2xResolver;
IV3CoreProxy public v3System;
Expand All @@ -38,6 +38,7 @@ contract LegacyMarket is ILegacyMarket, Ownable, UUPSImplementation, IMarket {
error InsufficientCollateralMigrated(uint256 amountRequested, uint256 amountAvailable);
error Paused();

// solhint-disable-next-line no-empty-blocks
constructor() Ownable(msg.sender) {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ pragma solidity >=0.8.11 <0.9.0;
import {IAtomicOrderModule} from "@synthetixio/spot-market/contracts/interfaces/IAtomicOrderModule.sol";
import {ISpotMarketFactoryModule} from "@synthetixio/spot-market/contracts/interfaces/ISpotMarketFactoryModule.sol";

interface ISpotMarketSystem is IAtomicOrderModule, ISpotMarketFactoryModule {}
// solhint-disable-next-line no-empty-blocks
interface ISpotMarketSystem is IAtomicOrderModule, ISpotMarketFactoryModule {

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import {IAssociatedSystemsModule} from "@synthetixio/core-modules/contracts/inte
import {IMarketManagerModule} from "@synthetixio/main/contracts/interfaces/IMarketManagerModule.sol";
import {IUtilsModule} from "@synthetixio/main/contracts/interfaces/IUtilsModule.sol";

interface ISynthetixSystem is IAssociatedSystemsModule, IMarketManagerModule, IUtilsModule {}
// solhint-disable-next-line no-empty-blocks
interface ISynthetixSystem is IAssociatedSystemsModule, IMarketManagerModule, IUtilsModule {

}
3 changes: 2 additions & 1 deletion markets/perps-market/contracts/mocks/MockPyth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import {MockPyth as BaseMockPyth} from "@synthetixio/oracle-manager/contracts/mo
* @title Module for connecting to other systems.
* See oracle-manager/../MockPyth
*/
// solhint-disable-next-line no-empty-blocks
contract MockPyth is BaseMockPyth {
// solhint-disable no-empty-blocks
constructor(
uint _validTimePeriod,
uint _singleUpdateFeeInWei
) BaseMockPyth(_validTimePeriod, _singleUpdateFeeInWei) {}
// solhint-enable no-empty-blocks
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import "@synthetixio/main/contracts/interfaces/IMarketManagerModule.sol";
import "@synthetixio/main/contracts/interfaces/IMarketCollateralModule.sol";
import "@synthetixio/main/contracts/interfaces/IUtilsModule.sol";

// solhint-disable no-empty-blocks
interface ISynthetixSystem is
IAssociatedSystemsModule,
IMarketCollateralModule,
IMarketManagerModule,
IUtilsModule
{}
{

}
// solhint-enable no-empty-blocks
5 changes: 5 additions & 0 deletions markets/spot-market/contracts/mocks/FeeCollectorMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ contract FeeCollectorMock is IFeeCollector {
address sender,
uint8 tradeType
) external override returns (uint256) {
// mention the variables in the block to prevent unused local variable warning
marketId;
sender;
tradeType;

uint256 feeToCollect = feeAmount / 2;
return feeToCollect;
}
Expand Down
8 changes: 8 additions & 0 deletions markets/spot-market/contracts/mocks/OracleVerifierMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ contract OracleVerifierMock is IPythVerifier, IChainlinkVerifier {
uint64 minPublishTime,
uint64 maxPublishTime
) external payable override returns (IPythVerifier.PriceFeed[] memory priceFeeds) {
// mention the variables in the block to prevent unused local variable warning
updateData;
maxPublishTime;

priceFeeds = new IPythVerifier.PriceFeed[](1);

priceFeeds[0] = IPythVerifier.PriceFeed({
Expand All @@ -41,12 +45,16 @@ contract OracleVerifierMock is IPythVerifier, IChainlinkVerifier {
function verify(
bytes memory chainlinkBlob
) external view override returns (bytes memory verifierResponse) {
// mention the variables in the block to prevent unused local variable warning
chainlinkBlob;
// solhint-disable-next-line numcast/safe-cast
int192 priceFormatted = int192(price) * 10 ** 18;
verifierResponse = abi.encode("ETH-USD", block.timestamp, 10, priceFormatted);
}

function getUpdateFee(uint256 updateDataSize) external view override returns (uint256) {
// mention the variables in the block to prevent unused local variable warning
updateDataSize;
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "@synthetixio/core-contracts/contracts/utils/SafeCast.sol";
* @title Module with custom NFT logic for the account token.
* @dev See IAccountTokenModule.
*/
// solhint-disable-next-line no-empty-blocks
contract CouncilTokenModule is ICouncilTokenModule, NftModule {

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract ElectionCredentials is ElectionBase {
using Council for Council.Data;
using AssociatedSystem for AssociatedSystem.Data;

bytes32 constant _COUNCIL_NFT_SYSTEM = "councilToken";
bytes32 internal constant _COUNCIL_NFT_SYSTEM = "councilToken";

function _removeAllCouncilMembers(uint epochIndex) internal {
SetUtil.AddressSet storage members = Council.load().councilMembers;
Expand Down
8 changes: 4 additions & 4 deletions protocol/oracle-manager/contracts/mocks/pyth/MockPyth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import "./PythStructs.sol";
import "./PythErrors.sol";

contract MockPyth is AbstractPyth {
mapping(bytes32 => PythStructs.PriceFeed) priceFeeds;
uint64 sequenceNumber;
mapping(bytes32 => PythStructs.PriceFeed) internal priceFeeds;
uint64 internal sequenceNumber;

uint singleUpdateFeeInWei;
uint validTimePeriod;
uint internal singleUpdateFeeInWei;
uint internal validTimePeriod;

constructor(uint _validTimePeriod, uint _singleUpdateFeeInWei) {
singleUpdateFeeInWei = _singleUpdateFeeInWei;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity >=0.8.11 <0.9.0;
import "@synthetixio/oracle-manager/contracts/interfaces/INodeModule.sol";

/// @title Effective interface for the oracle manager
// solhint-disable-next-line no-empty-blocks
interface IOracleManager is INodeModule {

}
2 changes: 2 additions & 0 deletions protocol/synthetix/contracts/mocks/CcipRouterMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity >=0.8.4;
import "../interfaces/external/ICcipRouterClient.sol";

contract CcipRouterMock {
// solhint-disable no-empty-blocks
function ccipSend(
uint64 destinationChainId,
CcipClient.EVM2AnyMessage calldata message
Expand All @@ -13,4 +14,5 @@ contract CcipRouterMock {
uint64 destinationChainId,
CcipClient.EVM2AnyMessage memory message
) external view virtual returns (uint256 fee) {}
// solhint-enable no-empty-blocks
}
1 change: 1 addition & 0 deletions protocol/synthetix/contracts/storage/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ library Vault {
/**
* @dev The previous debt of the vault, when `updateCreditCapacity` was last called by the Pool.
*/
// solhint-disable-next-line var-name-mixedcase
int128 _unused_prevTotalDebtD18;
/**
* @dev Vault data for all the liquidation cycles divided into epochs.
Expand Down
Loading