-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Marcin M <[email protected]> Co-authored-by: Dennis <[email protected]> Co-authored-by: Shahar Kaminsky <[email protected]> Co-authored-by: Vlad Bochok <[email protected]> Co-authored-by: koloz193 <[email protected]> Co-authored-by: AntonD3 <[email protected]>
- Loading branch information
1 parent
b6286ef
commit ef5e5f7
Showing
81 changed files
with
6,057 additions
and
3,532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import {DEPLOYER_SYSTEM_CONTRACT, NONCE_HOLDER_SYSTEM_CONTRACT, CURRENT_MAX_PREC | |
|
||
/** | ||
* @author Matter Labs | ||
* @custom:security-contact [email protected] | ||
* @notice The storage of this contract serves as a mapping for the code hashes of the 32-byte account addresses. | ||
* @dev Code hash is not strictly a hash, it's a structure where the first byte denotes the version of the hash, | ||
* the second byte denotes whether the contract is constructed, and the next two bytes denote the length in 32-byte words. | ||
|
@@ -44,7 +45,7 @@ contract AccountCodeStorage is IAccountCodeStorage { | |
/// but checks whether the bytecode hash corresponds to the constructed smart contract. | ||
function storeAccountConstructedCodeHash(address _address, bytes32 _hash) external override onlyDeployer { | ||
// Check that code hash corresponds to the deploying smart contract | ||
require(Utils.isContractConstructed(_hash), "Code hash is not for a contract on constructor"); | ||
require(Utils.isContractConstructed(_hash), "Code hash is not for a constructed contract"); | ||
_storeCodeHash(_address, _hash); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import "./libraries/EfficientCall.sol"; | |
|
||
/** | ||
* @author Matter Labs | ||
* @custom:security-contact [email protected] | ||
* @notice A contract that provides some utility methods for the bootloader | ||
* that is very hard to write in Yul. | ||
*/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,25 +2,23 @@ | |
|
||
pragma solidity ^0.8.0; | ||
|
||
import "./interfaces/IComplexUpgrader.sol"; | ||
import {IComplexUpgrader} from "./interfaces/IComplexUpgrader.sol"; | ||
import {FORCE_DEPLOYER} from "./Constants.sol"; | ||
|
||
/** | ||
* @author Matter Labs | ||
* @custom:security-contact [email protected] | ||
* @notice Upgrader which should be used to perform complex multistep upgrades on L2. In case some custom logic for an upgrade is needed | ||
* this logic should be deployed into the user space and then this contract will delegatecall to the deployed contract. | ||
*/ | ||
contract ComplexUpgrader is IComplexUpgrader { | ||
/// @notice Executes an upgrade process by delegating calls to another contract. | ||
/// @dev This function allows only the `FORCE_DEPLOYER` to initiate the upgrade. | ||
/// @dev This function allows only the `FORCE_DEPLOYER` to initiate the upgrade. | ||
/// If the delegate call fails, the function will revert the transaction, returning the error message | ||
/// provided by the delegated contract. | ||
/// @param _delegateTo the address of the contract to which the calls will be delegated | ||
/// @param _calldata the calldata to be delegate called in the `_delegateTo` contract | ||
function upgrade( | ||
address _delegateTo, | ||
bytes calldata _calldata | ||
) external payable { | ||
function upgrade(address _delegateTo, bytes calldata _calldata) external payable { | ||
require(msg.sender == FORCE_DEPLOYER, "Can only be called by FORCE_DEPLOYER"); | ||
|
||
require(_delegateTo.code.length > 0, "Delegatee is an EOA"); | ||
|
Oops, something went wrong.