-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set of fixes to the dev branch #311
Changes from 5 commits
d7103f8
733ef42
d823732
4299f4c
5204c04
2fafafe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ contract L2BaseToken is IBaseToken, ISystemContract { | |
emit Mint(_account, _amount); | ||
} | ||
|
||
/// @notice Initiate the ETH withdrawal, funds will be available to claim on L1 `finalizeEthWithdrawal` method. | ||
/// @notice Initiate the withdrawal of the base token, funds will be available to claim on L1 `finalizeEthWithdrawal` method. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately no, since we need the old SDKs to be backward-compatible, this function is also only available for the Era hyperchain |
||
/// @param _l1Receiver The address on L1 to receive the funds. | ||
function withdraw(address _l1Receiver) external payable override { | ||
uint256 amount = _burnMsgValue(); | ||
|
@@ -79,7 +79,7 @@ contract L2BaseToken is IBaseToken, ISystemContract { | |
emit Withdrawal(msg.sender, _l1Receiver, amount); | ||
} | ||
|
||
/// @notice Initiate the ETH withdrawal, with the sent message. The funds will be available to claim on L1 `finalizeEthWithdrawal` method. | ||
/// @notice Initiate the withdrawal of the base token, with the sent message. The funds will be available to claim on L1 `finalizeEthWithdrawal` method. | ||
/// @param _l1Receiver The address on L1 to receive the funds. | ||
/// @param _additionalData Additional data to be sent to L1 with the withdrawal. | ||
function withdrawWithMessage(address _l1Receiver, bytes memory _additionalData) external payable override { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ pragma solidity 0.8.20; | |
|
||
import {MAX_SYSTEM_CONTRACT_ADDRESS} from "../Constants.sol"; | ||
|
||
import {CALLFLAGS_CALL_ADDRESS, CODE_ADDRESS_CALL_ADDRESS, EVENT_WRITE_ADDRESS, EVENT_INITIALIZE_ADDRESS, GET_EXTRA_ABI_DATA_ADDRESS, LOAD_CALLDATA_INTO_ACTIVE_PTR_CALL_ADDRESS, META_CODE_SHARD_ID_OFFSET, META_CALLER_SHARD_ID_OFFSET, META_SHARD_ID_OFFSET, META_AUX_HEAP_SIZE_OFFSET, META_HEAP_SIZE_OFFSET, META_GAS_PER_PUBDATA_BYTE_OFFSET, META_CALL_ADDRESS, PTR_CALLDATA_CALL_ADDRESS, PTR_ADD_INTO_ACTIVE_CALL_ADDRESS, PTR_SHRINK_INTO_ACTIVE_CALL_ADDRESS, PTR_PACK_INTO_ACTIVE_CALL_ADDRESS, PRECOMPILE_CALL_ADDRESS, SET_CONTEXT_VALUE_CALL_ADDRESS, TO_L1_CALL_ADDRESS} from "./SystemContractsCaller.sol"; | ||
import {CALLFLAGS_CALL_ADDRESS, CODE_ADDRESS_CALL_ADDRESS, EVENT_WRITE_ADDRESS, EVENT_INITIALIZE_ADDRESS, GET_EXTRA_ABI_DATA_ADDRESS, LOAD_CALLDATA_INTO_ACTIVE_PTR_CALL_ADDRESS, META_CODE_SHARD_ID_OFFSET, META_CALLER_SHARD_ID_OFFSET, META_SHARD_ID_OFFSET, META_AUX_HEAP_SIZE_OFFSET, META_HEAP_SIZE_OFFSET, META_PUBDATA_PUBLISHED_OFFSET, META_CALL_ADDRESS, PTR_CALLDATA_CALL_ADDRESS, PTR_ADD_INTO_ACTIVE_CALL_ADDRESS, PTR_SHRINK_INTO_ACTIVE_CALL_ADDRESS, PTR_PACK_INTO_ACTIVE_CALL_ADDRESS, PRECOMPILE_CALL_ADDRESS, SET_CONTEXT_VALUE_CALL_ADDRESS, TO_L1_CALL_ADDRESS} from "./SystemContractsCaller.sol"; | ||
|
||
uint256 constant UINT32_MASK = type(uint32).max; | ||
uint256 constant UINT64_MASK = type(uint64).max; | ||
|
@@ -224,9 +224,9 @@ library SystemContractHelper { | |
/// that a single byte sent to L1 as pubdata costs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given the changes made in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in this PR: #351 |
||
/// @notice NOTE: The behavior of this function will experience a breaking change in 2024. | ||
/// @param meta Packed representation of the ZkSyncMeta. | ||
/// @return pubdataPublished The current price in gas per pubdata byte. | ||
/// @return pubdataPublished The amount of pubdata published in the system so far. | ||
function getPubdataPublishedFromMeta(uint256 meta) internal pure returns (uint32 pubdataPublished) { | ||
pubdataPublished = uint32(extractNumberFromMeta(meta, META_GAS_PER_PUBDATA_BYTE_OFFSET, 32)); | ||
pubdataPublished = uint32(extractNumberFromMeta(meta, META_PUBDATA_PUBLISHED_OFFSET, 32)); | ||
} | ||
|
||
/// @notice Given the packed representation of `ZkSyncMeta`, retrieves the number of the current size | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ address constant MULTIPLICATION_HIGH_ADDRESS = address((1 << 16) - 26); | |
address constant GET_EXTRA_ABI_DATA_ADDRESS = address((1 << 16) - 27); | ||
|
||
// All the offsets are in bits | ||
uint256 constant META_GAS_PER_PUBDATA_BYTE_OFFSET = 0 * 8; | ||
uint256 constant META_PUBDATA_PUBLISHED_OFFSET = 0 * 8; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ensure that this change is clearly indicated in the docs as a warning. |
||
uint256 constant META_HEAP_SIZE_OFFSET = 8 * 8; | ||
uint256 constant META_AUX_HEAP_SIZE_OFFSET = 12 * 8; | ||
uint256 constant META_SHARD_ID_OFFSET = 28 * 8; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The in-code documentation for a lot of functions is missing. It'll be better if we could address them.