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

@@ -104,8 +104,8 @@ module.exports = {
//=================== NFTPool ==================
DODONFTApprove: "0x9CA2A5FB3771d824FAc3a307ff6B0fbb992C00Bc",
FilterAdmin: "0x729f7f44bf64Ce814716b6261e267DbE6cdf021c",
FilterERC721V1: "0xdE39C2901e72A883f7446951fB533219F3622b87",
FilterERC1155V1: "0x0727dEd495E35f4bA4F5D64794145152301Db23f",
FilterERC721V1: "0x72d220cE168C4f361dD4deE5D826a01AD8598f6C",
FilterERC1155V1: "0x80930Cb1849F7D42531506fF45E66724338A821b",
DODONFTPoolProxy: "0x888B9d4C25664F8B1BF744e8F4397d1429314155",
NFTPoolController: "0xf5d24499dD76C3791ee6D19aa206f55b72270415"

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]);