Skip to content

Commit 06417d6

Browse files
committed
ensure that the authorizer only lets the caller pass
Signed-off-by: stadolf <[email protected]>
1 parent 8d76ce3 commit 06417d6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/IPNFT.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { IReservable } from "./IReservable.sol";
2323
\▓▓▓▓▓▓\▓▓ \▓▓ \▓▓\▓▓ \▓▓
2424
*/
2525

26-
/// @title IPNFT V2.4
26+
/// @title IPNFT V2.5
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 {
@@ -188,7 +188,6 @@ contract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReser
188188
(bool success,) = _msgSender().call{ value: address(this).balance }("");
189189
require(success, "transfer failed");
190190
}
191-
192191

193192
/// @inheritdoc UUPSUpgradeable
194193
function _authorizeUpgrade(address /*newImplementation*/ )

test/IPNFT.t.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ contract IPNFTTest is IPNFTMintHelper {
229229
(uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPk, authMessageHash);
230230
bytes memory authorization = abi.encodePacked(r, s, v);
231231

232+
//the signoff only allows alice to call this
233+
vm.startPrank(charlie);
234+
vm.expectRevert(IPNFT.Unauthorized.selector);
235+
ipnft.amendMetadata(1, "ipfs://QmNewUri", authorization);
236+
232237
vm.startPrank(alice);
233238
vm.expectEmit(true, true, false, false);
234239
emit MetadataUpdate(1);

0 commit comments

Comments
 (0)