Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Jan 9, 2024
1 parent e43564d commit e5e8153
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 17 deletions.
10 changes: 6 additions & 4 deletions l1-contracts/contracts/bridge/L1ERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ contract L1ERC20Bridge is IL1Bridge, IL1BridgeLegacy, ReentrancyGuard {

/// @dev A mapping L2 batch number => message number => flag
/// @dev Used to indicate that zkSync L2 -> L1 message was already processed
mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized)) public isWithdrawalFinalized;
mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized))
public isWithdrawalFinalized;

/// @dev A mapping account => L1 token address => L2 deposit transaction hash => amount
/// @dev Used for saving the number of deposited funds, to claim them in case the deposit transaction will fail
mapping(address account => mapping(address l1Token => mapping(bytes32 depositL2TxHash => uint256 amount))) internal depositAmount;
mapping(address account => mapping(address l1Token => mapping(bytes32 depositL2TxHash => uint256 amount)))
internal depositAmount;

/// @dev The address of deployed L2 bridge counterpart
address public l2Bridge;
Expand Down Expand Up @@ -130,7 +132,7 @@ contract L1ERC20Bridge is IL1Bridge, IL1BridgeLegacy, ReentrancyGuard {
/// @notice Legacy deposit method with refunding the fee to the caller, use another `deposit` method instead.
/// @dev Initiates a deposit by locking funds on the contract and sending the request
/// of processing an L2 transaction where tokens would be minted.
/// @dev If the token is bridged for the first time, the L2 token contract will be deployed. Note however, that the
/// @dev If the token is bridged for the first time, the L2 token contract will be deployed. Note however, that the
/// newly-deployed token does not support any custom logic, i.e. rebase tokens' functionality is not supported.
/// @param _l2Receiver The account address that should receive funds on L2
/// @param _l1Token The L1 token address which is deposited
Expand All @@ -151,7 +153,7 @@ contract L1ERC20Bridge is IL1Bridge, IL1BridgeLegacy, ReentrancyGuard {

/// @notice Initiates a deposit by locking funds on the contract and sending the request
/// of processing an L2 transaction where tokens would be minted
/// @dev If the token is bridged for the first time, the L2 token contract will be deployed. Note however, that the
/// @dev If the token is bridged for the first time, the L2 token contract will be deployed. Note however, that the
/// newly-deployed token does not support any custom logic, i.e. rebase tokens' functionality is not supported.
/// @param _l2Receiver The account address that should receive funds on L2
/// @param _l1Token The L1 token address which is deposited
Expand Down
3 changes: 2 additions & 1 deletion l1-contracts/contracts/bridge/L1WethBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ contract L1WethBridge is IL1Bridge, ReentrancyGuard {

/// @dev A mapping L2 batch number => message number => flag
/// @dev Used to indicate that zkSync L2 -> L1 WETH message was already processed
mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized)) public isWithdrawalFinalized;
mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized))
public isWithdrawalFinalized;

/// @dev Contract is expected to be used as proxy implementation.
/// @dev Initialize the implementation to prevent Parity hack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pragma solidity 0.8.20;
import "../../bridge/L1ERC20Bridge.sol";
import {IMailbox} from "../../zksync/interfaces/IMailbox.sol";


/// @author Matter Labs
contract L1ERC20BridgeTest is L1ERC20Bridge {
constructor(IZkSync _zkSync) L1ERC20Bridge(_zkSync) {}
Expand Down
4 changes: 1 addition & 3 deletions l1-contracts/contracts/zksync/interfaces/IZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ import {IGetters} from "./IGetters.sol";
/// @author Matter Labs
/// @dev This interface combines the interfaces of all the facets of the zkSync contract.
/// @custom:security-contact security@matterlabs
interface IZkSync is IMailbox, IAdmin, IExecutor, IGetters {

}
interface IZkSync is IMailbox, IAdmin, IExecutor, IGetters {}
3 changes: 2 additions & 1 deletion l1-contracts/contracts/zksync/libraries/Diamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ library Diamond {
0x33774e659306e47509050e97cb651e731180a42d458212294d30751925c551a2; // keccak256("diamond.zksync.init") - 1

/// @dev Storage position of `DiamondStorage` structure.
bytes32 private constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b; // keccak256("diamond.standard.diamond.storage") - 1;
bytes32 private constant DIAMOND_STORAGE_POSITION =
0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b; // keccak256("diamond.standard.diamond.storage") - 1;

event DiamondCut(FacetCut[] facetCuts, address initAddress, bytes initCalldata);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ contract AuthorizationTest is AdminTest {
bytes32 correctNewFeeParamsHash = keccak256(abi.encode(newParams));
bytes32 currentFeeParamsHash = keccak256(abi.encode(proxyAsGettersMock.getFeeParams()));

require(
currentFeeParamsHash == correctNewFeeParamsHash,
"Fee params were not changed correctly"
);
require(currentFeeParamsHash == correctNewFeeParamsHash, "Fee params were not changed correctly");
}

function test_changeFeeParams_RevertWhen_PriorityTxMaxPubdataHigherThanMaxPubdataPerBatch() public {
FeeParams memory newParams = FeeParams({
pubdataPricingMode: PubdataPricingMode.Rollup,
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/bridge/L2ERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {SystemContractsCaller} from "../SystemContractsCaller.sol";

/// @author Matter Labs
/// @custom:security-contact [email protected]
/// @notice The "default" bridge implementation for the ERC20 tokens. Note, that it does not
/// @notice The "default" bridge implementation for the ERC20 tokens. Note, that it does not
/// support any custom token logic, i.e. rebase tokens' functionality is not supported.
contract L2ERC20Bridge is IL2Bridge, Initializable {
/// @dev The address of the L1 bridge counterpart.
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/bridge/L2StandardERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {IL2StandardToken} from "./interfaces/IL2StandardToken.sol";

/// @author Matter Labs
/// @custom:security-contact [email protected]
/// @notice The ERC20 token implementation, that is used in the "default" ERC20 bridge. Note, that it does not
/// @notice The ERC20 token implementation, that is used in the "default" ERC20 bridge. Note, that it does not
/// support any custom token logic, i.e. rebase tokens' functionality is not supported.
contract L2StandardERC20 is ERC20PermitUpgradeable, IL2StandardToken, ERC1967Upgrade {
/// @dev Describes whether there is a specific getter in the token.
Expand Down

0 comments on commit e5e8153

Please sign in to comment.