Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sb-n07-library-fix-review' into …
Browse files Browse the repository at this point in the history
…ra/library-fix-review-merged-fixes
  • Loading branch information
Raid Ateir committed Oct 30, 2024
2 parents 086a8bd + e524304 commit 93d4bb9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions l1-contracts/contracts/common/libraries/DataEncoding.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ library DataEncoding {
}
}

/// @notice Decodes the token data by combining chain id, asset deployment tracker and asset data.
/// @notice Decodes the token data
/// @dev Note that all the returned metadata of the token is ABI encoded.
/// @return chainId The chainId of the origin of the token
/// @return name The name of the token.
/// @return symbol The symbol of the token.
/// @return decimals The decimals of the token.
function decodeTokenData(
bytes calldata _tokenData
) internal pure returns (uint256 chainId, bytes memory name, bytes memory symbol, bytes memory decimals) {
Expand All @@ -134,7 +139,8 @@ library DataEncoding {
}
}

/// @notice Encodes the token data by combining chain id, asset deployment tracker and asset data.
/// @notice Encodes the token data by combining chain id, and its metadata.
/// @dev Note that all the metadata of the token is expected to be ABI encoded.
/// @param _chainId The id of the chain token is native to.
/// @param _name The name of the token.
/// @param _symbol The symbol of the token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract CustomUpgradeTest is BaseZkSyncUpgrade {
/// upgrade.
function _postUpgrade(bytes calldata _customCallDataForUpgrade) internal override {}

/// @notice The main function that will be called by the upgrade proxy.
/// @notice The main function that will be delegate-called by the chain.
/// @param _proposedUpgrade The upgrade to be executed.
function upgrade(ProposedUpgrade calldata _proposedUpgrade) public override returns (bytes32) {
(uint32 newMinorVersion, bool isPatchOnly) = _setNewProtocolVersion(_proposedUpgrade.newProtocolVersion);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract contract BaseZkSyncUpgrade is ZKChainBase {
/// @notice Notifies about complete upgrade
event UpgradeComplete(uint256 indexed newProtocolVersion, bytes32 indexed l2UpgradeTxHash, ProposedUpgrade upgrade);

/// @notice The main function that will be provided by the upgrade proxy
/// @notice The main function that will be delegate-called by the chain.
/// @dev This is a virtual function and should be overridden by custom upgrade implementations.
/// @param _proposedUpgrade The upgrade to be executed.
/// @return txHash The hash of the L2 system contract upgrade transaction.
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/upgrades/DefaultUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {BaseZkSyncUpgrade, ProposedUpgrade} from "./BaseZkSyncUpgrade.sol";
/// @author Matter Labs
/// @custom:security-contact security@matterlabs.dev
contract DefaultUpgrade is BaseZkSyncUpgrade {
/// @notice The main function that will be called by the upgrade proxy.
/// @notice The main function that will be delegate-called by the chain.
/// @param _proposedUpgrade The upgrade to be executed.
function upgrade(ProposedUpgrade calldata _proposedUpgrade) public override returns (bytes32) {
super.upgrade(_proposedUpgrade);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/upgrades/GatewayUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract GatewayUpgrade is BaseZkSyncUpgrade {
THIS_ADDRESS = address(this);
}

/// @notice The main function that will be called by the upgrade proxy.
/// @notice The main function that will be delegate-called by the chain.
/// @param _proposedUpgrade The upgrade to be executed.
/// @dev Doesn't require any access-control restrictions as the contract is used in the delegate call.
function upgrade(ProposedUpgrade calldata _proposedUpgrade) public override returns (bytes32) {
Expand Down
4 changes: 4 additions & 0 deletions l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {L2ContractHelper} from "../common/libraries/L2ContractHelper.sol";
/// @author Matter Labs
/// @custom:security-contact security@matterlabs.dev
contract L1GenesisUpgrade is IL1GenesisUpgrade, BaseZkSyncUpgradeGenesis {
<<<<<<< HEAD
<<<<<<< HEAD
/// @notice The main function that will be called by the Admin facet.
/// @param _l1GenesisUpgrade the address of the l1 genesis upgrade
Expand All @@ -32,6 +33,9 @@ contract L1GenesisUpgrade is IL1GenesisUpgrade, BaseZkSyncUpgradeGenesis {
=======
/// @notice The main function that will be delegate called by the upgrade proxy.
>>>>>>> origin/kl/n04-library
=======
/// @notice The main function that will be delegate-called by the chain.
>>>>>>> origin/sb-n07-library-fix-review
function genesisUpgrade(
address _l1GenesisUpgrade,
uint256 _chainId,
Expand Down

0 comments on commit 93d4bb9

Please sign in to comment.