Skip to content

Commit

Permalink
chore: comment for REP15Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
thaixuandang committed Jul 8, 2024
1 parent a67a963 commit e1c81d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/REP15Utils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
pragma solidity ^0.8.18;

library REP15Utils {
struct Delegation {
Expand All @@ -20,18 +20,22 @@ library REP15Utils {
uint64 readyForDetachmentAt;
}

/// @dev Checks if the delegation is active
function isActive(Delegation storage self) internal view returns (bool) {
return self.delegated && self.until > block.timestamp;
}

/// @dev Checks if the delegation is pending
function isPending(Delegation storage self) internal view returns (bool) {
return !self.delegated && self.until > block.timestamp;
}

/// @dev Checks if the context is existent
function isExistent(Context storage self) internal view returns (bool) {
return self.controller != address(0);
}

/// @dev Checks if the token context is requested for detachment
function hasRequestedForDetachment(TokenContext storage self) internal view returns (bool) {
return self.readyForDetachmentAt > 0;
}
Expand Down

0 comments on commit e1c81d2

Please sign in to comment.