Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from matter-labs/vb-fix-oz-keccak256-audit-n-01
Browse files Browse the repository at this point in the history
Add missing Comments for temporary functions in Bootloader and ContractDeployer
  • Loading branch information
StanislavBreadless authored Nov 21, 2023
2 parents d2001f6 + 40d31d5 commit 6903d17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions bootloader/bootloader.yul
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ object "Bootloader" {
}
}

/// @dev The function that is temporarily needed to upgrade the Keccak256 precompile. This function and `ContractDeployer:forceDeployKeccak256`
/// are to be removed once the upgrade is complete.
/// @dev Checks whether the code hash of the Keccak256 precompile contract is correct and updates it if needed.
/// @dev When we upgrade to the new version of the Keccak256 precompile contract, the keccak precompile will not work correctly
/// and so the upgrade it should be done before any `keccak` calls.
Expand Down
10 changes: 5 additions & 5 deletions contracts/ContractDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ contract ContractDeployer is IContractDeployer, ISystemContract {
);
}

/// @notice The method that is temporarily needed to upgrade the Keccak256 precompile. It is to be removed in the
/// future. Unlike a normal forced deployment, it does not update account information as it requires updating a
/// mapping, and so requires Keccak256 precompile to work already.
/// @dev This method expects the sender (FORCE_DEPLOYER) to provide the correct bytecode hash for the Keccak256
/// precompile.
/// @notice The method that is temporarily needed to upgrade the Keccak256 precompile. This function and `Bootloader:upgradeKeccakIfNeeded`
/// are to be removed once the upgrade is complete. Unlike a normal forced deployment, it does not update account information as it requires
/// updating a mapping, and so requires Keccak256 precompile to work already.
/// @dev This method expects the sender (FORCE_DEPLOYER) to provide the correct bytecode hash for the Keccak256
/// precompile.
function forceDeployKeccak256(bytes32 _keccak256BytecodeHash) external payable onlyCallFrom(FORCE_DEPLOYER) {
_ensureBytecodeIsKnown(_keccak256BytecodeHash);

Expand Down

0 comments on commit 6903d17

Please sign in to comment.