add filterName && nftPool test context

This commit is contained in:
owen05
2021-09-13 14:31:23 +08:00
parent 4deca2be13
commit fb64de3a04
8 changed files with 157 additions and 25 deletions

View File

@@ -16,6 +16,8 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
using SafeMath for uint256;
//=================== Storage ===================
string public _FILTER_NAME_;
address public _NFT_COLLECTION_;
uint256 public _NFT_ID_START_;
uint256 public _NFT_ID_END_ = uint256(-1);
@@ -273,4 +275,11 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
_SPREAD_IDS_REGISTRY_[tokenIds[i]] = isRegistered[i];
}
}
function changeFilterName(string memory newFilterName)
external
onlySuperOwner
{
_FILTER_NAME_ = newFilterName;
}
}

View File

@@ -21,11 +21,14 @@ contract FilterERC1155V1 is IERC1155Receiver, BaseFilterV1 {
address filterAdmin,
address nftCollection,
bool[] memory toggles,
string memory filterName,
uint256[] memory numParams, //0 - startId, 1 - endId, 2 - maxAmount, 3 - minAmount
uint256[] memory priceRules,
uint256[] memory spreadIds
) external {
initOwner(filterAdmin);
_FILTER_NAME_ = filterName;
_NFT_COLLECTION_ = nftCollection;
_changeNFTInPrice(priceRules[0], priceRules[1], toggles[0]);

View File

@@ -24,13 +24,15 @@ contract FilterERC721V1 is IERC721Receiver, BaseFilterV1 {
address filterAdmin,
address nftCollection,
bool[] memory toggles,
string memory filterName,
uint256[] memory numParams, //0 - startId, 1 - endId, 2 - maxAmount, 3 - minAmount
uint256[] memory priceRules,
uint256[] memory spreadIds
) external {
initOwner(filterAdmin);
_NFT_COLLECTION_ = nftCollection;
_FILTER_NAME_ = filterName;
_NFT_COLLECTION_ = nftCollection;
_changeNFTInPrice(priceRules[0], priceRules[1], toggles[0]);
_changeNFTRandomInPrice(priceRules[2], priceRules[3], toggles[1]);
_changeNFTTargetOutPrice(priceRules[4], priceRules[5], toggles[2]);