Skip to content

Commit

Permalink
Merge pull request #91 from MoonSHRD/network/ropsten
Browse files Browse the repository at this point in the history
Network/ropsten
  • Loading branch information
JackBekket committed Nov 14, 2021
2 parents 7a283f6 + 360e9ff commit 333c90c
Show file tree
Hide file tree
Showing 24 changed files with 6,086 additions and 2,463 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Universal NFT Marketplace

### Currencies erc20
We use some stable-coins and other erc20 tokens as currencies
So users can set up and get paid in USDT,USDC,DAI,MST or other custom currencies
So users can set up and get paid in USDT,USDC,DAI, MST or other custom currencies

For more info see `./contracts/721/singleton/CurrenciesERC20.sol`

Expand Down
1 change: 1 addition & 0 deletions contracts/721/singleton/CurrenciesERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "../../../node_modules/@openzeppelin/contracts/access/Ownable.sol";
/**
* CurrenciesERC20
* @title CurrenciesERC20
* @author JackBekket
* @dev This contract allow to use erc20 tokens as a currency in crowdsale-like contracts
*
*/
Expand Down
61 changes: 61 additions & 0 deletions contracts/721/singleton/InterfaceRegister.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT


import "../../../node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "../../../node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "../../../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol";



contract InterfaceRegister {

bytes4 public _INTERFACE_ID_MSNFT;
bytes4 public _INTERFACE_ID_IERC721ENUMERABLE; // should be 0x780e9d63
// bytes4 private _INTERFACE_ID_ERC721METADATA = 0x5b5e139f; // 0x5b5e139f
bytes4 public _INTERFACE_ID_IERC721METADATA; // 0x5b5e139f
bytes4 public _INTERFACE_ID_IERC721; // 0x7aa5391d -- @WARN -- MAY BE *WRONG*


function getInterfaceEnumerable() public view returns (bytes4) {
return _INTERFACE_ID_IERC721ENUMERABLE;
}

function getInterfaceMetadata() public view returns (bytes4) {
return _INTERFACE_ID_IERC721METADATA;
}

function getInterface721() public view returns (bytes4) {
return _INTERFACE_ID_IERC721;
}

function calculateIERC721Enumarable() public pure returns (bytes4) {

IERC721Enumerable i;
return i.totalSupply.selector ^ i.tokenOfOwnerByIndex.selector ^ i.tokenByIndex.selector;
}


function calculateIERC721Metadata() public pure returns (bytes4) {

IERC721Metadata i;
return i.name.selector ^ i.symbol.selector ^ i.tokenURI.selector;
}


function calculateIERC721() public pure returns (bytes4) {
// TODO: wrong calculation, need to fix.. use IERC721Enumarable interface for MSNFT
IERC721 i;
return i.balanceOf.selector ^ i.ownerOf.selector ^ i.transferFrom.selector ^ i.approve.selector ^ i.getApproved.selector ^ i.setApprovalForAll.selector ^ i.isApprovedForAll.selector;

}

constructor() {

_INTERFACE_ID_IERC721ENUMERABLE = calculateIERC721Enumarable();
_INTERFACE_ID_IERC721METADATA = calculateIERC721Metadata();
_INTERFACE_ID_IERC721 = calculateIERC721();
}


}

0 comments on commit 333c90c

Please sign in to comment.