Creation of different types sale (Rarity and Currencies work check, general creation token check)
Common Rarity Item case
Before tests make sure we have funded ourselves with ERC20 currencies
Consider accounts(0) as admin and seller
Consider accounts(1) as buyer
Create Master Copy of common item
createMasterItem(string memory link, string memory _description, uint256 _supplyType) // --- Factory
_supplyType = 0
@todo: check if link is unuque
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
same function, supplyType = 10
same function, sale_limit 10
there should be also additional check if sale_limit > totalSupply in this case
same function
should fail if:
a. tokenAmountToBuy more than 10
b. not enough funds to pay
c. wrong currency to pay
Unique rarity
same, supplyType = 1
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
same
should fail if:
a. try to buy more than one token
b. not enough funds
c. wrong currency to pay
Creation of different types sale (Rarity and Currencies work check, general creation token check)
Common Rarity Item case
Before tests make sure we have funded ourselves with ERC20 currencies Consider accounts(0) as admin and seller Consider accounts(1) as buyer
Create Master Copy of common item
createMasterItem(string memory link, string memory _description, uint256 _supplyType)
// --- Factory _supplyType = 0@todo: check if link is unuque
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
same function, supplyType = 10
same function, sale_limit 10 there should be also additional check if sale_limit > totalSupply in this case
same function should fail if: a. tokenAmountToBuy more than 10 b. not enough funds to pay c. wrong currency to pay
Unique rarity
same, supplyType = 1
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
same should fail if: a. try to buy more than one token b. not enough funds c. wrong currency to pay