Skip to content

Commit

Permalink
check sol file lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmorphl2 committed May 15, 2024
1 parent 0f9f9e3 commit a198171
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 52 deletions.
4 changes: 1 addition & 3 deletions contracts/contracts/l2/staking/Distribute.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Own
import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";

import {Predeploys} from "../../libraries/constants/Predeploys.sol";
import {IL2Staking} from "./IL2Staking.sol";
import {IRecord} from "./IRecord.sol";
import {IDistribute} from "./IDistribute.sol";
import {IMorphToken} from "../system/IMorphToken.sol";

Expand Down Expand Up @@ -290,7 +288,7 @@ contract Distribute is IDistribute, OwnableUpgradeable {
) external view returns (uint256 reward) {
uint256 totalAmount;
uint256 delegatorAmount;
uint start = unclaimed[delegator].unclaimedStart[delegatee];
uint256 start = unclaimed[delegator].unclaimedStart[delegatee];
for (uint256 i = start; i < mintedEpochCount; i++) {
if (distributions[delegatee][i].amounts[delegator] > 0) {
delegatorAmount = distributions[delegatee][i].amounts[
Expand Down
3 changes: 1 addition & 2 deletions contracts/contracts/l2/staking/Gov.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/util
import {Predeploys} from "../../libraries/constants/Predeploys.sol";
import {ISequencer} from "./ISequencer.sol";
import {IGov} from "./IGov.sol";
import {IL2Staking} from "./IL2Staking.sol";

contract Gov is IGov, OwnableUpgradeable {
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
Expand Down Expand Up @@ -297,7 +296,7 @@ contract Gov is IGov, OwnableUpgradeable {
address[] memory latestSequencerSet = ISequencer(SEQUENCER_CONTRACT)
.getSequencerSet2();
uint256 validVotes = 0;
for (uint i = 0; i < latestSequencerSet.length; i++) {
for (uint256 i = 0; i < latestSequencerSet.length; i++) {
if (votes[proposalID].contains(latestSequencerSet[i])) {
validVotes = validVotes + 1;
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/contracts/l2/staking/IRecord.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {Types} from "../../libraries/common/Types.sol";

interface IRecord {
/***********
* Structs *
Expand Down
3 changes: 0 additions & 3 deletions contracts/contracts/l2/staking/Record.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ pragma solidity =0.8.24;
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import {Predeploys} from "../../libraries/constants/Predeploys.sol";
import {Types} from "../../libraries/common/Types.sol";
import {IMorphToken} from "../system/IMorphToken.sol";
import {IL2Staking} from "./IL2Staking.sol";
import {ISequencer} from "./ISequencer.sol";
import {IDistribute} from "./IDistribute.sol";
import {IGov} from "./IGov.sol";
import {IRecord} from "./IRecord.sol";

contract Record is IRecord, OwnableUpgradeable {
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/l2/staking/Sequencer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity =0.8.24;

import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import {Types} from "../../libraries/common/Types.sol";
import {Predeploys} from "../../libraries/constants/Predeploys.sol";
import {ISequencer} from "./ISequencer.sol";

Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/Gov.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity =0.8.24;

import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol";
import {Gov} from "../l2/staking/Gov.sol";
import {IGov} from "../l2/staking/IGov.sol";
import {Types} from "../libraries/common/Types.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
Expand Down
5 changes: 2 additions & 3 deletions contracts/contracts/test/L1CrossDomainMessenger.t.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {L1MessageQueueWithGasPriceOracle} from "../l1/rollup/L1MessageQueueWithGasPriceOracle.sol";
import {IL1CrossDomainMessenger} from "../l1/L1CrossDomainMessenger.sol";
import {IRollup} from "../l1/rollup/IRollup.sol";
import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {L1MessageBaseTest} from "./base/L1MessageBase.t.sol";

contract L1CrossDomainMessengerTest is L1MessageBaseTest {
uint256 L1CrossDomainMessenger_provenWithdrawals_slot = 251;
address refundAddress = address(2048);
uint256 public l1CrossDomainMessengerProvenWithdrawalsSlot = 251;
address public refundAddress = address(2048);

function test_proveWithdrawalTransaction_relayMessage_succeeds() external {
// tx msg set
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/L1CustomERC20Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {L1GatewayBaseTest} from "./base/L1GatewayBase.t.sol";
import {L1CustomERC20Gateway} from "../l1/gateways/L1CustomERC20Gateway.sol";
import {L1GatewayRouter} from "../l1/gateways/L1GatewayRouter.sol";
import {IL1ERC20Gateway} from "../l1/gateways/IL1ERC20Gateway.sol";
import {L2CustomERC20Gateway} from "../l2/gateways/L2CustomERC20Gateway.sol";
import {IL1MessageQueue} from "../l1/rollup/IL1MessageQueue.sol";
import {IL2ERC20Gateway} from "../l2/gateways/IL2ERC20Gateway.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
Expand Down
4 changes: 2 additions & 2 deletions contracts/contracts/test/L1ERC721Gateway.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import "@rari-capital/solmate/src/test/utils/mocks/MockERC721.sol";
import "@rari-capital/solmate/src/tokens/ERC721.sol";
import {MockERC721} from "@rari-capital/solmate/src/test/utils/mocks/MockERC721.sol";
import {ERC721TokenReceiver} from "@rari-capital/solmate/src/tokens/ERC721.sol";

import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
Expand Down
3 changes: 1 addition & 2 deletions contracts/contracts/test/L1ETHGateway.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {IL1MessageQueue} from "../l1/rollup/IL1MessageQueue.sol";
Expand All @@ -10,7 +9,7 @@ import {IL1ETHGateway} from "../l1/gateways/IL1ETHGateway.sol";
import {L1GatewayBaseTest} from "./base/L1GatewayBase.t.sol";

contract L1ETHGatewayTest is L1GatewayBaseTest {
address counterpartGateway;
address public counterpartGateway;

function setUp() public virtual override {
super.setUp();
Expand Down
4 changes: 1 addition & 3 deletions contracts/contracts/test/L1MessageQueue.t.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {IL1MessageQueue} from "../l1/rollup/IL1MessageQueue.sol";
import {L1MessageBaseTest} from "./base/L1MessageBase.t.sol";
import {L1MessageQueueWithGasPriceOracle} from "../l1/rollup/L1MessageQueueWithGasPriceOracle.sol";

contract L1MessageQueueTest is L1MessageBaseTest {
L1MessageQueueWithGasPriceOracle l1MessageQueue;
L1MessageQueueWithGasPriceOracle public l1MessageQueue;

function setUp() public virtual override {
super.setUp();
Expand Down
3 changes: 1 addition & 2 deletions contracts/contracts/test/L1StandardERC20Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity =0.8.24;

import {MockERC20} from "@rari-capital/solmate/src/test/utils/mocks/MockERC20.sol";

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {IL2ERC20Gateway} from "../l2/gateways/IL2ERC20Gateway.sol";
Expand All @@ -14,7 +13,7 @@ import {FeeOnTransferToken} from "../mock/tokens/FeeOnTransferToken.sol";
import {L1GatewayBaseTest} from "./base/L1GatewayBase.t.sol";

contract L1StandardERC20GatewayTest is L1GatewayBaseTest {
address counterpartGateway;
address public counterpartGateway;
MockERC20 private l1Token;
MockERC20 private l2Token;
TransferReentrantToken private reentrantToken;
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/L2CrossDomainMessenger.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity =0.8.24;
import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {Tree} from "../libraries/common/Tree.sol";
import {L2MessageBaseTest} from "./base/L2MessageBase.t.sol";

contract L2CrossDomainMessengerTest is L2MessageBaseTest {
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/L2CustomERC20Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {MockERC20} from "@rari-capital/solmate/src/test/utils/mocks/MockERC20.so

import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2CustomERC20Gateway} from "../l2/gateways/L2CustomERC20Gateway.sol";
import {L2GatewayRouter} from "../l2/gateways/L2GatewayRouter.sol";
import {IL2ERC20Gateway} from "../l2/gateways/IL2ERC20Gateway.sol";
Expand Down
3 changes: 0 additions & 3 deletions contracts/contracts/test/L2ERC1155Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ pragma solidity =0.8.24;
import {MockERC1155} from "@rari-capital/solmate/src/test/utils/mocks/MockERC1155.sol";
import {ERC1155TokenReceiver} from "@rari-capital/solmate/src/tokens/ERC1155.sol";

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2GatewayBaseTest} from "./base/L2GatewayBase.t.sol";
import {L1ERC1155Gateway} from "../l1/gateways/L1ERC1155Gateway.sol";
import {L2ERC1155Gateway} from "../l2/gateways/L2ERC1155Gateway.sol";
import {MockCrossDomainMessenger} from "../mock/MockCrossDomainMessenger.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";

contract L2ERC1155GatewayTest is L2GatewayBaseTest, ERC1155TokenReceiver {
uint256 private constant TOKEN_COUNT = 100;
Expand Down
3 changes: 0 additions & 3 deletions contracts/contracts/test/L2ERC721Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ pragma solidity =0.8.24;

import {MockERC721} from "@rari-capital/solmate/src/test/utils/mocks/MockERC721.sol";

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2GatewayBaseTest} from "./base/L2GatewayBase.t.sol";
import {L1ERC721Gateway} from "../l1/gateways/L1ERC721Gateway.sol";
import {L2ERC721Gateway} from "../l2/gateways/L2ERC721Gateway.sol";
import {MockCrossDomainMessenger} from "../mock/MockCrossDomainMessenger.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";

contract L2ERC721GatewayTest is L2GatewayBaseTest {
uint256 private constant TOKEN_COUNT = 100;
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/L2ETHGateway.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2ToL1MessagePasser} from "../l2/system/L2ToL1MessagePasser.sol";
import {IL2ETHGateway} from "../l2/gateways/IL2ETHGateway.sol";
import {L2ETHGateway} from "../l2/gateways/L2ETHGateway.sol";
Expand Down
3 changes: 0 additions & 3 deletions contracts/contracts/test/L2GatewayRouter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ pragma solidity =0.8.24;

import {MockERC20} from "@rari-capital/solmate/src/test/utils/mocks/MockERC20.sol";

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2GatewayBaseTest} from "./base/L2GatewayBase.t.sol";
import {L2GatewayRouter} from "../l2/gateways/L2GatewayRouter.sol";
import {IL2GatewayRouter} from "../l2/gateways/IL2GatewayRouter.sol";
import {L2CrossDomainMessenger} from "../l2/L2CrossDomainMessenger.sol";

import {MockCrossDomainMessenger} from "../mock/MockCrossDomainMessenger.sol";

contract L2GatewayRouterTest is L2GatewayBaseTest {
L2GatewayRouter private router;
L2CrossDomainMessenger private l2Messenger;
Expand Down
2 changes: 0 additions & 2 deletions contracts/contracts/test/L2Staking.t.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {L2Staking} from "../l2/staking/L2Staking.sol";
import {IRecord} from "../l2/staking/IRecord.sol";
import {Types} from "../libraries/common/Types.sol";
import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";

Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/L2StandardERC20Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pragma solidity =0.8.24;

import {MockERC20} from "@rari-capital/solmate/src/test/utils/mocks/MockERC20.sol";

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {IMorphStandardERC20Factory} from "../libraries/token/IMorphStandardERC20Factory.sol";
Expand Down
2 changes: 0 additions & 2 deletions contracts/contracts/test/L2WETHGateway.t.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import {MockERC20} from "@rari-capital/solmate/src/test/utils/mocks/MockERC20.sol";
import {WETH} from "@rari-capital/solmate/src/tokens/WETH.sol";

import {L2GatewayBaseTest} from "./base/L2GatewayBase.t.sol";
import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol";
import {AddressAliasHelper} from "../libraries/common/AddressAliasHelper.sol";
import {L2ToL1MessagePasser} from "../l2/system/L2ToL1MessagePasser.sol";
Expand Down
1 change: 0 additions & 1 deletion contracts/contracts/test/MorphToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity =0.8.24;

import {Predeploys} from "../libraries/constants/Predeploys.sol";
import {Types} from "../libraries/common/Types.sol";
import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol";

contract MorphTokenTest is L2StakingBaseTest {
Expand Down
19 changes: 10 additions & 9 deletions contracts/contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.24;

import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import {ChunkCodecV0} from "../libraries/codec/ChunkCodecV0.sol";
import {L1MessageQueueWithGasPriceOracle} from "../l1/rollup/L1MessageQueueWithGasPriceOracle.sol";
import {L1MessageBaseTest} from "./base/L1MessageBase.t.sol";
import {Types} from "../libraries/common/Types.sol";
import {Rollup} from "../l1/rollup/Rollup.sol";
import {IRollup} from "../l1/rollup/IRollup.sol";
import {IL1Staking} from "../l1/staking/IL1Staking.sol";

contract RollupCommitBatchTest is L1MessageBaseTest {
address public caller = address(0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84);
bytes32 public stateRoot = bytes32(uint256(1));
IRollup.BatchDataInput batchDataInput;
IRollup.BatchSignatureInput batchSignatureInput;
IRollup.BatchDataInput public batchDataInput;
IRollup.BatchSignatureInput public batchSignatureInput;

function setUp() public virtual override {
super.setUp();
Expand Down Expand Up @@ -328,7 +324,12 @@ contract RollupCommitBatchTest is L1MessageBaseTest {
)
);

// 0x01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000bc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98abc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98abc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a
// 0x
// 0100000000000000000000000000000000000000000000000000000000000000
// 0000000000000000000000000000000000000000000000000000030000bc3678
// 9e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98abc3678
// 9e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98abc3678
// 9e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a
batchDataInput = IRollup.BatchDataInput(
0,
batchHeader1,
Expand Down Expand Up @@ -395,8 +396,8 @@ contract RollupCommitBatchTest is L1MessageBaseTest {
contract RollupTest is L1MessageBaseTest {
address public caller = address(0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84);
bytes32 public stateRoot = bytes32(uint256(1));
IRollup.BatchDataInput batchDataInput;
IRollup.BatchSignatureInput batchSignatureInput;
IRollup.BatchDataInput public batchDataInput;
IRollup.BatchSignatureInput public batchSignatureInput;

function setUp() public virtual override {
super.setUp();
Expand Down

0 comments on commit a198171

Please sign in to comment.