Skip to content

Commit

Permalink
Fix: code4rena issues (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbochok authored Mar 6, 2024
1 parent 6e14c97 commit f29f2b7
Show file tree
Hide file tree
Showing 27 changed files with 54 additions and 1,264 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/contracts/governance/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract Governance is IGovernance, Ownable2Step {
//////////////////////////////////////////////////////////////*/

/// @dev Returns whether an id corresponds to a registered operation. This
/// includes both Waiting, Ready, and Done operations.
/// includes Waiting, Ready, and Done operations.
function isOperation(bytes32 _id) public view returns (bool) {
return getOperationState(_id) != OperationState.Unset;
}
Expand Down
4 changes: 1 addition & 3 deletions l1-contracts/contracts/zksync/facets/Mailbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ contract MailboxFacet is Base, IMailbox {
_l2GasLimit,
_l2GasPerPubdataByteLimit,
_factoryDeps,
false,
_refundRecipient
);
}
Expand All @@ -233,7 +232,6 @@ contract MailboxFacet is Base, IMailbox {
uint256 _l2GasLimit,
uint256 _l2GasPerPubdataByteLimit,
bytes[] calldata _factoryDeps,
bool _isFree,
address _refundRecipient
) internal returns (bytes32 canonicalTxHash) {
require(_factoryDeps.length <= MAX_NEW_FACTORY_DEPS, "uj");
Expand All @@ -246,7 +244,7 @@ contract MailboxFacet is Base, IMailbox {
// Checking that the user provided enough ether to pay for the transaction.
// Using a new scope to prevent "stack too deep" error
{
params.l2GasPrice = _isFree ? 0 : _deriveL2GasPrice(tx.gasprice, _l2GasPerPubdataByteLimit);
params.l2GasPrice = _deriveL2GasPrice(tx.gasprice, _l2GasPerPubdataByteLimit);
uint256 baseCost = params.l2GasPrice * _l2GasLimit;
require(msg.value >= baseCost + _l2Value, "mv"); // The `msg.value` doesn't cover the transaction cost
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion l1-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {
},
contractSizer: {
runOnCompile: false,
except: ["dev-contracts", "zksync/upgrade-initializers", "zksync/libraries", "common/libraries"],
except: ["dev-contracts", "zksync/libraries", "common/libraries"],
},
paths: {
sources: "./contracts",
Expand Down
6 changes: 0 additions & 6 deletions l1-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
"initialize-governance": "ts-node scripts/initialize-governance.ts",
"migrate-governance": "ts-node scripts/migrate-governance.ts",
"display-governance": "ts-node scripts/display-governance.ts",
"upgrade-1": "ts-node scripts/upgrades/upgrade-1.ts",
"upgrade-2": "ts-node scripts/upgrades/upgrade-2.ts",
"upgrade-3": "ts-node scripts/upgrades/upgrade-3.ts",
"upgrade-4": "ts-node scripts/upgrades/upgrade-4.ts",
"upgrade-5": "ts-node scripts/upgrades/upgrade-5.ts",
"upgrade-6": "ts-node scripts/upgrades/upgrade-6.ts",
"upgrade-system": "ts-node upgrade-system/index.ts"
},
"dependencies": {
Expand Down
10 changes: 0 additions & 10 deletions l1-contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ async function main() {
return;
}

// Deploy diamond upgrade init contract if needed
const diamondUpgradeContractVersion = cmd.diamondUpgradeInit || 1;
if (diamondUpgradeContractVersion) {
await deployer.deployDiamondUpgradeInit(create2Salt, diamondUpgradeContractVersion, {
gasPrice,
nonce,
});
nonce++;
}

await deployer.deployDefaultUpgrade(create2Salt, {
gasPrice,
nonce,
Expand Down
Loading

0 comments on commit f29f2b7

Please sign in to comment.