From 540d0b3fb8390e9b9223fd1ee31139a3d2d1e493 Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Mon, 9 Oct 2023 20:43:28 +0530 Subject: [PATCH] refactor: removed unused mocks --- .../contracts/mocks/ERC1155Test.sol | 15 -- .../contracts/mocks/ERC721Test.sol | 15 -- .../contracts/mocks/LibFeeSideTest.sol | 14 -- .../contracts/mocks/LibFillTest.sol | 24 --- .../contracts/mocks/LibOrderTest.sol | 42 ----- .../contracts/mocks/Royalties2981Test.sol | 20 --- .../contracts/mocks/RoyaltiesRegistryTest.sol | 16 -- .../contracts/mocks/SimpleTest.sol | 18 -- .../contracts/mocks/SimpleTransferManager.sol | 19 --- .../contracts/mocks/TestERC20ZRX.sol | 157 ------------------ .../contracts/mocks/TestRoyaltiesRegistry.sol | 75 --------- .../contracts/mocks/TestRoyaltyInfo.sol | 15 -- .../mocks/tokens/MintableERC1155.sol | 16 -- .../tokens/MintableERC1155WithRoyalties.sol | 27 --- .../contracts/mocks/tokens/MintableERC20.sol | 12 -- .../contracts/mocks/tokens/MintableERC721.sol | 12 -- .../tokens/MintableERC721WithRoyalties.sol | 27 --- 17 files changed, 524 deletions(-) delete mode 100644 packages/marketplace/contracts/mocks/ERC1155Test.sol delete mode 100644 packages/marketplace/contracts/mocks/ERC721Test.sol delete mode 100644 packages/marketplace/contracts/mocks/LibFeeSideTest.sol delete mode 100644 packages/marketplace/contracts/mocks/LibFillTest.sol delete mode 100644 packages/marketplace/contracts/mocks/LibOrderTest.sol delete mode 100644 packages/marketplace/contracts/mocks/Royalties2981Test.sol delete mode 100644 packages/marketplace/contracts/mocks/RoyaltiesRegistryTest.sol delete mode 100644 packages/marketplace/contracts/mocks/SimpleTest.sol delete mode 100644 packages/marketplace/contracts/mocks/SimpleTransferManager.sol delete mode 100644 packages/marketplace/contracts/mocks/TestERC20ZRX.sol delete mode 100644 packages/marketplace/contracts/mocks/TestRoyaltiesRegistry.sol delete mode 100644 packages/marketplace/contracts/mocks/TestRoyaltyInfo.sol delete mode 100644 packages/marketplace/contracts/mocks/tokens/MintableERC1155.sol delete mode 100644 packages/marketplace/contracts/mocks/tokens/MintableERC1155WithRoyalties.sol delete mode 100644 packages/marketplace/contracts/mocks/tokens/MintableERC20.sol delete mode 100644 packages/marketplace/contracts/mocks/tokens/MintableERC721.sol delete mode 100644 packages/marketplace/contracts/mocks/tokens/MintableERC721WithRoyalties.sol diff --git a/packages/marketplace/contracts/mocks/ERC1155Test.sol b/packages/marketplace/contracts/mocks/ERC1155Test.sol deleted file mode 100644 index 41d1a025ad..0000000000 --- a/packages/marketplace/contracts/mocks/ERC1155Test.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {ECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; -import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; - -contract ERC1155Test is EIP712Upgradeable { - using ECDSAUpgradeable for bytes32; - - // solhint-disable-next-line func-name-mixedcase - function __ERC1155Test_init() external initializer { - __EIP712_init("Mint1155", "1"); - } -} diff --git a/packages/marketplace/contracts/mocks/ERC721Test.sol b/packages/marketplace/contracts/mocks/ERC721Test.sol deleted file mode 100644 index 2e9ec8b8de..0000000000 --- a/packages/marketplace/contracts/mocks/ERC721Test.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; -import {ECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; - -contract ERC721Test is EIP712Upgradeable { - using ECDSAUpgradeable for bytes32; - - // solhint-disable-next-line func-name-mixedcase - function __ERC721Test_init() external initializer { - __EIP712_init("Mint721", "1"); - } -} diff --git a/packages/marketplace/contracts/mocks/LibFeeSideTest.sol b/packages/marketplace/contracts/mocks/LibFeeSideTest.sol deleted file mode 100644 index 6633f9962d..0000000000 --- a/packages/marketplace/contracts/mocks/LibFeeSideTest.sol +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {LibAsset} from "../lib-asset/LibAsset.sol"; - -contract LibFeeSideTest { - function getFeeSideTest( - LibAsset.AssetClassType maker, - LibAsset.AssetClassType taker - ) external pure returns (LibAsset.FeeSide) { - return LibAsset.getFeeSide(maker, taker); - } -} diff --git a/packages/marketplace/contracts/mocks/LibFillTest.sol b/packages/marketplace/contracts/mocks/LibFillTest.sol deleted file mode 100644 index 61de9d9554..0000000000 --- a/packages/marketplace/contracts/mocks/LibFillTest.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {LibOrder} from "../lib-order/LibOrder.sol"; -import {LibFill} from "../exchange/libraries/LibFill.sol"; - -contract LibFillTest { - function fillOrder( - LibOrder.Order calldata leftOrder, - LibOrder.Order calldata rightOrder, - uint256 leftOrderFill, - uint256 rightOrderFill - ) external pure returns (LibFill.FillResult memory) { - return LibFill.fillOrder(leftOrder, rightOrder, leftOrderFill, rightOrderFill); - } - - function calculateRemaining( - LibOrder.Order calldata order, - uint256 fill - ) external pure returns (uint256 makeAmount, uint256 takeAmount) { - return LibFill.calculateRemaining(order, fill); - } -} diff --git a/packages/marketplace/contracts/mocks/LibOrderTest.sol b/packages/marketplace/contracts/mocks/LibOrderTest.sol deleted file mode 100644 index 1fb8e661f5..0000000000 --- a/packages/marketplace/contracts/mocks/LibOrderTest.sol +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {LibOrder, LibAsset} from "../lib-order/LibOrder.sol"; - -contract LibOrderTest { - function hashKey(LibOrder.Order calldata order) external pure returns (bytes32) { - return LibOrder.hashKey(order); - } - - function hashKeyOnChain(LibOrder.Order calldata order) external pure returns (bytes32) { - return LibOrder.hashKey(order); - } - - function validate(LibOrder.Order calldata order) external view { - LibOrder.validateOrderTime(order); - } - - function hashV2( - address maker, - LibAsset.Asset memory makeAsset, - LibAsset.Asset memory takeAsset, - uint256 salt, - bytes memory data - ) public pure returns (bytes32) { - return - keccak256( - abi.encode(maker, LibAsset.hash(makeAsset.assetType), LibAsset.hash(takeAsset.assetType), salt, data) - ); - } - - function hashV1( - address maker, - LibAsset.Asset memory makeAsset, - LibAsset.Asset memory takeAsset, - uint256 salt - ) public pure returns (bytes32) { - return - keccak256(abi.encode(maker, LibAsset.hash(makeAsset.assetType), LibAsset.hash(takeAsset.assetType), salt)); - } -} diff --git a/packages/marketplace/contracts/mocks/Royalties2981Test.sol b/packages/marketplace/contracts/mocks/Royalties2981Test.sol deleted file mode 100644 index 2b13dea58c..0000000000 --- a/packages/marketplace/contracts/mocks/Royalties2981Test.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol"; - -contract Royalties2981Test { - IERC2981 internal immutable ROYALTIES; - - constructor(IERC2981 _royalties) { - ROYALTIES = _royalties; - } - - event Test(address account, uint256 value); - - function royaltyInfoTest(uint256 _tokenId, uint256 _salePrice) public { - (address account, uint256 value) = ROYALTIES.royaltyInfo(_tokenId, _salePrice); - emit Test(account, value); - } -} diff --git a/packages/marketplace/contracts/mocks/RoyaltiesRegistryTest.sol b/packages/marketplace/contracts/mocks/RoyaltiesRegistryTest.sol deleted file mode 100644 index 91a6d8f423..0000000000 --- a/packages/marketplace/contracts/mocks/RoyaltiesRegistryTest.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {IRoyaltiesProvider} from "../interfaces/IRoyaltiesProvider.sol"; -import {LibPart} from "../lib-part/LibPart.sol"; - -contract RoyaltiesRegistryTest { - event GetRoyaltiesTest(LibPart.Part[] royalties); - - function _getRoyalties(address royaltiesTest, address token, uint256 tokenId) external { - IRoyaltiesProvider withRoyalties = IRoyaltiesProvider(royaltiesTest); - LibPart.Part[] memory royalties = withRoyalties.getRoyalties(token, tokenId); - emit GetRoyaltiesTest(royalties); - } -} diff --git a/packages/marketplace/contracts/mocks/SimpleTest.sol b/packages/marketplace/contracts/mocks/SimpleTest.sol deleted file mode 100644 index 49c50153fc..0000000000 --- a/packages/marketplace/contracts/mocks/SimpleTest.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {TransferManager} from "../transfer-manager/TransferManager.sol"; -import {TransferExecutor, LibAsset} from "../transfer-manager/TransferExecutor.sol"; -import {LibPart} from "../lib-part/LibPart.sol"; - -contract SimpleTest is TransferManager, TransferExecutor { - function getRoyaltiesByAssetTest(LibAsset.AssetType memory matchNft) external returns (LibPart.Part[] memory) { - return _getRoyaltiesByAssetType(matchNft); - } - - /// @dev returning false for mock contract - function _applyFees(address /* from */) internal pure override returns (bool) { - return false; - } -} diff --git a/packages/marketplace/contracts/mocks/SimpleTransferManager.sol b/packages/marketplace/contracts/mocks/SimpleTransferManager.sol deleted file mode 100644 index 45482e5ea9..0000000000 --- a/packages/marketplace/contracts/mocks/SimpleTransferManager.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {ITransferManager} from "../transfer-manager/interfaces/ITransferManager.sol"; -import {LibAsset} from "../lib-asset/LibAsset.sol"; - -abstract contract SimpleTransferManager is ITransferManager { - function doTransfers( - DealSide memory left, - DealSide memory right, - LibAsset.FeeSide /* feeSide */ - ) internal override { - transfer(left.asset, left.from, right.from); - transfer(right.asset, right.from, left.from); - } - - uint256[50] private __gap; -} diff --git a/packages/marketplace/contracts/mocks/TestERC20ZRX.sol b/packages/marketplace/contracts/mocks/TestERC20ZRX.sol deleted file mode 100644 index 55ee6242ce..0000000000 --- a/packages/marketplace/contracts/mocks/TestERC20ZRX.sol +++ /dev/null @@ -1,157 +0,0 @@ -// SPDX-License-Identifier: MIT - -/** - *Submitted for verification at Etherscan.io on 2017-08-11 - */ - -/* - - Copyright 2017 ZeroEx Intl. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -*/ - -// solhint-disable-next-line one-contract-per-file -pragma solidity 0.8.21; - -interface Token { - /// @return total amount of tokens - function totalSupply() external view returns (uint256); - - /// @param _owner The address from which the balance will be retrieved - /// @return The balance - function balanceOf(address _owner) external view returns (uint256); - - /// @notice send `_value` token to `_to` from `msg.sender` - /// @param _to The address of the recipient - /// @param _value The amount of token to be transferred - /// @return Whether the transfer was successful or not - function transfer(address _to, uint256 _value) external returns (bool); - - /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` - /// @param _from The address of the sender - /// @param _to The address of the recipient - /// @param _value The amount of token to be transferred - /// @return Whether the transfer was successful or not - function transferFrom(address _from, address _to, uint256 _value) external returns (bool); - - /// @notice `msg.sender` approves `_addr` to spend `_value` tokens - /// @param _spender The address of the account able to transfer the tokens - /// @param _value The amount of wei to be approved for transfer - /// @return Whether the approval was successful or not - function approve(address _spender, uint256 _value) external returns (bool); - - /// @param _owner The address of the account owning tokens - /// @param _spender The address of the account able to transfer the tokens - /// @return Amount of remaining tokens allowed to spent - function allowance(address _owner, address _spender) external view returns (uint256); - - event Transfer(address indexed _from, address indexed _to, uint256 _value); - event Approval(address indexed _owner, address indexed _spender, uint256 _value); -} - -abstract contract StandardToken is Token { - function transfer(address _to, uint256 _value) public override returns (bool success) { - //Default assumes totalSupply can't be over max (2^256 - 1). - if (balances[msg.sender] >= _value && balances[_to] + _value >= balances[_to]) { - balances[msg.sender] -= _value; - balances[_to] += _value; - emit Transfer(msg.sender, _to, _value); - return true; - } else { - return false; - } - } - - function transferFrom(address _from, address _to, uint256 _value) public virtual override returns (bool success) { - if ( - balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value >= balances[_to] - ) { - balances[_to] += _value; - balances[_from] -= _value; - allowed[_from][msg.sender] -= _value; - emit Transfer(_from, _to, _value); - return true; - } else { - return false; - } - } - - function balanceOf(address _owner) public view override returns (uint256 balance) { - return balances[_owner]; - } - - function approve(address _spender, uint256 _value) public override returns (bool success) { - allowed[msg.sender][_spender] = _value; - emit Approval(msg.sender, _spender, _value); - return true; - } - - function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { - return allowed[_owner][_spender]; - } - - mapping(address => uint256) internal balances; - mapping(address => mapping(address => uint256)) internal allowed; -} - -abstract contract UnlimitedAllowanceToken is StandardToken { - uint256 internal constant MAX_UINT = 2 ** 256 - 1; - - /// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance. - /// @param _from Address to transfer from. - /// @param _to Address to transfer to. - /// @param _value Amount to transfer. - /// @return Success of transfer. - function transferFrom(address _from, address _to, uint256 _value) public override returns (bool) { - uint256 allowance = allowed[_from][msg.sender]; - if (balances[_from] >= _value && allowance >= _value && balances[_to] + _value >= balances[_to]) { - balances[_to] += _value; - balances[_from] -= _value; - if (allowance < MAX_UINT) { - allowed[_from][msg.sender] -= _value; - } - emit Transfer(_from, _to, _value); - return true; - } else { - return false; - } - } -} - -contract TestERC20ZRX is UnlimitedAllowanceToken { - uint256 private _totalSupply = 10 ** 27; // 1 billion tokens, 18 decimal places - string private _name = "0x Protocol Token"; - string private _symbol = "ZRX"; - - constructor() { - balances[msg.sender] = _totalSupply; - } - - function name() public view returns (string memory) { - return _name; - } - - function symbol() public view returns (string memory) { - return _symbol; - } - - function decimals() public pure returns (uint8) { - return 18; - } - - function totalSupply() external view override returns (uint256) { - return _totalSupply; - } -} diff --git a/packages/marketplace/contracts/mocks/TestRoyaltiesRegistry.sol b/packages/marketplace/contracts/mocks/TestRoyaltiesRegistry.sol deleted file mode 100644 index 01e69d875f..0000000000 --- a/packages/marketplace/contracts/mocks/TestRoyaltiesRegistry.sol +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; -import {IRoyaltiesProvider} from "../interfaces/IRoyaltiesProvider.sol"; -import {LibPart} from "../lib-part/LibPart.sol"; -import {LibRoyalties2981} from "../royalties/LibRoyalties2981.sol"; -import {IERC2981} from "../royalties/IERC2981.sol"; - -contract TestRoyaltiesRegistry is IRoyaltiesProvider { - struct RoyaltiesSet { - bool initialized; - LibPart.Part[] royalties; - } - - mapping(bytes32 => RoyaltiesSet) public royaltiesByTokenAndTokenId; - mapping(address => RoyaltiesSet) public royaltiesByToken; - - function setRoyaltiesByToken(address token, LibPart.Part[] memory royalties) external { - uint256 sumRoyalties = 0; - for (uint256 i = 0; i < royalties.length; ++i) { - require(royalties[i].account != address(0x0), "RoyaltiesByToken recipient should be present"); - require(royalties[i].value != 0, "Fee value for RoyaltiesByToken should be > 0"); - royaltiesByToken[token].royalties.push(royalties[i]); - sumRoyalties += royalties[i].value; - } - require(sumRoyalties < 10000, "Set by token royalties sum more, than 100%"); - royaltiesByToken[token].initialized = true; - } - - function setRoyaltiesByTokenAndTokenId(address token, uint256 tokenId, LibPart.Part[] memory royalties) external { - setRoyaltiesCacheByTokenAndTokenId(token, tokenId, royalties); - } - - function getRoyalties(address token, uint256 tokenId) external view override returns (LibPart.Part[] memory) { - RoyaltiesSet memory royaltiesSet = royaltiesByTokenAndTokenId[keccak256(abi.encode(token, tokenId))]; - if (royaltiesSet.initialized) { - return royaltiesSet.royalties; - } - royaltiesSet = royaltiesByToken[token]; - if (royaltiesSet.initialized) { - return royaltiesSet.royalties; - } else if (IERC165Upgradeable(token).supportsInterface(LibRoyalties2981._INTERFACE_ID_ROYALTIES)) { - IERC2981 v2981 = IERC2981(token); - try v2981.royaltyInfo(tokenId, LibRoyalties2981._WEIGHT_VALUE) returns ( - address receiver, - uint256 royaltyAmount - ) { - return LibRoyalties2981.calculateRoyalties(receiver, royaltyAmount); - // solhint-disable-next-line no-empty-blocks - } catch {} - } - return royaltiesSet.royalties; - } - - function setRoyaltiesCacheByTokenAndTokenId( - address token, - uint256 tokenId, - LibPart.Part[] memory royalties - ) internal { - uint256 sumRoyalties = 0; - bytes32 key = keccak256(abi.encode(token, tokenId)); - for (uint256 i = 0; i < royalties.length; ++i) { - require(royalties[i].account != address(0x0), "RoyaltiesByTokenAndTokenId recipient should be present"); - require(royalties[i].value != 0, "Fee value for RoyaltiesByTokenAndTokenId should be > 0"); - royaltiesByTokenAndTokenId[key].royalties.push(royalties[i]); - sumRoyalties += royalties[i].value; - } - require(sumRoyalties < 10000, "Set by token and tokenId royalties sum more, than 100%"); - royaltiesByTokenAndTokenId[key].initialized = true; - } - - uint256[46] private __gap; -} diff --git a/packages/marketplace/contracts/mocks/TestRoyaltyInfo.sol b/packages/marketplace/contracts/mocks/TestRoyaltyInfo.sol deleted file mode 100644 index e0ed52a9fd..0000000000 --- a/packages/marketplace/contracts/mocks/TestRoyaltyInfo.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.21; - -/// @title TestRoyaltyInfo contract -/// @dev Implements royaltyInfo function but not supportInferace. -/// @dev used to execute getRoyalties() in RoyaltiesRegistry contract with royaltyType = 3 -contract TestRoyaltyInfo { - function royaltyInfo( - uint256 /* _tokenId */, - uint256 /* _salePrice */ - ) external view returns (address receiver, uint256 royaltyAmount) { - return (msg.sender, 0); - } -} diff --git a/packages/marketplace/contracts/mocks/tokens/MintableERC1155.sol b/packages/marketplace/contracts/mocks/tokens/MintableERC1155.sol deleted file mode 100644 index 9ce0ab6074..0000000000 --- a/packages/marketplace/contracts/mocks/tokens/MintableERC1155.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; - -contract MintableERC1155 is ERC1155 { - constructor() ERC1155("http://test.test") {} - - function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) public { - _mintBatch(to, ids, amounts, data); - } - - function mint(address account, uint256 id, uint256 amount, bytes memory data) public { - _mint(account, id, amount, data); - } -} diff --git a/packages/marketplace/contracts/mocks/tokens/MintableERC1155WithRoyalties.sol b/packages/marketplace/contracts/mocks/tokens/MintableERC1155WithRoyalties.sol deleted file mode 100644 index d8585c0087..0000000000 --- a/packages/marketplace/contracts/mocks/tokens/MintableERC1155WithRoyalties.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; -import {MintableERC1155, ERC1155} from "./MintableERC1155.sol"; - -contract MintableERC1155WithRoyalties is MintableERC1155, ERC2981 { - function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC2981) returns (bool) { - return ERC1155.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); - } - - function setDefaultRoyalty(address receiver, uint96 feeNumerator) external { - _setDefaultRoyalty(receiver, feeNumerator); - } - - function deleteDefaultRoyalty() external { - _deleteDefaultRoyalty(); - } - - function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external { - _setTokenRoyalty(tokenId, receiver, feeNumerator); - } - - function resetTokenRoyalty(uint256 tokenId) external { - _resetTokenRoyalty(tokenId); - } -} diff --git a/packages/marketplace/contracts/mocks/tokens/MintableERC20.sol b/packages/marketplace/contracts/mocks/tokens/MintableERC20.sol deleted file mode 100644 index 53a7fe54dd..0000000000 --- a/packages/marketplace/contracts/mocks/tokens/MintableERC20.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract MintableERC20 is ERC20 { - constructor() ERC20("MINE", "MINE") {} - - function mint(address to, uint256 amount) public { - _mint(to, amount); - } -} diff --git a/packages/marketplace/contracts/mocks/tokens/MintableERC721.sol b/packages/marketplace/contracts/mocks/tokens/MintableERC721.sol deleted file mode 100644 index aaddaa0cbf..0000000000 --- a/packages/marketplace/contracts/mocks/tokens/MintableERC721.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; - -contract MintableERC721 is ERC721 { - constructor() ERC721("MINFT", "MINFT") {} - - function safeMint(address to, uint256 tokenId) public { - _safeMint(to, tokenId); - } -} diff --git a/packages/marketplace/contracts/mocks/tokens/MintableERC721WithRoyalties.sol b/packages/marketplace/contracts/mocks/tokens/MintableERC721WithRoyalties.sol deleted file mode 100644 index 809de1e9d8..0000000000 --- a/packages/marketplace/contracts/mocks/tokens/MintableERC721WithRoyalties.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol"; -import {MintableERC721, ERC721} from "./MintableERC721.sol"; - -contract MintableERC721WithRoyalties is MintableERC721, ERC2981 { - function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { - return ERC721.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); - } - - function setDefaultRoyalty(address receiver, uint96 feeNumerator) external { - _setDefaultRoyalty(receiver, feeNumerator); - } - - function deleteDefaultRoyalty() external { - _deleteDefaultRoyalty(); - } - - function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external { - _setTokenRoyalty(tokenId, receiver, feeNumerator); - } - - function resetTokenRoyalty(uint256 tokenId) external { - _resetTokenRoyalty(tokenId); - } -}