Universal NFT Marketplace
Primary usage for buying and selling didgital goods (assets) for erc-20 compatible currency (USDT,USDC,DAI,WETH and so on)
There is functionality for 'first-hand' market (crowdsale model) and for second-hand market (p2p marketplace, auction)
This repository contains contracts, test's and deployment schemes for Universal NFT Marketplace.
We use open-zeppeline erc721Enumerable as a standard for base NFT token This standard means that every created token are stored and can be operable from one singleton-like contract as record Instead of creating new instance of contract each time someone create new token This help us to save the gas and reduce universe entropy!
For more info see ./contracts/721/singleton/MSNFT.sol
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
For more info see ./contracts/721/singleton/CurrenciesERC20.sol
User can start/plug crowdsale for any emitted tokens We consider this crowdsale to be the initial form of sale
TokenSale contract is a modified OZ crowdsale contract. It has been modified to work with ERC721 token and get ERC20 tokens as payment
P2P exchange of any NFT's from anywhere It can be considered as simple secondary market
Each token represent some file, so it stores link to the file and some meta-information about NFT as MasterCopy Any tokens are considered items and attached to specific master-copy, which contain meta-info about NFT Tokens do not store this info but it can be obtained by links
So each item (token) is a link to specific master-copy which contain link to the file
This is a truffle project, so fist you need to get truffle by
npm install -g truffle
Download project dependencies:
npm i
Deploy into blockchain / ganache :
truffle migrate --reset
(reset flag will do clean migration)
Deployment scheme can be found in ./migrations/2_deploy_contracts.js
Networks configs ./truffle-config.js
If you want to test contract locally you may also need ganache Contracts ABI (build artifacts) would be found in ./build directory after any sucessfull migration
Tests are in directory ./test
To run tests run truffle test
By default truffle will run tests in test enviroment, described as development
network in truffle-config.js
Make sure you have ganache up and running, cause development
end-point are looking for ganache
What should I do when test fails?
If tests fail with any revert message you should use truffle debugger, to understand at which point execution fails
There are different ways to approach debugger, let's see how we can use it
https://www.trufflesuite.com/docs/truffle/getting-started/debugging-your-contracts
After you have wrapped failed test invokation in test.js, run truffle test --debug
Sometimes this method does not work as intended, so in this case you may try to
truffle test --debug -b
or truffle test ./test/test.js --debug -b
or even truffle test --debug --stacktrace -b
If none of it work's try method B
- at ganache switch to tab
logs
, make clear logs - run
truffle test -b
- find in logs last transaction, which fail, copy it's txid
- run
truffle debug <failed_tx_id>
-- it will start truffle in CLI debug mode, where you can expect execution of tx line by line - find at which line exactly tx have been failed and why (try to use breakpoints, watch variables, arguments and so on)
- report problem
Business Source License 1.1
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
Parameters
Licensor: Moonshard
Licensed Work: Moonshard NFT Marketplace The Licensed Work is (c) 2021 Moonshard
Change Date: The earlier of 2025-02-07
Change License: GNU General Public License v2.0 or later
For more info see: [https://github.com/MoonSHRD/UniversalNFTMarketplace/blob/master/LICENSE]
YOU CAN BUY LICENSE AS NFT AT THIS MARKETPLACE