Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Aug 16, 2024
1 parent baf463c commit eaeb812
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import {MailboxFacet} from "../../state-transition/chain-deps/facets/Mailbox.sol
import {FeeParams, PubdataPricingMode} from "../../state-transition/chain-deps/ZkSyncHyperchainStorage.sol";

contract DummyHyperchain is MailboxFacet {
constructor(address bridgeHubAddress, uint256 _eraChainId, uint256 _l1ChainId) MailboxFacet(_eraChainId, _l1ChainId) {
constructor(
address bridgeHubAddress,
uint256 _eraChainId,
uint256 _l1ChainId
) MailboxFacet(_eraChainId, _l1ChainId) {
s.bridgehub = bridgeHubAddress;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract AdminFacet is ZkSyncHyperchainBase, IAdmin {
L1_CHAIN_ID = _l1ChainId;
}

modifier onlyL1 {
modifier onlyL1() {
require(block.chainid == L1_CHAIN_ID, "AdminFacet: not L1");
_;
}
Expand Down Expand Up @@ -100,7 +100,10 @@ contract AdminFacet is ZkSyncHyperchainBase, IAdmin {
}

/// @inheritdoc IAdmin
function setTokenMultiplier(uint128 _nominator, uint128 _denominator) external onlyAdminOrStateTransitionManager onlyL1 {
function setTokenMultiplier(
uint128 _nominator,
uint128 _denominator
) external onlyAdminOrStateTransitionManager onlyL1 {
require(_denominator != 0, "AF: denominator 0");
uint128 oldNominator = s.baseTokenGasPriceMultiplierNominator;
uint128 oldDenominator = s.baseTokenGasPriceMultiplierDenominator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract MailboxFacet is ZkSyncHyperchainBase, IMailbox {
/// L1 that is at the most base layer.
uint256 internal immutable L1_CHAIN_ID;

modifier onlyL1 {
modifier onlyL1() {
require(block.chainid == L1_CHAIN_ID, "MailboxFacet: not L1");
_;
}
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/deploy-scripts/DeployL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ contract DeployL1Script is Script {
console.log("ExecutorFacet deployed at:", executorFacet);
addresses.stateTransition.executorFacet = executorFacet;

address adminFacet = deployViaCreate2(abi.encodePacked(type(AdminFacet).creationCode, abi.encode(config.l1ChainId)));
address adminFacet = deployViaCreate2(
abi.encodePacked(type(AdminFacet).creationCode, abi.encode(config.l1ChainId))
);
console.log("AdminFacet deployed at:", adminFacet);
addresses.stateTransition.adminFacet = adminFacet;

Expand Down
14 changes: 12 additions & 2 deletions l1-contracts/src.ts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,12 @@ export class Deployer {
}

public async deployAdminFacet(create2Salt: string, ethTxOptions: ethers.providers.TransactionRequest) {
const contractAddress = await this.deployViaCreate2("AdminFacet", [await this.getL1ChainId()], create2Salt, ethTxOptions);
const contractAddress = await this.deployViaCreate2(
"AdminFacet",
[await this.getL1ChainId()],
create2Salt,
ethTxOptions
);

if (this.verbose) {
console.log(`CONTRACTS_ADMIN_FACET_ADDR=${contractAddress}`);
Expand All @@ -570,7 +575,12 @@ export class Deployer {

public async deployMailboxFacet(create2Salt: string, ethTxOptions: ethers.providers.TransactionRequest) {
const eraChainId = getNumberFromEnv("CONTRACTS_ERA_CHAIN_ID");
const contractAddress = await this.deployViaCreate2("MailboxFacet", [eraChainId, await this.getL1ChainId()], create2Salt, ethTxOptions);
const contractAddress = await this.deployViaCreate2(
"MailboxFacet",
[eraChainId, await this.getL1ChainId()],
create2Salt,
ethTxOptions
);

if (this.verbose) {
console.log(`Mailbox deployed with era chain id: ${eraChainId}`);
Expand Down
5 changes: 4 additions & 1 deletion l1-contracts/test/unit_tests/mailbox_test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ describe("Mailbox tests", function () {

before(async () => {
const mailboxTestContractFactory = await hardhat.ethers.getContractFactory("MailboxFacetTest");
const mailboxTestContract = await mailboxTestContractFactory.deploy(chainId, await mailboxTestContractFactory.signer.getChainId());
const mailboxTestContract = await mailboxTestContractFactory.deploy(
chainId,
await mailboxTestContractFactory.signer.getChainId()
);
testContract = MailboxFacetTestFactory.connect(mailboxTestContract.address, mailboxTestContract.signer);

// Generating 10 more gas prices for test suit
Expand Down

0 comments on commit eaeb812

Please sign in to comment.