-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMUSEENFTMarket.sol
154 lines (144 loc) · 5.08 KB
/
MUSEENFTMarket.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
MUSEE Protocol
*/
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "./mixins/Constants.sol";
import "./mixins/MuseeTreasuryNode.sol";
import "./mixins/NFTMarketAuction.sol";
import "./mixins/NFTMarketBuyPrice.sol";
import "./mixins/NFTMarketCore.sol";
import "./mixins/NFTMarketCreators.sol";
import "./mixins/NFTMarketFees.sol";
import "./mixins/NFTMarketOffer.sol";
import "./mixins/NFTMarketPrivateSale.sol";
import "./mixins/NFTMarketReserveAuction.sol";
import "./mixins/SendValueWithFallbackWithdraw.sol";
/**
* @title A market for NFTs on Musee.
* @notice The Musee marketplace is a contract which allows traders to buy and sell NFTs.
* It supports buying and selling via auctions, private sales, buy price, and offers.
* @dev All sales in the Musee market will pay the creator 10% royalties on secondary sales. This is not specific
* to NFTs minted on Musee, it should work for any NFT. If royalty information was not defined when the NFT was
* originally deployed, it may be added using the [Royalty Registry](https://royaltyregistry.xyz/) which will be
* respected by our market contract.
*/
contract MUSEENFTMarket is
Constants,
Initializable,
MuseeTreasuryNode,
NFTMarketCore,
ReentrancyGuardUpgradeable,
NFTMarketCreators,
SendValueWithFallbackWithdraw,
NFTMarketFees,
NFTMarketAuction,
NFTMarketReserveAuction,
NFTMarketPrivateSale,
NFTMarketBuyPrice,
NFTMarketOffer
{
/**
* @notice Set immutable variables for the implementation contract.
* @dev Using immutable instead of constants allows us to use different values on testnet.
* @param treasury The Musee Treasury contract address.
* @param meth The METH ERC-20 token contract address.
* @param royaltyRegistry The Royalty Registry contract address.
* @param duration The duration of the auction in seconds.
* @param marketProxyAddress The address of the proxy fronting this contract.
*/
constructor(
address payable treasury,
address meth,
address royaltyRegistry,
uint256 duration,
address marketProxyAddress,
address museeNftContract
)
MuseeTreasuryNode(treasury)
NFTMarketCore(meth)
NFTMarketCreators(royaltyRegistry)
NFTMarketReserveAuction(duration)
NFTMarketPrivateSale(marketProxyAddress) // solhint-disable-next-line no-empty-blocks
NFTMarketFees(museeNftContract)
{}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _transferFromEscrow(
address nftContract,
uint256 tokenId,
address recipient,
address authorizeSeller
) internal override(NFTMarketCore, NFTMarketReserveAuction, NFTMarketBuyPrice) {
super._transferFromEscrow(nftContract, tokenId, recipient, authorizeSeller);
}
/**
* @notice Called once to configure the contract after the initial proxy deployment.
* @dev This farms the initialize call out to inherited contracts as needed to initialize mutable variables.
*/
function initialize() external initializer {
NFTMarketAuction._initializeNFTMarketAuction();
}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _beforeAuctionStarted(address nftContract, uint256 tokenId)
internal
override(NFTMarketCore, NFTMarketBuyPrice, NFTMarketOffer)
{
super._beforeAuctionStarted(nftContract, tokenId);
}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _transferFromEscrow(
address nftContract,
uint256 tokenId,
address recipient,
address authorizeSeller
) internal override(NFTMarketCore, NFTMarketReserveAuction, NFTMarketBuyPrice) {
super._transferFromEscrow(nftContract, tokenId, recipient, authorizeSeller);
}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _transferFromEscrowIfAvailable(
address nftContract,
uint256 tokenId,
address recipient
) internal override(NFTMarketCore, NFTMarketReserveAuction, NFTMarketBuyPrice) {
super._transferFromEscrowIfAvailable(nftContract, tokenId, recipient);
}
function initialize() external initializer {
NFTMarketAuction._initializeNFTMarketAuction();
}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _transferToEscrow(address nftContract, uint256 tokenId)
internal
override(NFTMarketCore, NFTMarketReserveAuction, NFTMarketBuyPrice)
{
super._transferToEscrow(nftContract, tokenId);
}
/**
* @inheritdoc NFTMarketCore
* @dev This is a no-op function required to avoid compile errors.
*/
function _getSellerFor(address nftContract, uint256 tokenId)
internal
view
override(NFTMarketCore, NFTMarketReserveAuction, NFTMarketBuyPrice)
returns (address payable seller)
{
seller = super._getSellerFor(nftContract, tokenId);
}
}