From 75e63f46cbdbe2572b2b525004b4a9f0831a2070 Mon Sep 17 00:00:00 2001 From: Ihor Barenblat Date: Mon, 31 May 2021 14:21:08 +0300 Subject: [PATCH] cutNoticePeriod AdditiaonalZkSync.sol --- contracts/contracts/AdditionalZkSync.sol | 25 +++++++++++++++++++++++- contracts/contracts/ZkSync.sol | 17 +--------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/contracts/contracts/AdditionalZkSync.sol b/contracts/contracts/AdditionalZkSync.sol index d1957a86cf..4a8e94e13b 100644 --- a/contracts/contracts/AdditionalZkSync.sol +++ b/contracts/contracts/AdditionalZkSync.sol @@ -113,7 +113,7 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard { totalOpenPriorityRequests -= toProcess; } - function withdrawPendingNFTBalance(uint32 _tokenId) external nonReentrant { + function withdrawPendingNFTBalance(uint32 _tokenId) external { Operations.WithdrawNFT memory op = pendingWithdrawnNFTs[_tokenId]; require(op.creatorAddress != address(0), "op"); // No NFT to withdraw NFTFactory _factory = governance.getNFTFactory(op.creatorAccountId, op.creatorAddress); @@ -130,4 +130,27 @@ contract AdditionalZkSync is Storage, Config, Events, ReentrancyGuard { emit WithdrawalNFT(op.tokenId); delete pendingWithdrawnNFTs[_tokenId]; } + + address internal constant SECURITY_COUNCIL_2_WEEKS_ADDRESS = address($$(SECURITY_COUNCIL_2_WEEKS_ADDRESS)); + address internal constant SECURITY_COUNCIL_1_WEEK_ADDRESS = address($$(SECURITY_COUNCIL_1_WEEK_ADDRESS)); + address internal constant SECURITY_COUNCIL_3_DAYS_ADDRESS = address($$(SECURITY_COUNCIL_3_DAYS_ADDRESS)); + + function cutNoticePeriod() external { + require(upgradeStartTimestamp != 0); + if (msg.sender == SECURITY_COUNCIL_2_WEEKS_ADDRESS) { + if (approvedUpgradeNoticePeriod > 2 weeks) { + approvedUpgradeNoticePeriod = 2 weeks; + } + } + if (msg.sender == SECURITY_COUNCIL_1_WEEK_ADDRESS) { + if (approvedUpgradeNoticePeriod > 1 weeks) { + approvedUpgradeNoticePeriod = 1 weeks; + } + } + if (msg.sender == SECURITY_COUNCIL_3_DAYS_ADDRESS) { + if (approvedUpgradeNoticePeriod > 3 days) { + approvedUpgradeNoticePeriod = 3 days; + } + } + } } diff --git a/contracts/contracts/ZkSync.sol b/contracts/contracts/ZkSync.sol index 0967a88f35..68ba633b37 100644 --- a/contracts/contracts/ZkSync.sol +++ b/contracts/contracts/ZkSync.sol @@ -164,22 +164,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard { address internal constant SECURITY_COUNCIL_3_DAYS_ADDRESS = address($$(SECURITY_COUNCIL_3_DAYS_ADDRESS)); function cutNoticePeriod() external nonReentrant { - require(upgradeStartTimestamp != 0); - if (msg.sender == SECURITY_COUNCIL_2_WEEKS_ADDRESS) { - if (approvedUpgradeNoticePeriod > 2 weeks) { - approvedUpgradeNoticePeriod = 2 weeks; - } - } - if (msg.sender == SECURITY_COUNCIL_1_WEEK_ADDRESS) { - if (approvedUpgradeNoticePeriod > 1 weeks) { - approvedUpgradeNoticePeriod = 1 weeks; - } - } - if (msg.sender == SECURITY_COUNCIL_3_DAYS_ADDRESS) { - if (approvedUpgradeNoticePeriod > 3 days) { - approvedUpgradeNoticePeriod = 3 days; - } - } + delegateAdditional(); } /// @notice Sends tokens