Skip to content

Commit

Permalink
cutNoticePeriod AdditiaonalZkSync.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
Barichek committed May 31, 2021
1 parent 13b4cc6 commit 75e63f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
25 changes: 24 additions & 1 deletion contracts/contracts/AdditionalZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
}
}
}
17 changes: 1 addition & 16 deletions contracts/contracts/ZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75e63f4

Please sign in to comment.