From d6efffc6c635fe3c8e4534f57a9bd7999525def1 Mon Sep 17 00:00:00 2001 From: neokry Date: Mon, 4 Sep 2023 14:17:05 +0900 Subject: [PATCH] Fix merge issues --- src/metadata/media/MediaMetadata.sol | 2 +- src/metadata/property/PropertyMetadata.sol | 2 ++ src/token/default/IToken.sol | 4 ++++ src/token/default/Token.sol | 1 + src/token/default/types/TokenTypesV1.sol | 2 +- src/token/partial-soulbound/PartialSoulboundToken.sol | 2 +- .../partial-soulbound/types/PartialSoulboundTokenTypesV1.sol | 2 +- test/PartialSoulboundToken.t.sol | 3 +++ test/Token.t.sol | 3 +++ 9 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/metadata/media/MediaMetadata.sol b/src/metadata/media/MediaMetadata.sol index 54d41ed..d5a1297 100644 --- a/src/metadata/media/MediaMetadata.sol +++ b/src/metadata/media/MediaMetadata.sol @@ -13,7 +13,7 @@ import { IOwnable } from "../../lib/interfaces/IOwnable.sol"; import { ERC721 } from "../../lib/token/ERC721.sol"; import { MediaMetadataStorageV1 } from "./storage/MediaMetadataStorageV1.sol"; -import { IToken } from "../../token/IToken.sol"; +import { IToken } from "../../token/default/IToken.sol"; import { IMediaMetadata } from "./interfaces/IMediaMetadata.sol"; import { IManager } from "../../manager/IManager.sol"; import { IBaseMetadata } from "../interfaces/IBaseMetadata.sol"; diff --git a/src/metadata/property/PropertyMetadata.sol b/src/metadata/property/PropertyMetadata.sol index bfdd9d5..aeca79a 100644 --- a/src/metadata/property/PropertyMetadata.sol +++ b/src/metadata/property/PropertyMetadata.sol @@ -4,6 +4,8 @@ pragma solidity 0.8.16; import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; import { UriEncode } from "sol-uriencode/src/UriEncode.sol"; +import { MetadataBuilder } from "micro-onchain-metadata-utils/MetadataBuilder.sol"; +import { MetadataJSONKeys } from "micro-onchain-metadata-utils/MetadataJSONKeys.sol"; import { UUPS } from "../../lib/proxy/UUPS.sol"; import { Initializable } from "../../lib/utils/Initializable.sol"; diff --git a/src/token/default/IToken.sol b/src/token/default/IToken.sol index 89bb2f7..43d4455 100644 --- a/src/token/default/IToken.sol +++ b/src/token/default/IToken.sol @@ -7,6 +7,7 @@ import { IManager } from "../../manager/IManager.sol"; import { IBaseToken } from "../interfaces/IBaseToken.sol"; import { TokenTypesV1 } from "./types/TokenTypesV1.sol"; import { TokenTypesV2 } from "./types/TokenTypesV2.sol"; +import { IBaseMetadata } from "../../metadata/interfaces/IBaseMetadata.sol"; /// @title IToken /// @author Rohan Kulkarni @@ -102,6 +103,9 @@ interface IToken is IUUPS, IERC721Votes, IBaseToken, TokenTypesV1, TokenTypesV2 /// @notice Mints the specified amount of tokens to the recipient and handles founder vesting function mintBatchTo(uint256 amount, address recipient) external returns (uint256[] memory tokenIds); + /// @notice Mints the specified token from the reserve to the recipent + function mintFromReserveTo(address recipient, uint256 tokenId) external; + /// @notice Burns a token owned by the caller /// @param tokenId The ERC-721 token id function burn(uint256 tokenId) external; diff --git a/src/token/default/Token.sol b/src/token/default/Token.sol index 801574b..8a97188 100644 --- a/src/token/default/Token.sol +++ b/src/token/default/Token.sol @@ -14,6 +14,7 @@ import { IAuction } from "../../auction/IAuction.sol"; import { IToken } from "./IToken.sol"; import { IBaseToken } from "../interfaces/IBaseToken.sol"; import { VersionedContract } from "../../VersionedContract.sol"; +import { IBaseMetadata } from "../../metadata/interfaces/IBaseMetadata.sol"; /// @title Token /// @author Rohan Kulkarni diff --git a/src/token/default/types/TokenTypesV1.sol b/src/token/default/types/TokenTypesV1.sol index 72162ea..7d91255 100644 --- a/src/token/default/types/TokenTypesV1.sol +++ b/src/token/default/types/TokenTypesV1.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.16; -import { IBaseMetadata } from "../../metadata/interfaces/IBaseMetadata.sol"; +import { IBaseMetadata } from "../../../metadata/interfaces/IBaseMetadata.sol"; /// @title TokenTypesV1 /// @author Rohan Kulkarni diff --git a/src/token/partial-soulbound/PartialSoulboundToken.sol b/src/token/partial-soulbound/PartialSoulboundToken.sol index 78a4929..c1d34cd 100644 --- a/src/token/partial-soulbound/PartialSoulboundToken.sol +++ b/src/token/partial-soulbound/PartialSoulboundToken.sol @@ -7,7 +7,7 @@ import { ERC721Votes } from "../../lib/token/ERC721Votes.sol"; import { ERC721 } from "../../lib/token/ERC721.sol"; import { Ownable } from "../../lib/utils/Ownable.sol"; import { PartialSoulboundTokenStorageV1 } from "./storage/PartialSoulboundTokenStorageV1.sol"; -import { IBaseMetadata } from "../metadata/interfaces/IBaseMetadata.sol"; +import { IBaseMetadata } from "../../metadata/interfaces/IBaseMetadata.sol"; import { IManager } from "../../manager/IManager.sol"; import { IAuction } from "../../auction/IAuction.sol"; import { IPartialSoulboundToken } from "./IPartialSoulboundToken.sol"; diff --git a/src/token/partial-soulbound/types/PartialSoulboundTokenTypesV1.sol b/src/token/partial-soulbound/types/PartialSoulboundTokenTypesV1.sol index 3d4a8ce..412393f 100644 --- a/src/token/partial-soulbound/types/PartialSoulboundTokenTypesV1.sol +++ b/src/token/partial-soulbound/types/PartialSoulboundTokenTypesV1.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.16; -import { IBaseMetadata } from "../../metadata/interfaces/IBaseMetadata.sol"; +import { IBaseMetadata } from "../../../metadata/interfaces/IBaseMetadata.sol"; /// @title PartialSoulboundTokenTypesV1 /// @author Neokry diff --git a/test/PartialSoulboundToken.t.sol b/test/PartialSoulboundToken.t.sol index 723cb7e..32f2fa3 100644 --- a/test/PartialSoulboundToken.t.sol +++ b/test/PartialSoulboundToken.t.sol @@ -440,6 +440,7 @@ contract PartialSoulboundTokenTest is NounsBuilderTest, TokenTypesV1 { function testRevert_OnlyMinterCanMint(address newMinter, address nonMinter) public { vm.assume(newMinter != nonMinter && newMinter != founder && newMinter != address(0) && newMinter != address(auction)); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployAltMock(0); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true }); @@ -464,6 +465,7 @@ contract PartialSoulboundTokenTest is NounsBuilderTest, TokenTypesV1 { vm.assume( newMinter != nonMinter && newMinter != founder && newMinter != address(0) && newMinter != address(auction) && recipient != address(0) ); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployAltMock(0); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true }); @@ -495,6 +497,7 @@ contract PartialSoulboundTokenTest is NounsBuilderTest, TokenTypesV1 { amount > 0 && amount < 100 ); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployAltMock(0); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true }); diff --git a/test/Token.t.sol b/test/Token.t.sol index fdd5da5..0095f22 100644 --- a/test/Token.t.sol +++ b/test/Token.t.sol @@ -438,6 +438,7 @@ contract TokenTest is NounsBuilderTest, TokenTypesV1 { function testRevert_OnlyMinterCanMint(address newMinter, address nonMinter) public { vm.assume(newMinter != nonMinter && newMinter != founder && newMinter != address(0) && newMinter != address(auction)); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployMock(); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true }); @@ -462,6 +463,7 @@ contract TokenTest is NounsBuilderTest, TokenTypesV1 { vm.assume( newMinter != nonMinter && newMinter != founder && newMinter != address(0) && newMinter != address(auction) && recipient != address(0) ); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployMock(); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true }); @@ -493,6 +495,7 @@ contract TokenTest is NounsBuilderTest, TokenTypesV1 { amount > 0 && amount < 100 ); + vm.assume(nonMinter != founder && nonMinter != address(0) && nonMinter != address(auction)); deployMock(); TokenTypesV2.MinterParams memory params = TokenTypesV2.MinterParams({ minter: newMinter, allowed: true });