Skip to content

Commit

Permalink
merged master
Browse files Browse the repository at this point in the history
  • Loading branch information
dovgopoly committed Dec 12, 2023
1 parent 6740f8d commit 0769e68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/IdentityManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,20 @@ contract IdentityManager is IIdentityManager, Signers, MultiOwnable {
) external onlyOwner {
RootData storage _prevRoot = _roots[prevRoot_];

require(prevRoot_ != postRoot_, "IdentityManager: same prev and post roots");
require(_prevRoot.replacedAt == 0, "IdentityManager: can't update already stored root");

if (_prevRoot.replacedBy != 0) {
_roots[postRoot_].replacedBy = _prevRoot.replacedBy;
}

if (replacedAt_ >= _latestTimestamp) {
_roots[_latestRoot].replacedBy = postRoot_;

_latestRoot = postRoot_;
_latestTimestamp = replacedAt_;
}

if (_prevRoot.replacedBy != 0) {
_roots[postRoot_].replacedBy = _prevRoot.replacedBy;
}

_prevRoot.replacedAt = replacedAt_;
_prevRoot.replacedBy = postRoot_;

Expand Down

0 comments on commit 0769e68

Please sign in to comment.