Skip to content

Commit a1e6173

Browse files
committed
renamed arg
uses constant Signed-off-by: stadolf <[email protected]>
1 parent 977706d commit a1e6173

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/IPNFT.sol

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
4444
/// @notice an IPNFT's base symbol, to be determined by the minter / owner, e.g. BIO-00001
4545
mapping(uint256 => string) public symbol;
4646

47+
/// @dev the highest possible reservation id
48+
uint256 private constant MAX_RESERVATION_ID = type(uint128).max;
49+
4750
event Reserved(address indexed reserver, uint256 indexed reservationId);
4851
event IPNFTMinted(address indexed owner, uint256 indexed tokenId, string tokenURI, string symbol);
4952
event ReadAccessGranted(uint256 indexed tokenId, address indexed reader, uint256 until);
@@ -206,8 +209,10 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
206209
super._burn(tokenId);
207210
}
208211

209-
function isPoi(uint256 poi) public pure returns (bool) {
210-
return poi > type(uint128).max;
212+
/// @notice checks whether a token id is a Proof of Idea
213+
/// @param tokenId the token id, either a reserved id or a poi hash
214+
function isPoi(uint256 tokenId) public pure returns (bool) {
215+
return tokenId > MAX_RESERVATION_ID;
211216
}
212217

213218
/// @inheritdoc ERC721Upgradeable

0 commit comments

Comments
 (0)