Skip to content

Commit

Permalink
Cherry pick contract events
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Jun 24, 2020
1 parent 14424a6 commit f84994a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions contracts/contracts/Events.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ interface Events {
uint16 indexed tokenId,
uint128 amount
);

event PendingWithdrawalsAdd(
uint32 queueStartIndex,
uint32 queueEndIndex
);

event PendingWithdrawalsComplete(
uint32 queueStartIndex,
uint32 queueEndIndex
);
}

/// @title Upgrade events
Expand Down
4 changes: 3 additions & 1 deletion contracts/contracts/ZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
}
}
}
emit PendingWithdrawalsComplete(startIndex, startIndex + toProcess);
}

/// @notice Accrues users balances from deposit priority requests in Exodus mode
Expand Down Expand Up @@ -686,8 +687,9 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
withdrawalsDataHash = keccak256(abi.encode(withdrawalsDataHash, addToPendingWithdrawalsQueue, _to, _tokenId, _amount));
offset += ONCHAIN_WITHDRAWAL_BYTES;
}
numberOfPendingWithdrawals = localNumberOfPendingWithdrawals;
require(withdrawalsDataHash == expectedWithdrawalsDataHash, "pow12"); // pow12 - withdrawals data hash not matches with expected value
emit PendingWithdrawalsAdd(firstPendingWithdrawalIndex + numberOfPendingWithdrawals, firstPendingWithdrawalIndex + localNumberOfPendingWithdrawals);
numberOfPendingWithdrawals = localNumberOfPendingWithdrawals;
}

/// @notice Checks whether oldest unverified block has expired
Expand Down

0 comments on commit f84994a

Please sign in to comment.