This commit is contained in:
owen05
2021-09-24 22:29:47 +08:00
parent 685ffa81c4
commit 5af15a4eff
4 changed files with 29 additions and 5 deletions

View File

@@ -319,7 +319,31 @@ contract BaseFilterV1 is InitializableOwnable, ReentrancyGuard {
external
onlySuperOwner
{
_changeFilterName(newFilterName);
}
function _changeFilterName(string memory newFilterName) internal {
_FILTER_NAME_ = newFilterName;
emit ChangeFilterName(newFilterName);
}
function resetFilter(
string memory filterName,
bool[] memory toggles,
uint256[] memory numParams, //0 - startId, 1 - endId, 2 - maxAmount, 3 - minAmount
uint256[] memory priceRules,
uint256[] memory spreadIds,
bool[] memory isRegistered
) external onlySuperOwner {
_changeFilterName(filterName);
_changeNFTInPrice(priceRules[0], priceRules[1], toggles[0]);
_changeNFTRandomOutPrice(priceRules[2], priceRules[3], toggles[1]);
_changeNFTTargetOutPrice(priceRules[4], priceRules[5], toggles[2]);
_changeNFTAmountRange(numParams[2], numParams[3]);
_changeTokenIdRange(numParams[0], numParams[1]);
_changeTokenIdMap(spreadIds, isRegistered);
}
}

View File

@@ -34,8 +34,8 @@ contract FilterERC1155V1 is IERC1155Receiver, BaseFilterV1 {
uint256[] memory spreadIds
) external {
initOwner(filterAdmin);
_FILTER_NAME_ = filterName;
_changeFilterName(filterName);
_NFT_COLLECTION_ = nftCollection;
_changeNFTInPrice(priceRules[0], priceRules[1], toggles[0]);

View File

@@ -37,8 +37,8 @@ contract FilterERC721V1 is IERC721Receiver, BaseFilterV1 {
uint256[] memory spreadIds
) external {
initOwner(filterAdmin);
_FILTER_NAME_ = filterName;
_changeFilterName(filterName);
_NFT_COLLECTION_ = nftCollection;
_changeNFTInPrice(priceRules[0], priceRules[1], toggles[0]);
_changeNFTRandomOutPrice(priceRules[2], priceRules[3], toggles[1]);