Skip to content

Commit

Permalink
Fix audittens I08 (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless authored Nov 29, 2024
1 parent 19262a2 commit f7364fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract AdminFacet is ZKChainBase, IAdmin {
}

/// @inheritdoc IAdmin
function setPriorityTxMaxGasLimit(uint256 _newPriorityTxMaxGasLimit) external onlyChainTypeManager {
function setPriorityTxMaxGasLimit(uint256 _newPriorityTxMaxGasLimit) external onlyChainTypeManager onlyL1 {
if (_newPriorityTxMaxGasLimit > MAX_GAS_PER_TRANSACTION) {
revert TooMuchGas();
}
Expand Down Expand Up @@ -111,7 +111,7 @@ contract AdminFacet is ZKChainBase, IAdmin {
}

/// @inheritdoc IAdmin
function setTokenMultiplier(uint128 _nominator, uint128 _denominator) external onlyAdminOrChainTypeManager {
function setTokenMultiplier(uint128 _nominator, uint128 _denominator) external onlyAdminOrChainTypeManager onlyL1 {
if (_denominator == 0) {
revert DenominatorIsZero();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,16 @@ abstract contract SharedL2ContractDeployer is Test, DeployUtils {
new bytes[](0)
);

uint256 currentChainId = block.chainid;

// This function is available only on L1 (and it is correct),
// but inside testing we need to call this function to recreate commitment
vm.chainId(L1_CHAIN_ID);
vm.prank(chainAdmin);
AdminFacet(chainAddress).setTokenMultiplier(1, 1);

vm.chainId(currentChainId);

// Now, let's also append a priority transaction for a more representative example
bytes[] memory deps = new bytes[](0);

Expand Down

0 comments on commit f7364fb

Please sign in to comment.