Skip to content

Commit 977706d

Browse files
committed
upgrade contract version / make isPoi visibility public
1 parent 5edc1bf commit 977706d

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

src/IPNFT.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import { IReservable } from "./IReservable.sol";
2121
_| ▓▓_| ▓▓ | ▓▓ \▓▓▓▓ ▓▓ | ▓▓
2222
| ▓▓ \ ▓▓ | ▓▓ \▓▓▓ ▓▓ | ▓▓
2323
\▓▓▓▓▓▓\▓▓ \▓▓ \▓▓\▓▓ \▓▓
24-
*/
24+
*/
2525

26-
/// @title IPNFT V2.5
26+
/// @title IPNFT V2.5.1
2727
/// @author molecule.to
2828
/// @notice IP-NFTs capture intellectual property to be traded and synthesized
2929
contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReservable, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable {
@@ -122,8 +122,8 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
122122
whenNotPaused
123123
returns (uint256)
124124
{
125-
bool isPoi = _verifyPoi(reservationId);
126-
if (!isPoi && reservations[reservationId] != _msgSender()) {
125+
bool _isPoi = isPoi(reservationId);
126+
if (!_isPoi && reservations[reservationId] != _msgSender()) {
127127
revert NotOwningReservation(reservationId);
128128
}
129129

@@ -134,7 +134,7 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
134134
if (!mintAuthorizer.authorizeMint(_msgSender(), to, abi.encode(SignedMintAuthorization(reservationId, _tokenURI, authorization)))) {
135135
revert Unauthorized();
136136
}
137-
if(!isPoi) {
137+
if (!_isPoi) {
138138
delete reservations[reservationId];
139139
}
140140

@@ -206,7 +206,7 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
206206
super._burn(tokenId);
207207
}
208208

209-
function _verifyPoi(uint256 poi) internal pure returns (bool) {
209+
function isPoi(uint256 poi) public pure returns (bool) {
210210
return poi > type(uint128).max;
211211
}
212212

subgraph/subgraph.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dataSources:
5959
file: ./src/swapMapping.ts
6060
- kind: ethereum/contract
6161
name: Tokenizer
62-
network: mainnet
62+
network: foundry
6363
source:
6464
abi: Tokenizer
6565
address: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
@@ -84,7 +84,7 @@ dataSources:
8484
file: ./src/tokenizerMapping.ts
8585
- kind: ethereum/contract
8686
name: CrowdSale
87-
network: mainnet
87+
network: foundry
8888
source:
8989
abi: CrowdSale
9090
address: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F"
@@ -121,7 +121,7 @@ dataSources:
121121
file: ./src/crowdSaleMapping.ts
122122
- kind: ethereum/contract
123123
name: StakedLockingCrowdSale
124-
network: mainnet
124+
network: foundry
125125
source:
126126
abi: StakedLockingCrowdSale
127127
address: "0x0B306BF915C4d645ff596e518fAf3F9669b97016"
@@ -167,7 +167,7 @@ dataSources:
167167
file: ./src/stakedLockingCrowdSaleMapping.ts
168168
- kind: ethereum/contract
169169
name: TermsAcceptedPermissioner
170-
network: mainnet
170+
network: foundry
171171
source:
172172
abi: TermsAcceptedPermissioner
173173
address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
@@ -188,7 +188,7 @@ dataSources:
188188
templates:
189189
- name: IPToken
190190
kind: ethereum/contract
191-
network: mainnet
191+
network: foundry
192192
source:
193193
abi: IPToken
194194
mapping:
@@ -208,7 +208,7 @@ templates:
208208
handler: handleCapped
209209
- name: TimelockedToken
210210
kind: ethereum/contract
211-
network: mainnet
211+
network: foundry
212212
source:
213213
abi: TimelockedToken
214214
mapping:
@@ -240,4 +240,4 @@ templates:
240240
abis:
241241
- name: IPNFT
242242
file: ./abis/IPNFT.json
243-
network: mainnet
243+
network: foundry

test/IPNFT.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ contract IPNFTTest is IPNFTMintHelper {
7474

7575
function testVerifyPoi() public {
7676
uint256 tokenId = uint256(0x073cb54264ef688e56531a2d09ab47b14086b5c7813e3a23a2bd7b1bb6458a52);
77-
bool isPoi = verifyPoi(tokenId);
77+
bool isPoi = ipnft.isPoi(tokenId);
7878
assertEq(isPoi, true);
7979
}
8080

test/IPNFTMintHelper.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,4 @@ abstract contract IPNFTMintHelper is Test {
3636
vm.stopPrank();
3737
return reservationId;
3838
}
39-
40-
function verifyPoi(uint256 tokenId) public pure returns (bool) {
41-
return tokenId > type(uint128).max;
42-
}
4339
}

0 commit comments

Comments
 (0)