-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c6bea8
Showing
28 changed files
with
17,038 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
.env | ||
artifacts | ||
build | ||
|
||
#Hardhat files | ||
cache | ||
artifacts | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ICICB-Marketplace-Contract | ||
|
||
This is NFT Marketplace Contract. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract Token is ERC20 { | ||
constructor(uint256 initialSupply) ERC20("test token", "test") { | ||
_mint(msg.sender, initialSupply * 1e18); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
contract FeeManager is Ownable { | ||
|
||
event ChangedFeePerMillion(uint256 cutPerMillion); | ||
|
||
// Market fee on sales | ||
uint256 public cutPerMillion=100000; | ||
uint256 public constant maxCutPerMillion = 100000; // 10% cut | ||
|
||
uint256 public royaltyPerMillion=100000; | ||
|
||
/** | ||
* @dev Sets the share cut for the owner of the contract that's | ||
* charged to the seller on a successful sale | ||
* @param _cutPerMillion - Share amount, from 0 to 99,999 | ||
*/ | ||
function setOwnerCutPerMillion(uint256 _cutPerMillion) external onlyOwner { | ||
require( | ||
_cutPerMillion < maxCutPerMillion, | ||
"The owner cut should be between 0 and maxCutPerMillion" | ||
); | ||
|
||
cutPerMillion = _cutPerMillion; | ||
emit ChangedFeePerMillion(cutPerMillion); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
interface IMarketplace { | ||
struct Order { | ||
// Order ID | ||
bytes32 id; | ||
// Owner of the NFT | ||
address seller; | ||
// NFT registry address | ||
address nftAddress; | ||
// Price (in wei) for the published item | ||
uint256 price; | ||
// Time when this sale ends | ||
uint256 expiresAt; | ||
} | ||
|
||
struct Bid { | ||
// Bid Id | ||
bytes32 id; | ||
// Bidder address | ||
address bidder; | ||
// Price for the bid in wei | ||
uint256 price; | ||
// Time when this bid ends | ||
uint256 expiresAt; | ||
} | ||
|
||
// ORDER EVENTS | ||
event OrderCreated( | ||
bytes32 id, | ||
address indexed seller, | ||
address indexed nftAddress, | ||
uint256 indexed assetId, | ||
uint256 priceInWei, | ||
uint256 expiresAt | ||
); | ||
|
||
event OrderUpdated(bytes32 id, uint256 priceInWei, uint256 expiresAt); | ||
|
||
event OrderSuccessful( | ||
bytes32 id, | ||
address indexed buyer, | ||
uint256 priceInWei | ||
); | ||
|
||
event OrderCancelled(bytes32 id); | ||
|
||
// BID EVENTS | ||
event BidCreated( | ||
bytes32 id, | ||
address indexed nftAddress, | ||
uint256 indexed assetId, | ||
address indexed bidder, | ||
uint256 priceInWei, | ||
uint256 expiresAt | ||
); | ||
|
||
event BidAccepted(bytes32 id); | ||
event BidCancelled(bytes32 id); | ||
|
||
event BuyCreated( | ||
address indexed nftAddress, | ||
uint256 indexed assetId, | ||
address indexed bidder, | ||
address seller, | ||
uint256 priceInWei | ||
); | ||
} |
Oops, something went wrong.