Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
newstable committed Nov 3, 2022
0 parents commit 5c6bea8
Show file tree
Hide file tree
Showing 28 changed files with 17,038 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.env
artifacts
build

#Hardhat files
cache
artifacts
.vscode
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ICICB-Marketplace-Contract

This is NFT Marketplace Contract.
10 changes: 10 additions & 0 deletions contracts/ERC20.sol
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);
}
}
31 changes: 31 additions & 0 deletions contracts/FeeManager.sol
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);
}
}
70 changes: 70 additions & 0 deletions contracts/IMarketplace.sol
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
);
}
Loading

0 comments on commit 5c6bea8

Please sign in to comment.