Skip to content

Commit

Permalink
Merge branch 'vb-correct-instant-upgrade' into vb-smart-contract-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbochok authored Jan 7, 2022
2 parents 83a5ce7 + 7e5f315 commit 4198655
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions contracts/contracts/AdditionalZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard {
address _nftCreatorAddress,
uint32 _nftSerialId,
bytes32 _nftContentHash,
uint256[] memory _proof
uint256[] calldata _proof
) external {
require(_accountId <= MAX_ACCOUNT_ID, "e");
require(_accountId != SPECIAL_ACCOUNT_ID, "v");
Expand Down Expand Up @@ -91,7 +91,7 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard {
performedExodus[_accountId][_tokenId] = true;
}

function cancelOutstandingDepositsForExodusMode(uint64 _n, bytes[] memory _depositsPubdata) external {
function cancelOutstandingDepositsForExodusMode(uint64 _n, bytes[] calldata _depositsPubdata) external {
require(exodusMode, "8"); // exodus mode not active
uint64 toProcess = Utils.minU64(totalOpenPriorityRequests, _n);
require(toProcess > 0, "9"); // no deposits to process
Expand All @@ -114,6 +114,9 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard {

uint256 internal constant SECURITY_COUNCIL_THRESHOLD = $$(SECURITY_COUNCIL_THRESHOLD);

/// @notice processing new approval of decrease upgrade notice period time to zero
/// @param addr address of the account that approved the reduction of the upgrade notice period to zero
/// NOTE: does NOT revert if the address is not a security council member or number of approvals is already sufficient
function approveCutUpgradeNoticePeriod(address addr) internal {
address payable[SECURITY_COUNCIL_MEMBERS_NUMBER] memory SECURITY_COUNCIL_MEMBERS = [
$(SECURITY_COUNCIL_MEMBERS)
Expand All @@ -124,7 +127,7 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard {
numberOfApprovalsFromSecurityCouncil += 1;
emit ApproveCutUpgradeNoticePeriod(addr);

if (numberOfApprovalsFromSecurityCouncil == SECURITY_COUNCIL_THRESHOLD) {
if (numberOfApprovalsFromSecurityCouncil >= SECURITY_COUNCIL_THRESHOLD) {
if (approvedUpgradeNoticePeriod > 0) {
approvedUpgradeNoticePeriod = 0;
emit NoticePeriodChange(approvedUpgradeNoticePeriod);
Expand Down Expand Up @@ -209,7 +212,7 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard {
}

/// @notice Reverts unverified blocks
function revertBlocks(StoredBlockInfo[] memory _blocksToRevert) external {
function revertBlocks(StoredBlockInfo[] calldata _blocksToRevert) external {
requireActive();

governance.requireActiveValidator(msg.sender);
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/IERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface IERC20 {

/// @dev Interface of the ERC20 standard as defined in the EIP.
/// 1. Implements only `transfer` and `transferFrom` methods
/// 2. These methods return a boolean which indicates success of the transaction
/// 2. These methods return a boolean value which indicates success of the transaction
/// Note: It is assumed that the interface applies to those `ERC20` tokens whose code exactly matches the standard.
/// Note: Used to perform transfers for tokens that explicitly return a boolean value
/// (if the token returns any other data or does not return at all, then the function call will reverted)
Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract Verifier is KeysWithPlonkVerifier, KeysWithPlonkVerifierOld, Config {

function verifyAggregatedBlockProof(
uint256[] memory _recursiveInput,
uint256[] memory _proof,
uint256[] calldata _proof,
uint8[] memory _vkIndexes,
uint256[] memory _individualVksInputs,
uint256[16] memory _subproofsLimbs
Expand Down
6 changes: 3 additions & 3 deletions contracts/contracts/ZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
/// @dev WARNING: Only for Exodus mode
/// @dev Canceling may take several separate transactions to be completed
/// @param _n number of requests to process
function cancelOutstandingDepositsForExodusMode(uint64 _n, bytes[] memory _depositsPubdata) external {
function cancelOutstandingDepositsForExodusMode(uint64 _n, bytes[] calldata _depositsPubdata) external {
// All functions delegated to additional contract should NOT be nonReentrant
delegateAdditional();
}
Expand Down Expand Up @@ -603,7 +603,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
}

/// @notice Reverts unverified blocks
function revertBlocks(StoredBlockInfo[] memory _blocksToRevert) external {
function revertBlocks(StoredBlockInfo[] calldata _blocksToRevert) external {
// All functions delegated to additional contract should NOT be nonReentrant
delegateAdditional();
}
Expand Down Expand Up @@ -645,7 +645,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
address _nftCreatorAddress,
uint32 _nftSerialId,
bytes32 _nftContentHash,
uint256[] memory _proof
uint256[] calldata _proof
) external {
// All functions delegated to additional should NOT be nonReentrant
delegateAdditional();
Expand Down

0 comments on commit 4198655

Please sign in to comment.