MoonSHRD / UniversalNFTMarketplace

Universal NFT Marketplace
Other
9 stars 0 forks source link

[draft] Testing -1 scenario (creation Master record and create&operate with tokensale) #41

Closed JackBekket closed 3 years ago

JackBekket commented 3 years ago

Creation of different types sale (Rarity and Currencies work check, general creation token check)

Common Rarity Item case

  1. Before tests make sure we have funded ourselves with ERC20 currencies Consider accounts(0) as admin and seller Consider accounts(1) as buyer

  2. Create Master Copy of common item createMasterItem(string memory link, string memory _description, uint256 _supplyType) // --- Factory _supplyType = 0

@todo: check if link is unuque

  1. Create Item Sale of it createItemSale(uint price, uint sale_limit, CurrenciesERC20.CurrencyERC20 currency, uint f_master_id) ( There also should be 4 options for different currencies)

3.Try to buy an item from itemsale buyTokens(address beneficiary,uint256 tokenAmountToBuy, CurrenciesERC20.CurrencyERC20 currency)

should fail if: a. wrong currency setted for buy (like if we set price in stables like USDT and want to pay buy dynamic price SNM) b. beneficiary is 0 address c. not enough funds to pay

Otherwise should processed

Test's should be setted for each currencies!

Rare rarity sale

  1. same function, supplyType = 10

  2. same function, sale_limit 10 there should be also additional check if sale_limit > totalSupply in this case

  3. same function should fail if: a. tokenAmountToBuy more than 10 b. not enough funds to pay c. wrong currency to pay

Unique rarity

  1. same, supplyType = 1

  2. same check sale_limit after setting up sale, should be equal 1, no matter what we type as input parameter, it should be setted to 1

  3. same should fail if: a. try to buy more than one token b. not enough funds c. wrong currency to pay