forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expiration Time for Child IPs Not Exceed Parent IP (storyprotocol#129)
* childIP expire time cannot longer than parent IP expire time * reduce complexity * extract a common lib function for earliest expiration time
- Loading branch information
1 parent
888bb8b
commit 96ebc7c
Showing
4 changed files
with
142 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.23; | ||
|
||
library ExpiringOps { | ||
/// @dev Get the earliest expiration time from two expiration times | ||
/// @param currentEarliestExp The current earliest expiration time | ||
/// @param anotherExp Another expiration time | ||
function getEarliestExpirationTime( | ||
uint256 currentEarliestExp, | ||
uint256 anotherExp | ||
) internal view returns (uint256 earliestExp) { | ||
earliestExp = currentEarliestExp; | ||
if (anotherExp > 0 && (anotherExp < earliestExp || earliestExp == 0)) earliestExp = anotherExp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters